Section 1

Preview this deck

The next step beyond micokernels was the modular approach. How was the operating system structured with this approach?

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

1

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (57)

Section 1

(50 cards)

The next step beyond micokernels was the modular approach. How was the operating system structured with this approach?

Front

There is still a micro-kernel, but now it is structured as a set of modules. Further, each module is only loaded when it is needed.

Back

Explain multitasking and multiprogramming. How are they similar? Different?

Front

Multiprogramming refers to the OS keeping multiple programs in memory, switching from one to another when the one running has to wait on some event. Multitasking (time sharing) is similar, but the OS also switches between the programs after short time intervals to give the illusion of all the programs "running" at the same time. This rapid switching is generally necessary in an interactive environment to provide acceptable response time to the user They are similar that both types of systems allow multiple jobs to be in the machine, in memory, and "executing" at the same time. With both, when a process has to wait (i.e., on I/O), the system switches to another process. They differ in that multitasking / timesharing adds a concern for the user's response time, typically switching between processes rapidly enough to permit interactive computing.

Back

What is meant by a "dual core" CPU?

Front

This is a single chip, containing two CPUs, each of which is referred to as a CPU core.

Back

. What is the difference between synchronous I/O and asynchronous I/O, and in what way is asynchronous I/O "better"?

Front

With synchronous I/O, the CPU initiates an I/O operation and then waits until the I/O operation completes, whereas with asynchronous I/O, the CPU continues executing instructions while the I/O operation proceeds concurrently. Asynchronous I/O is better because it allows the CPU to do useful work during the I/O operation, instead of just waiting.

Back

An important innovation in bringing computing to the masses was interactive timesharing. Define timesharing. (Multitasking)

Front

(Multitasking) In a time-shared system, multiple users connect to one computer, but the OS switches rapidly between their various processes, giving each user rapid response time and the illusion of a dedicated computer.

Back

The next step beyond the microkernel system structure is a kernel implemented as "loadable kernel modules". Explain what this term means.

Front

It means the kernel is structured as a set of modules, using an object-oriented approach, with separation of information, communication over fixed interfaces, etc. Each module is also loaded only when and if it is needed.

Back

In a modern CPU, one or more caches are placed between the CPU and memory to improve performance. How does the cache improve performance?

Front

When the CPU reads data from memory, it first checks the cache, and if the data is there, it is returned to the CPU much faster than if the data had to be retrieved from memory.

Back

When the CPU reads data from memory, it takes much longer to read from memory than from registers, so a cache is used to help improve performance. a. What happens if the data needed is in the cache? b. What happens if the data needed is not in the cache?

Front

a. It is returned to the CPU, and the memory is not accessed. b. The data is read from the memory, and a copy is placed in the cache for the next time it is needed.

Back

What is the benefit of giving an I/O device Direct Memory Access (DMA)?

Front

It allows that device to directly transfer data into a memory buffer allocated by the OS, without involving the CPU. This lets the CPU proceed asynchronously, executing other code, while the I/O devices is transferring data to memory.

Back

Most modern CPUs provide both user mode and privileged (kernel) mode instructions. a. Why is it necessary to differentiate between two sets of instructions in this manner? b. Explain how the CPU transitions from user mode to kernel mode and vice-versa.

Front

a. The privileged instructions access machine functions, such as I/O and memory control, which should be restricted to authorized use only. Thus user programs and OS support programs are only permitted to use user mode instructions, while the OS kernel is permitted to use both user mode and privileged mode instructions. b. When a user process makes a system call, a trap (software-generated interrupt) occurs, which causes (1) the appropriate trap handler to be invoked and (2) kernel mode to be set. This is the only method for the CPU to go into kernel mode. When the trap handler finishes, user mode is set as control returns to the calling process. Note that it's important to realize that a user program can not just put itself into kernel mode; going into kernel mode is a CPU function that happens only through one carefully-managed mechanism (the OS's set of traps).

Back

