13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

60 Space Management Chapter 38 bits. We use K for kilo to mean 2 10 = 1024, M for mega to mean 2 20 = 1,048,576, andG for giga to mean 2 30 = 1,073,741,824.) The Cray-2 computer has 2G bytes of mainstore. Addresses can be described as binary numbers but are often represented by eitherbase-8 (octal), base-10 (decimal), or base-16 (hexadecimal) numbers for convenience.Certain locations in physical store may be reserved by the hardware for specialpurposes. For example, the DEC PDP-11 reserves the first 1K bytes for tables that directthe hardware when a device interrupts. The kernel often resides in ‘‘low core,’’ whichmeans physical store at low addresses. (‘‘Core’’ is an old word for main store thatderives from magnetic-core technology.) The rest of physical store may be partitionedinto pieces for the processes in the ready list.Each process has its own virtual store, which is the memory perceived by the process.We will often refer to all the virtual store of a process as its virtual space. As faras the process is concerned, there is no physical store. All address references refer to virtualspace. In the simplest case, virtual store looks like a contiguous chunk, starting atvirtual address zero and continuing to some maximum address. The largest virtual storepossible is usually limited by the architecture of the machine, in particular, by the numberof bits that make up an address. If there are n bits in an address, the largest address is2 n . For example, the DEC PDP-10 has 18 bits of address, so the largest address is 256K.The DEC PDP-11 has only 16 bits of address; the largest address is thus only 64K.Therefore, the virtual space on the PDP-11 has one-fourth the addresses of the PDP-10.<strong>An</strong> address on the PDP-11 refers to an 8-bit byte, whereas an address on the PDP-10refers to a 36-bit word; therefore, the PDP-11 actually allows only one eighteenth aslarge a virtual space as the PDP-10.Although the virtual space is limited by the number of bits in an address, it is usuallynot limited by the amount of physical store on the machine. Virtual-space size andphysical-space size are independent.Virtual space can be larger than physical space, especially if paging is used. Wewill discuss paging later in this chapter.Some machines can have far more physical store than can be addressed. Somemodels of DEC PDP-11, for example, can take 1,044,480 bytes of main store, butindividual virtual spaces are still limited to 65,536 bytes.Ordinarily a process may access any portion of its virtual store. When the processstarts, instructions will fill part of virtual store. Besides the instructions area, the processmay keep a data area and a stack area. (Stacks are used for implementing procedurecalls; their details need not concern us here.) In more complicated cases, the operatingsystem may divide virtual store into regions called segments, each of which has its ownset of addresses called offsets, starting with zero and reaching some maximum for eachsegment. When a process wishes to access a location in main store, it must name boththe segment and the offset within the segment.1.4 Address translation

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!