Operating Systems
Operating Systems
Operating Systems
Chapter 1: Introduction
Faculty of Computers and Artificial Intelligence
System View
● The operating system is closely tied to the hardware, serving as a
resource allocator.
● It manages various resources like CPU time, memory, file storage,
and I/O devices in a computer system.
● acts as the manager of these resources
3
• OS is a resource allocator
➢ Manages all resources.
➢ Decides between conflicting requests for efficient and fair
resource use.
• OS is a control program
➢ Controls execution of programs to prevent errors and
improper use of the computer.
Computer Startup
• bootstrap program is loaded at power-up or reboot
➢ Typically stored in ROM or electrically erasable
programmable read-only memory (EPROM), generally known
as firmware.
➢ Initializes all aspects of system.
➢ Loads operating system kernel and starts execution.
Interrupts
• The occurrence of an event is usually signaled by an
interrupt from either the hardware or the software.
Main memory
–only large storage media that the CPU can access
directly.
➢ Random access
➢ Typically volatile
Secondary storage
– extension of main memory that provides large
nonvolatile storage capacity
➢ Two types:
Symmetric Multiprocessing
A Dual-Core Design
Multi-chip and multicore
➢ Single user cannot keep CPU and I/O devices busy at all times
➢ Multiprogramming organizes jobs (code and data) so CPU always has
one to execute
➢ A subset of total jobs in system is kept in memory
➢ One job selected and run via job scheduling
➢ When it has to wait (for I/O for example), OS switches to
another job
8
Levels of Storage
10
• Touchscreen Interfaces
• Touchscreen devices require new interfaces.
➢ Mouse not possible or not desired.
➢ Actions and selection based on gestures.
➢ Virtual keyboard for text entry.
• Voice commands.
1. Process control
2. File management
3. Device management
4. Information maintenance
5. Communications
6. Protection
Chapter 3: Processes
Program vs. Process
• A program is a passive entity such as the file that
contains the list of instructions stored on a disk always
referred to as an executable file.
• A program becomes a process when an executable file is
loaded into the memory and then becomes an active
entity
Schedulers (1/2)
• Medium-term scheduler
➢ Can be added if degree of multiple programming needs to
decrease
➢ Remove process from memory, store on disk, bring back in
from disk to continue execution: swapping
20
Chapter 4: Threads
Benefits of Threads
• Responsiveness – may allow continued execution if part
of process is blocked, especially important for user
interfaces.
• Resource Sharing – threads share resources of process,
easier than shared memory or message passing.
• Economy – cheaper than process creation, thread
switching lower overhead than context switching.
• Scalability
process can take advantage of
multiprocessor architectures.