Section 1

Preview this deck

What is a Disk Driver?

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (219)

Section 1

(50 cards)

What is a Disk Driver?

Front

deals with the hardware and provides and interface to read and write disk blocks

Back

How did Vacuum Tube computers exist without an OS?

Front

- One user at a time. - Any operating-system-like functionality that was needed was part of the user's program.

Back

What is an important distinction between the Kernel and all the layers of abstraction above it?

Front

the kernel runs in privileged mode (a.k.a supervisor mode or kernel mode)

Back

Why must the Kernel manage the resources?

Front

- to handle contention - resolve conflicts between users

Back

What does resources being shared or multiplexed among the users TAKE THE FORM OF?

Front

Time-multiplexing Space-multiplexing

Back

What is Machine INdependent in the Kernel Layers?

Front

- files and filesystems. - I/O

Back

how many milliseconds in one second

Front

1000

Back

What are the 2 different modes of operation a Computer uses?

Front

- User mode - Supervisor Mode

Back

How did Transistors and Batch Systems manages resources?

Front

Many jobs were batched together, but the systems were still uniprogrammed,

Back

What is a prime example of a user program not being able to do things in privileged mode ?

Front

user programs cannot directly execute I/O instructions but they can (and do) ask the OS to perform I/O

Back

How is physically memory organized in Multiprogramming with a Fixed number of Tasks?

Front

- Physical memory is partitioned at boot time - the size of each partition cannot be changed until the system reboots.

Back

What is the main difficulty of multiprogramming AND of making operating systems reliable

Front

concurrent activities can interact in a time-dependent manner, which makes it practically impossibly to locate programming errors by systematic testing.

Back

How is the Kernel Layered?

Front

1. files and filesystems. 2. I/O 3. device drivers.

Back

How are layers of abstraction virtual machines?

Front

each layer is written as though it runs on the virtual machine supplied by the lower layers and in turn provides a more abstract (pleasant) virtual machine for the higher layers to run on.

Back

How is an OS Fundamentally Different from (say) a Compiler?

Front

Concurrency!

Back

How is software often abstracted?

Front

in layers.

Back

What issues come with resource sharing?

Front

- protection, - privacy, - fairness, etc.

Back

What are ICs?

Front

Integrated Circuits

Back

what are microseconds?

Front

millionth of a second 1000th of a millisecond

Back

What were the 2nd generation of Computers after Vacuum Tubes (and no OS)

Front

Transistors and Batch Systems

Back

How does the the OS raise the abstraction level?

Front

by providing a higher level virtual machine

Back

Since multiple jobs are in memory at the same time as other jobs, what must be done?

Front

One job's memory must be protected from the other jobs.

Back

What are the Multiple type of Batch Streams?

Front

Multiprogramming with a ---------------------------- - Fixed number of Tasks - Variable number of Tasks

Back

What is Time-Multiplexing?

Front

where the users take turns using entire resource

Back

How did Transistors and Batch Systems change from Vacuum Tubes?

Front

the OS was not reloaded for each job and hence needed to be protected from the user's execution

Back

is the concept of a file present in software?

Front

no

Back

What were the 1st generation of Computers?

Front

Vacuum Tubes (and no OS)

Back

What is uniprogrammed?

Front

a job once started was run to completion without interruption and then flushed from the system.

Back

How does the OS manage resources besides explicitly giving access to one user?

Front

Often the resource is shared or multiplexed among the users

Back

What is The purpose of multiprogramming?

Front

to overlap CPU and I/O activity and thus greatly improve CPU utilization.

Back

What does he mean when he says Users?

Front

- (user-mode) processes running on behalf of human users. NOT referring directly to humans

Back

How does the kernel itself raises the level of abstraction and hides details?

Front

the kernel can write() to a file and can do so without knowing whether the file resides on a solid-state-disk (SSD), an internal SCSI disk, or an external server in Europe. The user can also ignore issues such as whether the file is stored contiguously or is broken into blocks.

Back

How do the layers of software abstraction interact with each other?

Front

The higher layers use the facilities provided by lower layers. the upper layers are written using a more powerful and more abstract virtual machine than the lower layers.

Back

very briefly what is multiprogramming?

Front

- many processes executing concurrently - OS fielding requests whose arrival order is non-deterministic

Back

what are nanoseconds?

Front

one billionth of a second.

Back

