Free Newsletter! • Suggestions! • Win! • About HSW • Contact Us • Home
 Daily Stuff • Top 40 • What's New • HSW Store • Advertise!
    
  
Supercategories!
 Computers & Internet
 Engines & Automotive
 Electronics & Telecom
 Science & Technology
 Aviation & Transportation
 In the News
 Body & Health
 Living & Entertainment
 Around the House
 Machines
 Cool!

Get Stuff!

Teachers!
How Operating Systems Work
››Tell a friend about this article!

  
  › Introduction to How Operating Systems Work
› The Bare Bones
› Wake-Up Call
› Processor Management
› Memory and Storage Management
› Device Management
› Interfacing to the World
› Once and Future Differences
› Lots More Information!

Memory and Storage Management
When an operating system manages the computer's memory, there are two broad tasks to be accomplished. First, each process must have enough memory in which to execute, and it can neither run into the memory space of another process, nor be run into by another process. Next, the different types of memory in the system must be used properly, so that each process can run most effectively. The first task requires the operating system to set up memory boundaries for types of software, and for individual applications.

As an example, let's look at an imaginary system with 1 megabyte of RAM. During the boot process, the operating system of our imaginary computer is designed to go to the top of available memory and then "back up" far enough to meet the needs of the operating system itself. Let's say that the operating system needs 300 kilobytes to run. Now, the operating system goes to the bottom of the pool of RAM, and starts building up with the various driver software required to control the hardware subsystems of the computer. In our imaginary computer, the drivers take up 200 kilobytes. Now, after getting the operating system completely loaded, there are 500 kilobytes remaining for application processes.

When applications begin to be loaded into memory, they are loaded in block sizes determined by the operating system. If the block size is 2 kilobytes, then every process that is loaded will be given a chunk of memory that is a multiple of 2 kilobytes in size. Applications will be loaded in these fixed block sizes, with the blocks starting and ending on boundaries established by words of 4 or 8 bytes. These blocks and boundaries help to ensure that applications won't be loaded on top of one another's space by a poorly calculated bit or two. With that ensured, the larger question of what to do when the 500 kilobyte application space is filled.

In most computers it's possible to add memory beyond the original capacity. For example, you might expand RAM from 1 to 2 megabytes. This works fine, but tends to be relatively expensive. It also ignores a fundamental fact of life -- most of the information that an application stores in memory is not being used at any given moment. A processor can only access memory one location at a time, so the vast majority of RAM is unused at any moment. Since disk space is cheap compared to RAM, then moving information in RAM to hard disk intelligently can greatly expand RAM space at no cost. This technique is called Virtual Memory Management.

Disk storage is only one of the memory types that must be managed by the operating system, and is the slowest. Ranked in order of speed, the memory in a computer system is:

  • High-speed cache -- This is fast, relatively small amounts of memory that are available to the CPU through the fastest connections. Cache controllers predict which pieces of data the CPU will need next and pull it from main memory into high-speed cache to speed system performance.
  • Main memory --The RAM that you see measured in megabytes when you buy a computer.
  • Secondary memory --This is most often some sort of rotating magnetic storage that keeps applications and data available to be used, and serves as virtual RAM under the control of the operating system.
The operating system must balance the needs of the various processes with the availability of the different types of memory, moving data in blocks called pages between available memory as the schedule of processes dictates.

 
<< Prev Page    Intro    Next Page >>

Table of Contents:
› Introduction to How Operating Systems Work
› The Bare Bones
› Wake-Up Call
› Processor Management
› Memory and Storage Management
› Device Management
› Interfacing to the World
› Once and Future Differences
› Lots More Information!

 
Rate this Article!
 


Join HSW!  ||   Newsletter  ||   Suggestions  ||   Link to HSW  ||   Hiring
Win!  ||   Store  ||   About Us  ||   Contact Us  ||   Privacy  ||   Home
Frequently Asked Questions  ||   Advertising

Copyright © 1998-2001 Howstuffworks, Inc. All rights reserved
Sponsored By:
Daily Stuff
Question of the Day
Gadget of the Day
Survey of the Day
Article of the Day
Top 40 of the day!

Other Articles

• How USB Ports Work
• How Computer Mice Work
• How Universal Translators Will Work
• How Hard Disks Work
• How Microprocessors Work

Other Questions

• What is the difference between static RAM and dynamic RAM in my c...
• What does open source mean?
• How can I burn MP3s from my computer onto CD-Rs?
• Why are there so many different image formats on the Web?
• What causes the faint horizontal lines on my monitor?

Related Books
• HowStuffWorks: The Reference Book
• How Much Does the Earth Weigh
• For more books, click here!