This is what I want to do.
Bootsect (realmode) -> Loader (realmode) -> kernel (pmode)
I am using A.A. Frounze's Simple bootsector and the OSLoader 4 Dummies (I dunno if its a good Idea, but I really like the work he's done, and It would save me time later on as I want to go straight into kernel programming)
Following his instructions step by step I build a coff file. The code is a simple C file that sets a pointer to video mem and sets a couple of bytes. It compiles fine... without errors or warnings... and links fine... I am using his predefined link script:
Code: Select all
/* Adapted from /djgpp/lib/djgpp.djl */
OUTPUT_FORMAT("coff-go32")
ENTRY(_main)
SECTIONS
{ .text 0x00110000 :
{ *(.text)
. = ALIGN(4096);
etext = .; _etext = .; }
.data :
{ *(.data)
. = ALIGN(4096);
edata = .; _edata = .; }
.bss :
{ *(.bss)
*(COMMON)
. = ALIGN(4096);
end = .; _end = .; }}
Loading COFF file header
magic : 0x14C
number of sections : 4
symbol table offset : 0x2014
number of symtab entries : 17
size of optional header : 0x1C
flags : 0x107
File must have 3 sections (.text, .data and .bss).
Im not to sure whats going on with this but...
If you guys feel that I am better off using grub and not the 2 stage loader approach... please let me know. Thanks for the help!
Rich