Higher-half kernel

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
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Higher-half kernel

Post 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.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

How about the Higher Half Bare Bones in the wiki...
Every good solution is obvious once you've found it.
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post 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,
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Post 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?
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post 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?
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post 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.
Every good solution is obvious once you've found it.
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post 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.
Post Reply