News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Paging memory

Started by thomasantony, January 16, 2005, 09:44:46 AM

Previous topic - Next topic

thomasantony

Hi,
   I am trying to make a memory management system for my OS. I am not sure whether I should put this here. Ok here is my problem. I read some tuts on paging at www.osdever.net . They explained setting up a page directory and page tables and using  cr3 and cr0 to enable paging. Then I am stuck. Then I saw this another tut at http://legendos.codingworld.net/tutorials/phys_memory_tutorial.html . this one doesn't say anything about using the hardware's help for paging. It does it all by itself. Which one should I use?

Thomas Antony :red
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

thomasantony

Pleeeeease help me!! :(

Thomas Antony :snooty:
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

hutch--

Sorry Thomas but its not really my field. Designing a memory management system is no simple task as you must be capable of keeping track of many different things to do it.

We have a few people floating around who would know it like Bogdan Ontanu and various orther people as well but you will have to try your luck with them as they see the posting.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

tenkey

The phys memory tutorial is about memory management - allocation and deallocation (freeing). It's basically a heap system designed to be used by a paging system. If you want to store two programs in memory as if they were both located in the same location (a la Windows and Unix), it's not enough. In that case, you will also need the hardware.
A programming language is low level when its programs require attention to the irrelevant.
Alan Perlis, Epigram #8

Tedd

Yes, you do need to use hardware and mess around with page directories/tables, enable paging, and all of the fun stuff :U
I'd recommend reading lots and lots until you're sure you understand how it all works - it's not so straightforward, but it's okay once you understand the idea (you just need the light-bulb in your head :wink) And then, once you think you understand it all, read some more :bdg And then work out how you want it to work before you even think about coding.
For a simple paging system, you can get away with only having one page directory, which will make things a little easier.
And remember, if it all seems hard, that's because you've got to the good bits (which is further than many!) :green
No snowflake in an avalanche feels responsible.

thomasantony

Hi,
    I read the docs abt this topic at osdever.net . I also googled and looked at the sources of other OS es. I think i get the idea of paging but I have no idea how to implement allocating, deallocating etc. And where does this bitmap and stack stuff fit into all this. Do I have to make a MM for enabling DMA? Or can I set a static address for the DMA channel I want to use? This is because I am grasping  something about the FDC drivers faster than this mem, paging etc. etc. ;) :red ;)

Thomas Antony ;)
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

Tedd

No, you don't need a MM for dma :lol
The only reason for MM is so different parts of the os or programs don't try to use the same parts of memory; otherwise you can see what will happen ;)
Move onto the FDC!! You can forget all the MM for now, as long as you remember what memory your driver is using and don't go trying to use that for something else as well. DMA for floppy can only use memory below 1Meg tho :bdg
Once your os starts getting new things tho, you'll eventually need a MM, but that's a bit later :dance:
No snowflake in an avalanche feels responsible.

The Dude of Dudes

Hi Thomas.

The Intel manuals explain paging very well. Also have all the info on the hardware support for it.