What is Spacing-Multiplexing?

Front

where each user that needs a resource gets a part of the resource

Back

What are the I/O Devices in the Computer?

Front

peripherals as keyboards, mice, - disk drives, printers, USB devices, - network adapters, and display devices

Back

What is a "job"

Front

a program or set of programs

Back

What is a ______ Driver?

Front

deals with the hardware and provides and interface to interact with the __________

Back

What are the two main functions of an operating system?

Front

be an Extended (virtual) Machine be an Resource Manager

Back

What were the 3rd generation of Computers after Transistors and Batch Systems

Front

ICs and Multiprogramming

Back

What are the layers of abstraction for a Computer?

Front

- Applications and utilities - User interface (UI). Shell and GUI - Libraries - The OS proper (the kernel). - Hardware.

Back

What does Supervisor mode do?

Front

It enables the OS to execute all possible instructions.

Back

What is Machine dependent in the Kernel Layers?

Front

device drivers.

Back

What are the different things that only a kernel can access?

Front

processors (CPUs) -memories (RAM) -I/O devices

Back

What are batches of jobs assigned to and how are they programmed in Multiprogramming with a Fixed number of Tasks?

Front

to a each partition of physical memory this batch is UNIprogrammed

Back

what are examples of Utilities

Front

(e.g., compiler, linker).

Back

What was the batch system?

Front

The batches of user jobs were prepared offline (cards to magnetic tape) using a separate computer. The tape was brought to the main computer where the output to be printed was written on another tape. This tape went back to the service machine and was printed.

Back

With multiprogramming why did OS's become notoriously hard to get right?

Front

due to the inability to test a significant percentage of the possible interactions and the inability to reproduce bugs on request.

Back

How is the I/O layer Machine Independent?

Front

is written assuming "virtual (i.e. idealized) hardware" EX. the machine independent I/O portion can access a certain byte in a given file - In reality, I/O devices, e.g., disks, have no support or knowledge of files; these devices support only block. Lower levels of the software implement files in terms of blocks.

Back

Section 2

(50 cards)

How did multiprogramming affect the offline preparation of job batches? as done in the second generation

Front

it was no longer needed.

Back

How are SSD's Unlike a Disk?

Front

it has no moving parts (and hence is much faster)

Back

A key point about ROM is...

Front

ROM is non-volatile. As a result, when a computer is turned on the first instructions to be executed are from ROM.

Back

How does Each job get just the amount of memory it needs? in Multiprogramming with a Variable number of Tasks

Front

the partitioning of memory changes as jobs enter and leave. - the memory used by a job can grow and shrink dynamically while the program is running

Back

When a bus sends a message which devices receive it and why?

Front

Back

What are Solid State Disks (SSDs)

Front

This is flash RAM organized in sector-like blocks as is a disk.

Back

What does ROM stand for?

Front

Read Only Memory

Back

How is memory organized? in Multiprogramming with a Variable number of Tasks

Front

Each job gets just the amount of memory it needs.

Back

A key point about RAM is...

Front

it's volatile, i.e. the memory loses its data if power is turned off. Hence when power is turned back on, the RAM contains junk.

Back

The central memory in a system is called

Front

RAM (Random Access Memory)

Back

What is a Virtual Address?

Front

the address as written in the program

Back

How was submitting a card deck by the user affected by multiprogramming (Spooling)?

Front

it could be read directly into an on-disk queue on the main computer. Then when the system is ready to run another job, it is already there.

Back

What questions arise with varying size partitions? in Multiprogramming with a Variable number of Tasks

Front

-compaction -holes -fragmentation arise

Back

HW 2.2 Why was time-sharing not widespread in 2nd Gen Computers?

Front

because in order to switch between jobs you would need to output the current job to be used later, load another program and repeat this process each time you switch which is unnecessarily resource consuming

Back

What were the 4th generation of Computers after ICs and Multiprogramming

Front

Personal Computers

Back

HW 2.4 Do you think that advanced personal computers will have spooling as a standard feature in the future?

Front

YES because as the computer gets more advanced and the OS larger, there will be an enormous amount of more jobs to be processed by the CPU and so there will be a lot that cannot be processed through multiprogramming and so many will need to wait in a queue until it can be loaded and processed.

Back

What is Scheduling?

Front

Deciding when to switch and to which process to switch for Time-Sharing

Back

