0% found this document useful (0 votes)
19 views2 pages

hw1 Reference

The document contains homework assignments on operating system topics including the roles of an OS, interrupts, storage systems ranking, batch system problems, application programming interfaces, microkernel advantages and disadvantages, layered architecture concerns, virtual machines performance, and process states.

Uploaded by

viere1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views2 pages

hw1 Reference

The document contains homework assignments on operating system topics including the roles of an OS, interrupts, storage systems ranking, batch system problems, application programming interfaces, microkernel advantages and disadvantages, layered architecture concerns, virtual machines performance, and process states.

Uploaded by

viere1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Operating Systems 2024

U3680
National Taipei University

Homework Assignments 1 [Chapter 1 / Chapter 2 / Chapter 3 (partial) ]

1. What are the two goals (roles) of an OS? (10%)

• Control the executions of user programs and operations of I/O devices to prevent errors and
improper use of the computer (Control, 5%)
• Manage and allocate resources to ensure efficiency and fairness (Coordinate, 5%)

2. Describe why modern computers need interrupts to communicate with devices. (10%)
Most devices are slow compared to the CPU (2%). Interrupts provide an event-driven way to
change the control flow in the CPU, so it doesn’t have to be busy waiting. (8%)

3. Rank the following storage systems from slowest to fastest: (10%)

(a) Hard-disk drives


(b) Main memory
(c) Registers
(d) Magnetic tapes
(e) Nonvolatile memory
(f) Cache
(g) Optical disk

d → g → a → e → b → f → c (10%)

4. Describe the two problems of batch systems. How do later computer systems address these two
problems? (10%)

• Batch systems can only do one job at a time. Thus, the CPU is often idle (2%). Multi-
programming addresses this issue by putting multiple programs in memory. OS can organize
the jobs so that the CPU always has one job to execute (3%).
• No interaction between users and jobs (2%). Time-sharing addresses this problem by dividing
CPU resources into time slots. CPU can switch jobs frequently so that users can interact
with each job while running (3%).

5. Describe why application programming interface (API) can improve portability. (10%)
Different OSes share the same programming interface despite the underlying implementation or
hardware being different. For this reason, when a program needs to be run on a different OS, it
just needs re-compiling, not re-writing. (10%)

6. What are the advantages and disadvantages of the micro-kernel approach for the OS design?
(10%)
Operating Systems 2024 Homework Assignments 2

• Advantages: safer, less possible to crash (3%), modulation (2%), easy to extend, easier for
porting (2%)
• Disadvantage: slow (3%)

7. What are the two major concerns of a layered architecture for the OS design? (10%)

• Less efficient (5%)


• Difficult to define layers (5%)

8. Why running a program in a virtual machine is usually slower than in the original OS? (10%)
A virtual machine is less efficient because running privileged instructions requires two interrupts:
one on the virtual OS (fail) and another on the main OS (success). (10%)

9. Draw the process state diagram (10%) and briefly describe the meaning of each state. (10%)

• New: the process is being created (2%)


• Ready: the process is in the memory waiting to be assigned to a processor (2%)
• Running: the process whose instructions are being executed by the CPU (2%)
• Waiting: the process is waiting for events to occur (2%)
• Terminated: the process has finished execution (2%)

Fig. 1: Process state diagram (10%)

Operating Systems 2024 Homework Assignments

You might also like