When I tried to run the compiled binary I kept getting call instructions pointing into the middle of functions instead of the start. Here is a section of the code disassembled by objdump.
Code: Select all
...
00100f70 <_kmain>:
100f70: 55 push %ebp
100f71: 89 e5 mov %esp,%ebp
100f73: 57 push %edi
100f74: 56 push %esi
100f75: 53 push %ebx
100f76: 83 ec 1c sub $0x1c,%esp
100f79: 8b 75 0c mov 0xc(%ebp),%esi
100f7c: c7 45 f0 ff ff ff ff movl $0xffffffff,0xfffffff0(%ebp)
100f83: e8 bd fa ff ff call 100a45 <_gdt_install+0x18>
100f88: e8 5a f4 ff ff call 1003e7 <_idt_install+0x1d>
100f8d: e8 96 f4 ff ff call 100428 <_isrs_install+0x22>
100f92: e8 a5 2f 00 00 call 103f3c <_irq_install+0x27>
100f97: e8 14 3f 00 00 call 104eb0 <_init_video+0x2c>
...
This is a c function with the prototype:
Code: Select all
void kmain(Uint32 mbMagic, mboot_info *mboot);
I use mingw32 and the binutils from Bran's Kernel Development Tutorial (http://www.osdever.net/bkerndev/index.php)
--- NOTE ---
Sorry if I sound like a noob, most probebly the answer is staring me in the face and I can't see it.