In the CPU, what is the role of the Program Counter (PC)?

Front

It holds the address of the next instruction to be executed.

Back

What is the relationship between a system call and a trap?

Front

A system call is implemented using a trap, which is a software-generated interrupt. The trap handler contains the code for the system call. APIs are often standard across multiple systems.

Back

What functions does a command line interpreter provide?

Front

It lets the user enter textual commands, primarily to execute programs, but also to run analyses, list files, etc.

Back

A partial definition of an operating system is that it is a "control program". What does it control, and why?

Front

It controls the execution of programs to prevent errors and improper use of the computer.

Back

What is the relationship between Application Programming Interfaces (APIs) and system calls?

Front

APIs are usually higher-level functions; an API is typically composed of multiple system calls. Application programmers typically use APIs instead of system calls.

Back

Silberschatz says that most users' view of the operating system is defined by system programs, not actual system calls. Explain

Front

A normal user would never use the system calls directly, but would instead use application programs or system programs, which in turn make system calls. Thus most users see the "operating system" as a set of system programs.

Back

What is the difference between a system call and a system program?

Front

A system call is a specific type of procedure call, which can be made from a user program, system program, or in the OS kernel. A system program is an entire program, but is more system oriented and is one which the user would expect to be provided along with the OS — such as a text editor, compiler, web server, etc.

Back

Two methods that the CPU can use to determine when an I/O operation finishes are polling and vectored interrupts. Briefly describe how this is accomplished with each method.

Front

In polling, the CPU starts the I/O operation and then repeatedly (i.e., in a loop) checks a bit in the status register on the I/O device; that bit is set by the I/O device when the I/O operation finishes. With vectored interrupts, the CPU starts the I/O operation and then goes on to other tasks, When the I/O operation finishes, the I/O device sends an interrupt to the CPU. Each type of interrupt is sent by the CPU, though the interrupt vector table, to an interrupt service routine appropriate for that type of interrupt where that interrupt is processed.

Back

System calls provide access to operating system services, but often require input data or return results. One common approach is to pass these parameters via a block of memory. How does the system call know where to find this block of memory?

Front

The address to the memory block is passed to the system call in a register.

Back

A CPU can communicate with I/O devices in a variety of ways, one of which is softwarepolling synchronous I/O. a. Briefly define software-polling synchronous I/O. b. Why is this technique not ideal?

Front

The OS starts an I/O operation, then continuously checks ("polls") that I/O device until the I/O operation finishes. During this time the CPU busy-waits, rather than doing useful work. It wastes CPU time looping and checking, instead of doing useful work executing another process while the I/O proceeds.

Back

Consider the traditional UNIX system structure. Are shells and compilers part of the kernel? If not, what are they?

Front

No. They are system programs.

Back

What is a system program?

Front

System programs are programs supplied along with the OS to supplement the OS kernel and providing an environment for entering text, data, and program code, as well as compiling and testing programs. Typical examples are text editors, program development environments, compilers, and debuggers. The term is rather fuzzy, however, so some may also consider email clients, browsers, file managers, and other application programs supplied along with the OS to be system programs.

Back

Most modern CPUs make a distinction between user mode and kernel mode. a. How does the CPU get into kernel mode? b. What can the CPU do in kernel mode that it cannot do in user mode?

Front

a. When the program executes a TRAP instruction, the CPU sets kernel mode (along with calling the appropriate trap handler). b. It can execute privileged instructions, which can access I/O devices, control interrupts, change the memory state, and change the mode.

Back

A partial definition of an operating system is that it is a "resource allocator". Explain.

Front

It manages key resources (CPU, memory, I/O devices, disk/files) and allocates them to programs in some fair and efficient manner.

Back

In a typical computer system with multiple I/O devices, the CPU initiates an I/O operation and then needs to know when the operation has finished. a. One method for finding out when the operation has finished is software polling, which requires the CPU to continuously poll that I/O device to find out if it has finished. What is the main disadvantage of this techniques? b. Another method for finding out when the operation has finished is to use hardware interrupts, which requires the I/O device to send an interrupt signal when it has finished. What is the main advantage of this techniques?

