Page 1 of 1
Bootstraping and Loading the Kernel
Posted: Mon Jun 23, 2003 10:56 pm
by Dumboo
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 ?
Re:Bootstraping and Loading the Kernel
Posted: Tue Jun 24, 2003 2:44 am
by Pype.Clicker
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 :-/
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.
Moreover, did you make sure that Turbo C wasn't trying to use some DOS interrupts without telling you about it ?
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 ?
This is *not* a newsgroup, but a forum ... so i don't think you could use it through Outlook Express ...
Re:Bootstraping and Loading the Kernel
Posted: Tue Jun 24, 2003 3:57 am
by Dumboo
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
Re:Bootstraping and Loading the Kernel
Posted: Tue Jun 24, 2003 5:09 am
by Pype.Clicker
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
Posted: Tue Jun 24, 2003 9:57 pm
by Dumboo
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
Re:Bootstraping and Loading the Kernel
Posted: Wed Jun 25, 2003 12:41 am
by Pype.Clicker
Dumboo wrote:
can you help me with some simple, steps or direct me towards some nice online tutorials or references
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 ...) .
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
Re:Bootstraping and Loading the Kernel
Posted: Wed Jun 25, 2003 1:36 am
by Dumboo
Thanks for that tutorial its a nice one
-Dumboo