Download Operating system overview and more Summaries Operating Systems in PDF only on Docsity!
What is an Operating System? ➢ A program that acts as an intermediary between a user of a computer and the computer hardware. ➢ A software that manages the computer hardware. GOALS:
- Execute user programs and make solving user problems easier
- Make the computer system convenient to use
- Use the computer hardware in an efficient manner Four Components of a Computer System HARDWARE ➢ provides basic computing resources; CPU, memory, I/O devices OPERATING SYSTEM ➢ Controls and coordinates use of hardware among various applications and users APPLICATION PROGRAMS ➢ define the ways in which the system resources are used to solve the computing problems of the users ➢ Word processors, compilers, web
browsers, database systems, video games USERS ➢ People, machines, other computers What Operating Systems Do? ➢ OS are unique in design or makeup
- In MAINFRAME COMPUTERS – OS are designed to optimize utilization of hardware
- In PC (PERSONAL COMPUTERS) – OS support complex games, business applications, and everything in between
- In HANDHELD COMPUTERS – OS are designed to optimize usability and battery life Users of dedicate systems such as workstations have dedicated resources but frequently use shared resources from servers Some computers have little or no user interface, such as embedded computers in devices and automobiles ➢ Depends on the point of view USERS VIEW PC users
- single users want convenience, ease of use and performance
- don’t care about resource utilization (how various hardware and software are shared) Mainframe or minicomputer users
- sharing users are accessing the same computer in other terminals
- share resources and exchange information
- resource utilization is important (available CPU time, memory, and I/O are used
- I/O devices and user programs
- Controls execution of user programs to prevent errors and improper use of the computer
- Concerned with the operation and control of I/O devices Functions of Operating System Computer System Organization ➢ One or more CPUs, device controllers connect through common bus providing access to shared memory ➢ Concurrent execution of CPUs and devices competing for memory cycles ➢ I/O devices and the CPU can execute concurrently ➢ Each device controller is in charge of a particular device type ➢ Each device controller has a local buffer ➢ CPU moves data from/to main memory to/from local buffers ➢ I/O is from the device to local buffer of controller ➢ Device controller informs CPU that it has finished its operation by causing an interrupt Computer Startup BOOTSTRAP PROGRAM
- loaded at power-up or reboot
- typically stored in ROM (Read-Only Memory) or EEPROM (Electrically Erasable Programmable Read- Only Memory), generally known as
firmware (software embedded into hardware
- initializes all aspects of system (CPU registers to device controllers to memory contents)
- loads operating system kernel into memory, starts executing the first process and waits for event to occur (interrupt from hardware or software) Common Functions of Interrupts ➢ Hardware triggers an interrupt by sending a signal to the CPU through the system bus ➢ Software triggers an interruption by executing a special operation called system call (also called monitor call). ➢ When a CPU is interrupted, it stops what it is doing and transfers execution to a fixed location. ➢ Interrupt transfers control to the interrupt service routine generally, through the interrupt vector, which contains the addresses of all the service routines ➢ Interrupt architecture must save the address of the interrupted instruction ➢ Incoming interrupts are
disabled while another
interrupt is being processed
to prevent a lost interrupt
➢ A trap is a software- generated interrupt caused either by an error or a user request ➢ An operating system is interrupt driven Interrupt is a signal emitted by a device or program.
Storage-Device Heirarchy ➢ Storage systems organized in hierarchy
- Speed
- Cost
- Volatility Caching ➢ Copying information into faster storage system; main memory can be viewed as a cache for secondary storage ➢ Important principle, performed at many levels in a computer (in hardware, operating system, software) ➢ Information in use copied from slower to faster storage temporarily ➢ Faster storage (cache) checked first to determine if information is there
- If it is, information used directly from the cache (fast)
- If not, data copied to cache and used there ➢ Cache smaller than storage being cached
- Cache management important design problem
- Cache size and replacement policy Input/Output Structure After I/O starts, control returns to user program only upon I/O completion
- Wait instruction idles the CPU until the next interrupt
- Wait loop (contention for memory access)
- At most one I/O request is outstanding at a time, no simultaneous I/O processing
After I/O starts, control returns to user program without waiting for I/O completion
- System call – request to the operating system to allow user to wait for I/O completion
- Device-status table contains entry for each I/O device indicating its type, address, and state
- Operating system indexes into I/O device table to determine device status and to modify table entry to include interrupt Computer-System Architecture Most systems use a single general-purpose processor (PDAs through mainframes)
- Most systems have special-purpose processors as well Multiprocessors systems growing in use and importance
- Also known as parallel systems, tightly coupled systems
- Advantages include:
- Increased throughput
- Economy of scale
- Increased reliability
- graceful degradation or fault tolerance
- Two types:
- Asymmetric Multiprocessing
- Symmetric Multiprocessing HOW A MODERN COMPUTER WORKS SYSTEM MULTIPROCESSING ARCHITECTURE
- Response time should be < 1 second
- Each user has at least one program executing in memory - > process
- If several jobs ready to run at the same time - > CPU scheduling
- If processes don’t fit in memory, swapping moves them in and out to run
- Virtual memory allows execution of processes not completely in memory Memory Layout for Multiprogrammed System Operating-System Operations ➢ Interrupt driven by hardware ➢ Software error or request creates exception or trap
- Division by zero, request for operating system service ➢ Other process problems include infinite loop, processes modifying each other or the operating system ➢ Dual-mode operation allows OS to protect itself and other system components
- User mode and kernel mode
- Mode bit provided by hardware Provides ability to distinguish when system is running user code or kernel code Some instructions designated as privileged, only executable in kernel mode System call changes mode to kernel, return from call resets it to user Transition form User to Kernel Mode
➢ Timer to prevent infinite loop / process hogging resources
- Set interrupt after specific period
- Operating system decrements counter
- When counter zero generate an interrupt
- Set up before scheduling process to regain control or terminate program that exceeds allotted time Process Management PROCESS
- program in execution
- unit of work within the system
- program is a passive entity, process is an active entity ➢ Process needs resources to accomplish its task
- CPU, memory, I/O, files
- Initialization data ➢ Process termination requires reclaim of any reusable resources ➢ Single-threaded process has one program counter specifying location of next instruction to execute
- Process executes instructions sequentially, one at a time, until completion ➢ Multi-threaded process has one program counter per thread ➢ Typically, system has many processes, some user, some operating system running concurrently on one or more CPUs
- Concurrency by multiplexing the CPUs among the processes / threads Process Management Activities ➢ Creating and deleting both user and system processes ➢ Suspending and resuming processes
- Primitives to manipulate files and dirs
- Mapping files onto secondary storage
- Backup files onto stable (non- volatile) storage media Mass Storage Management ➢ Usually, disks used to store data that does not fit in main memory or data that must be kept for a “long” period ➢ Proper management is of central importance ➢ Entire speed of computer operation hinges on disk subsystem and its algorithms ➢ OS activities
- Free-space management
- Storage allocation
- Disk scheduling ➢ Some storage need not be fast
- Tertiary storage includes optical storage, magnetic tape
- Still must be managed – by OS or applications
- Varies between WORM (write- once, read-many- times) and RW (read-write) I/O Subsystem ➢ One purpose of OS is to hide peculiarities of hardware devices from the user ➢ I/O subsystem responsible for
- Memory management of I/O including buffering, caching spooling (overlapping of output of one job with input of other jobs)
- General device-driver interface
- Drivers for specific hardware devices Protection and Security ➢ Protection – any mechanism for controlling access of processes or users to resources defined by the OS
➢ Security- defense of the system against internal and external attacks ➢ Systems generally first distinguish among users, to determine who can do what Distributed Computing ➢ Collection of separate, possibly heterogeneous, systems networked together Network is a communications path
- Local Area Network (LAN)
- Wide Area Network (WAN)
- Metropolitan Area Network (MAN) ➢ Network Operating System provides features between systems across network Special Purpose Systems Real-time embedded systems most prevalent form of computers
- Vary considerable, special purpose, limited purpose OS, real-time OS Multimedia systems
- Streams of data must be delivered according to time restrictions Handheld systems
- PDAs, smart phones, limited CPU, memory, power
- Reduced feature set OS, limited I/O Computing Environments Traditional computer ➢ Blurring over time ➢ Office environment
- PCs connected to a network, terminals attached to mainframe or minicomputers providing batch and timesharing
- Now portals allowing networked and remote systems access to same resources Home networks
source-code format rather than just binary closed-source ➢ Counter to the copy protection and Digital Rights Management (DRM) movement ➢ Started by Free Software Foundation (FSF), which has “copyleft” GNU Public License (GPL) ➢ Examples include GNU/Linux and BSD UNIX (including core of Mac OS X), and many more