HW 2.1 What is Multiprogramming?

Front

Multiprogramming is the act of Physical memory being partitioned into several sections with different jobs in each partition. So that the CPU doesn't simply have to wait while I/O tasks are being completed and can work on another job waiting in another partition.

Back

All the devices "receive" the message: There are no switches in between to steer the message to the desired destination, but often some of the wires form an address that indicates which devices should actually process the message.

Front

All the devices "receive" the message: There are no switches in between to steer the message to the desired destination, but often some of the wires form an address that indicates which devices should actually process the message.

Back

What is Time-Sharing?

Front

This is multiprogramming with rapid switching between jobs (processes)

Back

What is a downside of Time-sharing?

Front

slower rate than if run alone

Back

What is spooled? in Multiprogramming with a Fixed number of Tasks

Front

- Jobs were spooled from cards into the memory - similarly output was spooled from the memory to a printer

Back

what is EPROM and EEPROM?

Front

(Electronically) Erasable PROM, which is like a CD-RW

Back

what is ROM is used for?

Front

(low-level control) software that often comes with devices on general purpose computers, and for the entire software system on non-user-programmable devices It is also used for non- changing data.

Back

A bus is...

Front

a set of wires that connect two or more devices

Back

What is a trap the key mechanism for?

Front

implementing system calls in which a user program enters the operating system.

Back

multiprogramming requires that we protect what?

Front

one process from another. That is, we need to translate the virtual addresses into physical addresses such that, at any point in time, the physical address of each process are disjoint.

Back

What is PROM ?

Front

(Programmable ROM), which, like a CD-R, can be written once (as opposed to being mass produced already written like a CD-ROM),

Back

What is a Physical Address?

Front

the actual memory address in the compute

Back

How does Multiprogramming with a Variable number of Tasks compare to a Fixed number of tasks?

Front

MVT is a more efficient user of resources, but is more difficult to implement.

Back

What is a downside of Context Switching?

Front

the virtual-to-physical address translation must change, which can be an expensive operation.

Back

HW 2.5 On early computers, every byte of data read or written was handled by the CPU What implications does this have for multiprogramming?

Front

now I/O processes can be handled by hardware other than the CPU and that frees up the CPU to work on many other jobs while current jobs are being worked on by I/O processes. Thus Memory partitioning was incredibly useful to have so that other jobs didn't need to be loaded every time a CPU switched jobs.

Back

What is Spooling

Front

the ability to read jobs from cards onto the disk as soon as they were brought to the computer room. Then, whenever a running job finished, the operating system could load a new job from the disk into the now-empty partition and run it

Back

What were the 5th generation of Computers after Personal Computers

Front

Mobile Computers

Back

How was printing affected by multiprogramming (Spooling)?

Front

jobs would print to disk and later another task would really print these disk files onto paper.

Back

How many messages can be on the bus at a time

Front

Only one

Back

What is context switching?

Front

switching from one process to another,

Back

Why is Time-sharing needed?

Front

so that, to the user it appears that their job is always running So that individual users can efficiently spool their own printed output onto a remote terminal.

Back

Why was the offline preparation of job batches no longer needed with Multiprogramming (Spooling)?

Front

One job could be loading, another job could be printing, and a third computing, all on the same computer.

Back

How did Mobile Computers change from the other generations?

Front

Primarily hardware (and gui) changes.

Back

How are jobs that are in DIFFERENT partitions programmed? in Multiprogramming with a Fixed number of Tasks

Front

MULTIprogrammed.

Back

The hardware that performs the translation of virtual addresses into physical addresses is called...

Front

the MMU or Memory Management Unit.

Back

How is GUIs associated with the Layers of Abstraction of an OS?

Front

unclear. Windows GUI is built in to the kernel, MacOS and Linux GUIs are separate layers

Back

How are SSD's Unlike RAM?

Front

SSD is non volatile;

Back

What is a trap?

Front

an instruction that atomically switches the processor into privileged mode and jumps to a pre-defined physical address.

Back

How are jobs that are in DIFFERENT partitions MULTIprogrammed. in Multiprogramming with a Fixed number of Tasks?

Front

when a job residing in one partition starts a (slow) I/O, the CPU switches to executing the loaded job in another partition.

Back

How are jobs in Personal Computers programmed?

Front

ALL are multiprogrammed originally some were uniprogrammed

Back

