Home / Notes / Class 11 / Computer Science / Operating systems
Role and types of operating systems, their functions, process and CPU scheduling, memory management with paging, file systems, device management, user interfaces, and common systems such as Windows, Linux and Android.
An operating system (OS) is system software that manages the hardware and software of a computer and gives users and programs a way to use them. It sits between the user, the application programs and the hardware. Examples are Windows, Linux, macOS and Android.
Main goals of an OS:
Types of operating systems:
Functions of an OS:
A program is a set of instructions stored on disk. A process is a program in execution, with its own memory, registers and state. A process moves among states: new, ready, running, waiting (blocked) and terminated. A process goes from running to waiting when it needs input or output, and from waiting to ready when that finishes.
The CPU can run only one process at a time per core, so the scheduler decides which ready process runs next. Changing from one process to another is a context switch: the OS saves the state of the old process and loads that of the new one. It takes time but no useful work is done.
CPU scheduling algorithms:
Waiting time is the time a process spends in the ready queue. Turnaround time is the time from arrival to completion. Deadlock is a state where processes wait forever because each holds a resource another needs.
Memory management keeps track of which parts of main memory (RAM) are used. In paging, a program is split into equal pages and memory into frames of the same size, so pages can sit in any free frames. In virtual memory part of the disk acts as extra RAM, letting programs larger than RAM run. Too much swapping between RAM and disk slows the system, called thrashing.
A file system organises data on a disk into files and folders (directories). A file has a name, type, size, location and permissions. Common file systems are FAT32, NTFS, ext4 and APFS. Operations are create, open, read, write, rename and delete.
A device driver is a small program that lets the OS talk to a particular device such as a printer. Spooling stores output in a buffer on disk so the CPU need not wait for a slow printer.
A user interface may be a command line interface (CLI), where commands are typed, or a graphical user interface (GUI), with windows, icons, menus and a pointer. A CLI uses little memory and is powerful for experts, while a GUI is easier for beginners.
Study tip: For scheduling questions draw a Gantt chart first, then read off waiting times. Learn the functions of an OS as a list of six headings and give one line on each. Compare types of OS using one real example for each.
Say the meaning first, then open the card to check.
System software that manages hardware and provides services to programs.
A program that is being executed.
The part of the OS that chooses which process gets the CPU.
Saving one process state and loading another to change the running process.
Disk space used as an extension of RAM.
Dividing memory into fixed-size frames and programs into pages of the same size.
Software that lets the OS control a specific hardware device.
A situation where processes wait forever for resources held by each other.
The core part of the OS that controls hardware and processes.
| Name | Formula | What it means |
|---|---|---|
| Turnaround time | completion time − arrival time | Total time a process spends in the system |
| Waiting time | turnaround time − burst time | Time spent waiting in the ready queue |
| Page number | logical address ÷ page size (whole part) | Which page an address falls in |
| Offset | logical address mod page size | Position inside the page |
These are the kind of questions asked for 2, 3 and 5 marks. Try each one before opening the answer.
An operating system is system software that controls the computer hardware and provides services for application programs and users. It manages processes, memory, files and devices.
A program is a passive set of instructions stored on a disk. A process is a program that is loaded in memory and being executed, with its own data, registers and state. One program can create several processes.
A CLI needs commands to be typed. It uses little memory and is fast and flexible for trained users, but commands must be remembered. A GUI uses windows, icons and a mouse or touch. It is easy to learn, but it needs more memory and processing power.
Each process in the ready queue is given the CPU for a fixed small time called the time quantum. If it finishes within the quantum it leaves. If not, it is stopped and placed at the end of the queue, and the next process runs. This gives all processes a fair share and quick response, so it suits time-sharing systems. A very large quantum makes it act like FCFS.
The OS manages processes by creating, scheduling and ending them. It manages memory by allocating and freeing space. It manages files by storing, naming, protecting and retrieving them. It controls devices through drivers. It provides security through accounts and permissions, and a user interface to give commands.
Virtual memory is a technique that uses part of the hard disk as if it were RAM. Only the needed pages of a program are kept in RAM and the rest stay on disk. It is needed so that programs larger than the physical RAM can run and so that many programs can be open together.
Answer: 4.33 ms
Answer: 3.67 ms, less than FCFS
Answer: Page 2, offset 1808