Sponsored Content
Operating Systems Linux How does the Operating System handle memory? Post 302894604 by Corona688 on Wednesday 26th of March 2014 11:30:58 AM
Old 03-26-2014
Mostly the kernel doesn't care what's in memory contents, as much as who they belong to. It just handles memory as undifferentiated pages, each having its own set of rwx permissions (handled in hardware). Mostly. Virtual memory allows it to set up triggers so special things can happen when a page is accessed, too.

Jeff Barryman wrote a whimsical explanation in 1972 which I've found somewhat helpful:
  1. Each player gets several million things.
  2. Things are kept in crates that hold 4096 things each. Things in the same crate are called crate-mates.
  3. Crates are stored either in the workshop or the warehouses. The workshop is almost always too small to hold all the crates.
  4. There is only one workshop but there may be several warehouses. Everybody shares them.
  5. Each thing has its own thing number.
  6. What you do with a thing is to zark it. Everybody takes turns zarking.
  7. You can only zark your things, not anybody else’s.
  8. Things can only be zarked when they are in the workshop.
  9. Only the Thing King knows whether a thing is in the workshop or in a warehouse.
  10. The longer a thing goes without being zarked, the grubbier it is said to become.
  11. The way you get things is to ask the Thing King. He only gives out things by the crateful. This is to keep the royal overhead down.
  12. The way you zark a thing is to give its thing number. If you give the number of a thing that happens to be in a workshop it gets zarked right away. If it is in a warehouse, the Thing King packs the crate containing your thing back into the workshop. If there is no room in the workshop, he first finds the grubbiest crate in the workshop, whether it be yours or somebody else’s, and packs it off with all its crate-mates to a warehouse. In its place he puts the crate containing your thing. Your thing then gets zarked and you never know that it wasn’t in the workshop all along.
  13. Each player’s stock of things have the same numbers as everybody else’s. The Thing King always knows who owns what thing and whose turn it is, so you can’t ever accidentally zark somebody else’s thing even if it has the same thing number as one of yours.

Notes
  1. Traditionally, the Thing King sits at a large, segmented table and is attended to by pages (the so-called “table pages”) whose job it is to help the king remember where all the things are and who they belong to.
  2. One consequence of Rule 13 is that everybody’s thing numbers will be similar from game to game, regardless of the number of players.
  3. The Thing King has a few things of his own, some of which move back and forth between workshop and warehouse just like anybody else’s, but some of which are just too heavy to move out of the workshop.
  4. With the given set of rules, oft-zarked things tend to get kept mostly in the workshop while little-zarked things stay mostly in a warehouse. This is efficient stock control.

This sounds like an awful lot of work, and is... But since it happens at the hardware level, mostly without the OS being involved, it's not so bad. The OS sets up big lists of pages and the processor uses them directly. This means things mostly happen by themselves -- smooth sailing until something needs to be paged in for whatever reason, or someone accesses memory they don't have access to. Then the processor stops that process and informs the OS somehow.

Last edited by Corona688; 03-26-2014 at 12:42 PM..
These 4 Users Gave Thanks to Corona688 For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix Operating System

I need the Unix operating system on disc as im new to unix. Im studying unix and x windows next year at Sheffield University and would like to get a head start. Any suggestions would be appreciated (2 Replies)
Discussion started by: jeffersno1
2 Replies

2. Programming

How to handle memory error?

Hi, I need to know what is the right way of handling out of memory conditions. If a program is not able to dynamically allocate memory (new fails), is it right to wait for some amount of time (say 5 sec) and then try again to allocate memory? Or should we kill the process and again restart it?... (1 Reply)
Discussion started by: diganta
1 Replies

3. UNIX for Dummies Questions & Answers

Operating System

Which is much more powerful as an operating system: 1. Windows 2000 2. Windows 98 3. Windows XP 4. Windows ME 5. Unix 6. Linux and why is it much more powerful than the other operating systems that i have mentioned. thanks for your info... (1 Reply)
Discussion started by: alecks1975
1 Replies

4. Homework & Coursework Questions

Operating system LINUX

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a C program that accepts 3 parameters. Each parameter indicates the quantity of product to be produced.... (1 Reply)
Discussion started by: paradise
1 Replies

5. Homework & Coursework Questions

Operating system LINUX

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a C program that accepts 3 parameters. Each parameter indicates the quantity of product to be produced.... (0 Replies)
Discussion started by: paradise
0 Replies

6. UNIX for Advanced & Expert Users

Best Operating System

Hello All, I want to install Linux on my machine, so please tell me one thing which is the best to install- 1.)Red Hat 2.)Cent OS 3.)Red Hat 4.)Ubuntu 5.)Fedora except that if there is any please tell me. (1 Reply)
Discussion started by: parthmittal2007
1 Replies

7. UNIX for Advanced & Expert Users

What's my Operating System

Can we know the operating given the IP address or DNS of the host. All I have is file://myserver/myapp (4 Replies)
Discussion started by: mohtashims
4 Replies

8. Android

Android (operating system)

From Wikipedia (FYI): (0 Replies)
Discussion started by: Neo
0 Replies

9. UNIX and Linux Applications

Pick Operating System

Anyone know anything about "Advanced Plus Operating Environment". Preferably release 10 Revision 522Gcd probably dated 2003. (4 Replies)
Discussion started by: jgt
4 Replies
All times are GMT -4. The time now is 06:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy