URI: 
       # 2026-02-28 - Install SvarDOS In NetBSD NVMM
       
       Last year i posted about installing SvarDOS in qemu & KVM on
       Slackware Linux.  Then i configured DOSBox-X to boot SvarDOS from the
       resulting disk image.
       
   DIR Install SvarDOS In Virtual Machine (Slackware)
       
       This is a follow up demonstrating how to do the same using
       NetBSD NVMM instead of Linux KVM.  I used dosbox-x and qemu from
       pkgsrc.  Refer to my 2025 post for screenshots, FAT filesystem lore,
       and other extra detail.
       
       Download the SvarDOS stable build (20240915) and package ISO.
       
  HTML SvarDOS 1.44M floppy disk
       
  HTML SvarDOS package repository ISO
       
       I placed these in ~/dist/dos/os/svardos/20240915/ and unzipped the
       floppy image.
       
       # Install SvarDOS using Qemu
       
       SvarDOS supports FAT32, but i avoid it because it can be
       pathologically slow to repair using the free dosfsck.exe.  I accept
       the limitations of FAT16B as a trade-off for better compatibility and
       maintenance.  This limits partition sizes to 2G using the SvarDOS
       installer.
       
       * * *
       
       Later in these instructions i answer "Y" to permit fdisk to create a
       partition with the maximum size.  With the 2G disk image, this uses
       a 32K cluster size, which is compatible with other versions of DOS.
       
       With a larger disk, it might use a 64K cluster size, which is
       not compatible with some versions of DOS.  I might need to answer "N"
       and enter 2000 as the partition size, to keep the partition under 2G.
       
       I can verify the cluster size of a FAT16 filesystem using the
       CHKDSK command.
       
           C:\>chkdsk c: /s | find "every cluster"
           
                    32.768 bytes in every cluster
       
       32.768 means the c: drive has the more compatible 32K cluster size.
       
       * * *
       
       I use the raw disk image format for maximum compatibility
       with various virtual machine software.  I use a sparse file to
       conserve space on the host system.
       
           $ mkdir -p Qemu/svardos
           $ cd Qemu/svardos
           $ size=$((2*1024*1024*1024))
           $ dd if=/dev/zero of=svardos.raw bs=1 count=1 seek=$size
       
       Create a shell script and run it to start qemu.
       
           $ ed qemu-svardos.sh
           qemu-svardos.sh: No such file or directory
           a
           #!/bin/sh
           DISK="/home/ben/Qemu/svardos/svardos.raw"
           CDROM="/home/ben/dist/dos/os/svardos/20240915/sv-repo.iso"
           FLOPPY="/home/ben/dist/dos/os/svardos/20240915/disk1.img"
           MACH="pc-i440fx-10.1,mem-merge=off,usb=off"
           qemu-system-i386                               \
               -accel nvmm                                \
               -machine "$MACH"                           \
               -machine pcspk-audiodev=1                  \
               -overcommit mem-lock=off                   \
               -no-user-config                            \
               -msg timestamp=on                          \
               -cpu max                                   \
               -m 32M                                     \
               -global i8042.kbd-throttle=on              \
               -audiodev sdl,id=1                         \
               -device sb16,audiodev=1                    \
               -device VGA                                \
               -drive file="$FLOPPY",format=raw,if=floppy \
               -drive file="$DISK",format=raw,media=disk  \
               -cdrom "$CDROM"                            \
               -display sdl,gl=on,grab-mod=rctrl          \
               -rtc base=localtime
           .
           w
           917
           q
           $ chmod a+rx qemu-svardos.sh
           $ ./qemu-svardos.sh
       
       At the welcome screen, I press Enter to select English.
       
       At the keyboard layout screen, I press Enter to select English (US).
       
       At the installation screen, I press Enter to Install SvarDOS.
       
       At the partition screen, I select Run the FDISK partitioning tool,
       then press Enter.
       
       At FDISK introduction, I press N to disable FAT32,
       then press Enter.
       
       At FDISK Options, I press Enter to Create DOS partition or
       Logical DOS Drive.
       
       At Create DOS Partition or Logical DOS Drive, I press 1 to
       Create Primary DOS Partition, then press Enter.
       
       At Create Primary DOS Partition, I press Enter to use the maximum
       available size for a Primary DOS Partition and make the partition
       active.
       
       At the partition screen, I press ESC to continue.
       
       At FDISK Options, I press ESC to exit FDISK.
       
       At You MUST restart your system for your changes to take effect,
       I press ESC to exit FDISK.
       
       At Your computer will reboot now, I press Enter.
       
       At the welcome screen, I press Enter to select English.
       
       At the keyboard layout screen, I press Enter to select English (US).
       
       At the installation screen, I press Enter to Install SvarDOS.
       
       At the disk screen, I press Enter to select C: [2047 MiB, hda0]
       
       At the format screen, I press Enter to Format drive C:
       
       At the installation of SvarDOS to C: screen, I press Enter
       to Install SvarDOS.
       
       It installs 32 packages.  When it is done, it shows a screen
       Your computer will reboot now.
       
       I close the QEMU window to power off the virtual machine.
       
       This is equivalent to turning off the power while a PC is running.
       By default, SvarDOS does synchronous I/O and does not use a cache.
       When at the prompt, the data is already written to disk, so it is OK
       to abruptly power off the machine.
       
       I start qemu to boot the fresh install of SvarDOS.
       
           $ ./qemu-svardos.sh
       
       It takes a moment to do the post-install steps.  When finished,
       it shows SvarDOS has been installed. Restart your computer now.
       
       I run FDAPM to do a cold boot.
       
           C:\TEMP>\SVARDOS\FDAPM COLDboot
       
       It boots to the Welcome to SvarDOS screen.
       
       The first thing i would like to do is enable access to the optical
       drive.  Unfortunately, the driver is not included on the install
       floppy.  I will need to copy it in place from the NetBSD host.  I
       close the QEMU window to power off the virtual machine.
       
       I create scripts to mount and unmount the disk image on the NetBSD
       host.  My uid is 1000.  Adjust the script to match yours.
       
       On NetBSD i use the vnd(4) device to achieve a "loop" mount.
       Since NetBSD uses a static /dev directory, i dedicate a vnd special
       file to each virtual disk.  I will use vnd1 for SvarDOS. See the
       MAKEDEV(8) manual if you need to create additional /dev/vnd*
       special files.
       
           $ ed mount-svardos.sh
           mount-svardos.sh: No such file or directory
           a
           #!/bin/sh
           disk="/home/ben/Qemu/svardos/svardos.raw"
           log="/mnt/fuse/svardos.log"
           dir="/mnt/svardos"
           vnd="vnd1"
           
           # truncate log
           cat /dev/null >"$log"
       
           # probe partitions
           vndconfig "$vnd" "$disk" >"$log" 2>&1
           part=$(disklabel vnd1 2>/dev/null |\
               awk '/MSDOS/ {sub(/:/,"",$1);print $1}')
           dev="/dev/$vnd$part"
           
           # mount it
           mount "$dev" "$dir"
           .
           w
           341
           q
           $ chmod a+rx mount-svardos.sh
           
           $ ed unmount-svardos.sh
           unmount-svardos.sh: No such file or directory
           a
           #!/bin/sh
           disk="/home/ben/Qemu/svardos/svardos.raw"
           dir="/mnt/svardos"
           vnd="vnd1"
           
           # unmount the filesystem
           umount "$dir"
           
           # detach vnd device
           vndconfig -u $vnd
           .
           w
           161
           q
           $ chmod a+rx unmount-svardos.sh
       
       To actually mount this disk image, i need to run these scripts as
       user root.  The first time around i need to create directories for
       the mount point and log file.
       
           $ su -
           # mkdir -p /mnt/cdrom
           # mkdir -p /mnt/fuse
           # mkdir -p /mnt/svardos
       
       Next i mount the disk image, the package ISO, copy the CD driver
       package, unmount everything, and exit the root shell.
       
           # /home/ben/mount-svardos.sh
           # iso=/home/ben/dist/dos/os/svardos/20240915/sv-repo.iso
           # vndconfig -r vnd0 $iso
           # mount -o ro -t cd9660 /dev/vnd0a /mnt/cdrom
           # cp /mnt/cdrom/videcdd.svp /mnt/svardos/
           # umount /mnt/cdrom
           # vndconfig -u vnd0
           # /home/ben/unmount-svardos.sh
           # exit
       
       I boot SvarDOS to the welcome screen again.
       
       I install the CD driver packages.
       
           C:\>pkg install videcdd.svp
       
       I use the excellent SVED editor to enable the CD driver in
       CONFIG.SYS.
       
           C:\>copy CONFIG.SYS CONFIG.BAK
           C:\>sved CONFIG.SYS
       
       I use the arrow keys to navigate to the ;DEVICE=C:\DRIVERS\VIDECDD...
       line.
       
       I press Backspace to delete the leading ; character, uncommenting line
       DEVICE=C:\DRIVERS\VIDECDD\VIDE-CDD.SYS /D:SVCD0001
       
       I press Esc to open the SVED menu, press Down to select Save, and
       press Enter.
       
       I press Esc to open the SVED menu, press Up to select Quit, and
       press Enter.
       
       I use SVED to enable the CD driver in AUTOEXEC.BAT.
       
           C:\>copy AUTOEXEC.BAT AUTOEXEC.BAK
           C:\>sved AUTOEXEC.BAT
       
       I use the arrow keys to navigate to the REM SHSUCDX ... line.
       
       I press the Backspace key 4 times to remove the "REM " prefix.
       
       I press Esc to open the SVED menu, press Down to select Save, and
       press Enter.
       
       I press Esc to open the SVED menu, press Up to select Quit, and
       press Enter.
       
       I use FDAPM to do a cold boot.
       
           C:\>SVARDOS\FDAPM COLDboot
       
       I install the unzip program from CD.
       
           C:\>pkg install D:\unzip.svp
       
       I get the disk geometry from FDISK.
       
           C:\>FDISK /INFO
           
           Current fixed disk drive 1   4193280 sectors, geometry 520/128/63
           ...
       
       Note the text "geometry 520/128/63" in the output.
       
       I close the QEMU window to power off the virtual machine.
       
       # Configure SvarDOS in DOSBox-X
       
       I make a copy of the DOSBox-X default configuration.
       
           $ mkdir -p .config/dosbox-x
           $ cd .config/dosbox-x
           $ cp /usr/pkg/share/dosbox-x/dosbox-x.reference.conf dosbox-x.conf
       
       I make the SvarDOS specific DOSBox-X configuration.
       
           $ cp dosbox-x.conf dosbox-x-svardos.conf
       
       I edit the SvarDOS specific DOSBox-X configuration.  I change the
       memory size from 16 to 32M to match the qemu virtual machine.
       DOSBox-X needs the geometry for the raw disk image.  Note that FDISK
       in qemu reported "geometry 520/128/63" and that the sector size is
       512 bytes.  Thus the parameters "-size 512,63,128,520".
       
           $ ed dosbox-x-svardos.conf
           96658
           /^memsize                   = 16/s/16/32/p
           memsize                   = 32
           $a
           imgmount c /home/ben/Qemu/svardos/svardos.raw \
             -size 512,63,128,520
           imgmount d /home/ben/dist/dos/os/svardos/20240915/sv-repo.iso \
             -t iso -fs iso
           boot c:
           .
           w
           96818
           q
       
       I create a shell script and run it to start dosbox-x.
       
           $ cd
           $ ed dosbox-svardos.sh
           dosbox-svardos.sh: No such file or directory
           a
           #!/bin/sh
           dosbox-x -conf \
               /home/ben/.config/dosbox-x/dosbox-x-svardos.conf
           .
           w
           80
           q
           $ chmod a+rx dosbox-svardos.sh
           $ ./dosbox-svardos.sh
       
       That's it!
       
       # Notes
       
       These steps create two virtual machines, one using dosbox-x and the
       other using qemu.  These both use the same disk image.  Make sure to
       power off one before powering on the other.
       
       The qemu virtual machine is accelerated using NetBSD NVMM, which runs
       faster.
       
       The dosbox-x virtual machine provides a more accurate BIOS.  If your
       keyboard has a Num Lock key, then you can use Alt Codes to enter
       special characters in DOSBox-X.
       
       Alt codes do not work in qemu nor VirtualBox because of BIOS bugs.
       
       tags: bencollver,retrocomputing,technical
       
       # Tags
       
   DIR bencollver
   DIR retrocomputing
   DIR technical