What is incredibly import part of the advent of Personal Computers?

Front

GUIs

Back

How is each batch of jobs UNIprogrammed for each partition of physical memory? in Multiprogramming with a Fixed number of Tasks?

Front

the first job in the batch is loaded into the partition and begins to execute. The remainder of the batch waits for the first job to finish and which point the second job in the batch is loaded and runs.

Back

12. Which of the following instructions should be allowed only in kernel mode? a. Disable all interrupts. b. Read the time-of-day clock. c. Set the time-of-day clock. d. Change the memory map.

Front

a c d

Back

Section 3

(50 cards)

A process is

Front

program in execution

Back

What is the same and different with processes involved in fork().

Front

The parent and child are very, VERY nearly identical. For example they have the same instructions, they have the same data, and they are both currently executing the fork() system call. But there is a difference! The fork() system call returns a zero in the child process and returns a positive integer in the parent.

Back

The OS serves what two masters?

Front

The hardware (at the bottom) asynchronously sends interrupts and the user (at the top) synchronously invokes system calls and generates page faults.

Back

How does one Often one distinguishes the state or context of a process

Front

its address space (roughly its memory image), open files, etc.—from the thread of control

Back

Most systems supply at least what associated permissions for Files and directories

Front

rwx (readable, writable, executable).

Back

How does Busy Wait compare to the other methods for knowing when I/O is complete?

Front

This is the easiest method, but can have low performance.

Back

You can name a file via...

Front

an absolute path starting at the root directory (or in Windows A root directory) or via a relative path starting at the current working directory.

Back

WHAT ARE THE STEPS to transfer control from the caller, passing the value of parameters and second to transfer control back?

Front

1. push return address to stack 2. push variables 3. jump to function 4. pop parameters 5. execute function 6. put return value to register 7. return stack to original state 8. pop return address 9. jump to the instruction after the call

Back

What makes interrupts different from system calls and generates page faults ?

Front

at almost any point during execution, including execution of most of the OS, an interrupt can occur that will transfer control immediately to certain points in the operating system (e.g., to a disk driver or to the scheduler). This means that at (almost) any point during its execution, the OS must be prepared for an immediate transfer to a driver or the scheduler. Since the code being executed just prior to the interrupt might well be OS code and hence might be using variables shared with the drivers and the scheduler, writing the OS so that it is prepared for this immediate transfer is not easy.

Back

What does it mean if the OS busy waits?

Front

constantly asking the controller if the I/O is complete. It is also called polling or PIO (Programmed I/O).

Back

current operating systems permit each process to be given how much virtual memory?

Front

more (virtual) memory than the total amount of (real) memory on the machine.

Back

What is the (the signal handler).

Front

One process can send a signal to another process to cause the latter to execute a predefined function

Back

Unix also uses the file system namespace for what else?

Front

devices (called special files), which are typically found in the /dev directory. That is, in some ways you can treat the device as a file. In particular some utilities that are normally applied to (ordinary) files can be applied as well to some special files

Back

Question: Since the power was turned off, why doesn't the BIOS contain junk when the power is turned back on?

Front

Answer: RAM is volatile, but ROM is not.

Back

Before a file can be accessed, it is normally...

Front

opened and a file descriptor obtained.

Back

What happens when a file is opened?

Front

permissions are checked and, if the open is permitted, a file descriptor is returned that is used for subsequent operations.

Back

When the power button is pressed, control starts at...

Front

the BIOS, a PROM (typically flash) in the system. Control is then passed to (the tiny program stored in) the MBR (Master Boot Record), which is the first 512-byte block on the "primary" disk. Control then proceeds to the first block in the "active" partition and from there the OS is finally invoked (normally via an OS loader).

Back

What is DMA?

Front

Direct Memory Access

Back

Subsequent I/O system calls (e.g., read and write) use what?

Front

the file descriptor rather than the file name. This is an optimization that enables the OS to find the file once and save the information in a file table accessed by the file descriptor.

Back

What is a Group IDentification, GID?

Front

A group of users can be formed and given a GID. One UID is special (the superuser or administrator) and has extra privileges.

Back

What issues do processes have?

Front

each process requires memory, but there are other issues as well. For example, your linkers (will) produce a load module that assumes the process is loaded at location 0. The result is that every load module has the same (virtual) address space. The operating system must ensure that the virtual addresses of concurrently executing processes are assigned disjoint physical memory.

