Calling 16-Bit kernel from 16-Bit assembly boot code?
Posted: Thu Nov 17, 2005 12:00 am
Hi guys,
I'm restarting my OS project I was doing, intending to write most of it myself.
However, I'm having a bit of trouble. My bootloader works fine, I've tested it with other 16-Bit real mode booters. However, they are written entirely in assembly.
I wish to include a Turbo C 2.01 program I wrote, but this is proving difficult. Does anyone know if its possible to link a program written in Turbo C, and write the loaded kernel in assembly (TASM most likely.)
I'm having trouble explaining this. Basically, all I want to do is:
Bootloader loads file 'loader.bin', jumps to execution start.
Loader.bin contains 'start.asm' and 'loader.c' (compiled, of course). start.asm should only call _main located in loader.c
I can't however get the assembly to start the 'main' function in the C code. The C code by itself as an exe or com file works fine (uses the BIOS for IO) but when linked with my own version of the startup library (which just calls _main) nothing happens.
Which is exactly the same thing that happens if I strip the loader.exe file and put it on my disk as loader.bin to be loaded and booted by the bootloader :\
Sorry for the long description, having trouble expressing exactly whats wrong and what I need.
Thanks in advance!
I'm restarting my OS project I was doing, intending to write most of it myself.
However, I'm having a bit of trouble. My bootloader works fine, I've tested it with other 16-Bit real mode booters. However, they are written entirely in assembly.
I wish to include a Turbo C 2.01 program I wrote, but this is proving difficult. Does anyone know if its possible to link a program written in Turbo C, and write the loaded kernel in assembly (TASM most likely.)
I'm having trouble explaining this. Basically, all I want to do is:
Bootloader loads file 'loader.bin', jumps to execution start.
Loader.bin contains 'start.asm' and 'loader.c' (compiled, of course). start.asm should only call _main located in loader.c
I can't however get the assembly to start the 'main' function in the C code. The C code by itself as an exe or com file works fine (uses the BIOS for IO) but when linked with my own version of the startup library (which just calls _main) nothing happens.
Which is exactly the same thing that happens if I strip the loader.exe file and put it on my disk as loader.bin to be loaded and booted by the bootloader :\
Sorry for the long description, having trouble expressing exactly whats wrong and what I need.
Thanks in advance!