Problems executing C code
Posted: Tue Sep 09, 2008 4:16 pm
Hi,
Please I need help...
I wrote:
1) Boot.asm
called by BIOS.POST
(16 Bits Code)
->load code from disk to...
7000:0000 - cpu.asm
7000:0200 - library.asm (with some functions like ShowMessage, LoadCode, etc)
7000:0400 - kernel32.asm
7000:0600 - kernel32.c
2) cpu.asm
loaded to (7000:0000) and jumped from boot.asm (1)
->Check the actual cpu that is running the code...
->If it support PM, then call next piece of code
-> them jumps to 7000:0400 (kernel32.asm)
3) kernel32.asm
just call C function
Kernel32.c
just write "Hello world" directly to the memory address
It seem simple, but is where all my problems start!!!!!
Here is my problem
This is 32bits asm code that is attached to a 32 bit C code (DGJPP) - No problem here!
When I call the C function the result is not what expect...
I'm using the bochs emulator to test the code...
It seems that I need to set up some registers... is this the case?
For example what kind o preparation the GRUB boot loader perform???
Please help me!
I want to start using C code without any boot loader...
I want make my own BL....
Please I need help...
I wrote:
1) Boot.asm
called by BIOS.POST
(16 Bits Code)
->load code from disk to...
7000:0000 - cpu.asm
7000:0200 - library.asm (with some functions like ShowMessage, LoadCode, etc)
7000:0400 - kernel32.asm
7000:0600 - kernel32.c
2) cpu.asm
loaded to (7000:0000) and jumped from boot.asm (1)
->Check the actual cpu that is running the code...
->If it support PM, then call next piece of code
-> them jumps to 7000:0400 (kernel32.asm)
3) kernel32.asm
just call C function
Kernel32.c
just write "Hello world" directly to the memory address
It seem simple, but is where all my problems start!!!!!
Here is my problem
This is 32bits asm code that is attached to a 32 bit C code (DGJPP) - No problem here!
When I call the C function the result is not what expect...
I'm using the bochs emulator to test the code...
It seems that I need to set up some registers... is this the case?
For example what kind o preparation the GRUB boot loader perform???
Please help me!
I want to start using C code without any boot loader...
I want make my own BL....