Back

Separate permissions can be defined for...

Front

the file's owner (files, like processes and users, have UIDs and GIDs), for other users with the same GID as the file, and for everyone else.

Back

How does the process tree differ in modern OS's?

Front

the parent is free to continue executing and in particular is free to fork again, thereby producing another child, a sibling of the first child

Back

The shell presents what to the operating system?

Front

the command line interface

Back

If you run the same program twice, you have created...

Front

two processes. For example if you have two programs compiling in two windows, each instance of the compiler is a separate process.

Back

The shell presents the command line interface to the operating system and offers what convenient features?

Front

. Invoke commands. Pass arguments to the commands. Redirect the output of a command to a file or device. Redirect the input of a command to be from a file or device. Pipe one command to another (as illustrated above via "dir | wc -w").

Back

A System call is...

Front

the mechanism by which a user (i.e., a process running in user mode) directly interfaces with the OS.

Back

How does the OS manage the wide variety of I/O devices?

Front

The OS contains device specific code (drivers) for each device (really each controller) as well as device-independent I/O code.

Back

What makes system calls and generates page faults different from interrupts?

Front

When the user process issues a system call or generates a page fault, it clearly must be running, which implies that the operating system is not executing. When the operating system last relinquished control, it had the opportunity to prepare itself for processing a system call or a page fault.

Back

What is a deadlock?

Front

A set of processes is deadlocked if each of the processes is blocked by a process in the set. The automotive equivalent is called gridlock.

Back

How many times can blocks be written written to in SSDs

Front

a "large number" of times. However, the "large number" is not large enough to be completely ignored.

Back

How are interrupts used?

Front

The OS can tell the controller to start the I/O and then switch to other tasks. The controller must then interrupt the OS when the I/O is done. This method induces less waiting, but is harder to program (concurrency!). Moreover, on modern processors a single interrupt is rather costly, much more costly than a single memory reference (but much, much less costly than a disk I/O).

Back

The key data structure to transfer control from the caller, passing the value of parameters and second to transfer control back is...

Front

a run-time stack

Back

Why must Memory assigned to a process, i.e., an address space, be protected?

Front

so that unrelated processes do not read and write each others' memory.

Back

The OS keeps information about all processes in..

Front

the process table. Indeed, the OS views the process as the entry

Back

What are the high level steps of The read() System Call?

Front

A user program makes a normal function call to an I/O library routine. The library routine does tasks like formatting output and calls a small assembler routine. The assembler routine moves arguments to a predefined place and issues a trap. The OS runs in supervisor mode and performs the (possibly complex) actions required. The OS issues an RTI (return-from-interrupt), which switches the system back to user mode and returns to the assembly routine. The assembly routine moves the result to where the library routine expects it and returns to the library routine. The library routine does its remaining work and then returns to the user program.

Back

In the case the system call handler may block, what happens?

Front

the operating system will probably switch to another process. Such process switching is far from trivial and is discussed later in the course.

Back

Some textbooks use the term envelope for...

Front

the component of the OS responsible for fielding system calls and dispatching them to the appropriate component of the OS.

Back

What is there for each different I/O device controller in memory hardware?

Front

a corresponding device driver is included in the OS.

Back

How Does the OS Know When I/O Is Complete?

Front

Three methods can be employed. -Busy Wait -Interrupts -DMA

Back

What are the low level steps inside the read() System Call?

Front

3. Machine/OS dependent actions, for example putting the system call number corresponding to read() in a well defined place, such as a specific register. 4. Trap (a magic instruction) causes control to enter the operating system proper and shifts the computer to privileged mode. 5. The envelope uses the system call number to access a table of pointers and finds the handler for read(). 6. The read system call handler processes the request. 7. Another magic instruction (RTI) returns to user mode and jumps to the location right after the trap.

Back

One requirement for naming a file via a relative path?

Front

the OS must know the current working directory for each process. As a result the operating system stores the location of the current working directory in the process table entry for each process.

Back

A major complication inside the read() System Call is that...

Front

the system call handler may... block. Indeed, the read system call handler is likely to block.

Back

What is a "multithreaded processes"?

Front

If one has many threads running in the same task

Back

What is The Process Tree?

Front

The set of processes forms a tree via the (Unix) fork system call. The forker is called the parent of the forkee, which is called the child

Back

