Paging from the beginning

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
OSMAN

Paging from the beginning

Post by OSMAN »

Now I don't know what should do next. I have only interrupts, keyboard task and some print-functions. I don't a sort of know why to do paging or segmentation or what. I've read your FAQ many times but there isn't said the commands or any example code about how could I implement paging.
So could you show me a little skeleton/pseudo-code and tell me what it would be supposed to do?
Warrior

Re:Paging from the beginning

Post by Warrior »

http://www.mega-tokyo.com/forum/index.p ... eadid=7993
This is a topic where I knew next to nothing about paging, maybe it can help you.

Also I have other topics floating around which are indepth discussions on paging where I got great help.

Good luck.
Nelson
pradeep

Re:Paging from the beginning

Post by pradeep »

Try this site, which helped me with paging. However it seems that new version is out there,it's older version with memory management through stacks is really good. http://codezen.org/newviridis/index.php Haven't gone through it's new version.
JAAman

Re:Paging from the beginning

Post by JAAman »

for both basic information and implementation details, consult the bible intel manuals:
[url=http://developer.intel.com/design/pentium4/manuals/index_new.htm#sdm_vol1]
## ---- ----- ------ Intel Manuals[/url]

specifically:
vol. 3 chapters 3 & 4

each chapter starts with segmentaion, then discusses paging

most people ignore paging (its depreciated, and no longer availible in long mode) and just use the flat model (discribed in section 3.2.1: page: 3-3 -- except they use 2 segs for ring 0 and 2 for ring 3)

and simply use paging (which is much more flexible)

paging will allow all programs to think they have access to the full memory, and at the same time, isolate misbehaving programs from crashing the whole system

it will also allow programs to use more memory than the computer actually has (this is how programs can be written to work on any computer no matter how little memory it has)

the intel manuals can be intimidating but they are the most reliable, and are actually quite easy to understand (after you read it a couple of times)
bluecode

Re:Paging from the beginning

Post by bluecode »

JAAman wrote:most people ignore paging (its depreciated, and no longer availible in long mode) and just use the flat model (discribed in section 3.2.1: page: 3-3 -- except they use 2 segs for ring 0 and 2 for ring 3)
you're talking about segmentation here... paging is widly used (as you are stating in your next paragraph)
User avatar
kataklinger
Member
Member
Posts: 381
Joined: Fri Nov 04, 2005 12:00 am
Location: Serbia

Re:Paging from the beginning

Post by kataklinger »

If you want to implement paging, you should implement physical memory allocator.

Try reading this:
Part 1:
http://www.osdever.net/tutorials/memory1.php?the_id=44
Part 2:
http://www.osdever.net/tutorials/memory2.php?the_id=45

Tutorial about memory managemet written by Tim Robinson, and it is really good document.
JAAman

Re:Paging from the beginning

Post by JAAman »

most people ignore paging (its depreciated, and no longer availible in long mode) and just use the flat model (discribed in section 3.2.1: page: 3-3 -- except they use 2 segs for ring 0 and 2 for ring 3)
you're talking about segmentation here... paging is widly used (as you are stating in your next paragraph)
oops, writing to fast with to little sleep last night!!

your right, i ment segmentation isn't used much
JAAman

Re:Paging from the beginning

Post by JAAman »

kataklinger wrote: If you want to implement paging, you should implement physical memory allocator.

Try reading this:
Part 1:
http://www.osdever.net/tutorials/memory1.php?the_id=44
Part 2:
http://www.osdever.net/tutorials/memory2.php?the_id=45

Tutorial about memory managemet written by Tim Robinson, and it is really good document.

yes it should be a very good tutorial, but unless its been changed, there is an error in the calculations for the GDT entry for alter-segment method of moving kernel to Top_of_mem (iirc)
(which shouldn't be used anyway, if you ever expect to use long mode)
Post Reply