Front

a. It wastes the CPU's time to keep checking on the status. b. The CPU can continue to do useful work until the I/O device actually needs its attention.

Back

What are some of the characteristics of a graphical user interface?

Front

It supports a desktop, with icons for files and programs. The user uses a mouse to interact with the various icons.

Back

What is the relationship between Application Programming Interfaces (APIs) and system calls?

Front

APIs are usually higher-level functions; an API is typically composed of multiple system calls. Application programmers typically use APIs instead of system calls.

Back

Consider the traditional UNIX system structure. How is the "kernel" defined?

Front

The kernel is everything below the system call interface and above the hardware.

Back

I/O devices typically communicate their completion of an I/O operation to the CPU through interrupts. a. What is the role of the interrupt vector? b. How are interrupts similar to traps?

Front

When an interrupt occurs, the interrupt vector is used to look up the "type" of interrupt, after which the CPU goes into kernel mode and transfers control to the proper interrupt service routine. All this is done under hardware control as part of responding to the interrupt. A trap is simply a software-generated interrupt, caused by the execution of a TRAP instruction. Depending on the operand of the TRAP, control is transferred through the interrupt vector to the proper service routine after going into kernel mode — exactly the same as a hardware-generated interrupt.

Back

Operating System

Front

A program that acts as an intermediary between a user of a computer and the computer hardware OS is a resource allocator - manages resources fairly, efficiently; OS is a control program - controls execution of programs

Back

In many cases, the operating system must distinguish between a policy and a mechanism. What is the distinction between these two?

Front

A policy says what will be done, while the mechanism says how it will be done. For example, give each process 100ms to run is a policy, while implementing it using a timer and interrupts is a mechanism.

Back

What is meant by multitasking?

Front

Multitasking refers to the OS keeping multiple programs in memory, and switching between them quickly to give the illusion of all the programs "running" at the same time. This rapid switching is generally necessary in an interactive environment to provide acceptable response time to the user

Back

In the CPU, what is the role of the Arithmetic Logic Unit (ALU)?

Front

It performs arithmetic and logical operations on the values in the registers.

Back

The basic idea of the microkernel is to make the kernel as small as possible, keeping just the functions that need to run in kernel mode, such as CPU scheduling and memory management. What happens to other functions, such as the file system or the graphical user interface?

Front

They get moved out of the kernel into system programs, which run in user mode and make system calls when necessary, and which can communicate with other systems programs via message passing.

Back

What is a system program? Define the term and provide a few examples of system programs.

Front

System programs are programs that ship with the operating system and supplement its kernel, providing system-like services such as a file system, software development environment, methods for communication, and various background services. In the Unix world, system code above the system-call interface is a system program, and below that interface is the kernel. Programs such as email clients, web browsers, text editors, etc. are usually considered system programs.

Back

When a computer system is turned on, the CPU starts by running a small piece of code, which in turn loads the rest of the operating system. What is this code called, and where is it found?

Front

This code is called the bootstrap, or bootstrap program, or bootstrap loader, and it is stored in ROM or EEPROM memory.

Back

Most modern operating systems have taken a microkernel approach. What is the basic idea of the microkernel?

Front

Make the microkernel as small as possible by moving functionality from the kernel into system programs (which run in user space).

Back

Computer System Structure

Front

Four components: Hardware - CPU, memory, I/O Devices Operating System - Controls and coordinates use of hardware among various applications and users Application Programs - define the ways in which the system resources are used to solve the computing problems of the users - Word processors, compilers, web browsers, database systems, videogames, etc Users - people, machines, other computers

Back

What is a system call?

Front

A mechanism for the program to request services from the operating system, generally services which only the OS can provide, such as access to memory, I/O devices, etc.

Back