What are the low level steps at the end and beginning of the read() System Call?

Front

the same as any STEPS to transfer control from the caller, passing the value of parameters and second to transfer control back?

Back

If the system always blocks the parent until the child finishes, the "tree" is...

Front

quite simple, just a line.

Back

How does the OS communicate with an I/O device?

Front

The OS communicates with the device controller, not with the device itself

Back

How do controllers can do DMA...

Front

they deal directly with memory after being started by the CPU. A DMA controller relieves the CPU of some work and halves the number of bus accesses.

Back

What is a User IDentification (UID) ?

Front

Each user is assigned a UID and all processes created by that user have this UID. A child has the same UID as its parent.

Back

Section 4

(50 cards)

STEPS FOR Actions by caller Prior to the Call

Front

1. Save the registers by pushing them onto the stack. (in some implementations this is done by callee instead of by caller). 2. Push arguments c,b,a onto the stack.

Back

STEPS FOR Actions by the Process upon the return from the OS

Front

11. We are now in at the instruction right after the trap Undo step 2: Reclaim any space used by the arguments. 12. Undo step 1: Restore the registers by popping the stack. 13. Continue the execution of the Process, referencing the returned value(s) of the trap, if any.

Back

How does the trap instruction have an unusual effect?

Front

processor execution is switched from user-mode to kernel-mode. That is, the trap instruction normally is itself executed in user-mode (it is naturally an UNprivileged instruction), but the next instruction executed (which is NOT the instruction written after the trap) is executed in kernel-mode.

Back

What does trap instructions with different trap numbers do during the jump?

Front

Recall that trap instructions with different trap numbers jump to locations very close to each other. There is not enough room between them for the real trap handler. Indeed one can think of the trap as having an extra level of indirection; it jumps to a location that then jumps to the real start address. If you learned about writing jump tables in assembler, this is very similar.

Back

What does RTI or ReTurn from Interrupt do?

Front

returns the processor to user mode and transfers control to the return location saved by the trap.

Back

An early layered system was "THE" operating system by Dijkstra and his students at Technische Hogeschool Eindhoven. How did it operate?

Front

This was a simple batch system so the "operator" was the user. The layering was done by convention, i.e. there was no enforcement by hardware and the entire OS was linked together as one program. This is true of many modern OS systems as well (e.g., linux).

Back

What are Kernel-mode Procedure Calls?

Front

one procedure running in kernel mode calling another procedure, which also runs in kernel mode, i.e., a procedure call within the operating system itself.

Back

What are Microkernels?

Front

The idea is to have the kernel, i.e. the portion running in supervisor mode, as small as possible and to have most of the operating system functionality provided by separate processes. The microkernel provides just enough to implement processes.

Back

What are "calling conventions"

Front

Such items as where to place parameters, which routine saves the registers, exact semantics of trap, etc, vary as one changes language/compiler/OS. I i.e. their implementation is a matter of convention rather then logical requirement.

Back

Why does the term The word "interrupt" appear in RTI (ReTurn from Interrupt)

Front

The word "interrupt" appears because an RTI is also used when the kernel is returning from an interrupt as well as the present case when it is returning from an trap. Actually, an RTI doesn't always go back to user mode. Instead it returns to the mode in effect before the trap or interrupt.

Back

Advantages of the Microkernel approach.

Front

an error in the file server cannot corrupt memory in the process server since they have separate address spaces (they are after all separate process). Confining the effect of errors makes them easier to track down. Also an error in the ethernet driver can corrupt or stop network communication, but it cannot crash the system as a whole.

Back

When implemented on one computer, a client-server OS often uses...

Front

the microkernel approach shown above in which the microkernel just handles communication between clients and servers, and the main OS functions are provided by a number of separate processes.

Back

How does TRAP/RTI exhibit Synchronous behavior?

Front

The author of the assembly code in the Process knows where and hence when the trap will occur. There are no surprises, so it is relatively easy for the programmer to prepare for the transfer of control.

Back

downside of the microkernel approach

Front

when a (real) user process makes a system call there are more processes switches. These are expensive and have hindered the adoption of pure microkernel operating systems.

Back

How do kernel-mode and user-mode procedure calls compare to one another?

Front

There is not much difference between the actions taken during a kernel-mode procedure call and during a user-mode procedure call. The procedures executing in kernel-mode are permitted to issue privileged instructions, but the instructions used for transferring control are all unprivileged so there is no change in that respect.

