rdos wrote:
it might not be possible to handle reading the root directory of EXT or NTFS from the boot sector.
That's why EXT2 and NTFS have more than one sector for the boot "sector".[/quote]
Well, you say that, but my previous attempt to write a real-mode ext2 file loader finally clocked in at 2048 bytes. Unfortunately, ext2 only gives me 1024 bytes of space (irrespective of block size, by the way).
However, those 1024 bytes
are enough to load i-node 5 (which is the ext2 reserved i-node for the boot loader). So if I had gone that route, I would have had routines to load sectors in the first 512 bytes, routines to load i-nodes in the second 512 bytes, then skip 1024 bytes for superblock and block group descriptors, then routines to traverse directories in however much memory was needed.
But I never finished it. My main goal was to only use the first 1024 bytes. But it seems like that is just not enough space for
- enabling A20-gate
- testing if the CPU is acceptable
- loading second bootloader block and superblock
- traversing directories to find a programmable path name
- finally loading that one to the 1MB line
- mapping it as an ELF file
- doing the rest of stuff my kernel needs
- and finally transitioning to 64-bit mode