Wednesday, May 29, 2019

FreeDOS on AtomicPi

Atomic Pi can be a great platform to try other OSes, such as DOS, ReactOS, Minix.  Here we start with the oldest PC OS, DOS.  We will install FreeDOS to a microSD card.  We will use an old 256MB microSD card.

It appears that the easiest way to get a DOS disk image is to use VirtualBox, QEMU or Bochs.  We get the CDROM ISO file from freedos.org.  We'll use QEMU.  First, create a 200MB DOS disk,
qemu-img create dos.img 200M
Then run the emulator to boot from the ISO image,
 qemu-system-i386 -m 16 -k en-us -rtc base=localtime  -hda dos.img -cdrom FD12CD.iso -boot order=d
We proceed with installation.  We did a full installation, which took about 89MB.  Additionally packages can be installed by running fdimples.  Included on the CD are games, including a version DOOM clone, BOOM, which runs fine on QEMU.

We can mount the disk image in Linux,
 sudo mount -o loop,offset=32256 dos.img /mnt/dos/
The offset is necessary, because the DOS partition starts at sector 63.  We can write the disk image to the SD card
 dd if=/dev/loop0 of=/dev/sdb1
We install the DOS MBR by adding it as the second disk,
 qemu-system-i386 -hda dos.img -hdb /dev/sdb
and run `fdsik /mbr 2`.
After that, we can directly boot the SD card,
 qemu-system-i386 -hda /dev/sdb 
On an older PC with Intel Core2 Duo,  it boots directly with a USB uSD reader.  Or we can use GRUB chain-loading,
set root=(hd1,msdos1)
chainloader +1
boot
We added this as another menuentry to the grub.cfg file.

However, if we try chain-loading on Atomic Pi, we get the error message "invalid EFI file path".  The Atomic Pi BIOS cannot load the legacy MBR; and it may not provide the BIOS that DOS is depended on.  It does not seem to have the Compatibility Support Module to provide the legacy BIOS support.

Is it possible to have a BIOS compatibility layer?




No comments:

Post a Comment