Podcast
Questions and Answers
What are the four key components that a computer system can be divided into?
What are the four key components that a computer system can be divided into?
Hardware, Operating System, Application Programs, and Users.
In simple terms, describe the role of an operating system within a computer system.
In simple terms, describe the role of an operating system within a computer system.
It controls the hardware and provides necessary resources for programs.
What is the core of the operating system called, and what is its primary function?
What is the core of the operating system called, and what is its primary function?
The core is called the kernel, and it manages the resources and operations of the system.
Briefly describe the main goal of abstraction in the context of computer system components.
Briefly describe the main goal of abstraction in the context of computer system components.
What are three key objectives of operating systems?
What are three key objectives of operating systems?
Name three strategies used by operating systems.
Name three strategies used by operating systems.
In the early history of operating systems, what was the primary way programs were run, and what does this entail?
In the early history of operating systems, what was the primary way programs were run, and what does this entail?
What is spooling, and why was it introduced in early operating systems?
What is spooling, and why was it introduced in early operating systems?
List at least five components of operating systems.
List at least five components of operating systems.
From 'programmer's view', what does an operating system provide for program execution?
From 'programmer's view', what does an operating system provide for program execution?
From 'system’s view', what are three services that an operating system provides?
From 'system’s view', what are three services that an operating system provides?
Outline the primary role of system calls within an operating system.
Outline the primary role of system calls within an operating system.
Explain what system programs are and provide two examples.
Explain what system programs are and provide two examples.
What is a process?
What is a process?
How does CPU handle multiple processes in a Multiprogramming environment?
How does CPU handle multiple processes in a Multiprogramming environment?
Distinguish between foreground and background processes.
Distinguish between foreground and background processes.
What is the role of a process manager in an operating system?
What is the role of a process manager in an operating system?
What is a PCB (Process Control Block) and what is its purpose?
What is a PCB (Process Control Block) and what is its purpose?
What are the typical steps involved in creating a new process?
What are the typical steps involved in creating a new process?
List three possible causes of process termination.
List three possible causes of process termination.
Explain the hierarchy in processes. What are 'parent processes' and 'child processes'?
Explain the hierarchy in processes. What are 'parent processes' and 'child processes'?
How are signals managed in process groups in UNIX?
How are signals managed in process groups in UNIX?
Outline how process hierarchy is generally handled in Windows operating systems compared to UNIX.
Outline how process hierarchy is generally handled in Windows operating systems compared to UNIX.
Name 3 or more possible states of a process.
Name 3 or more possible states of a process.
What triggers allowable state transitions in a process waiting for an I/O operation?
What triggers allowable state transitions in a process waiting for an I/O operation?
Which state transition can only be initiated by the running process itself?
Which state transition can only be initiated by the running process itself?
Explain the key role of Process descriptor.
Explain the key role of Process descriptor.
List at least five data fields that a process descriptor usually contains.
List at least five data fields that a process descriptor usually contains.
What is process scheduling?
What is process scheduling?
Describe two types of Jobs with Regard to Process Execution.
Describe two types of Jobs with Regard to Process Execution.
What are at least four key factors that affect scheduling decisions in an operating system?
What are at least four key factors that affect scheduling decisions in an operating system?
What are the three types of schedulers?
What are the three types of schedulers?
What is the primary responsibility of the long-term scheduler?
What is the primary responsibility of the long-term scheduler?
What is the main function of the short-term scheduler (or CPU scheduler)?
What is the main function of the short-term scheduler (or CPU scheduler)?
Explain the role provided by a medium-term scheduler.
Explain the role provided by a medium-term scheduler.
In FCFS (First Come First Served) scheduling, how is the CPU allocated to processes?
In FCFS (First Come First Served) scheduling, how is the CPU allocated to processes?
Suggest a disadvantage of FCFS (First Come First Served) Scheduling.
Suggest a disadvantage of FCFS (First Come First Served) Scheduling.
How does the Shortest-Job-First (SJF) scheduling algorithm work?
How does the Shortest-Job-First (SJF) scheduling algorithm work?
What's the difference between preemptive and non-preemptive SJF (Shortest-Job-First) scheduling?
What's the difference between preemptive and non-preemptive SJF (Shortest-Job-First) scheduling?
Flashcards
Computer Hardware
Computer Hardware
Provides basic computing resources, e.g., CPU, memory, I/O devices.
Operating System
Operating System
Controls and coordinates the use of hardware among various applications and users.
Application Programs
Application Programs
Define the ways in which the system resources are used to solve computing problems for users.
Kernel
Kernel
Signup and view all the flashcards
Abstraction by OS
Abstraction by OS
Signup and view all the flashcards
Resource Allocation
Resource Allocation
Signup and view all the flashcards
User Interface
User Interface
Signup and view all the flashcards
Batch Operating Systems
Batch Operating Systems
Signup and view all the flashcards
Time Sharing Systems
Time Sharing Systems
Signup and view all the flashcards
Spooling
Spooling
Signup and view all the flashcards
Process
Process
Signup and view all the flashcards
Program Execution
Program Execution
Signup and view all the flashcards
I/O Operations
I/O Operations
Signup and view all the flashcards
Communication
Communication
Signup and view all the flashcards
Error Detection
Error Detection
Signup and view all the flashcards
Usage Details
Usage Details
Signup and view all the flashcards
Kernel
Kernel
Signup and view all the flashcards
System Programs
System Programs
Signup and view all the flashcards
Process Control Block (PCB)
Process Control Block (PCB)
Signup and view all the flashcards
Process Model
Process Model
Signup and view all the flashcards
Parent-Child Process
Parent-Child Process
Signup and view all the flashcards
UNIX Process Groups
UNIX Process Groups
Signup and view all the flashcards
Windows: Special Token
Windows: Special Token
Signup and view all the flashcards
Process State
Process State
Signup and view all the flashcards
Process Table
Process Table
Signup and view all the flashcards
Maximum Process support
Maximum Process support
Signup and view all the flashcards
Process Model
Process Model
Signup and view all the flashcards
Process Manager Algorithms
Process Manager Algorithms
Signup and view all the flashcards
Multiprogramming
Multiprogramming
Signup and view all the flashcards
CPU Intensive Jobs
CPU Intensive Jobs
Signup and view all the flashcards
I/O Intensive Jobs
I/O Intensive Jobs
Signup and view all the flashcards
Throughput
Throughput
Signup and view all the flashcards
Turnaround time
Turnaround time
Signup and view all the flashcards
Waiting time
Waiting time
Signup and view all the flashcards
Interactive system
Interactive system
Signup and view all the flashcards
Uniprocessor system
Uniprocessor system
Signup and view all the flashcards
Long Term scheduler
Long Term scheduler
Signup and view all the flashcards
Medium Term scheduler
Medium Term scheduler
Signup and view all the flashcards
Short term scheduler
Short term scheduler
Signup and view all the flashcards
First Come First Served
First Come First Served
Signup and view all the flashcards
Shortest-Job-First Scheduling
Shortest-Job-First Scheduling
Signup and view all the flashcards
Study Notes
- This document contains study notes for COU4302 Operating Systems, Dayschool 1.
- The notes cover objectives, the history of operating systems, components, functions, process concepts and process states.
Course Overview
- There are two No Book Tests each lasting one hour.
- CAT 1 questions are from sessions 1-12.
- CAT 2 questions are from sessions 13-25.
- The final examination lasts 2 hours.
Computer System Components
- A computer system is divided into four components: hardware, operating system, application programs, and users.
- Hardware provides basic computing resources like the CPU, memory, and I/O devices.
- The operating system controls and coordinates the use of hardware among applications and users, examples being Windows, Linux, and Unix.
- Application programs define the ways system resources are used to solve computing problems, examples being word processors, compilers, web browsers, database systems and video games.
- Users interact with the computer, which may include people, machines, and other computers.
About Operating Systems (OS)
- An OS controls the hardware and provides the resources required for programs on a computer.
- The OS makes hardware usable, keeps track of all PC resources, and efficiently manages/allocates them.
- The OS provides functions to assist in the processing and execution of programs.
- The core of the operating system is the "kernel".
Kernel Details
- The kernel is a control program that functions in a privileged state and has the authority to run all hardware instructions; it is always running.
- The kernel will respond to service calls from processes and interrupts from devices.
Objectives of an Operating System
- The OS will hide hardware details by creating abstractions.
- The OS will allocate resources to processes.
- The OS will provide an effective user interface.
Strategies of Operating Systems
- Batch Operating Systems process jobs in batches.
- Time Sharing Systems allow multiple users to share the computer's resources simultaneously.
- Workstations are high-performance computers designed for individual use
- Real Time Systems are designed to respond to events within a specific time frame.
- Network Computing distributes processing across multiple computers on a network.
History of Operating Systems
- Early computers did not have operating systems or programming languages.
- In the early 1950s punch cards were introduced.
- General Motors Research Laboratories introduced the first operating system for their IBM 701.
- Initially programs ran as batch jobs.
- 1950: One job ran at a time, known as single-stream batch processing.
- 1960: Batch operating systems ran several jobs at once.
- Multiprogramming to improve memory and I/O utilization was introduced and spooling improved program running time without waiting for slow I/O devices.
- Time sharing was later introduced.
Operating System Components
- Process Management
- Main Memory Management
- File Management
- I/O System Management
- Secondary Storage Management
- Networking
- Protection System
- Command Interpreter
Operating System Functions
- Services provided by operating systems can be viewed from two perspectives: what they provide for programmers (programmer's view) and what they do for the system itself (system's view).
Programmer's View of OS Services
- Program Execution: The OS provides an environment where users can conveniently run programs.
- I/O Operations: Each program requires I/O procedures which are handled by the OS.
- File System Manipulation: The OS provides file management services.
- Communication: The OS provides services for processes to communicate with each other.
- Error Detection: The OS monitors the system to detect and prevent errors.
The System's View of OS Services
- Allocation of Available Resources: The OS handles resource requests in a multiprogramming environment.
- Usage Details: Keeps track of which user used which type of resources for service improvement.
- Security and Protection: The OS will protect programs, data, and control access, due to users competing for resources.
System Calls
- System calls allow user-level processes to request services from the OS that the process itself cannot access directly.
- Five major categories of system calls: process management, file management, device management, communication, and information management.
- System calls are developed using high-level languages like C and C++; in Windows, they are provided as part of the WIN32 API.
System Programs
- These provide basic functions to users, eliminating the need for users to write their own environment for programs.
- Different OS provides these services in different ways.
- System programs can include file management, program execution, status information, support for programming languages, file modification, and communications.
Process Concepts
- A process is a key element used in computation in modern systems.
- A process can be a program in execution, an asynchronous activity or the "locus (place) of control" of a procedure in execution.
- A process’ existence is represented with a process control block in the operating system.
- A process is the dispatchable unit of a program and is the entity to which processors are assigned.
- Programs are passive entities until the processor selects them for execution when they become active entities.
- While running a user program, a computer will also read from disk and output text to a screen or printer.
- In a multiprogramming environment, the CPU switches from process to process, running each for a given duration.
- The CPU responds to program requests, I/O requests, and error traps.
- Process management refers to the services provided by the OS to support the administration and execution of a collection of processes in an order.
- The CPU is running only one program at a time, giving users an idea of parallelism.
Foreground vs Background Processes
- Foreground Processes are interactive and user driven.
- Background Processes are not interactive, like email or print servers.
Programmer's View of Processes
- The process manager, part of the OS, can create, terminate, suspend, and resume processes.
- The process manager can change a process's priority, block or wakeup a process, and dispatch a process.
- Processes can communicate with each other (inter-process communication).
- Creating a process involves operations including naming the process, inserting it in the system's process list, determining initial priority, creating the process control block and allocating the process' initial resources.
The Process Model
- In the process model, all runnable software on the computer will organize as sequential processes.
- The CPU switches from process to process.
- PCB (Process Control Block) is used to track how the CPU switches from process to process and store the details of processes.
- A process is an activity with a program, input, output, and a state.
Process Creation
- Processes creation occurs upon system initialization, when a running process executes a process creation call, from a user program request, or when a batch job is initiated.
Process Termination
- Process termination can be upon normal exit or end, error exit or abort, encountering a fatal error, or being killed by a user or another process.
Hierarchy in Processes
- When a process creates another process, it creates a hierarchical relationship where the creator is called the parent process, and the newly created process is the child process.
- Child processes can create more child processes, forming a tree-like structure.
- This hierarchy will allow a parent to have some control of the child process.
Process Groups in UNIX
- In UNIX, a process and all its child processes can form a process group.
- When a user sends a signal, like from the keyboard, it is sent to all processes in the group.
- Each process can choose how to handle the signal: accept it, ignore it, or follow the default action, like termination.
Process Hierarchy in Windows
- Windows does not have a strict process hierarchy and treats all processes equally.
- Windows assigns a special token or handle to the parent instead of a parent-child relationship, which can be passed to another process for control.
- Newer versions of Windows (Windows 7) has implemented the concept of a process tree and gives the option to end either the process or the process tree in task manager.
States of Processes
- A process' state changes due to different events.
- The process manager algorithms will change the state of processes depending on the current activity.
- A process can be in one of the following states: Running, Ready, or Blocked.
- Running State: the process currently uses the CPU
- Ready State: the process could use a CPU, if available
- Blocked State: the process is waiting for an event
Processes State Transition
- New: a newly admitted process to the system
- Ready : Process ready to be executed
- Running : Process in execution
- Waiting/Blocked : Process blocked to await some event
- Terminate: Process completes execution
Allowable State Transition
- I/O operation completes other events a process is waiting for
- Dispatch (process name) : Ready -> Running state
- Timer runout (process name) : Running -> Ready
- Block (process name) : Running -> Blocked
- Wakeup (process name) : Blocked -> Ready
Process Control Block
- The operating system must keep track of each process status.
- To implement the process model, the operating system maintains a data structure or table called a process table with one entry per process.
- A process descriptor is the basic data structure for the specific state of each process.
- Process descriptor entries are sometimes called the process control block (PCB).
- A PCB is where information to save a process when it is suspended is stored.
- This information is useful when the process switches states, so it can restart later as if it was never stopped.
Process Descriptor Content
- Process descriptors contain processor registers content at when the process was last suspended and Unique identification of the process.
- The process descriptor also contains the processor and its memory state and The address space mapping details.
- The resources allocated and required and the number for the processor when running as well as all program counters, CPU registers, I/O status and any CPU Scheduling
Process Descriptor Fields
- Internal process name
- State
- Owner
- Parent process
- List of reusable resources
- List of consumable resources
- List of file descriptors
- Message queue
- Protection domain
- CPU status register content
- CPU general register content
Operating System Design Issues
- When an OS is configured, it has a fixed number of process descriptors that represents the maximum number of processes it can support at one time.
- A process descriptor allocates when the process creates and releases when terminates or exits
- The process manager manages the process descriptor, but the OS can change its various fields.
Multiprogramming
- The CPU executes multiple jobs or tasks at a given time.
- This ensures CPU time is shared across programs and achieves higher throughput by maximizing system resource occupation.
- When a system employs multiprogramming, multiples processes compete for CPU concurrently.
- Jobs are kept in the memory so when one stalls the OS takes CPU it away from it and moves it to another.
- OS will schedule the CPU for processes and scheduling algorithms is a primary OS function.
Types of Jobs with process execution
- CPU-intensive Jobs use more CPU time.
- I/O-intensive Jobs use more I/O time.
Scheduling Decisions Factors
- Decisions are affected by CPU utilization, and the throughput ,as well as turnaround time, weighting time and response time.
- CPU utilization of 40% occurs in a lightly loaded system, compared to 90% observed in heavily loaded systems.
Important factors on scheduling decisions
- In interactive system it is important to minimize the variance in the response time than minimizing the average response time
- In a uniprocessor system there is only a single running process at CPU, all others are blocked or in the ready queue which is a linked list.
Schedulers
- Job or Long-Term Scheduler
- CPU or Short-Term Scheduler
- Medium-Term Scheduler
Process Queuing
- A long-term scheduler manages the Ready Queue.
- A short-term scheduler manages the CPU
- I/O devices have Waiting Queues.
Long-Term/Job Scheduler
- A long-term scheduler determines which jobs are admitted to the system for processing and selects jobs from the job queue that should be loaded into main memory for execution.
- Jobs are carefully scheduled to ensure CPU and I/O intensive jobs for scheduling are available.
Short-Term/CPU Scheduler
- Selects jobs in memory ready to execute and allocates CPU time to one.
- The short-term scheduler must select a new process quite often and must be fast.
- Some time sharing systems have only the short-term scheduler.
Medium-Term Scheduler
- It is known as medium term scheduler, and it is an additional intermediate level of scheduling for memory with virtual memory.
- Useful for removing processes from memory and reload that processes where it left off at a later point.
- This method named swapping and frees commited memory.
First Come First Served (FCFS)/ FIFO Scheduling
- The process which requests CPU first gets the CPU first , implemented via FIFO queue.
Shortest-Job-First (SJR) Scheduling
- Associate the length of its next CPU burst with each process and use those lengths to scheduling.
- This will minimize the waiting jobs while long one is running and SJR will provide minimum average waiting time for a given set of processes.
- If two jobs have same burst time FCFS is used.
SJF (Shortest-Job-First) Schemas
- Non-Preemptive Scheme Once CPU is assigned to process can not be preempted until CPU burst gets complete.
- Pre-emptive Scheme If process arrives with burst length smaller than that of the remaining running time, the former will be preempt and called Shortest-Remaining-Time-First (SRTF).
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.