Page 1 of 1
file format
Posted: Wed Jan 21, 2004 10:25 am
by slacker
can a kernel be compiled into any file format and run correctly? like an exe?
Re:file format
Posted: Wed Jan 21, 2004 10:30 am
by Pype.Clicker
use whatever format you wish, provided that your bootloader supports it ...
historically, bootloaders have been small piece of code with limited resource, and kernel need not to be relocated (as you may decide the location at compile-time) nor linked to anything else, so there's a trend for flat binary format ...
now that we have GRUB, it's easier to support various formats, but afaik, neither EXE-MZ nor EXE-PE have a bootloader that support them ...
Re:file format
Posted: Wed Jan 21, 2004 10:46 am
by Tim
GRUB can boot any format if you use the a.out kludge described in the GRUB docs. However, it's not clever enough to understand relocations. If you use it to load an MZ EXE, you'll need to do relocations yourself. If you use it to load a PE EXE, you'll need to either set the base address to a valid physical address, or set up paging soon to map the base virtual address to the actual physical address.
Re:file format
Posted: Wed Jan 21, 2004 12:16 pm
by slacker
anybody have a doc on exe file formats?
Re:file format
Posted: Wed Jan 21, 2004 1:05 pm
by Neo