THINK FIRST·CODE LATER

← Operating Systems
Chapter 2 · Week 2

Hardware Support, System Calls and OS Architecture

Answered 0/30 Correct 0
Sign in to save progress across devices
Q1

On a 64-bit Linux system, which system call sends a signal to a process?

Q2

A program divides by zero. What kind of event transfers control to the OS?

Q3

What is the role of the interrupt vector table?

Q4

While the disk interrupt handler runs, a higher-priority timer interrupt arrives. In a system with nested interrupts, what happens?

Q5

A 1 GHz CPU polls a device 1,000,000 times per second, and each poll costs 400 cycles. What fraction of the CPU does polling use?

Q6

For the same 4 MB/s device, the system switches to DMA with one interrupt per 4,096-byte block, costing 1,500 cycles per block (setup + interrupt). About how much CPU does it use on a 1 GHz CPU?

Q7

Why can interrupt-driven I/O be worse than polling for a very fast device?

Q8

Which component knows the registers and protocol of a specific network card and offers a uniform interface to the rest of the kernel?

Q9

Which instruction must be privileged (allowed only in kernel mode)?

Q10

A user program executes an instruction that disables interrupts. What happens?

Q11

A process has base register 30000 and limit register 12000. Which address causes a protection exception?

Q12

Why does the OS set a timer before giving the CPU to a user program?

Q13

Timer interrupts occur 1,000 times per second and each costs 2 µs. What fraction of CPU time do they consume?

Q14

In what order do these steps of a Linux system call happen? (1) kernel looks up the number in the system-call table; (2) library places the call number and arguments in registers; (3) syscall instruction traps into kernel mode; (4) result returned and CPU back in user mode.

Q15

Which Linux system call creates a new process that is a copy of the caller?

Q16

A program writes 1,000,000 bytes one byte per write call. Assuming 1 µs per system call plus 1 ns per byte, about how long does it take? And with a 4,096-byte buffer?

Q17

Why does the kernel check the arguments of every system call (for example, that a buffer pointer really lies in the caller's memory)?

Q18

What is the correct boot order on a modern PC?

Q19

In which architecture do device drivers and file systems run as user-mode servers that communicate by message passing?

Q20

What is the main disadvantage of a monolithic kernel such as Linux?

Q21

Which OS family is commonly described as a hybrid kernel?

Q22

A car maker needs an OS for a brake-control unit where a crashed component must never take down the whole system and deadlines are strict. Which choice is most appropriate?

Q23

What does strace -c ls show?

Q24

How does a user program legally switch the CPU from user mode to kernel mode?

Q25

Why does openat usually return file descriptor 3 for the first file a program opens?

Q26

What is a unikernel?

Q27 Short answer

A 2 GHz CPU handles a network card that receives 50,000 packets per second. Compare the CPU cost of (a) one interrupt per packet at 2,000 cycles each and (b) "interrupt coalescing" — one interrupt per 32 packets at 4,000 cycles each. Show the computation and explain the trade-off.

Q28 Short answer

Describe, step by step, what happens from the moment a Java program calls System.out.println("hi") until the text reaches the terminal, naming the modes, the trap and the kernel's checks.

Q29 Short answer

Choose an OS architecture for each EdgeCampus device and justify: (a) the building's GPU edge server running containers; (b) the electronic door-lock controller of the lab; (c) a tiny battery-powered air-quality sensor.

Q30 Short answer

Explain why an operating system cannot provide protection without hardware support. Give three hardware mechanisms and what each prevents.