Phase 0
Phase 0 Checkpoint: 15 questions on computer basics, modes and system calls.
15 questions · 20 marks · 40 minutes. Negative marking on MCQ only: −1/3 mark for a wrong 1-mark MCQ, −2/3 for a wrong 2-mark MCQ. No negative marking for MSQ or NAT; MSQ has no partial credit.
Q1 · NAT · 1 mark(s) — Powers of two
How many bytes are in 2 MB?
Numerical answer: ________
Q2 · NAT · 1 mark(s) — Address bits
A byte-addressable memory has 2²⁴ bytes. How many address bits?
Numerical answer: ________
Q3 · NAT · 2 mark(s) — Blocks
A 16 GB disk is divided into 4 KB blocks. How many blocks (as a power of two, give the exponent)?
Numerical answer: ________
Q4 · MCQ · 1 mark(s) — Volatile
Which loses its contents when power is switched off?
- (A) USB flash drive
- (B) Hard disk
- (C) SSD
- (D) RAM
Q5 · MCQ · 1 mark(s) — OS role
Which is NOT a job of the operating system?
- (A) Protecting processes from each other
- (B) Managing files on disk
- (C) Compiling your C program
- (D) Sharing the CPU among processes
Q6 · MSQ · 2 mark(s) — Privileged
Which instructions must be privileged?
- (A) Read a general-purpose register
- (B) Set the timer
- (C) Change the page-table base register
- (D) Enable or disable interrupts
Q7 · MCQ · 1 mark(s) — Interrupt vs trap
A disk finishing a read operation signals the CPU with:
- (A) an interrupt
- (B) a trap
- (C) a system call
- (D) a privileged instruction
Q8 · MCQ · 1 mark(s) — Multiprogramming
The degree of multiprogramming is:
- (A) the number of CPUs
- (B) the time-slice length
- (C) the number of users
- (D) the number of processes in memory at once
Q9 · MCQ · 1 mark(s) — Real-time
An airbag controller that must react within 10 ms needs a:
- (A) hard real-time OS
- (B) time-sharing OS
- (C) microkernel only
- (D) batch OS
Q10 · NAT · 1 mark(s) — Mode switches
A program makes 12 system calls. How many user-to-kernel switches do they cause?
Numerical answer: ________
Q11 · MCQ · 1 mark(s) — System call
Which is a system call in UNIX?
- (A) printf
- (B) strcpy
- (C) fork
- (D) atoi
Q12 · MCQ · 2 mark(s) — Steps
During a system call, the kernel finds which routine to run by:
- (A) asking the user
- (B) indexing the system-call table with the system-call number
- (C) reading the disk
- (D) scanning the program's source code
Q13 · MSQ · 2 mark(s) — Parameters
How can a program pass parameters to a system call?
- (A) In CPU registers
- (B) In a memory block whose address is in a register
- (C) On the stack
- (D) By writing directly into kernel memory
Q14 · MCQ · 1 mark(s) — Kernel design
Linux is usually described as a:
- (A) microkernel
- (B) real-time-only system
- (C) monolithic kernel
- (D) batch system
Q15 · NAT · 2 mark(s) — Arithmetic
A 32-bit address space is split into pages of 4 KB. How many pages?
Numerical answer: ________
✓Answer Vault
Try the questions first. Open when you are ready to check.
🔐 Open the Answer Vault
Q1 Answer: 2097152 · 1 mark(s)
2 × 2²⁰.
Re-read: Lesson 0.1.1 — Inside a computer: CPU, memory, disk, I/O; bits, bytes and powers of two
Q2 Answer: 24 · 1 mark(s)
n bits ↔ 2ⁿ bytes.
Re-read: Lesson 0.1.1 — Inside a computer: CPU, memory, disk, I/O; bits, bytes and powers of two
Q3 Answer: 22 · 2 mark(s)
2³⁴/2¹² = 2²².
Re-read: Lesson 0.1.1 — Inside a computer: CPU, memory, disk, I/O; bits, bytes and powers of two
Q4 Answer: (D) · 1 mark(s)
Main memory is volatile.
- (A) is wrong: Non-volatile.
- (B) is wrong: Non-volatile.
- (C) is wrong: Non-volatile.
Re-read: Lesson 0.1.1 — Inside a computer: CPU, memory, disk, I/O; bits, bytes and powers of two
Q5 Answer: (C) · 1 mark(s)
That is the compiler's job.
- (A) is wrong: Protection.
- (B) is wrong: File management.
- (D) is wrong: Resource management.
Re-read: Lesson 0.1.2 — What an operating system does: kernel, user mode and kernel mode, interrupts
Q6 Answer: (B) (C) (D) · 2 mark(s)
Reading a register is harmless.
- (A) is wrong: Not privileged.
Re-read: Lesson 0.1.2 — What an operating system does: kernel, user mode and kernel mode, interrupts
Q7 Answer: (A) · 1 mark(s)
Device-generated.
- (B) is wrong: Traps come from the running program.
- (C) is wrong: The program did not request it at that moment.
- (D) is wrong: Privileged instructions are run by the kernel; they are not signals from devices.
Re-read: Lesson 0.1.2 — What an operating system does: kernel, user mode and kernel mode, interrupts
Q8 Answer: (D) · 1 mark(s)
Definition.
- (A) is wrong: That is multiprocessing.
- (B) is wrong: A scheduling parameter.
- (C) is wrong: Not the definition.
Re-read: Lesson 0.1.2 — What an operating system does: kernel, user mode and kernel mode, interrupts
Q9 Answer: (A) · 1 mark(s)
Missing the deadline is a failure.
- (B) is wrong: Fair, not deadline-driven.
- (C) is wrong: A structure, not a guarantee.
- (D) is wrong: No deadlines.
Re-read: Lesson 0.1.2 — What an operating system does: kernel, user mode and kernel mode, interrupts
Q10 Answer: 12 · 1 mark(s)
One per call (plus one switch back each).
Re-read: Lesson 0.1.3 — System calls: how programs ask the operating system for help
Q11 Answer: (C) · 1 mark(s)
Creates a process in the kernel.
- (A) is wrong: Library.
- (B) is wrong: Library.
- (D) is wrong: Library.
Re-read: Lesson 0.1.3 — System calls: how programs ask the operating system for help
Q12 Answer: (B) · 2 mark(s)
The number selects the handler.
- (A) is wrong: Unrelated.
- (C) is wrong: Unrelated.
- (D) is wrong: The kernel never sees source code.
Re-read: Lesson 0.1.3 — System calls: how programs ask the operating system for help
Q13 Answer: (A) (B) (C) · 2 mark(s)
User programs cannot write kernel memory.
- (D) is wrong: Blocked by protection.
Re-read: Lesson 0.1.3 — System calls: how programs ask the operating system for help
Q14 Answer: (C) · 1 mark(s)
Most services run inside the kernel.
- (A) is wrong: Linux is not a microkernel.
- (B) is wrong: General-purpose.
- (D) is wrong: It is interactive.
Re-read: Lesson 0.1.3 — System calls: how programs ask the operating system for help
Q15 Answer: 1048576 · 2 mark(s)
2³²/2¹² = 2²⁰.
Re-read: Lesson 0.1.1 — Inside a computer: CPU, memory, disk, I/O; bits, bytes and powers of two