From 7e374459cc29510c19a4b48e8e371fb11c1cc974 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 3 Dec 2023 17:46:42 +0100 Subject: - proper padding of last floppy to full capacity (86Box misinterprets the format otherwise and hangs on boot) - added preliminary testing with 86Box --- local/init | 6 ++++- patches/uflbbl-debug.patch | 12 +++++++++ scripts/86box.cfg | 65 ++++++++++++++++++++++++++++++++++++++++++++++ scripts/build.sh | 11 ++++++-- scripts/run_86box.sh | 9 +++++++ 5 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 patches/uflbbl-debug.patch create mode 100644 scripts/86box.cfg create mode 100755 scripts/run_86box.sh diff --git a/local/init b/local/init index 5268b4d..d442f22 100755 --- a/local/init +++ b/local/init @@ -26,7 +26,11 @@ insmod /lib/modules/crypto/crc32c_generic.ko insmod /lib/modules/fs/ext4/ext4.ko insmod /lib/modules/drivers/block/nbd.ko ifconfig -a -nbd-client -N ROOT 10.0.0.2 /dev/nbd0 +# qemu +#nbd-client -N ROOT 10.0.0.2 /dev/nbd0 +# 86Box +nbd-client -N ROOT 10.0.2.2 /dev/nbd0 +# Unisys #nbd-client -N ROOT 192.168.1.31 /dev/nbd0 mount -t ext4 /dev/nbd0 /mnt diff --git a/patches/uflbbl-debug.patch b/patches/uflbbl-debug.patch new file mode 100644 index 0000000..1d84790 --- /dev/null +++ b/patches/uflbbl-debug.patch @@ -0,0 +1,12 @@ +diff -rauN uflbb/src/boot.asm uflbb-debug/src/boot.asm +--- uflbb/src/boot.asm 2023-12-02 16:34:04.000000000 +0100 ++++ uflbb-debug/src/boot.asm 2023-12-03 14:52:27.325432384 +0100 +@@ -322,7 +322,7 @@ + + ; print (C/H/S) info where we are currently reading and in which state + ; and how many data sectors are left in the current tar entry +- jmp .no_verbose ++; jmp .no_verbose + + ; states + mov al, 0x0d diff --git a/scripts/86box.cfg b/scripts/86box.cfg new file mode 100644 index 0000000..7003b72 --- /dev/null +++ b/scripts/86box.cfg @@ -0,0 +1,65 @@ +[General] +vid_renderer = qt_software +confirm_reset = 0 + +[Machine] +machine = p2bls +cpu_family = c3_samuel +cpu_speed = 133333333 +cpu_multi = 2 +cpu_use_dynarec = 1 +fpu_softfloat = 0 +time_sync = local +fpu_type = internal +cpu_manufacturer = 2 +cpu = 1 +mem_size = 65536 + +[Video] +gfxcard = cl_gd5422_isa + +[Input devices] +mouse_type = logibus + +[Sound] +fm_driver = nuked + +[Network] +net_01_link = 0 +net_02_link = 0 +net_03_link = 0 +net_04_link = 0 +net_01_card = ne1k +net_01_net_type = slirp + +[Storage controllers] +hdc = ide_isa +cassette_mode = load + +[Hard disks] +hdd_01_parameters = 17, 15, 1008, 0, ide +hdd_01_fn = root.img +hdd_01_speed = 1992_3600rpm +hdd_01_ide_channel = 0:0 + +[Floppy and CD-ROM drives] +fdd_01_type = 35_2hd +fdd_02_type = none +fdd_01_image_history_01 = floppy00.img +fdd_01_check_bpb = 0 +fdd_01_fn = floppy01.img + +[Novell NE1000 #1] +base = 0300 +irq = 3 +mac = f6:1d:9a + +[Serial Passthrough Device #1] +mode = 0 +host_serial_path = +data_bits = 8 +stop_bits = 1 +baudrate = 115200 + +[Ports (COM & LPT)] +serial1_passthrough_enabled = 1 diff --git a/scripts/build.sh b/scripts/build.sh index f2e8d4c..a026bd7 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -715,6 +715,7 @@ if [ ! -f "${BASE}/build/stage1/boot/boot.img" ]; then tar xf "${BASE}/downloads/uflbbl-${UFLBBL_VERSION}.tar.gz" cd "uflbbl-${UFLBBL_VERSION}" || exit 1 patch -Np1 < "${BASE}/patches/uflbbl-boot-options.patch" + patch -Np1 < "${BASE}/patches/uflbbl-debug.patch" cd src nasm -o boot.img boot.asm cp boot.img "${BASE}/build/stage1/boot/boot.img" @@ -764,8 +765,14 @@ if [ ! -f "${BASE}/floppy.img" ]; then tar cvf data.tar -b1 bzImage ramdisk.img EOF cat "${BASE}/build/stage1/boot/boot.img" data.tar > "${BASE}/floppy.img" split -d -b 1474560 floppy.img floppy -else - echo "floppy images exist" + LASTFILE=`ls floppy?? | sort | tail -n 1` + FILESIZE=`wc -c < "${LASTFILE}"` + PADSIZE=`echo "1474560-${FILESIZE}" | bc` + if [ "${PADSIZE}" -gt 0 ]; then + dd if=/dev/zero count=1 bs="${PADSIZE}" > PAD + cat "${LASTFILE}" PAD > "${LASTFILE}-padded" + mv "${LASTFILE}-padded" "${LASTFILE}" + fi fi trap - 0 diff --git a/scripts/run_86box.sh b/scripts/run_86box.sh new file mode 100755 index 0000000..7d60980 --- /dev/null +++ b/scripts/run_86box.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +[1]- Running 86Box & +[2]+ Running qemu-nbd -f raw root.img -x ROOT & + +qemu-nbd -f raw root.img -x ROOT & +sleep 2 && \ +86Box -C scripts/86box.cfg +pkill qemu-nbd -- cgit v1.2.3-54-g00ecf