week 5 os theory Flashcards

1
Q

what are the two valid os descriptions:

A

A program that acts as an intermediary between a ‘user’ of a
computer and the computer hardware
The one program that is at all times running on the computer,
with all else being systems programs and application programs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

main fucntions of an os

A

resource allocator
control system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

describe os as a resource allocator

A

Manages all hardware resources and decides between
conflicting requests for efficient and fair resource use
(e.g. accessing CPU, disk or other devices)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

describe os as a control system

A

Controls execution of programs to prevent errors and
improper use of the computer (e.g. protects one user
process from crashing another)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

define bootstrapping of os

A

Small bootstrap program is loaded at power-up or reboot
Typically stored in ROM or EPROM, generally known as
firmware (e.g. BIOS)
Initializes all aspects of the system (e.g. detects connected
devices, checks memory for errors, etc.)
Loads operating system kernel and starts its execution
ROM = Read Only Memory
EPROM = Erasable Programmable ROM
BIOS = Basic Input/Output System

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what does ROM stand for

A

Read Only Memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what does EPROM stand for

A

EPROM = Erasable Programmable ROM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what does BIOS stand for

A

BIOS = Basic Input/Output System

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

define sharing among reources in os (3 points )

A

Device controllers are hardware within laptop/computer
needed to connect to external resources
Bus (the ‘wire’) connects CPUs, device controller and memory
OS Kernel runs within the CPU and manages the devices
through the device controllers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

define device contollers when sharing among resources

A

I/O devices and the CPU can execute concurrently
Each device controller (e.g. controller chip) is in charge of a
particular device type
Each device controller has a local buffer (i.e. memory store for
general data and/or control registers)
CPU moves data from/to main memory to/from controller
buffers (e.g. write this data to the screen, read coordinates
from the mouse, etc.)
I/O is from the device to local buffer of controller
Device controller informs CPU that it has finished its
operation by causing an interrupt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

decribe aht an interrupt is

A

Interrupts can be implemented in different way, but a common
approach is through an interrupt vector
Interrupt Vector is a reserved part of the memory, tracking
which interrupts need to be handled
For each interrupt, the OS executes the appropriate ‘Interrupt
Service Routine’ to handle the interrupt
The address of the interrupted instruction is saved so original
processing can be resumed after completion of the interrupt
Software programs can also generate interrupts, through
system calls, for instance when an error occurs. A
software-generated interrupt is called a trap

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what does main memory store

A

large storage media that cpu can access directly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what does secondry storage store

A

provides large non volatile storage capacity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

give importat example of secondary storage

A

Important example: magnetic disks - rigid metal or glass
platters covered with magnetic recording material
Disk surface is logically divided into tracks, which are
subdivided into sectors
The disk controller determines the logical interaction between
the device and the computer
Today also often flash memory. However, same logical division
intro tracks and sectors still used

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

how do users interact with os

A

Users interact indirectly through a collection of system
programs that make up the operating system interface. The
interface could be:
A GUI, with icons and windows, etc. Nowadays, this is the
norm.
A command-line interface for running processes and scripts,
browsing files in directories, etc. For Computer Scientists only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

how do processes interact with os

A

Processes (the programs in execution) interact with the
Operating System by making system calls into the operating
system kernel.
Though we will see that, for stability, such calls are not direct
calls to kernel functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

state the 4 processes os offers

A

Program execution
I/O operations
file system manipulation
Interprocess Communication (IPC)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

what is program execution

A

The system must be able to load a
program into memory and to run that program, end execution,either normally or abnormally (indicating error)

19
Q

what is i/o operations :

A

A running program may require I/O, which
may involve a file or an I/O device
File-system manipulation: Programs need to read and write

20
Q

what is file system manipulation

A

programs need to read and write
files and directories, create and delete them, search them, list
file Information, permission management.

21
Q

what is interprocess communication (IPC)

A

Allowing processes to
share data through message passing or shared memory

22
Q

what are the fours services for os itself

A

Error handling
Resource allocation
Accounting
Protection and Security

23
Q

what is error handling

A

managing errors like if function dives by zero etc

24
Q

what is accounting

A

e.g. how much disk space is this or that user using? how much network bandwidth are we using?

