Solved Solutions.
operating system - Answer A fundamental system program whose job is to control all the
computer's resources and provide a base upon which application programs can be written.
The operating system acts as a ... and a ... . - Answer The operating system acts as a *virtual
machine* and a *resource manager*.
virtual machine - Answer A layer of software, that operates on top of the bare hardware, that
manages all parts of the system. This extended abstract machine presents the user with an
interface that is easier to understand and program.
From a user's perspective, what is the benefit of a virtual machine? - Answer 1. Virtualization
(you can see it, but it isn't there)
2. Transparency (it's there, but you can't see it)
resource manager - Answer Software with the primary task to keep track of who is using which
resource, grant resource requests, account for usage, and mediate conflicting requests from
different programs and users.
Resources are managed in which two domains? - Answer Time and Space
Resource Time Multiplexing - Answer The logic behind sharing access to a resource for
durations of time. Each request takes turns accessing the resource.
Resource Space Multiplexing - Answer The logic behind sharing portions of a resource. Each
request should get a fair share of the resource.
The operating system is (usually) the portion of the software that runs in ... mode or ... mode. -
Answer The operating system is (usually) the portion of the software that runs in *kernel
mode* or *supervisor mode*.
Compilers and editors run in ... mode. - Answer Compilers and editors run in *user mode*.
,How is the operating system protected from accidents and malice? - Answer The operating
system is protected from user tampering by the hardware (e.g. privileged instructions, paging).
How is an operating system defined from the users' point of view? - Answer An operating
system is defined by its *system calls*.
system call - Answer The means by which the kernel provides access to a particular operating
system service. The services available through system calls (e.g. reading and writing the disk,
allocating memory, starting new processes, etc.) are reserved to the kernel.
How does a user's system call return control to the kernel? - Answer The user's system call
triggers a software generated interrupt (trap) which is handled by the kernel.
What happens when a system call is executed? - Answer 1. Save the state of the executing
program.
2. Elevate processor privilege level to "supervisor".
3. Transfer control to a pre-registered routine.
4. OS does something (system call).
5. Restore privilege level to user.
6. Restore original state of executing program.
Minix vs. Linux - Answer Minix designed for readability, modularity, message passing, and
extensibility.
Linux designed for efficiency and "production" system.
What were the two new inventions with operation systems? - Answer Multiprogramming and
Timesharing
multiprogramming - Answer When a process pauses to wait for something (such as I/O),
another job that is currently in memory can run.
timesharing - Answer A variant of multiprogramming, in which each user has an online
terminal (computing as a service).
,UNIX - Answer ∙ Developed by Ken Thompson, a computer scientist at Bell Labs.
∙ Released as open source.
POSIX - Answer A standard for UNIX developed by IEEE that made it possible to write
programs which could run on any UNIX system.
MINIX - Answer (Mini-UNIX)
Released in 1987 as open source for studying and modification because UNIX version 7 could no
longer be studied.
process - Answer A program in execution.
daemon - Answer A process that works in the background to handle some activity.
The Process Model: Users' View: Definition - Answer Each running program becomes a
process, isolated from all other processes.
The Process Model: Users' View: Isolation - Answer Each process has the illusion of being
alone:
∙ Each process has its own memory.
∙ Each process has its own scheduling time.
∙ Each process has its own interface to the outside word (file descriptors).
∙ All interprocess (and outside world) interaction takes place through *the operating system*.
The Process Model: Users' View: Identity - Answer Each process has an identity:
∙ User ID
∙ Group ID
∙ Process ID
The Process Model: Users' View: Resources - Answer Each process has resources:
∙ memory (address space)
∙ time (execution time)
, The Process Model: OS View: Definition - Answer Each running program has a context.
The Process Model: OS View: Process Control Blocks - Answer Each process has an entry in the
process table:
∙ Process' State (Running, Ready, Blocked)
∙ Memory (Registers and Address space)
∙ Identity
∙ File Descriptors
∙ Signals and Masks (signal handlers)
How does the operating system keep track of process records? - Answer Records are kept in a
*process table*.
process table - Answer An array (or linked list) of structures, one for each process currently in
existence, that holds the information about that process.
file descriptor - Answer A small integer returned by the system when requesting access to a
file. If access is prohibited, an error code (-1) is returned.
Context Switch: Definition - Answer The act of changing the execution context from one
process to another.
Context Switch: Steps - Answer 1. Old process suspended.
2. Old process's registers saved.
3. Old process's memory (text, stack, data) saved in a core image.
4. Memory set up for new process.
5. Registers set up for new process.
4. New process "continued" as if nothing had happened.
Context Switch: Example - Answer 1. Process A is running.
2. Interrupt occurs (possibly a timer?).
3. Interrupt frame added to stack.
4. Control transfered to interrupt handler.