Home arrow Forums
OSDEV Forums  


anonymous
Visitor

Fresh Osdever
Posts: 0
graphgraph
Karma: 0  
Help me!! - 2005/04/19 10:23 Hi!! All

I have gone through several books and articles but am confused regarding the allocation of virtual address space for a process in an OS like WinNT. My doubt is like it says since 32 bit CPU so 32 bit OS so each process can have V.D.space upto 4GB(Upper 2 kernel lower 2 gb process private). So is this 4GB allocated separately for each process?So how does the V.address allocated beyond first 4GB(since V. memory can be 64 T.byte) is accessed by processor’s 32bit logical address(traslated by MMU to physical address?Means if I suppose 10 procceses running in system at present so around 4*10 GB of V.Mem(hard disk) would have been consumed????? Confused please help me I shall be highly oblised for your kind act.

Plz mail me at at the same as well as at below also

Apoorv_raghuvanshi@rediffmail.com

Bye and take care!!!!!

  | | The administrator has disabled public write access.
OSDEV
Community
Advertisement
   
root
Moderator

Moderator
Posts: 121
graphgraph
Karma: 1  
Re: Help me!! - 2005/04/19 21:39 Will answer you soon but on the board, not by email and one post should be enough. I won't edit your post but, making it too public will hurt (spam bots).
  | | The administrator has disabled public write access.
DRF
User

Platinum Osdever
Posts: 123
graphgraph
Karma: 1  
Re: Help me!! - 2005/04/20 11:15 I think 4gb is just the flat mode limit. Not the segmented mode limit. (Might be wrong).

One random (off the top of my head bad analogy) is imagine 'main memory' as a a port and the virtual memory as a fleet of ships.
So we run out of space on the port front to store anymore stuff. So any data that isn't being used is put onto a ship. When that ship is full (or change in programs) that ship sails down river a bit and an empty ship moves up. Then when we need data from the first ship again we move that one back to the port instead.

So what I am trying to say is that there is a different limit to the amount you can access at any 1 time to the amount you can access in total.

I apologise if this is a bit random (and probably a quite bad and analogy which I'm sure gaf and ciprian will say is all wrong lol).

Daniel
  | | The administrator has disabled public write access.
gaf
User

Platinum Osdever
Posts: 153
graph
Karma: 10  
Re: Help me!! - 2005/04/21 11:00 Hi Apoorv,
could it be that you're mixing up 'virtual memory' (as opposed to physical memory) and 'virtual disk-space' ?

Virtual memory is a technique that maps physical memory to a programm's address-space. Whenever the programm access a (virtual) address, the hardware looks up to which physical memory word this address corresponds.
The virtual address spaces are 4GB in size and there's no 'global limit' for virtual memory. Whenever the processor switches to new task, the virtual address-space is simply exchanged.

Virtual disk space is an other technique that can be used when need more memory (e.g if you start a new app) but your whole physical memory is currently in use.

a) swapping
The os simply chooses a process, evictes it from memory and copies its image to the hard-disk (clearing enought memory to load the new task). Of course you shouldn't forget to re-activate the process on the hard-disk

b) paginig
In this case only a portion of a programm is moved to the hard-disk. This is possible because most programms don't access their address-space at random but stick to a certain range (->locality). The advantage is that no task is (temporarly) suspended from execution.


One random (off the top of my head bad analogy) is imagine 'main memory' as a a port and the virtual memory as a fleet of ships.
So we run out of space on the port front to store anymore stuff. So any data that isn't being used is put onto a ship. When that ship is full (or change in programs) that ship sails down river a bit and an empty ship moves up. Then when we need data from the first ship again we move that one back to the port instead.


*sigh*, how romantic

regards,
gaf
  | | The administrator has disabled public write access.
DRF
User

Platinum Osdever
Posts: 123
graphgraph
Karma: 1  
Re: Help me!! - 2005/04/22 16:49 I wish the local female population agreed with you there gaf. Well I do a bit of sailing so I picked the first thing that came to mind. lol

Daniel
  | | The administrator has disabled public write access.

A WebArticles site. Sponsored by Evoleto. Motorola V525 / Business Directory / Delaware Incorporation / Home Made Bazaar