What an Operating System Is: Privilege and System Calls · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.

The kernel doorway every program must use

Computing · Computer Systems · ages 19-20
Name ______________________   Date ____________
  1. Which action is privileged, for the kernel only?

    • Printing a document
    • Changing the clock
    • Opening a text file
  2. Your app wants to save a file. What must it do?

    • Ask the operating system
    • Wait until no other app runs
    • Drive the disk motor itself
  3. A library call and a system call cost about the same.

    Circle one:   True   False

  4. Why does the kernel refuse to let programs touch devices directly?

    • It could grab or corrupt the device
    • Devices run faster without programs
    • To keep its own source secret
  5. Order the steps of reading a file.

    • Trap first, then decide what to ask
    • Fetch from disk, then ask the kernel
    • Ask, trap, fetch, return
  6. A student says creating a user folder needs kernel privilege like changing the clock. What is wrong?

    • Both actions are equally privileged
    • Only the clock change is privileged
    • Neither action involves the kernel
  7. A new laptop has bare hardware. What do you install before office tools, and why?

    • The OS, to manage the machine
    • A compiler, to build the OS later
    • Office tools, to test the screen
  8. A program ships secret data to the disk by driving it directly and corrupts a neighbor. Which rule broke?

    • The disk spun too slowly
    • The neighbor read too eagerly
    • It skipped the kernel doorway
LightMySky · lightmysky.comW1-mt_0kMavEKxpX-s1

Answer key

For grown-ups. Fold this page away before handing over the rest.

The kernel doorway every program must use W1-mt_0kMavEKxpX-s1

  1. Changing the clock · The clock is shared by all programs, so only the trusted kernel may change it.
  2. Ask the operating system · Apps never touch hardware directly; the manager does it for them.
  3. False · A library call is a plain jump, while a system call traps into the kernel and back.
  4. It could grab or corrupt the device · Shared hardware needs a guard, or one program can spoil it for all.
  5. Ask, trap, fetch, return · The program asks, traps in, the kernel works, and the answer returns.
  6. Only the clock change is privileged · Only the shared clock change is privileged; the folder request is ordinary.
  7. The OS, to manage the machine · Nothing else can run until a manager owns the hardware and hands out parts.
  8. It skipped the kernel doorway · All hardware contact must pass the kernel, which checks and orders each request.
Worksheet · LightMySky