15. Operating systems
Table of Contents
A. General Hardware
1. Central Processing Unit (CPU) - An electronic circuitry that executes instructions based on an input of binary data.
It consists of three main components:
-
Control unit (CU)
- Control and monitor input and output fo data from computer’s hardware
- Primary job: Ensure data is sent to right component, at the right time
- Ensure all hardware is working on the same schedule
- Does this with a clock
-
Arithmetic and Logic Unit (ALU)
- Findamental building block of the CPU, the brains of the entire computer
- Two primary areas
- Arithmetic - Performs arithmetic operations on data
- Logic - Performs logical operations on data
-
Registers (Immediate Access Store)
-
Limited space, high-speed memory that CPU can use for quick processing.
-
Provide CPU with a place to store and access values that are cruicial to immediate calculations the ALU is processing.
-
Fundamentally, data is just a series of electrical pulses. These pulses run through different components as a means to process and return data.
2. Memory
-
Random Access Memory (RAM)
- Used to store and access information on a short-term basis
- primary volatile memory
-
Static Memory (ROM)
-
Buses
-
It an engineering term for a job-specific high-speed wire.
-
Groups of wires that transfer electrical signals either in parallel or in series.
-
Three types of buses
-
Data buses - bidirectional; carry data back and forth between processor and other components
-
Address buses - unidirectional; carry a specific addresses in memory
-
Control buses - unidirectional; carry control signals of CU to other components as well as the clock signals for synchronization.
-
-
B. Basics of Operating Systems
Take a look at some of the vital functions of an OS:
- Process Management
- Memory Management
- File Management
- IO Management
- Multitasking
- Networking
- Security
- Providing a user interface
C. Processes and Threads
A process is an abstraction within the operating system that represents the program while it is in execution.
A thread represents the actual sequence of processor instructions that are actively being executed.
- Kernel threads are constructed through system calls to the kernel
- User threads are constructed using local function calls.
D. Process Scheduling
Computers have a limited amount of resources, be it processor cores, hard drives, or network links, but the number of tasks that it may need to run are ever-growing.
Processing States and Queues
Processes exist in multiple states in order to best utilize system resources so that if one process is waiting, another can take its place in the CPU.
States
- Ready
- Running
- Blocked
- Waiting
- Terminated
Usually, waiting is done in a queue (FIFO).
However, the data structure needs to be modified to accommodate the ready queue.
Different processes may have different priorities, hence a priority queue becomes the more relevant abstraction.
- priority is calculated is determined by the scheduling algorithm and is represented by some integer value or category such as low, medium, or high.