Page 1 of 1

Paging from the beginning

Posted: Sun Nov 13, 2005 9:55 am
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?

Re:Paging from the beginning

Posted: Sun Nov 13, 2005 10:02 am
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

Re:Paging from the beginning

Posted: Sun Nov 13, 2005 10:57 am
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.

Re:Paging from the beginning

Posted: Sun Nov 13, 2005 11:23 am
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)

Re:Paging from the beginning

Posted: Sun Nov 13, 2005 11:50 am
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)

Re:Paging from the beginning

Posted: Sun Nov 13, 2005 1:24 pm
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.

Re:Paging from the beginning

Posted: Sun Nov 13, 2005 1:33 pm
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

Re:Paging from the beginning

Posted: Sun Nov 13, 2005 1:49 pm
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)