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

hw1 Soln Ps

This document contains homework assignments from an operating systems course. The assignments cover differences between mainframe and PC operating systems, privileged instructions, the purpose of system programs, considerations for concurrent processing, and context switching among threads and processes.

Uploaded by

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

hw1 Soln Ps

This document contains homework assignments from an operating systems course. The assignments cover differences between mainframe and PC operating systems, privileged instructions, the purpose of system programs, considerations for concurrent processing, and context switching among threads and processes.

Uploaded by

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

CS 4/53201 Homework #1 Operating Systems

Due in class on Monday 22 September 1997

1. (Exercise 1.6 from OSC) What are the main differences between operating systems
for mainframe computers and personal computers?
Mainframe operating systems are concerned with fair and efficient usage of system resources
(CPU, memory, disk, I/O) for multiple users and processes. They need mechanisms for
multiple users, multi-tasking, and dual-mode operation, and they need elaborate security
mechanisms, file systems, and memory management.
Personal computer operating systems are generally simpler and support only a single user and
no multi-tasking. They generally have less elaborate security mechanisms, file systems, and
memory management.

2. (Exercise 2.6 from OSC) Which of the following instructions should be privileged:
(a) set value of timer, (b) read the clock, (c) clear memory, (d) turn off interrupts,
(e) switch from user to monitor mode? Also, justify your answer!
(a) set value of timer — should be privileged, because multiple users setting the timer would be
chaotic, and processes could even give themselves more time to run by resetting the time
slice timer
(b) read the clock — should not be privileged, because any user should be able to check the
time
(c) clear memory — should be privileged, because otherwise a process could disrupt every
running process, including the operating system
(d) turn off interrupts — should be privileged, because otherwise a process might be able to
keep the CPU forever, or disrupt other process’s I/O
(e) switch from user to monitor mode — should be privileged, because otherwise a process
might be able to keep the CPU forever

3. (Exercise 3.8 from OSC) What is the purpose of system programs?


System programs provide basic functionality to users so that they do not need to write their
own environment for program development (editors, compilers) and program execution
(shells). In some sense, they are bundles of useful system calls.
(Note that simply quoting the one sentence “System programs provide a more convenient
environment for program development and execution.” from the book is not a sufficient answer
for a senior / graduate level course. I expect you to interpret the book and show me you
understand what it’s saying, not just repeat the book’s text word-for-word.)

4. (Exercise 4.1 from OSC) Several popular microcomputer operating systems provide
little or no means of concurrent processing. Discuss the major considerations that
concurrent processing adds to an operating system.

1
The operating system must provide a mechanism for dynamic process creation and termination.
It must also support CPU scheduling (perhaps round-robin scheduling, maybe preemption of
processes that refuse to give up the CPU) and context switching.
It must provide mechanisms for inter-process communication, so that processes can cooperate
with each other. However, user and operating system processes must be protected from each
other; they should not be able to interfere with each other’s memory, I/O operations, or files.

5. (Exercise 4.6 from OSC) Describe the actions taken by a kernel to context switch
(a) among threads, and (b) among processes.
(a) among threads — the thread context (registers, PC, SP, accounting information) must be
saved and restored
(b) among processes — same as (a), plus the memory context (program code, data, memory
locations in use, etc.), information about operating system resources in use (open files,
ongoing I/O, etc.), and more accounting information must be saved and restored

You might also like