Hi,
I got close.

Using a 16MB floppy image, I added a size with 8 heads, 32 sectors and 128 tracks to SeaBIOS, which adds up to the right size.

After adding it to coreboot / SeaBIOS, I was able to select it as a Ramdisk with its correct name.

I got the Syslinux boot logo (that is what's installed on my floppy image), so I'm assuming that SeaBIOS found my image correctly and didn't barf (Yay?).

However, it hangs after that and doesn't boot my kernel. I tested this image successfully with memdisk / GRUB, so it should work. Since I don't get a syslinux prompt either, I'm not sure how to continue.

Any ideas?

Cheers,
R

On Tue, Apr 16, 2019 at 9:35 AM Mike Banon <mikebdp2@gmail.com> wrote:
Hopefully, simply inserting some stuff to
./payloads/external/SeaBIOS/seabios/src/hw/floppy.c (lines 80-108)
should be enough, but I haven't tried ;-) By the way, at my
"multiple_floppies.patch" I'm doing this:

+ // Find the max floppy size
+ for (;;) {
+ // Find the next image.
+ file = romfile_findprefix("floppyimg/", file);
+ if (!file)
+ break;
+ filename = file->name;
+ size = file->size;
+ dprintf(3, "Found floppy file %s of size %d\n", filename, size);
+ // Check if this size is valid.
+ ftype = find_floppy_type(size);
+ if (ftype < 0) {
+ dprintf(3, "No floppy type found for ramdisk size\n");
+ } else {
+ if (size > max_size)
+ max_size = size;
+ }
+ }

That's to determine, how much memory we should allocate for the
purpose of loading the selected floppy there (allocate the maximum
floppy size - so that any selected floppy will fit there). This code
should be compatible with any new sizes as well, but let me know if
there are any problems. When you're running QEMU with -serial stdio ,
it should output those debug messages into your console, if the debug
level of these messages is higher than what's set at your SeaBIOS
config.

Best regards,
Mike Banon

On Tue, Apr 16, 2019 at 6:49 PM Rafael Send <flyingfishfinger@gmail.com> wrote:
>
> Thanks,
> I had already played with building SeaBIOS+coreboot in the "default" configuration for QEMU with various common payloads.
>
> I meant I haven't gotten around to poking at the SeaBIOS code for larger floppies yet :)
>
> R
>
> Mike Banon <mikebdp2@gmail.com> schrieb am Di., 16. Apr. 2019, 01:39:
>>
>> You need to build a coreboot image for QEMU with SeaBIOS (master)
>> selected as the default payload. CBFS size should be increased to a
>> size large enough to contain your floppy (or floppies, btw here's a
>> patch to support multiple floppies at CBFS -
>> https://review.coreboot.org/c/coreboot/+/32238 , and you could install
>> it with this script - https://pastebin.com/raw/hv9sSuMU , more details
>> here - https://mail.coreboot.org/hyperkitty/list/seabios@seabios.org/thread/CKWLNTZU43SAHQ26USNFASORA2H5BXBE/
>> ) . After it will be compiled, you could use cbfstool to add/remove
>> floppies to/from CBFS of coreboot.rom, with LZMA compression to reduce
>> their size:
>> 1) Add: ./build/cbfstool ./build/coreboot.rom add -f
>> ./path_to/myfloppy.img -n floppyimg/myfloppy.lzma -t raw -c lzma
>> 2) Remove (e.g. to add a new version later): ./build/cbfstool
>> ./build/coreboot.rom remove -n floppyimg/myfloppy.lzma
>> 3) Print a memory map: ./build/cbfstool ./build/coreboot.rom print
>> Run this coreboot.rom by executing this QEMU command: (some floppies are 64-bit)
>> qemu-system-x86_64 -L . -m 768 -localtime -vga vmware -net nic,model=rtl8139 \
>>  -net user -soundhw ac97 -bios ./coreboot.rom -boot menu=on -serial stdio
>> Best regards,
>> Mike Banon
>>
>> On Mon, Apr 15, 2019 at 6:12 PM Rafael Send <flyingfishfinger@gmail.com> wrote:
>> >
>> > I haven't gotten around to poking at SeaBIOS yet, I'm still wondering how to test my large floppies.
>> >
>> > Syslinux appears to install to them fine, but QEMU doesn't seem to like booting them with -fda.
>> >
>> > Do you guys have any suggestions on how to test booting the large floppy images?
>> >
>> > Cheers,
>> > R
>> >
>> >
>> >
>> > Mike Banon <mikebdp2@gmail.com> schrieb am Mo., 15. Apr. 2019, 05:35:
>> >>
>> >> Personally I think that either this guy did something incorrectly or
>> >> there's a Windows 3.1 bug. Meanwhile, Rafael's Linux-based OS is going
>> >> to boot from this floppy like it's a ramdisk, so hopefully should be
>> >> indifferent to the custom floppy sizes and would work. I share the
>> >> same hopes for KolibriOS: although its' 1.44MB floppy contains really
>> >> a LOT of stuff, some cool things like console emulators didn't fit -
>> >> so I'm going to create the extended Kolibri floppy version, which will
>> >> be either 2.88MB or some custom ( 1.44MB * X ) size.
>> >>
>> >> On Sun, Apr 14, 2019 at 6:12 PM Kevin O'Connor <kevin@koconnor.net> wrote:
>> >> >
>> >> > On Fri, Apr 12, 2019 at 11:38:52AM -0700, Rafael Send wrote:
>> >> > > Hi,
>> >> > > I'm working on stuffing a bootable Linux distro into coreboot.  In QEMU I
>> >> > > already succeded by using coreboot's built-in kernel loading mechanism, but
>> >> > > that's without SeaBIOS.
>> >> > >
>> >> > > I'd love to have it as a SeaBIOS payload so I can also boot other things,
>> >> > > but I guess I'd have to create a custom-sized floppy image for this or
>> >> > > figure out how to create an ELF payload out of a Linux kernel (I'm open to
>> >> > > either, but I wasn't able to find any documentation on the ELF method).
>> >> > >
>> >> > > The guy who put Win 3.1 in coreboot attempted the floppy method, but
>> >> > > according to his article he did not find success with this method due to
>> >> > > unknown and complex issues in the floppy-side logic of SeaBIOS.
>> >> > >
>> >> > > So, I'm making the question explicit: What would it take to support
>> >> > > custom-sized floppy images? In particular, I'm thinking of a 16MB device...
>> >> >
>> >> > My vague recollection is that various OSes had hard coded expectations
>> >> > on the types of floppy drives supported.  I did not think it would be
>> >> > easy to support a floppy size larger than 2.8MB.
>> >> >
>> >> > It is possible to emulate a hard drive in memory.  However, that would
>> >> > require code changes.
>> >> >
>> >> > Cheers,
>> >> > -Kevin
>> >> > _______________________________________________
>> >> > SeaBIOS mailing list -- seabios@seabios.org
>> >> > To unsubscribe send an email to seabios-leave@seabios.org