Solved

Theory Question about MM

Posted on 2006-11-22
15
664 Views
Last Modified: 2010-04-20
what it mean by - different memory management scheme in different OS?
0
Comment
Question by:heyhey84
  • 5
  • 5
  • 5
15 Comments
 
LVL 6

Expert Comment

by:xRalf
ID: 18001346
Hi heyhey84,
here is quite good explanation of memory managment http://webfuse.cqu.edu.au/Courses/aut2001/85349/Resources/Lectures/8/
0
 

Author Comment

by:heyhey84
ID: 18001410
So the 2 scheme is Paging and segmentation? Does it say what is the rational or motive for those operating system using these scheme?
0
 
LVL 39

Expert Comment

by:noci
ID: 18001504
nope, different issues....

swapping/paging provide virtual memory by making place in real memory
through offloading contents to disk. (program as a whole or part).
The CPU needs to support this through lookup tables some how and signal if a bit
there tells the CPU to fetch a block of data from somewhere else)
CPU's like 8080, z80, 8086 don't have this support
CPU's like VAX, ALPHA, 80386, 80486, pentium* etc do have this support
(Also called demand paging). The main difference:
swapping moves whole programs, whereas paging only moves needed parts.

segmentation is a way to enlarge address space  without needing a whole new system
like 8080,Z80 are 8bit with 16bit addresses, the 8086 was a 16bit system with 20 bit addresses. At the time 1MB of memory was huge, indeed systems mostly had 16KB tops.
and to save money only 16 bit register are used,with a simple translater to enlarge this to 20 bits (shift left by 4 and add an offset).

If segmentation goes through a lookuptable like on the 80286 then you can again do
virtualisation. But the overhead in an OS is too big to handle variably sized chunks of memory, any time spent there managing is a waste. ==> pages are more or less comparable to fixed size segments. The main difference is that segments are visible to a program where pages are not.

try to read and understand the preiously given link.
All the slides too, not just the index
Also try to lookup on specs of CPU's they tell you the detailed story about what hardware can do.

Start looking from wikipedia "Computer Architecture"and go from there.
0
 
LVL 6

Expert Comment

by:xRalf
ID: 18001531
I would add that most of those slides are commented with audio.
0
 

Author Comment

by:heyhey84
ID: 18001536
I am reading the slides now and trying to understand it.
From what u had posted,
Those it mean that segmentation of less efficiency than paging? If so why are there OS still using it?
0
 
LVL 39

Expert Comment

by:noci
ID: 18001618
Ehm, because hardware needs it? it's an architecture thing decided upon by the CPU designer[-team]. Maybe try to get a hold on the book 'the soul of a new machine'
of tracy kidder, might give some insight how cpu design works...
http://www.amazon.com/Soul-New-Machine-Tracy-Kidder/dp/0316491977


You can't just pull a 80286 from a motherboard and putback a pentium pro etc.

Also when some systems come into existance they might become popular/important
widely used(think embedded), you can't call back all say less then 7 year old cars in the world to change their motor-management system processors.
0
 
LVL 6

Expert Comment

by:xRalf
ID: 18001728
Segmentation has also some advantages: No internal fragmentation, LAS (logical address space) is not divided implicitly into segments (it is the task of compiler).

The aim is to join the advantages of both mechanisms. Segmentation is used for various protections and sharing. The disadvante of placing the whole segments of various sizes into memory is eliminated with paging of individual segments. (e.g. Intel Pentium uses the combination of segmentation and paging.)
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:heyhey84
ID: 18001799
Hi xRalf

where can i find more information on what u have post?
0
 
LVL 6

Expert Comment

by:xRalf
ID: 18001811
0
 
LVL 39

Expert Comment

by:noci
ID: 18001929
Please also look into alpha, vax , itanium, sparc, ppc etc. architectures there the protection is page bound btw also in a pentium. In most x86 based designs paging is used solely. (OS/2 and old windows are the only exceptions I think i know of).
The problem being you have to do pagemanagement anyway so segmentation management needs to be done on top of that. Pagemanagment it's relative cheap because of the fixed size chunks it uses.
With variable sized chunks (segments) you need lookup lists and decide on first-fit/best-fit etc.
during "segment/page not-present" interrupt handling.
0
 

Author Comment

by:heyhey84
ID: 18007125
i am confuse about page in MM.

Let me say how i interpret it and can someone tell me am i wrong?

A page is like a piece of paper with a with tables in it.

So when a memory is needed, it look into the page and fetch the data from the main memory. (1 Level)

I read that 2 level or multi level is much faster. Somehow i dont understand why is it faster as it need more time to look for more pages.

I am quite confuse and somehow cannot visualize MM of a operating system. If somone can explained in real life concept, i would really appreciates it.
0
 

Author Comment

by:heyhey84
ID: 18007214
And what is meant by memory protection?
0
 
LVL 39

Expert Comment

by:noci
ID: 18007264
Seperation between user/kernel mode (or user,supervisor,executive & kernel mode for vax, alpha, itanium).
Separation between processes.

That means one process can't corrupt another process and can't corrupt/compromise the system (kernel)

But please read the pointed to materials & followup on leads there.
0
 
LVL 6

Accepted Solution

by:
xRalf earned 20 total points
ID: 18011101
>> A page is like a piece of paper with tables in it.

A page is like a piece of paper with data and instructions (ones and zeros). Every page is placed in physical memory in certain frame.

>> So when a memory is needed, it look into the page and fetch the data from the main memory. (1 Level)

When a memory is needed, OS looks into the page table (PT). This table has two columns (number of page, number of frame) and determines in which frame a certain page is placed. To get the particilar address OS has to add to the "number of frame" the offset (displacement) value.
Page table is usually placed in RAM (for quick manipulation).

>> Somehow i dont understand why is it faster as it need more time to look for more pages.

Yes. OS has to first go into the page table and this is slowdown. But the gain is elimination of external fragmentation.
Bigger problem is to solve external fragmentation. So we have to choose "the less evil".

>> I am quite confuse and somehow cannot visualize MM of a operating system.

look at this picture http://webfuse.cqu.edu.au/Courses/aut2001/85349/Resources/Lectures/8/17/
0
 
LVL 39

Expert Comment

by:noci
ID: 18012567


>>> So when a memory is needed, it look into the page and fetch the data from the main memory. (1 Level)

>When a memory is needed, OS looks into the page table (PT). This table has two columns (number of page, number >of frame) and determines in which frame a certain page is placed. To get the particilar address OS has to add to >the "number of frame" the offset (displacement) value.
>Page table is usually placed in RAM (for quick manipulation).

The CPU checks the a translation buffer (TLB) if there is nothing in that buffer the CPU consults the Pagetable.
In the page table there is a bit that sais Pageis valid (if not set => pagefault and the OS assists in filling that buffer, if page not valid the OS may use the other fields in the PTE (page table entry) for locating the
page in a different place.
For VMS there is a very good book "OpenVMS internals and datastructures", Ruth Goldenberg, everything is explained, including the code needed to manage stuff.

In stead of directly using a memory address, you have the overhead of looking it up in the TLB, then possibly in the PT and if not present it causes severalhundreds of thousands of instructions to be executed for load ding the page from disk. (Of course those instruction need to be in an area that is non-pagable).

You confuse caching of memory with memory management. Caching uses level1/level caching of parts of physical memory.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now