Operating System Software
Lecture 7 Lecture 7
The operating system The operating system
Defines our computing experience.
First software we see when we turn on the computer, and the last software we see when the computer is turned off.
Enables all the programs we use.
Not all computers have operating systems. The computer that controls the microwave oven in your kitchen doesn't need an operating system.
The computer in a microwave oven simply runs a single program all the time.
All desktop computers have operating All desktop computers have operating systems
systems
•Windows family of operating systems
•UNIX family of operating systems
•Macintosh operating systems.
There are hundreds of other operating systems available for special-purpose applications, including specializations for mainframes, robotics, manufacturing, real-time control systems and so on.
At the simplest level, At the simplest level,
an operating system does two things:
an operating system does two things:
• It manages the hardware and software resources of the computer system. These resources include such things as the processor, memory, disk space, etc.
• Ιt provides a stable, consistent way for applications to deal with the hardware without having to know all the details of the hardware
The basic unit of software The basic unit of software
that the operating system deals with is either a process or a thread, depending on the operating system.
A process is not always an application. The application you see (word processor or spreadsheet or game) is a process, but that application may cause several other processes to begin, for tasks like communications with other devices or other computers. There are also numerous processes that run without giving you direct evidence that they ever exist.
A process is software that performs some action and can be controlled -- by a user, by other applications or by the operating system.
It is processes, rather than applications, that the operating system controls and schedules for execution by the CPU
The OS - The Traffic Cop
• Keeps the system running smoothly
• Helps to coordinate the working parts
• Is essential
• Is different for
different platforms
The OS - The Traffic Cop
• Memory resident -
• Nonresident -
kernel
kernel or or supervisor supervisor stays on disk stays on disk
Functions of an OS
• Managing Programs
• Managing Memory
• Handling Input and Output ( I/O )
• Establish a User Interface
Figure 7.1
Managing Programs
• Single-task -
• Multitasking -
–
foreground application -
–background application -
• Multithreading -
• Multiprocessing -
run one program at a time run one program at a time more than one at a time more than one at a time
the one you are using is not active now do more than one thing in a do more than one thing in a single program, ex. print & load single program, ex. print & load more than one CPU running more than one CPU running at the same time
at the same time
Multi-Tasking Multi-Tasking
•
The CPU can only do one thing at a time.•
The operating system has to switch between different processes thousands of times a second.•
A process occupies a certain amount of RAM. It also makes use of registers, stacks and queues within the CPU and operating-system memory space.•
The operating system allots a certain number of CPU execution cycles to one program.•
After that number of cycles, the operating system makes copies of all the registers, stacks and queues used by the processes, and notes the point at which the process paused in its execution.•
This is loaded into a Process Control Block.•
It then loads all the registers, stacks and queues used by the second process and allows it a certain number of CPU cycles.CPU CPU
CPU CPU
PCB Process
PCBProcess PCB
Process
Multi Multi - - Tasking Tasking
Process PCB
PCB Process
RAM RAM
Process PCB
Process PCBPCB Process
PCB
Process
Processes and threads Mac
Figure 7.3
Processes and
threads PC Managing Memory
• Partition -
• Virtual Memory - – swap file -
each program runs in its own each program runs in its own part of RAM
part of RAM
use part of disk as an use part of disk as an extension of RAM extension of RAM switch information between switch information between disk and RAM disk and RAM
Managing Memory
• Virtual Memory - – swap file -
use part of disk as an use part of disk as an extension of RAM extension of RAM switch information between switch information between
disk and RAM disk and RAM
page swappe d
out swapfile
virtual me mory manage me nt
most re ce nt data or instructions page swappe d
in
le ast re ce nt data or instructions harddisk
me mory
Virtual memory
Figure 7.4
Managing Memory
• 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.
• The different types of memory in the system must be used properly so that each process can run most effectively.
Memory Boundaries
Cache Main memory Secondary memory
Handling I/O
• Keeps the OS aware of what is happening
• Prioritizes I/O activity
• Communicates with the I/O devices via
small programs called device drivers
Handling I/O
• The path between the operating system and all hardware not on the computer's motherboard goes through a special program called a driver.
• Much of a driver's function is to be the translator between the electrical signals of the hardware subsystems and the high-level programming languages of the operating system and application programs.
• Drivers take data that the operating system has defined as a file and translate them into streams of bits placed in specific locations on storage devices, or a series of laser pulses in a printer.
User Interface
• Command-Line -
–ex. UNIX, DOS
• Menu-Driven -
–ex. earlier programs
• Graphical (GUI) -
–ex. Mac, Windows
syntax is important has keywords, lots of typing text based, pick from a list use arrow keys and tap Enter icons, mouse
point and click
User Interface
• Command-Line -
–ex. UNIX, DOS
syntax is important has keywords, lots of typing
The Command Line
User Interface
• Menu-Driven -
–ex. earlier programs
• Graphical (GUI) -
–ex. Mac, Windows
text based, pick from a list use arrow keys and tap Enter icons, mouse
point and click
Popular Operating Systems
• UNIX - client/server computing many different flavors
• DOS - one of first for the IBM PC crashes often
uses only 640K of RAM at a time
• Mac OS - the first popular GUI
• Windows - GUI for the IBM PC
• Windows CE - light version for palm tops, recognizes handwriting and speech
Popular Operating Systems
• Windows NT - true 32-bit OS
designed for client/server
–security
–
remote administration
–directory services
–web server
• Linux - a flavor of UNIX open source code
free!
Linux sites:linuxtoday.com linuxnewbie.org*Idea* to have Basic written into the ROM chip
•Microsoft had never written an operating system before. Gates suggested that IBM investigate an OS called CP/M (Control Program for Microcomputers), written by Gary Kildall of Digital Research.
•IBM tried to contact Kildall for a meeting...
•The "Microsoft Disk Operating System" or MS-DOS was based on QDOS, the "Quick and Dirty Operating System" written by Tim Paterson of Seattle Computer Products.
•QDOS was based on Gary Kildall's CP/M, Paterson had bought a CP/M manual... QDOS was different enough from CP/M to be considered legal.
•Microsoft bought the rights to QDOS for $50,000, keeping the IBM deal a secret from Seattle Computer Products.
•Gates then talked IBM into letting Microsoft retain the rights, to market MS DOS separate from the IBM PC project…
•In 1981, Tim Paterson quit Seattle Computer Products and found employment at Microsoft.
MSDOS,
MSDOS, IBM, MicrosoftIBM, Microsoft