Using C functions in bootloader
Posted: Thu Jun 26, 2008 8:36 am
Cand anyone please explain (or give a tutorial on) how to use C written code in a bootlaoder (just like GRub does <however grub code is very hard to follow> ).
I want to write a two-stage bootloader. First stage loads stage2 from the next "N" sectors (where N is known). I want to use both assembly and C in stage2. I would like to implement support for FS in C (since implementing it in ASM is a real pain). I might want to implement some functions in ASM which I could use in C, like something to enter and leave pmode (in order to use BIOS HDD <since I am not planning to implement support for IDE and SCSI in the BLoader !>)
I am using the Gnu C Compiler;
I want to write a two-stage bootloader. First stage loads stage2 from the next "N" sectors (where N is known). I want to use both assembly and C in stage2. I would like to implement support for FS in C (since implementing it in ASM is a real pain). I might want to implement some functions in ASM which I could use in C, like something to enter and leave pmode (in order to use BIOS HDD <since I am not planning to implement support for IDE and SCSI in the BLoader !>)
I am using the Gnu C Compiler;