25
what is resource allocation
Resource allocation: Processes may compete for resources such as the CPU, memory, and I/O devices.
26
what is protection and security
The owners of information stored in a multi-user or networked computer system may want to control use of that information, and concurrent processes should not interfere with each other
27
describe system calls
Programming interface to the services provided by the OS (e.g. open file, read file, etc.) Typically written in C (or C++) Mostly accessed by programs via a high-level Application Program Interface (API) rather than direct system call. Two common APIs: Win32 API for Windows, POSIX API for UNIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X). The APIs allow application code to access the kernel without requiring root privileges: it transfers control from user mode to kernel mode
28
what are the system calls for file operations
open read write close
29
what is open in system call
Register the file with the operating system. Must be called before any operation on the file. Returns an integer called the file descriptor - an index into the list of open files maintained by the OS.
30
what is read in system call
Read data from the file. Returns number of bytes read or 0 for end of file.
31
what is write in system call
Write data to a file. Returns number of bytes written.
32
what is close in system call
De-registers the file with the operating system. No further operations on the file are possible
33
what do the file operations in system call return when they get an error
return negative number
34
what can we use to see if there is an error in the file operations in sc
perror
35
describe trapping to kernel
Trapping to the Kernel The user process calls the system call wrapper function from the standard C library The wrapper function issues a low-level trap instruction (in assembly) to switch from user mode to kernel mode There is some ‘magic’ happening to move from user mode to kernel mode: To get around the problem that no call can directly be made from user space to a specific function in kernel space: Before issuing the trap instruction, an index is stored in a well known location (e.g. CPU register, the stack, etc.). Then, once switched into kernel space, the index is used to look up the desired kernel service function, which is then called. Some function calls may take arguments, which may be passed as pointers to structures via registers.
36
describe traditional unix
UNIX - one big kernel Consists of everything below the system-call interface and above the physical hardware Provides the file system, CPU scheduling, memory management, and other operating-system functions; a large number of functions for one level Limited to hardware support compiled into the kernel
37
describe modular kernel
Most modern operating systems implement kernel modules Uses object-oriented–like approach Each core component is separate Each talks to the others over known interfaces Each is loadable as needed within the kernel, so you could download a new device driver for your OS and load it at run-time, or perhaps when a device is plugged in Overall, similar to layered architecture but with more flexibility, since all require drivers or kernel functionality need not be compiled into the kernel binary. Note that the separation of the modules is still only logical, since all kernel code (including dynamically loaded modules) runs in the same privileged address space (a design now referred to as monolithic), so I could write a module that wipes out the operating system no problem. This leads to the benefits of micro-kernel architecture, which we will look at soon
38
describe microkernel
Moves as much as possible from the kernel into less privileged “user” space (e.g. file system, device drivers, etc.) Communication takes place between user modules using message passing The device driver for, say, a hard disk device can run all logic in user space (e.g. decided when to switch on and off the motor, queuing which sectors to read next, etc.) But when it needs to talk directly to hardware using privileged I/O port instructions, it must pass a message requesting such to the kernel
39
benefits of microkernels
Easier to develop microkernel extensions Easier to port the operating system to new architectures More reliable (less code is running in kernel mode) - if a device driver fails, it can be re-loaded More secure, since kernel is less-complex and therefore less likely to have security holes. The system can recover from a failed device driver, which would usually cause “a blue screen of death” in Windows or a “kernel panic” in linux
40
con of microkernel
Performance overhead of user space to kernel space communication
41
example of microkernel
The Minix OS and L3/L4 are examples of microkernel architecture
42
describe virtual machines
A virtual machine allows to run one operating system (the guest) on another operating system (the host) A virtual machine provides an interface identical to the underlying bare hardware The operating system host creates the illusion that a process has its own processor and (virtual) memory Each guest is provided with a (virtual) copy of underlying computer, so it is possible to install, say, Windows 10 as a guest operating system on Linux.
43
describe paravisulisation
Presents guest with system similar but not identical to hardware (e.g. Xen Hypervisor) Guest OS must be modified to run on paravirtualized ’hardware’ For example, the kernel is recompiled with all code that uses privileged instructions replaced by hooks into the virtualisation layer After an OS has been successfully modified, para-virtualisation is very efficient, and is often used for providing low-cost rented Internet servers (e.g. Amazon EC2, Rackspace
44
describe VMWare Architecture
VMWare implements full virtualisation, such that guest operating systems do not require modification to run upon the virtualised machine. The virtual machine and guest operating system run as a user-mode process on the host operating system As such, the virtual machine must get around some tricky problems to convince the guest operating system that it is running in privileged CPU mode when in fact it is not. Consider a scenario where a process of the guest operating system raises a divide-by-zero error. Without special intervention, this would cause the host operating system immediately to halt the virtual machine process rather than the just offending process of the guest OS. So VMWare must look out for troublesome instructions and replace them at run-time with alternatives that achieve the same effect within user space, albeit with less efficiency But since usually these instructions occur only occasionally, many instructions of the guest operating system can run unmodified on the host CPU