Professional Documents
Culture Documents
System Software
System Software
Nizamettin AYDIN
naydin@yildiz.edu.tr
http://www.yildiz.edu.tr/~naydin
• Convenience
• The biggest and fastest computer in the world —An operating system makes a computer easier
is of no use if it cannot efficiently provide to use
beneficial services to its users. • Efficiency
• Users see the computer through their —An operating system allows better use of
application programs. These programs are computer resources
ultimately executed by computer hardware.
• System software-- in the form of operating
systems and middleware-- is the glue that
holds everything together.
3 4
5 6
1
O/S as a Resource Manager Main Resources managed by the O/S
• A computer is a set of resources for the
movement, storage, and processing of
data and for the control of these functions
• The O/S is responsible for managing these
resources
• O/S is a program executed by the
processor
• The O/S frequently relinquishes control
and must depend on the processor to
allow it to regain control
7 8
9 10
11 12
2
Multi-programmed Batch Systems Multi-programmed Batch Systems
13 14
15 16
3
Effects of Multiprogramming on Resource
Utilization histograms Utilization
19 20
• The evolution of operating systems has paralleled • In the 1960s, hardware has become powerful
the evolution of computer hardware. enough to accommodate multiprogramming,
—As hardware became more powerful, operating —the concurrent execution of more than one task.
systems allowed people to more easily manage
the power of the machine. • Multiprogramming is achieved by allocating each
• In the days when main memory was measured in process a given portion of CPU time (a timeslice).
kilobytes, and tape drives were the only form of • Interactive multiprogramming systems were
magnetic storage, operating systems were simple called timesharing systems.
resident monitor programs. —When a process is taken from the CPU and
—The resident monitor could only load, execute, replaced by another, we say that a context
and terminate programs. switch has occurred.
21 22
• Today, multiprocessor systems have become • Loosely coupled multiprocessor systems have
commonplace. physically separate memory.
—They present an array of challenges to the —These are often called distributed systems.
operating system designer,
– including the manner in which the processors will be
—Another type of distributed system is a
synchronized, networked system, which consists of a
– and how to keep their activities from interfering with collection of interconnected, collaborating
each other. workstations.
• Tightly coupled multiprocessor systems share a
• Real time operating systems control computers that
common memory and the same set of I/O devices.
respond to their environment.
—Symmetric multiprocessor systems are tightly
coupled and load balanced. —Hard real time systems have tight timing
constraints, soft real time systems do not.
23 24
4
Operating Systems Operating Systems
• Personal computer operating systems are designed • Operating systems having graphical user interfaces
for ease of use rather than high performance. were first brought to market in the 1980s.
• The idea that revolutionized small computer • At one time, these systems were considered
operating systems was the BIOS appropriate only for desktop publishing and games.
—(basic input-output operating system) chip that permitted a • Today they are seen as technology enablers for
single operating system to function on different types of users with little formal computer education.
small systems. • Once solely a server operating system, Linux holds
—The BIOS takes care of the details involved in the promise of bringing Unix to ordinary desktop
addressing divergent peripheral device designs systems.
and protocols.
25 26
• Two operating system components are crucial: • Microkernel systems provide better security,
— The kernel
easier maintenance, and portability at the expense
— and the system programs.
of execution speed.
• As the core of the operating system, the kernel performs
– scheduling, —Examples are Windows 2000, Mach, and
– synchronization, QNX.
– memory management, —Symmetric multiprocessor computers are
– interrupt handling ideal platforms for microkernel operating
– and it provides security and protection. systems.
• Microkernel systems provide minimal functionality, with most
services carried out by external programs. • Monolithic systems give faster execution speed,
• Monolithic systems provide most of their services within a but are difficult to port from one architecture to
single operating system program.
another.
—Examples are Linux, MacOS, and DOS.
27 28
• Process management lies at the heart of operating • The operating system schedules process execution.
system services. • First, the operating system determines which process
—The operating system creates processes, shall be granted access to the CPU.
schedules their access to resources, deletes —This is long-term scheduling.
processes, and deallocates resources that were • After a number of processes have been admitted, the
allocated during process execution. operating system determines which one will have
• The operating system monitors the activities of each access to the CPU at any particular moment.
process to avoid synchronization problems that can —This is short-term scheduling.
occur when processes use shared resources. • Context switches occur when a process is taken from
the CPU and replaced by another process.
• If processes need to communicate with one another, —Information relating to the state of the process
the operating system provides the services. is preserved during a context switch.
29 30
5
Scheduling Long Term Scheduling
31 32
• Identifier
• State
• Priority
• Program counter
• Memory pointers
• Context data
• I/O status
• Accounting
information
35 36
6
Scheduling Example Key Elements of O/S for Multiprogramming
37 38
39 40
• Programming tools carry out the mechanics of software • The output of most assemblers is a stream of
creation within the confines of the operating system relocatable binary code.
and hardware environment. —In relocatable code, operand addresses are
• Assemblers are the simplest of all programming tools. relative to where the operating system
chooses to load the program.
They translate mnemonic instructions to machine code.
—Absolute (nonrelocatable) code is most
• Most assemblers carry out this translation in two suitable for device and operating system
passes over the source code. control programming.
—The first pass partially assembles the code and
builds the symbol table • When relocatable code is loaded for execution,
—The second pass completes the instructions by special registers provide the base addressing.
supplying values stored in the symbol table. • Addresses specified within the program are
interpreted as offsets from the base address.
41 42
7
Programming Tools Programming Tools
• The process of assigning physical addresses to • On most systems, binary instructions must pass
program variables is called binding. through a link editor (or linker) to create an
• Binding can occur at compile time, load time, or run executable module.
time. • Link editors incorporate various binary routines into
• Compile time binding gives us absolute code. a single executable file as called for by a program’s
• Load time binding assigns physical addresses as external symbols.
the program is loaded into memory. • Like assemblers, link editors perform two passes:
—With load time, binding the program cannot be The first pass creates a symbol table and the
moved! second resolves references to the values in the
• Run time binding requires a base register to carry symbol table.
out the address mapping.
47 48
8
Programming Tools Programming Tools
• Compilers bridge the semantic gap between the • The last three compiler phases are synthesis
higher level language and the machine’s binary phases:
instructions. 4. Intermediate code generation creates three
address code to facilitate optimization and
• Most compilers effect this translation in a six-phase translation.
process. The first three are analysis phases: 5. Optimization creates assembly code while taking
1. Lexical analysis extracts tokens, e.g., reserved into account architectural features that can make
words and variables. the code efficient.
2. Syntax analysis (parsing) checks statement 6. Code generation creates binary code from the
construction. optimized assembly code.
3. Semantic analysis checks data types and the • Through this modularity, compilers can be written
validity of operators. for various platforms by rewriting only the last two
phases.
49 50
51 52
• The Java programming language exemplifies many of • The JVM is an operating system in miniature.
the concepts that we have discussed in this chapter. —It loads programs, links them, starts execution
threads, manages program resources, and
• Java programs (classes) execute within a virtual deallocates resources when the programs
machine, the Java Virtual Machine (JVM). terminate.
• This allows the language to run on any platform for
which a virtual machine environment has been written.
• Java is both a compiled and an interpreted language.
The output of the compilation process is an assembly-
like intermediate code (bytecode) that is interpreted by
the JVM. • Because the JVM performs so many tasks at run
time, its performance cannot match the performance
of a traditional compiled language.
53 54
9
Database Software Database Software
59 60
10
Transaction Managers Transaction Managers
61 62
Conclusion Conclusion
• The proper functioning and performance of a • Programming languages are often classed into
computer system depends as much on its generations, with assembly language being the
software as its hardware. first generation.
• The operating system is the system software • All languages above the machine level must be
component upon which all other software rests. translated into machine code.
• Operating systems control process execution, • Compilers bridge this semantic gap through a
resource management, protection, and security. series of six steps.
• Subsystems and partitions provide compatibility • Link editors resolve system calls and external
and ease of management. routines, creating a unified executable module.
63 64
Conclusion
65
66
11
Memory Management Swapping
67 68
71 72
12
Variable Sized Partitions (1) Variable Sized Partitions (2)
73 74
75 76
13
Logical and Physical Addresses - Paging Virtual Memory
• Demand paging
—Do not require all pages of a process in
memory
—Bring in pages as required
• Page fault
—Required page is not in memory
—Operating System must swap in required page
—May need to swap out a page to make space
—Select page to throw out based on recent
history
79 80
Thrashing Bonus
• Too many processes in too little memory • We do not need all of a process in
• Operating System spends all its time memory for it to run
swapping • We can swap in pages as required
• Little or no real work is done • So - we can now run processes that are
• Disk light is on all the time bigger than total memory available!
81 82
83 84
14
Pentium II Pentium II Address Translation Mechanism
• Hardware for segmentation and paging
• Unsegmented unpaged
— virtual address = physical address
— Low complexity
— High performance
• Unsegmented paged
— Memory viewed as paged linear address space
— Protection and management via paging
— Berkeley UNIX
• Segmented unpaged
— Collection of local address spaces
— Protection to single byte level
— Translation table needed is on chip when segment is in
memory
• Segmented paged
— Segmentation used to define logical memory partitions subject
to access control
— Paging manages allocation of memory within partitions
— Unix System V
85 86
89 90
15
PowerPC 32-bit Memory Management Formats PowerPC 32-bit Address Translation
91 92
16