Some kernel dev questions from a newbie

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Some kernel dev questions from a newbie

Post by Neo »

I'm a newbie to OS programming and want to develop a kernel using C and ASM. I have already written a FAT12 bootloader which loads a secondary, the secondary jumps to p-mode etc. Now I would like to know where exactly the boot loader ends its job and where the kernel start its job.(or rather what exactly are the jobs of the kernel).
The target architecture is intel 486/Pentium and above. I do not know its architecture in detail i.e. i can't understand the GDT,IDT etc and how to load them up as well as how they work etc. also how do i determine the processor? What about the memory layout of a PC which is just booted-up? is there any relevant information available anywhere or can i just use the memory without caring about overwriting any important info? I would reaally appreciate any help with these.Thanx in advance to all you folks.
And by the way i noticed in <a href="http://osdev.neopages.net/tutorials/brunmar/tutorial_02.php">Gregor Brunmar's Pmode tutorial</a> that he jumps to pmode without enabling the A20 line. is it necessary that it is enabled first or can i do the same?
And what about this invalid opcode stuff. If i execute a CPUID instruction the literature says that it would give me a "INVALID OPCODE" error on unsupported processors. How do i check this error?
Only Human
SquattyDog

RE:Some kernel dev questions from a newbie

Post by SquattyDog »

If you're a beginner then I would suggest "mastering" real mode before moving on to PMODE.  I tried PMODE with my first OS and I failed miserably.  If you HAVE TO write a PMODE OS then try using GRUB as your boot loader instead of writing your own.  Best of luck with your OS!
- SquattyDog *
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

RE:Some kernel dev questions from a newbie

Post by Neo »

Thanx i'm am using GRUB right now but was thinking of writing my own bootloader later on. What about the other question anyone?? Thanx
Only Human
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

RE:Some kernel dev questions from a newbie

Post by bubach »

look at the docs here:
http://osdev.neopages.net/

and here:
http://loonix.technigga.net/osdev.php

and here (for some memory spec.):
http://atrevida.comprenica.com/atrtut04.html

if you spent some nights on the net, u will find what you need.. =)
hope this heled some..

/Christoffer
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

RE:Some kernel dev questions from a newbie

Post by bubach »

it should be "helped"...

/Christoffer
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
Post Reply