tyler569 / nightingale

A small operating system where I experiment and learn osdev.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

could Nightingale OS fit on a floppy?

informer2016 opened this issue · comments

Even today the floppies are still being used, for example - as virtual floppies inside the coreboot open source BIOS. Just imagine: your wonderful OS could be a part of someone's BIOS build! (for coreboot supported motherboard, maybe you have or could get one - see https://www.coreboot.org/Supported_Motherboards )

@tyler569 , If you already have a coreboot-supported motherboard, or a real chance to get one, - wouldn't it be cool to be able to launch your own OS straight from the BIOS chip? ;) With one simple command its possible to add any floppy to coreboot BIOS build - and then you see it as a boot entry! Multiple floppies could be added this way (as long as you have enough space left inside the BIOS flash chip, luckily LZMA compression could be used for the stored floppies to reduce their occupied size)

It's a good question! I believe it should be possible, after stripping all binaries the complete distribution I ship today fits in less than 1MB. The kernel is ~120k stripped, and the init filesystem is ~800k with all binaries stripped.

I imagine the biggest challenge will be the boot protocol, I currently only support multiboot2. I don't currently have plans to support anything else, but I'd be happy to take a look at what would be needed if you can point me to the relevant documentation.

@tyler569 Is this "multiboot2" boot protocol compatible with the floppy images? If you could create a floppy that will be bootable in QEMU (which also uses a coreboot+SeaBIOS internally) or VirtualBox, no extra adjustments needed to try to launch it on the real hardware from this BIOS. I'll be happy to test ;)

Multiboot 2 is how the OS learns about things like memory maps, ACPI information, the display, etc. I don't boot directly off BIOS, I use grub2 to collect that information for me because it's a lot more convenient than doing all of the BIOS initialization manually. I don't believe grub2 can fit on a floppy, it has a lot of functionality and is probably much larger than my OS, but if you know of another multiboot2-compatible bootloader that you would recommend I can give it a try.

@tyler569 Interesting to know if there's a good reason for using GRUB2 and not GRUB 0.97 like https://github.com/mikaku/Fiwix/

I rely on features of GRUB2 that are not present in legacy GRUB 0.97, including multiboot 2 support.