Com Sci mod 3 Flashcards
Explain the main functions of Operating Systems
An operating system is a piece of software that manages files, manages memory, manages processes, handles input and output, and controls peripheral devices like disk drives and printers, resource manager, interface among other things.
eg. Apple macOS, Microsoft Windows, Google’s Android OS, Linux Operating System, and Apple iOS
Describe how Operating Systems have evolved from primitive batch systems to sophisticated multi user systems
Batch Systems: Single job at a time, no user interaction.
• Multi-Programming: Multiple jobs in memory, better resource use.
• Time-Sharing: Multiple users interact simultaneously, sharing CPU time.
• Multi-User Systems: Multiple users run applications simultaneously with advanced resource management.
• Modern OS: Comprehensive systems with GUIs, security, networking, and multi-tasking.
In essence, operating systems have evolved from processing one job at a time with no user interaction to sophisticated platforms supporting multiple users and applications concurrently with robust security and user interfaces.
Describe Batch Systems
a type of operating system that allows multiple users to use it at the same time, without direct communication between them. This is done by having the users submit their jobs to the operating system, which then processes them one at a time.
Describe Multi-Programming Systems
On a single processor computer, a multiprogramming OS can run many programs. In a multiprogramming OS, if one program must wait for an input/output transfer(blocked), the other programmes are ready to use the CPU. As a result, different jobs may have to split CPU time.
eg. Google Chrome browser
Describe Time Sharing
Time-sharing is a method of allowing multiple individuals at different terminals to access the same computer system simultaneously. In a time-sharing operating system, for each process, a time slot of 5 nanoseconds is allocated. Once a process is executed and completed (if it is not completed in its allocated timeshare it will be moved to the rear of the queue), the next process will be executed for the next 5 nanoseconds.
eg. round robin
Describe Multi-User Systems
allows multiple users on different computers or terminals to access a single system with one OS on it.
Examples: Linux, Ubuntu, Unix, Mac OS X, Windows 1010 etc.
Bootstrap Process
The process involves a chain of stages, in which at each stage, a relatively small and simple program loads and then executes the larger, more complicated program of the next stage.
- It is in this sense that the computer “pulls itself up by its bootstraps”; i.e., it improves itself by its own efforts.
Process Management
Process management in an operating system (OS) is the way the OS handles running programs. Think of it as a manager in a company ensuring that each employee (process) gets the resources they need (like CPU time, memory, etc.) and that they work efficiently without interfering with each other. Here are the key points in simple terms:
- Process Creation and Termination
- Scheduling
- Resource Allocation
- Inter-Process Communication (IPC)
- Synchronization
Overall, process management ensures that all running programs (processes) operate smoothly and efficiently, maximizing the performance and stability of the system.
Process States
Running
Running State: When the CPU is allocated to a process, it enters the running state. In this state, the process executes its instructions and uses system resources such as memory, CPU, and I/O devices
Process States
Ready
After the creation of a process, the process enters the ready state i.e. the process is loaded into the main memory. The process here is ready to run and is waiting to get the CPU time for its execution
Process States
Blocked
A blocking call is where the OS decides that it needs to wait for a certain operation to complete before allowing the program to continue execution.
How does the interrupt mechanism work?
An interrupt is an event that occurs to stop the current execution of the current process and notify the operating system to service an interrupt service routine (ISR).
- The ISR is responsible for identifying the software or hardware that caused the interrupt and notifying the CPU of it.
Types of Interrupt
Interrupt generated by the running process
An interrupt is a signal emitted by a device attached to a computer or from a program within the computer. It requires the operating system (OS) to stop and figure out what to do next. An interrupt temporarily stops or terminates a service or a current process.
-stops the running process
Types of Interrupt
Input/Output Interrupt
Interrupt I/O is a way of controlling input/output activity whereby a peripheral or terminal that needs to make or receive a data transfer sends a signal.
Types of Interrupt
External Interrupt
An external interrupt is a computer system interrupt that happens as a result of outside interference, whether that’s from the user, from peripherals, from other hardware devices or through a network.
Types of Interrupt
Input/Output vs External Interrupt
Purpose: I/O is about the ongoing communication between the computer and external devices, while external interrupts are about signaling the CPU to handle urgent tasks.
• Operation: I/O can involve continuous or periodic data transfer, managed by the CPU or dedicated controllers. External interrupts, on the other hand, are sporadic signals that demand immediate CPU action.
Types of Interrupt
Restart Interrupt
These interrupts occur when the operator selects the restart function at the console or when a restart SIGP (signal processor) instruction is received from another processor.
What is Deadlock?
a situation in which two computer programs sharing the same resource are effectively preventing each other from accessing the resource, resulting in both programs ceasing to function.
- The earliest computer operating systems ran only one program at a time.
What is the Process Control Block?
a data structure used by an operating system (OS) to manage and control the execution of processes. It contains all the necessary information about a process, including the process state, program counter, memory allocation, open files, and CPU scheduling information.
Scheduling Algorithms
What are Preemptive Scheduling Algorithms?
Preemptive scheduling is used in real-time systems where the tasks are usually configured with different priorities and time critical tasks are given higher priorities. A higher priority task can stop a lower priority one and grab and use the CPU until it releases it.
Scheduling Algorithms
What are Non-Preemptive Scheduling Algorithms?
Non-preemptive algorithms are designed so that once a process enters the running state, it cannot be preempted until it completes its allotted time
Scheduling Algorithms
Preemptive
Shortest Job First (SJF)
(can also be nonpreemptive)
- Definition: SJF selects the process with the shortest execution time to run next.
- Process: When multiple processes are waiting to be executed, the operating system looks at each one’s estimated execution time and picks the one that will take the least time to complete.
- Benefit: By choosing the shortest job first, SJF aims to minimize the average waiting time for all processes, making the system more efficient.
-
Types:
- Non-preemptive SJF: Once a process starts running, it continues until it finishes.
- Preemptive SJF (also known as Shortest Remaining Time First, SRTF): If a new process arrives with a shorter remaining time than the current one, the current process is paused, and the new process is executed first.
- Fairness: SJF is fair in terms of reducing waiting time but can cause longer jobs to wait significantly (known as the “starvation” problem).
- Optimality: SJF is optimal for minimizing average waiting time if all process times are known in advance.
- Usage: SJF is best suited for environments where job durations are predictable and small, such as batch processing systems
Scheduling Algorithms
Preemptive
Round Robin
time slices (also known as time quanta) are assigned to each process in equal portions and in circular order, handling all processes without priority
- Round-robin algorithm is a pre-emptive algorithm as the scheduler forces the process out of the CPU once the time quota expires.
Scheduling Algorithms
Non- Preemptive
First Come First Serve FCFS
FCFS Scheduling algorithm automatically executes the queued processes and requests in the order of their arrival. It allocates the job that first arrived in the queue to the CPU, then allocates the second one, and so on.
Memory Management
Virtual Memory
a method that computers use to manage storage space to keep systems running quickly and efficiently.
- Using the technique, operating systems can transfer data between different types of storage, such as random access memory (RAM), also known as main memory, and hard drive or solid-state disk storage.
Memory Management
Paging
a storage mechanism used in OS to retrieve processes from secondary storage to the main memory as pages. The primary concept behind paging is to break each process into individual pages. Thus the primary memory would also be separated into frames.
Memory Management
Thrashing
the system spends an excessive amount of time swapping data between physical memory (RAM) and virtual memory (disk storage) due to high memory demand and low available resources.
File Management
Directories/Folders
A directory is a unique type of file that contains only the information needed to access files or other directories. As a result, a directory occupies less space than other types of files.
- File systems consist of groups of directories and the files within the directories.
File Management
Files
used for all input and output (I/O) of information in the operating system, to standardize access to both software and hardware.
- Input occurs when the contents of a file is modified or written to.
- Output occurs when the contents of one file is read or transferred to another file.
Security of Files:
- User IDs
- Passwords
- Access Control List
- File Encryption
- File Compression
Interface (user)
Types of Interfaces:
- Menu
- Command Prompt
- GUI (Graphical User Interface)
- the manipulation of the interface 😟❓