Back

STEPS FOR Executing the Call Itself

Front

3. Execute METHODCALL <start-address of callee > This instruction saves the program counter, PC (a.k.a. the instruction pointer, IP), and jumps to the start address of callee.

Back

STEPS FOR Executing the trap itself

Front

3. Execute TRAP <trap-number>

Back

What should you do For non-sequential access to files

Front

lseek is used to move the "File Pointer", which is the location in the file where the next read or write will take place.

Back

Trap/RTI Instructions STEPS

Front

1. Actions by the Process prior to the trap 2. Executing the trap itself 3. Actions by the OS upon being TRAPped into 4. Actions by the OS when returning to user mode 5. Actions by the OS when returning to user mode 6. Actions by the Process upon the return from the OS

Back

STEPS FOR Actions by the OS upon being TRAPped into

Front

4. Jump to the real code. 5. Check all the arguments passed. The kernel must be paranoid and assume that the authors of the user mode program wear black hats. 6. Allocate space by decrementing the kernel stack pointer. The kernel and user stacks are usually separate. 7. Start execution from the jumped-to location.

Back

What does Execute TRAP <trap-number> do?

Front

This instruction switch the processor to kernel (privileged) mode, jumps to a location in the OS determined by trap-number, and saves the return address. For example, the processor may be designed so that the next instruction executed after a trap is at physical address 8 times the trap-number.

Back

In what manner are files accessed?

Front

sequentially from beginning to end. In this case the operations performed are open() -- possibly creating the file multiple read()s and write()s close()

Back

What is the value returned to the parent in fork()?

Front

the PID (process ID) of the child.

Back

Directories are changed by...

Front

the creation, modification, and deletion of files.

Back

How are several names managed for files?

Front

link gives another name to an existing file and unlink removes a name

Back

User-mode Procedure Calls STEPS

Front

1. Actions by caller Prior to the Call 2. Executing the Call Itself 3. Actions by callee Upon Being Called 4. Actions by callee When Returning to caller 5. Actions by caller Upon the Return from callee

Back

STEPS FOR Actions by caller Upon the Return from callee

Front

9. (We are now at the instruction in caller immediately following the call to callee.) Undo step 2: Remove the arguments from the stack by suitably incrementing SP. 10. Undo step 1: Restore the registers while popping their values off the stack. 11. Continue the execution of caller, referencing the returned value of callee, if any.

Back

STEPS FOR Actions by callee Upon Being Called

Front

4. Allocate space for callee's local variables by suitably decrementing SP. 5. Start execution from the beginning of callee, referencing the parameters as needed. The execution may involve calling other procedures, possibly including recursive calls to caller and/or callee.

Back

STEPS FOR Actions by callee When Returning to caller

Front

6. If callee is to return a value, store it in the conventional place. 7. Undo step 4: Deallocate local variables by suitably incrementing SP. 8. Undo step 3: Execute a RETURN instruction, setting PC to the return address saved in step 3.

Back

A distributed system can be thought of as...

Front

an extension of the client server concept where the servers are remote.

Back

What is the trap instruction?

Front

like a procedure call, is a synchronous transfer of control: We can see where, and hence when, it is executed. In this respect, there are no surprises.

Back

How do distributed system of yesteryear, compare to Today?

Front

before memory was scarce and it would be considered lavish to have full systems on each machine. Today with plentiful memory, each machine would have all the standard servers and specific servers for every device on that system. So

Back

the only reason an OS-internal message would be sent to a remote computer is...

Front

if the originating process wished to communicate with a specific process running on C or a specific device attached to C.

Back

The system switches from user mode to kernel mode and back...

Front

during the trap and then back when the OS does an RTI (return from interrupt).

Back

What is The trap-number?

Front

can be thought of as the "name" of the code-sequence to which the processor will jump rather than as an argument to trap.

Back

What are different return types to processes in fork needed?

Front

Thus, the parent and child execute different branches of the if- then-else in the code above.

Back

STEPS FOR Actions by the OS when returning to user mode

Front

8. If a value is to be returned, store it in the conventional place. 9. Undo step 6: Deallocate space by incrementing the kernel stack pointer. 10. Undo step 3: Execute (in assembler) another special instruction, RTI or ReTurn from Interrupt, which returns the processor to user mode and transfers control to the return location saved by the trap.

