Visopsys 0.83 - Initialization failed while booting as a Virtual Floppy from coreboot/SeaBIOS

General discussion about Visopsys. We'll create more specific forums if the number of posts justifies that.
User avatar
andymc
Posts: 491
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.83 - Initialization failed while booting as a Virtual Floppy from coreboot/SeaBIOS

Post by andymc » Fri Jan 04, 2019 3:05 pm

I'm not much familiar with this world of firmware flashing boot images and whatnot.

Is there any way you could post some instructions about how to set this up in an emulator, such as Qemu or VMware or VirtualBox?

How would the bootloader find out this memory address, of the virtual floppy image it's really booting from? That might be the 'hook' right there. Right now I assume the bootloader thinks it's booting from a real floppy disk - really an emulated one. The loader has to be able to figure out that address, to pass it to the kernel.

User avatar
andymc
Posts: 491
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.83 - Initialization failed while booting as a Virtual Floppy from coreboot/SeaBIOS

Post by andymc » Fri Jan 04, 2019 3:20 pm

I guess what that Fiwix guy did is to create the ramdisk in the bootloader. So the loader would have to pick a memory address, load the entire emulated floppy into it using the usual int13 calls, then pass that address. But we wouldn't want it to do that under normal circumstances, so there has to be some trigger for it. Perhaps with a custom boot sector.

Is there any part of this that you'd like to try doing? I have limited time (late-night coding sessions) and I'm trying to complete features for the 0.9 release. I'd be happy to work with you on it, though!

qmastery
Posts: 8
Joined: Mon Nov 19, 2018 8:48 pm

Re: Visopsys 0.83 - Initialization failed while booting as a Virtual Floppy from coreboot/SeaBIOS

Post by qmastery » Fri Jan 04, 2019 8:12 pm

andymc wrote:
Fri Jan 04, 2019 3:05 pm
Is there any way you could post some instructions about how to set this up in an emulator, such as Qemu or VMware or VirtualBox?
Sure! ;) Please download and unzip this coreboot.zip - https://github.com/informer2016/shr/fil ... reboot.zip ( just 574KB but too big to be attached to this message ) - it contains a special coreboot.rom build of coreboot+SeaBIOS for QEMU (with config.txt as .config) , to which I've added the latest visopsys.img as a virtual floppy, with this command after the build completion:

Code: Select all

./build/cbfstool ./build/coreboot.rom add -f ./visopsys.img -n floppyimg/visopsys.lzma -t raw -c lzma
QEMU command I'm using to run this coreboot.rom :

Code: Select all

qemu-system-x86_64 -L . -m 256 -localtime -vga vmware -net nic,model=rtl8139 -net user -soundhw ac97 -usb -usbdevice tablet -bios ./coreboot.rom -serial stdio
cbfstool is a tool from coreboot repository and it depends on some files from there, but of course it wouldn't be convenient for you to clone the whole coreboot repository just for this small tool. So I created a custom script, please download and unzip this cbfstool.zip - https://github.com/informer2016/shr/fil ... fstool.zip - then

Code: Select all

cd ./cbfstool
and run this script

Code: Select all

./cbfstool.sh
it will wget only the required files (< 2 MB), compile them and there'll be

Code: Select all

./cbfstool/util/cbfstool/cbfstool
executable which you can use for adding/removing the floppies, e.g. remove the old version of Visopsys floppy and add a new one:

1) Add floppy

Code: Select all

./cbfstool/util/cbfstool/cbfstool $COREBOOT_ROM_PATH add -f $VISOPSYS_FLOPPY_PATH -n floppyimg/visopsys.lzma -t raw -c lzma
2) Remove floppy

Code: Select all

./cbfstool/util/cbfstool/cbfstool $COREBOOT_ROM_PATH remove -n floppyimg/visopsys.lzma
3) Print memory map

Code: Select all

./cbfstool/util/cbfstool/cbfstool $COREBOOT_ROM_PATH print
and then we could run this coreboot.rom with QEMU :

Code: Select all

qemu-system-x86_64 -L . -m 256 -localtime -vga vmware -net nic,model=rtl8139 -net user -soundhw ac97 -usb -usbdevice tablet -bios ./coreboot.rom -serial stdio
andymc wrote:
Fri Jan 04, 2019 3:05 pm
Is there any part of this that you'd like to try doing?
To be honest my skills as a programmer are quite limited but I'm really good at testing / detailed bugreporting ; so if you could try to get Visopsys working as a part of coreboot image for QEMU, I will be happy to test it as a part of bios for real hardware and also help you testing the new features of your upcoming 0.90 release
Last edited by qmastery on Sat Jan 05, 2019 7:28 am, edited 1 time in total.

User avatar
andymc
Posts: 491
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.83 - Initialization failed while booting as a Virtual Floppy from coreboot/SeaBIOS

Post by andymc » Sat Jan 05, 2019 2:45 am

Good instructions, thanks for queueing everything up for me :-)

I'm deep into debugging something else at the moment, but I will give this a go soon.

In the past I've been asked on here about some multiboot stuff, and PXE, and I wonder whether these changes would help to enable all of that - booting from a virtual floppy image.

Rather than a custom boot sector I'd probably go with the creation of an empty file in the image, such /ramdisk, that the bootloader could search for, to trigger this behaviour (as it does with /nograph, which forces text mode operation).

Post Reply