Page 1 of 1

Higher-half kernel

Posted: Thu Feb 01, 2007 7:59 pm
by iammisc
Hi, do you have any resources for writing a higher-half kernel? Do I have to enable paging before calling my kernel?

thank you.

Posted: Thu Feb 01, 2007 10:40 pm
by Solar
How about the Higher Half Bare Bones in the wiki...

Posted: Thu Feb 01, 2007 10:50 pm
by iammisc
if someone could explain the HigherHalfBareBones example to me then yes that would help. I don't understand what i would have to do after to get paging working the way i want it,

Posted: Thu Feb 01, 2007 11:19 pm
by Colonel Kernel
If you can't come up with more specific questions, then there's little we can do (or have the time to do) to help you. Perhaps you need more background information...?

Here's at least a bit of info to get you started: HigherHalfBareBones gets the kernel up and running in the higher half with paging enabled. It sets up a page directory and a single 4MB page for the kernel (this means it requires the CPU to support PSE). The page directory itself should be accessible in the kernel's virtual address space, so you can mess around with it to your heart's content once main() starts running. The only real gotcha about HigherHalfBareBones is that it passes the physical address of the multiboot info structure to main(), not the virtual address (in fact it does nothing to make sure that the multiboot info structure is even within the kernel's 4MB page, although it probably is).

Does this help?

Posted: Fri Feb 02, 2007 12:02 am
by iammisc
yes a lot. it tells me what i have to do. I will have to map the rest of the memory like the video memory and the multiboot header too. And knowing that i could access the page table is good too. Because the page table in this tutorial is so small, can I change the page table in my main function? What do I have to take care of for this to work?

Posted: Fri Feb 02, 2007 1:20 am
by Solar
OK, OK, OK... I see where I went wrong.

I'd suggest you get a copy of the Intel Manuals, as, basically, all the information is in there.

Then, I'd strongly suggest you try your hands on a very simplistic "toy" kernel first. If you ask us whether you "could" expand the page table "in my main function", that points to some not-understandings that are more basic than HigherHalf kernels. Having a look at the FAQ wiki might help, too.

Posted: Fri Feb 02, 2007 5:26 pm
by iammisc
If i'm not mistaken the higher-half bare bones article uses a main function as the main entry point to the kernel.