Back

As mentioned, open can...

Front

create file

Back

STEPS FOR Actions by the Process prior to the trap

Front

1. Save the registers by pushing them onto the stack. 2. Store any arguments that are to be passed.

Back

Properties of TRAP/RTI

Front

Synchronous behavior Trivial control transfer when viewed from the Process Starts and ends in user mode and user space, but executed in kernel mode and kernel space in the middle.

Back

How does TRAP/RTI exhibit Trivial control transfer when viewed from the Process

Front

The next instruction of the Process that will be executed is the one following the trap. As we shall see later, other processes may execute between the Process 's trap instruction and the Process 's next instruction.

Back

microkernel approach is generally...

Front

as much as possible is moved out of the (supervisor mode) kernel into separate processes (see his article in CACM March 2016). The (hopefully small) portion left in supervisor mode is called a microkernel.

Back

The MULTICS system was layered...

Front

in a more formal manner. The hardware provided several protection layers and the OS used them. That is, arbitrary OS code could not jump into or access data in a more protected layer.

Back

What is the Predictable (often called synchronous) behavior of User-mode Procedure Calls?

Front

The author of caller knows where and hence when the call to callee will occur. There are no surprises, so it is relatively easy for the programmer to ensure that caller is prepared for the transfer of control. LIFO ("stack-like") transfer of control: we can be sure that control will return to caller() when the call to callee() exits. The above statement holds even if callee() calls h() and then h() calls d(). In fact it even holds if, via recursion, callee() calls caller().

Back

Directories are created and destroyed by....

Front

mkdir and rmdir.

Back

When the last name is deleted for a process what happens?

Front

(and the file is no longer open by any process) , the file data is destroyed.

Back

In Unix, What does it mean for one file system to be mounted on another.?

Front

(attached to) When this is done, access to an existing directory on the second filesystem is temporarily replaced by the entire first file system. Most often the directory chosen is empty before the mount so no files become (temporarily) invisible.

Back

What are the Trap/RTI Instructions

Front

Switching Between User and Kernel Mode

Back

What is The idea of Virtual Machines

Front

to use a "hypervisor" (i.e., beyond a supervisor, i.e. beyond a normal OS) to switch between multiple Operating Systems. The modern name for a hypervisor is a "Virtual Machine Monitor (VMM)".

Back

An important OS objective is that, even in the more complicated cases of page faults and blocking system calls requiring device interrupts,.....

Front

simple procedure call semantics are observed from a user process viewpoint. The complexity is hidden inside the kernel itself, yet another example of the operating system providing a more abstract, i.e., simpler, virtual machine to the user processes.

Back

Section 5

(19 cards)

what does the kill system call do?

Front

Send a signal to a process

Back

what does the wait(pid) system call do?

Front

Wait for a child to terminate.

Back

What are conditions where the FORK system call would fail?

Front

- there are no free slots left in the process table (and possibly if there is no memory or swap space left).

Back

what does the exit system call do?

Front

erminate process & return status

Back

What are conditions where the UNLINK system call would fail?

Front

- the file to be unlinked does not exist or - the calling process does not have the authority to unlink it.

Back

How does the Hardware interact with the Kernel?

Front

Interrupts communicate with Drivers

Back

what does the unmount system call do?

Front

Unmount a file system (to a child of another file system)

Back

what does the open system call do?

Front

Open a file & return descriptor

Back

what does the unlink system call do?

Front

Remove a directory entry

Back

what does the link system call do?

Front

Create a directory entry

Back

What is a benefit of Micro Kernels?

Front

able to detects bugs better

Back

What are conditions where the EXEC system call would fail?

Front

- the file name given does not exist or - is not a valid executable file.

Back

what does the exec(ve) system call do?

Front

Replace current process

Back

what does the close system call do?

Front

Close an open file

Back

what does the Fork system call do?

Front

Clone a current Process

Back

What are the 3 general layers of a Layered OS?

Front

-Envelope -Service Procedures -Utility Procedures

Back

How do Windows directory structures compare with Unix?

Front

Windows has a forest directory structure whereas Unix has a singular tree structure descending from the root

Back

what does the mount system call do?

Front

Mount a file system (to a child of another file system)

Back

How does the OS interact with the Kernel?

Front

System calls communicate with the envelope Page faults communicate with the MMU

Back