Most modern CPUs provide support for hardware-generated interrupts and software generated traps. In what ways are these two similar? In what ways are these two different?

Front

Similar: Both stop what they are currently doing, save state, use the interrupt service vector, perform the requested operation, restore state, and then resume program execution. Different: Interrupts are generated by hardware at unpredictable times; traps are generated by software when a TRAP instruction is executed. Traps also set kernel mode before performing the requested action, and then set user mode before returning.

Back

One of the services provided by an operating system is a file system. What functionality might a file system provide?

Front

Create and use directories, place directories and files inside of directories, create and use files, list files, manage files, etc.

Back

In an operating system, what is meant by security? (

Front

Defending the system against internal or external attacks, such as worms, viruses, or denialof-service attacks.

Back

One of the services that the operation system provides for users is program execution. What does that mean?

Front

The operating system can load a program into memory, start it executing, give it CPU time, and run it until it ends normally or ends with some sort of error.

Back

In a typical computer system, the I/O devices and the CPU are executing concurrently. Explain what that means, and give an example.

Front

It means they are executing at the same time. While the CPU is executing instructions, the I/O devices may be reading from some input device(s), writing to some output device(s), and reading or writing files - all at the same time.

Back

What is the interrupt vector and how is it used?

Front

It is a table of addresses to the interrupt handlers, and is indexed by the interrupt's number. It is used to find the code to process that particular interrupt.

Back

. What is the similarity between a system call and an interrupt?

Front

Both occur at (to the operating system) unpredictable times, and interrupt it from what it might be doing otherwise. Both use the CPU's interrupt mechanism of going through a vector table to a service routine dedicated to that time of request. In a sense, a system call executes a trap instruction, which is a software-triggered interrupt (whereas a "normal" interrupt is hardware triggered).

Back

Define "multiprogramming".

Front

Multiprogramming refers to the OS keeping multiple programs in memory, switching from one to another when the one running has to wait on some event.

Back

In a typical computer system with multiple I/O devices, the CPU initiates an I/O operation and then waits for an interrupt to indicate that the I/O has finished. What does the CPU do when it receives that interrupt to process the result of the I/O operation?

Front

It saves the CPU's current state (PC and SP), uses the interrupt vector to find the appropriate interrupt handler for that I/O operation, executes the code in that interrupt handler to processes the result of the I/O operation, restores the CPU state, and returns to the previous point of execution.

Back

How is a microkernel different from the larger kernels in early versions of UNIX?

Front

The large kernels consisted of a large body of code that executed in kernel mode, providing many machine-dependent and machine-independent services. In contrast, microkernels have a much smaller body of code that runs in kernel mode, supplementing that small microkernel with a set of OS progresses that can run in user mode. As an example, the large kernel would include the entire file system and disk management system in the kernel, while the microkernel would put much of that functionality into user mode, reserving only those portions that actually need to access the memory or disk for kernel mode.

Back

What are some of the characteristics of a graphical user interface?

Front

It supports a desktop, with icons for files and programs. The user uses a mouse to interact with the various icons - running programs, opening folders, etc.

Back

Section 2

(7 cards)

Control Unit

Front

controls ALU operation; moves values between registers, ALU, and main memory

Back

Program Counter

Front

holds address of the next instruction to execute

Back

Stack Pointer

Front

SP - Address of current location in the stack

Back

Instruction Register

Front

IR - instruction being executed

Back

What is the distinction between application programs, system programs, and the microkernel in a micro-kernel-based OS such as Mach?

Front

The micro-kernel is the "minimal" kernel possible, consisting of only those few core services that must run in privileged (kernel) mode. The rest of the "OS" — that portion which can run in user mode — is considered to by system processes / programs. Application programs are the non-OS programs such as word processors, multimedia players, and games.

Back

General Purpose Registers

Front

R1, R2, etc. - hold arithmetic operands and results

Back

Arithmetic Logic Unit

Front

ALU - performs arithmetic and logical (comparison) operations

Back