Unsigned wrote:
But it is already about 33KB in size, and I still need to implement the different filesystem drivers. So no, I can't implement a FD driver, because that would mean I need to implement drivers for IDE, ATAPI, SATA, USB, USB floppy, USB mass storage, and new kinds of drives that may appear in the future (EDIT: and PnP/PCI/ACPI for detecting those), and that may make my code grow beyond the limit. The 32-bit module (written in C) is limited to 64KB minus the size of the 16-bit module (written in assembler) because the bootloader is loaded by the boot sector and I don't want it to be too big. If you don't know, my 16-bit module performs basic setup like enabling the A20 line, detecting the 386, etc., and then copies the 32-bit module (which is included in assembler using the %incbin directive) in the location it's linked to, and then it jumps to the entry point. My kernel will not be necessarily limited in size, so I can't assume it can be loaded all in the first MB. I want to be able to load it at any free region, possibly fragmented physically (therefore using paging). Aditionally, I want my bootloader to be universal, that's to say, able to load the kerner from any kind of drive the BIOS was already able to load the MBR and bootloader from. I don't want to update my bootloader as new drives are invented, so using the BIOS will work, since it will take care of the hardware internals. And yes, I need to use protected mode becuase GCC doesn't produce real mode code, and I personally don't fancy to write the filesystem drivers in assembler. I find C far more convenient.
I guess that's justifiable...