You are on page 1of 1

Chapter 13 | UNIX Operating Systems

packages to become obsolete with every change in hardware. This goal was finally
achieved when device independent became a standard feature of UNIX.

Numerous versions of UNIX conform to the specifications for Portable Operating


System Interface for Computer Environments (POSIX)—a registered trademark of the
IEEE. POSIX is a family of IEEE standards that define a portable operating system inter-
face that enhances the portability of programs from one operating system to another.
All rights reserved. May not be reproduced in any form without permission from the publisher, except fair uses permitted under U.S. or applicable copyright law.

Memory Management
For multiprogramming systems, most UNIX operating systems use either swapping or
demand paging (or both) memory management techniques. The best choice depends
on the kind of applications that are running on the system: If most jobs are small, then
swapping could be the best choice; but if the system will be running many large jobs,
then demand paging is best.

Swapping requires that the entire program be in main memory before it can be executed,
and this imposes a size restriction on programs. For example, if the system has 2 GB
of memory and the operating system takes up a fourth of it (0.5 GB), then the size of
other resident programs must be less than the remaining 1.5 GB. Swapping uses a round
robin policy—when a job’s time slice is up, or when it generates an I/O interrupt, the
entire job is swapped out to secondary storage to make room for other jobs waiting in
the READY queue. This is fine when there are relatively few processes in the system, but
when traffic is heavy, this swapping back and forth can slow down the system.

Demand paging requires more complicated hardware configurations; it increases the


system overhead and, under heavy loads, might lead to thrashing. But it has the advan-
tage of implementing the concept of virtual memory.

Figure 13.3 shows the typical internal memory layout for a single user-memory part
image. An image is an abstract concept that can be defined as a computer execution
environment composed of a user-memory part (depicted in Figure 13.3), general register
values, the status of open files, and the current directory. This image must remain in
memory during the execution of a process.

The segment called program code is the sharable portion of the program. Because this
code can be physically shared by several processes, it must be written in reentrant code.
This means that the code is protected so that its instructions aren’t modified in any way
Copyright 2018. Cengage Learning.

during its normal execution. In addition, all data references are made without the use
of absolute physical addresses.

The Memory Manager gives the program code special treatment. Because several pro-
cesses share it, the space allocated to the program code can’t be released until all of the
processes using it have completed their execution. UNIX uses a text table to keep track
Copyright
EBSCO Publishing 2018 Cengage
: eBook Collection Learning.-All
(EBSCOhost) Rightson
printed Reserved. May
3/25/2024 notAM
3:56 bevia
copied, scanned,INSTITUTE
INDEPENDENT or duplicated, in whole
OF EDUCATION or in part. WCN 02-300
416AN: 2281858 ; Ann McHoes, Ida
Account: s6311349.main.ehost
M. Flynn.; Understanding Operating Systems

You might also like