Creating a 16 bits (real mode) OS
Posted: Fri Oct 19, 2007 6:41 pm
Hello everyone, its my first post in here.
For the past two weeks I've been reading a lot of guides/topics/tutorials about kernel programming. Almost 100% of the papers were about protected mode and 32 bit programming, and there was a lot of information and concepts that at the time I don't understand. Due to this fact, I decided that I need to really get into the real mode before getting in something bigger.
I have some experience on creating a basic kernel in real mode using assembly, and now I want to use C to program the mini-os. The problem is that GCC/DJGPP do not compile 16 bit code (as far as I know) and I have no idea on how to link my code with the kernel_start.asm (which calls the "main" function) using TurboC 2.01 (which seems to generate a lot of junk code with only a "void main() {}"). The bootloader I've already programmed (in asm).
Can you guys give some tips on how to correctly compile and link a 16bit C code with TurboC or point another compiler that is able to generate 16bit binaries?
Sorry for my english.
Thanks in advance,
Fergo
For the past two weeks I've been reading a lot of guides/topics/tutorials about kernel programming. Almost 100% of the papers were about protected mode and 32 bit programming, and there was a lot of information and concepts that at the time I don't understand. Due to this fact, I decided that I need to really get into the real mode before getting in something bigger.
I have some experience on creating a basic kernel in real mode using assembly, and now I want to use C to program the mini-os. The problem is that GCC/DJGPP do not compile 16 bit code (as far as I know) and I have no idea on how to link my code with the kernel_start.asm (which calls the "main" function) using TurboC 2.01 (which seems to generate a lot of junk code with only a "void main() {}"). The bootloader I've already programmed (in asm).
Can you guys give some tips on how to correctly compile and link a 16bit C code with TurboC or point another compiler that is able to generate 16bit binaries?
Sorry for my english.
Thanks in advance,
Fergo