Hi there
I m a complete newbie with the creating OS stuff,
I have written a bootstrap code, which uses BIOS API Calls to load the kernel from a predefined sectors, but the problem is,
Previously i have written my small OS kernel in ASM(NASM) and was able to sucessfully load it, but now I have written the same code in C, using Turbo C++ 3.0 compiler i created a tiny model (*.com) file, and copied on the predefined sector, but this time i was not getting the expectd output, i know that the kernel was loadeed in the memory, but i dont know where i did mistake :-/
Also i have been first time to this newsgroup, and was not able to read it using Outlook Express, any sugessions on how to configure OE ?
Bootstraping and Loading the Kernel
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Bootstraping and Loading the Kernel
First, the tiny model expects the loader to provide a special structure (i guess it's the PSP, not sure anymore) where it can find several things like available memory count etc. to be located at CS:0 while the program itself starts at CS:100. If your program doesn't respect this convention it will likely fail to load.Dumboo wrote: now I have written the same code in C, using Turbo C++ 3.0 compiler i created a tiny model (*.com) file, and copied on the predefined sector, but this time i was not getting the expectd output, i know that the kernel was loadeed in the memory, but i dont know where i did mistake :-/
Moreover, did you make sure that Turbo C wasn't trying to use some DOS interrupts without telling you about it ?
This is *not* a newsgroup, but a forum ... so i don't think you could use it through Outlook Express ...Also i have been first time to this newsgroup, and was not able to read it using Outlook Express, any sugessions on how to configure OE ?
Re:Bootstraping and Loading the Kernel
I wanted to write the OS kernel in C, using Turbo C++ 3.0 compiler, instead of ASM, any suggestions what should i do next ? ::)
-Dumboo
-Dumboo
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Bootstraping and Loading the Kernel
you should disassemble the Turbo-C produced code and check there's nothing unexpected in it (like dos calls). Also check TurboC documentation and make sure you don't need to add something like "-ffreestanding" to force the compiler to make a standalone file.
Re:Bootstraping and Loading the Kernel
Can you guide me, means what step should i take, to actually Create a loadable kernel in C, i tried disassembling the file, also, i tried with the dpcumentation, but it looks as if I m lost :-\
can you help me with some simple, steps or direct me towards some nice online tutorials or references
thanks
-Dumboo
can you help me with some simple, steps or direct me towards some nice online tutorials or references
thanks
-Dumboo
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Bootstraping and Loading the Kernel
sorry, i can't offer support for TurboC as i don't own a copy of it myself (or at least not the docs, just some abandonware i found ...) .Dumboo wrote: can you help me with some simple, steps or direct me towards some nice online tutorials or references
I don't know if you plan to make a real-mode OS or a protected-mode one, i assume you'll use realmode as it's the only thing TurboC can generate (afaik).
For a good step-by-step tutorial on starting a pmode OS using GNU tools, you can check http://www.mega-tokyo.com/os/os-faq.html