OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 6:39 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Bootstraping and Loading the Kernel
PostPosted: Mon Jun 23, 2003 10:56 pm 
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 ?


Top
  
 
 Post subject: Re:Bootstraping and Loading the Kernel
PostPosted: Tue Jun 24, 2003 2:44 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 2:31 am
Posts: 5964
Location: In a galaxy, far, far away
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 ?

Quote:
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 ...

_________________
Image May the source be with you.


Top
 Profile  
 
 Post subject: Re:Bootstraping and Loading the Kernel
PostPosted: Tue Jun 24, 2003 3:57 am 
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


Top
  
 
 Post subject: Re:Bootstraping and Loading the Kernel
PostPosted: Tue Jun 24, 2003 5:09 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 2:31 am
Posts: 5964
Location: In a galaxy, far, far away
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.

_________________
Image May the source be with you.


Top
 Profile  
 
 Post subject: Re:Bootstraping and Loading the Kernel
PostPosted: Tue Jun 24, 2003 9:57 pm 
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


Top
  
 
 Post subject: Re:Bootstraping and Loading the Kernel
PostPosted: Wed Jun 25, 2003 12:41 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 2:31 am
Posts: 5964
Location: In a galaxy, far, far away
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

_________________
Image May the source be with you.


Top
 Profile  
 
 Post subject: Re:Bootstraping and Loading the Kernel
PostPosted: Wed Jun 25, 2003 1:36 am 
Thanks for that tutorial its a nice one :)

-Dumboo


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 82 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group