Chapter 2.1: Software and Operating Systems
Multiple Choice · Software
Question 1: The Printer Driver
Which type of software does the printer driver installed to make a new printer work with the computer belong to?
D: Device drivers are system software that manages hardware together with the operating system; they talk to devices such as printers and graphics cards. Web browsers and office programs are application software, a compiler is a programming tool.
Step-by-Step Trace · Operating System
Question 2: How Does a Computer Boot?
From pressing the power button until the desktop appears, where is the running code at each step, and who is in control?
RAM is empty; the operating system is still waiting on the disk.
The processor starts with the UEFI (BIOS in older systems) held in permanent memory on the motherboard.
POST checks basic hardware such as memory, keyboard and disk; if there is an error it gives a beep or a message. If no RAM module is installed, booting stops here.
The boot disk is selected; the boot loader (Windows Boot Manager, GRUB) is loaded into RAM.
The boot loader loads the kernel into RAM and hands control to it.
The kernel loads drivers and starts the first processes and system services.
After authentication, the desktop and startup applications open.
power button pressed firmware (UEFI/BIOS) runs POST: basic hardware test boot loader is loaded from disk into RAM kernel is loaded into RAM drivers and services are started sign-in → desktop
Multiple Choice · Operating System
Question 3: MBR or GPT?
6 partitions will be created on a new 3 TB disk and Windows 11 will be installed. Which partitioning scheme and firmware are suitable?
D: MBR supports disks up to 2 TB and 4 primary partitions; a 3 TB disk needs GPT (with MBR, 6 partitions are possible only as logical partitions inside an extended partition). Windows 11 also requires UEFI + Secure Boot and TPM 2.0.
Step-by-Step Trace · Kernel
Question 4: Writing to a File: The System Call
When “Save” is pressed, the editor writes to the file report.txt. Follow the steps and the processor’s mode.
The editor cannot access the disk itself; it makes the write system call.
The processor switches to privileged mode; now only kernel code runs.
The file’s place on disk is found and the user’s write permission is checked. If there is no permission, the call returns with an error.
The data to write is copied from the editor’s memory area into the kernel’s buffer.
The driver translates the generic request into a command specific to that disk.
When the disk finishes, it notifies the processor with an interrupt.
The call returns and the processor switches to user mode. The editor never saw the hardware directly.
editor: write(report.txt, data) CPU: user mode → kernel mode file system: find place, write permission? kernel: take data from the editor's memory disk driver: write-to-disk command disk: job done → interrupt return: CPU → user mode
Multiple Choice · Kernel
Question 5: Kernel Types
Which design has only the basic functions in the kernel, with device drivers and the file system running in user mode?
B: In a microkernel, a driver crashing does not bring down the whole system; isolation is strong but there are more mode switches. In a monolithic kernel (Linux) everything is in a single privileged kernel; a hybrid design keeps some services in the kernel for speed.
Multiple Choice · Process Management
Question 6: Program, Process, Thread
The program calc.exe is run twice; the first window uses two threads. Which of the following is true?
D: A program is a passive file on disk; each run is a new process with its own memory space. Threads are execution flows within the same process that share its memory.
Output Question · Process Management
Question 7: Which State Is the Process In?
On a single-core system, the following happen to a process in order. In which state is the process after each event?
1 user started the program 2 OS admitted the process 3 scheduler picked the process 4 started waiting for keyboard input 5 user pressed a key 6 scheduler picked it again 7 time slice expired (interrupt) 8 scheduler picked it again 9 process finished
Show answer
1 New · 2 Ready · 3 Running · 4 Waiting · 5 Ready · 6 Running · 7 Ready · 8 Running · 9 Terminated
When the key is pressed, the process does not run immediately; it first returns to the Ready queue and is picked when its turn comes.
Step-by-Step Trace · Process Management
Question 8: Round-Robin Scheduling (q = 2)
Three processes are ready at t = 0: P1 = 4 ms, P2 = 2 ms, P3 = 3 ms. Round-robin scheduling, time slice 2 ms. Build the Gantt chart; when does each process finish?
Each process in turn gets at most 2 ms.
t = 0–2: P1 ran, 2 ms left → to the end of the queue.
t = 2–4: P2’s 2 ms finished; it leaves the system.
t = 4–6: P3 ran, 1 ms left → to the end.
t = 6–8: P1 completed its remaining 2 ms.
t = 8–9: P3 used its last 1 ms; it does not wait out the whole slice.
Queue empty → done. Finish times: P2 = 4, P1 = 8, P3 = 9 ms.
ready queue: P1(4) P2(2) P3(3)
q = 2
while queue is not empty
P = take from the front of the queue
run P for at most q ms
if P has work left
add P to the end of the queue
otherwise
finish(P) = current timeOutput Question · Process Management
Question 9: If the Time Slice Changes
The example in the lecture: P1 = 5, P2 = 3, P3 = 2 ms; with a 2 ms time slice the finish times are P3 = 6, P2 = 9, P1 = 10. What are the Gantt chart and finish times if the time slice is 3 ms? How many context switches occur?
Show answer
q = 3: P2 = 6, P3 = 8, P1 = 10.
- P1 runs 3 ms and goes to the end (2 left); P2 finishes in 3 ms, P3 in 2 ms; P1 finishes its remaining 2 ms.
- Context switches: 3 at q = 3, 5 at q = 2. As the slice grows, switches decrease but processes wait longer for their turn.
Multiple Choice · Process Management
Question 10: Preventing Deadlock
If all processes must request resources in the same order (first Printer, then File), which of the four conditions for deadlock cannot occur?
B: If everyone requests resources in the same order, a cycle such as “A waits for the File, B waits for the Printer” cannot form. All four conditions are required, so breaking one prevents deadlock. The Printer still has a single owner (mutual exclusion remains).
Output Question · Process Management
Question 11: Is There a Deadlock?
Determine whether there is a deadlock in each case.
(a) A holds the Printer and wants the File. B holds the File and wants the Scanner. C holds the Scanner and wants nothing else.
(b) In addition to (a), C wants the Printer without releasing the Scanner.
Show answer
(a) No deadlock. Since C is waiting for nothing, it finishes and releases the Scanner → B continues and releases the File → A continues.
(b) Deadlock: a circular wait forms: A → File → B → Scanner → C → Printer → A; since nobody releases, all three wait forever.
Step-by-Step Trace · Memory Management
Question 12: Protection with Base and Limit
A: base 100, limit 200; B: base 300, limit 150 (KB). What does the hardware do for the following memory accesses, in order?
Each process sees its own region; regions do not overlap.
150 < 200 → valid: 100 + 150 = 250.
199 < 200 → valid; A’s last address (299).
When the process changes, the OS loads B’s base/limit registers: 300 + 120 = 420.
150 < 150 is false → violation! Valid addresses are 0–149; 450 is outside B.
250 ≥ 200 → violation. If it were allowed, it would write into B’s area at 350.
On a violation the hardware raises an interrupt and the OS terminates the process (“access violation / segmentation fault”).
A: base=100, limit=200
B: base=300, limit=150
for each access (process, address)
if address < limit then
physical = base + address
otherwise
violation → interrupt, process terminated
accesses: A 150, A 199, B 120,
B 150, A 250Output Question · Memory Management
Question 13: Making Room with Swapping
RAM is 1024 KB. The OS occupies 0–128, Process A 128–448, Process B 448–704; the rest is free. B is waiting. A new process C wants 400 KB. (a) Can C be loaded immediately? (b) After swapping, what are C’s base and limit and the remaining free space?
Show answer
(a) No: the contiguous free space is 1024 − 704 = 320 KB < 400 KB.
(b) The waiting B is written to disk (swap out); 576 KB between 448 and 1024 is freed. C: base = 448, limit = 400 → 448–848. Remaining free: 176 KB.
When B is about to run again, it is brought back into RAM (swap in). Disk is much slower than RAM.
Multiple Choice · Memory Management
Question 14: What Virtual Memory Brings
Which of the following is true about virtual memory and paging?
A: The page table records which frame each virtual page is in; a rarely used page can be moved to disk. Each process has its own table (C is wrong). A page fault is usually normal: the OS loads the page from disk and the instruction runs again (D is wrong).
Multiple Choice · Memory Management
Question 15: When RAM Is Full
A new application is opened while RAM is completely full. What does the operating system do, and what is the cost?
A: Virtual memory increases capacity but at a speed cost: RAM ~50–100 ns, SSD ~0.1 ms. With too much swapping the computer slows down noticeably or freezes. This is why insufficient RAM causes slowness even when storage is free.
Step-by-Step Trace · Memory Management
Question 16: Translating a Virtual Address
The page size is 4096 bytes. Process A’s page table: 0 → frame 4, 1 → 5, 2 → on disk, 3 → 1. Frame 3 is free. Virtual addresses 12300 and then 9000 are read.
12300 = 3 × 4096 + 12 (3 × 4096 = 12288).
Table: page 3 → frame 1 (in RAM).
Physical = 1 × 4096 + 12 = 4108. The offset is preserved as is.
9000 = 2 × 4096 + 808 (2 × 4096 = 8192).
Page 2 is not in RAM → page fault.
The OS loads the page from disk into free frame 3 and updates the table; the instruction runs again.
Physical = 3 × 4096 + 808 = 13096.
page = address div 4096 offset = address mod 4096 frame = pageTable[page] if page is not in RAM page fault: OS loads the page from disk into a free frame, updates the table physical = frame * 4096 + offset
Output Question · File System
Question 17: Which File System Fits?
These files will be copied to a USB stick: a 200 MB presentation, a 3 GB film, a 5 GB video. Which can be copied if the stick is formatted with (a) FAT32, (b) exFAT? Which should be chosen if the stick will be written on both Windows and macOS?
Show answer
| file | FAT32 | exFAT |
|---|---|---|
| 200 MB | ✓ | ✓ |
| 3 GB | ✓ | ✓ |
| 5 GB | ✗ | ✓ |
- On FAT32 a single file can be at most 4 GB; the limit is on the size of a single file, not the total size.
- Choice: exFAT. macOS can only read NTFS.
- Formatting erases the contents: take a backup first.
Step-by-Step Trace · File System
Question 18: The cd and pwd Commands
In Linux the current folder is /home/ali. The tree: /home/ali/{documents, pictures}, /home/ayse/{notes.txt, book.pdf}, /tmp. What is the output of the commands?
pwd prints the absolute path of the current folder.
Relative path: goes down into documents inside the current folder.
“..” is the parent folder (ali), then pictures.
Two levels up: pictures → ali → home; then ayse.
ls lists the folder contents (dir in Windows cmd).
Parent folder: /home.
pwd → /home
A path starting with “/” is absolute: it starts from the root wherever you are.
pwd → /tmp
$ pwd $ cd documents $ cd ../pictures $ cd ../../ayse $ ls $ cd .. $ pwd $ cd /tmp $ pwd
Output Question · File System
Question 19: The chmod Numbers
r = 4, w = 2, x = 1 are added; the order is owner · group · others.
(a) What are the permissions after chmod 754 script.sh?
(b) After chmod 640 notes.txt?
(c) Which number gives the permission rwxr-x---?
Show answer
(a) rwxr-xr-- · (b) rw-r----- · (c) 750
- (a) 7 = rwx (owner everything), 5 = r-x (group reads, executes), 4 = r-- (others read only).
- (b) 6 = rw-, 4 = r--, 0 = --- (others nothing).
- (c) rwx = 7, r-x = 5, --- = 0.
Multiple Choice · Security and Types
Question 20: Authentication or Authorization?
A user with a standard account signs in with a password and can open their own documents, but is blocked when trying to change the system clock. At which stage is the block?
C: Authentication (“Who?”) succeeded; the user is signed in. Authorization (“What can they do?”) does not allow a standard account to make system-wide changes: the principle of least privilege. It is also written to the event log.
Multiple Choice · Security and Types
Question 21: Is Open Source Free?
Which of the following statements about open-source software is true?
C: The license determines rights and obligations; “open source” does not automatically mean free or unsupported. With commercial software too, you do not buy the software; you mostly buy a usage license (B is wrong). Not every freely distributed program is open source either; open-source licenses such as GPL and MIT also have conditions to be followed.
Multiple Choice · Security and Types
Question 22: Virtual Machine or Container?
A test environment needing both Windows and Linux will be set up on a server running Linux. Which should be chosen?
A: Containers share the host system’s kernel; software that needs a Windows kernel does not run on a Linux kernel. A virtual machine carries a full guest operating system on a hypervisor: strong isolation in exchange for more memory and slower startup.