CSCI 480 midterm bible

¡Supera tus tareas y exámenes ahora con Quizwiz!

How many processes will there be after N forks?

2^n processes

What is the rule of thumb for quantum duration?

80% of the CPU bursts should be shorter than the time quantum.

As of 2016, what percentage of households in america had a computer?

89

What is a system call?

A function that acts as an interface between program and OS

Why choose processes over threads?

A single thread malfunctioning will halt the whole program. processes will not. (think browser tabs)

What is a system program? How does it differ from a system call?

A system program is simply a program that might use system calls. A system call is a function to interface with the system

What is a multiprocessor system?

A system with two or more CPUs in close communication.

How does CPU protection work?

A timer interrupts computer after specified period to ensure OS maintains control. Timer is decremented every clock tick. when it reaches 0, an interrupt occurs.

How do you implement memory protection?

Add two registers that determine the range of legal address a program may access. Base register: holds the smallest legal physical memory addreess Limit register: contains the size of the range. Memory outside the range is protected

What's the main benefit of a time-sharing system? How is this accomplished? What is this phenomenon called?

Allows several users to share the computer at the same time. This is accomplished by having the response time be so fast its AS IF users had direct computer access. This is known as context switching.

In what language are system calls usually written?

Assembly, occasionally C or C++ like UNIX

What main types of clustering are used in clustered systems?

Asymmetric: One server runs the application while other servers standby. Symmetric: All N hosts are running the application

How did batch systems work?

Automatic job sequencing - automatically transfers control from one job to another. Card reader -> Tape drives -> (operator) CPU -> (operator) Tape drives -> Line printer Simple batch system has a user program area and an operating system. Mnemonic: ACS

In what order did SYSTEMS appear?

Batch systems multi programming (populated by ibm os/360) time sharing systems personal computers multiprocessors clustered systems distributed systems Mneomic to help remember: Ber Muda Triangle People Make Conspiracies Daily

What is turing's OS?

Debian GNU/Linux

What are distributed systems/How do they work?

Distributes the computation among several physically seperate computer systems (that may or may not be the same type of system) that are networked to provide users with access to the various resources of the system

What essential hardware protections must an operating system employ?

Dual Mode Operation A timer for CPU protection Memory protection Privileged instructions that can only execute in monitor mode Mnemonic: DAMP

How does I/O protection work?

Ensures that a user program could never gain control of the computer in monitor mode

What is the execvp() system call?

Execute program with passed arguments (Execute Vector of Pointers) Ex: char *command[] = {"ls", "-l", NULL}; execvp("ls", command);

What are the main deciding factors in what level of memory a piece of information will be stored?

File size, how recently it was used

A multilevel queue uses ___ for its BACKGROUND scheduling algorithm.

First-Come-First-Serve

What are the contents in /proc/cpuinfo?

For each processor the following information is stored: processor, vendor_id, cpu family, model, model name, stepping, microcode, cpu MHz, cache size, physical id, siblings, core id, cpu cores, apicid, initial apicid, fpu, fpu_exception, cpuid level, wp, flags, vmx flags, bugs, bogomips, clflush size, cache_alignment, address sizes, power management

What happens if you fork() twice? How many processes are there?

Four (main, child, child of child, and grandchild)

Who populated MultiProgramming Systems?

IBM OS/360

What are the benefits of multiprocessor systems?

Increased throughput and reliability. Mnemonic: Throughput And Reliability (TAR)

What is the difference between cooperating and independent processes?

Independent process cannot affect or be affected by the execution of another process Cooperating process can affect or be affected by the execution of another process

What is the process control block? What does it contain?

Information associated with each process. process state program counter CPU registers CPU Scheduling information Memory management information Accounting information I/O status information

An operating system is driven by what type of operation? What are the types of this operation? How does this operation work?

Interrupt driven Hardware interrupt Software Generated interrupt An INTERRUPT VECTOR stores the address of INTERRUPT HANDLERS, which receive interrupts, performs the necessary processing, then executes a 'return from interrupt' to return to the CPU

What is Dual Mode Operation and how does it work?

It ensures that a program cannot cause other programs to execute incorrectly. It does this by providing hardware support to differentiate between two modes: User mode and monitor mode.

What I/O might a personal computer have?

Keyboards, mice, monitors, printers, etc.

What OS features are needed for multiprogramming?

Memory management CPU Scheduling Disk Storage

What are the various system structures?

Monolithic (ms-dos, linux, unix, windows) Modules (loadable kernel module, linux) Microkernel (mach (part of darwin)) Hybrid (mac os x, ios android, wsl)

What are the possible states for a thread?

New: The process is being created Running: Instructions are being executed Waiting: The process is waiting for some event to occur Ready: The process is waiting to be assigned to a processor Terminated: The process has finished execution

Is a web browser a system program?

No

Did moore's law also apply to memory?If not, what was this known as? What was the solution

No. Known as the 'memory wall'. The solution was to implement 'memory hierarchy', with each memory type being faster than the next.

In what order did OPERATING SYSTEMS appear?

Non-existent Mainframes PC/GUI world multiprocessor systems distributed systems special purpose systems (embedded, multimedia) handheld (mobile) Mnemonic: No Mainstream Politician May Deny Simple Homologations

How many processors did personal computers have when they first started appearing? How many do they have now?

One A lot (think CPU cores)

What results from context switching?

Overhead

How does process creation work?

Parent process create children processes, which, in turn create other processes, forming a tree of processes

What is the main difference between preemptive and non-preemptive?

Preemptive allows the cpu to cut a process off and give start another process Non-preemptive processes must run from start to finish without stopping.

What are the types of system calls?

Process control• File management• Device management• Information maintenance• Communications

What are the differences between processes and threads?

Processes are heavy weight each process has its own address space processes typically do not share memory with others

What are the definitions of the process?

Program in Execution- Animated spirit of a program- What is represented by process control block- Entity to which processors are assigned- Dispatchable unit (PAWED)

A multilevel queue uses ___ for its FOREGROUND scheduling algorithm.

Round-Robin

How are multicore CPUs structured?

See picture

What are the various IPC mechanisms?

Shared memory Message Passing Pipes Sockets RPC JAVA RMI

How did multiprogramming systems work?

Storage for multiple jobs so CPU always has one to execute, requires special hardware to protect each job against snooping by the other ones.

What are the types of message passing?

Synchronous: blocking (think phone calls) Asynchronous: non-blocking (think texts)

How does dual mode operation know when to switch modes?

System calls will flip a MODE BIT as needed.

How is a process distributed in the memory stack?

Text section—the executable code Data section—global variables Heap section—memory that is dynamically allocated during programrun time Stack section—temporary data storage when invoking functions

What happens when the storage being cached is larger than the space available in the cache?

The CACHE MANAGEMENT POLICY is enacted, where the computer decides the best level of storage to put the data into.

What do threads share? What don't they?

They share code, data, and files. They do not share registers and stack

What well-known operating system is time-sharing?

UNIX

In dual mode operation, what are the differences between the two modes?

User mode: execution done by the user Monitor mode: execution done by the OS.

What does context switching do?

When CPU switches to another process,the system must save the state etc. of theold process and load the saved state forthe new process

What is the convoy effect?

When short processes are stuck behind longer processes

How do you determine program flow given two processes that wait upon binary semaphores, the entry point is known.

When you have two processes that wait on binary semaphores, you can follow a sequential path, starting with the entry process until it reaches a wait() condition or completes its execution. Once it reaches a wait() or completes, you can then switch your focus to the other forked process and follow its execution until it also reaches a wait() condition or completes.

What does a thread consist of?

a program counter, a set of registers, and stack space

What are the main features of clustered systems?

allows two or more individual systems to share storage, and provides high availability Mnemonic: Two comps, one drive

What is a socket?

an endpoint for communication. a concatenation of IP address and port.

What is a privileged instruction?

an instruction only issuable in monitor mode.

How to handle standard input?

cin: object of class istream that represents the standard input stream oriented to narrow characters (of type char). It corresponds to the C stream stdin.

In two threads, how do you determine all possible outcomes assuming no Mutex or synchronization stuff

consider all possible sequences of execution for each thread, including different interleaving of their statements

How does caching work?

faster storage is checked to see if information is there. Use the cache if it is. if its not there, put it in the cache.

What two system calls are used for process creation?

fork() and execlp()

What does fork process return?

fork() return 0 to child process - fork() return the process id of the child process to the parent process

What is IPC?

interprocess communication. a mechanism for Cooperating process can affect or be affected by the execution of another process

What must memory protection be provided to at the bare minimum?

interrupt vectors, and interrupt service routines

How does shared memory work?

it uses semaphores for synchronization

What are the different multi-threading models?

many-to one: Many user-level threads mapped to single kernelthread one-to-one: Each user-level thread maps to kernel thread Many-to-Many: Allows many user level threads to be mapped to manykernel threads

What are the two common communication models?

message passing shared memory

First-Come-First-Serve: Preemptive, non-preemptive or both.

non-preemptive

What are the differences between program and process?

one program can correspond to multiple processes. A process has address space, state, etc. a program does not.

What's the average amount of CPU's per person in the present day?

over 100

What general methods are used to pass parameters between running program and os?

pass parms in registers Store the parameters in a table in memory, and the table address is passedas a parameter in a register Push (store) the parameters onto the stack by the program, and pop off thestack by operating system

Round-Robin: Preemptive, non-preemptive or both.

preemptive

Priority Scheduling: Preemptive, non-preemptive or both.

preemptive or non-preemptive

Shortest Job First: Preemptive, non-preemptive or both.

preemptive or non-preemptive

All I/O instructions are ____________

privileged instructions

Linux virtual file system /proc -- What does it contain?

process information, system information, and sysctl pseudo-filesystem

How does message passing work?

provides the send(message) and receive(message) operations

What are the benefis of threads?

responsiveness, resource sharing economy (easier to create and destroy) utilization of mp architectures

What is the cpu scheduler?

selects which process should be executed next and allocates CPU

Process execution must progress in __________ fashion

sequential

What is a ready queue?

set of all processes residing inmain memory, ready and waiting to execute.

What is a device queue?

set of processes waiting for an I/O device

Is /proc in memory or on disk?

the kernel creates it in memory

What is moore's law?

the number of transistors in a cpu would double every 2 years

What are cpu timers commonly used to implement?

time sharing

True or false: loading base and limit registers are privileged instructions

true

How does an OS boot?

using the bootloader. It loads the kernel into memory, runs diagnostics, then starts the os and mounts the root file system

What is caching?

when information in use is temporarily copied to faster storage.

What are the types of thread cancellation?

• Asynchronous cancellation: the target threadterminates immediately, may not free anecessary system-wide resource • Deferred cancellation: The target thread has anopportunity to terminate itself in an orderlyfashion

Does fork() duplicate only the calling thread or all threads?

• Solaris threads duplicate all threads - linked using "-lthread" • POSIX threads duplicate only the calling thread - linkedusing "-lpthread". (Same as vfork() and fork1())

What are some examples of distributed systems?

Client-server systems, Peer to peer systems, or web-based systems

What are the differences between parallelism and concurrency?

Concurrency: multiple processes/threads on one cpu Parallelism: Multiple CPUs, each running one process

What is the dup() system call?

Create a new file descriptor that refers to the same file or resource as an existing file descriptor. This can be useful for redirecting input and output, among other tasks.

What is the fork() system call?

Create a new process. It duplicates the current process, creating a child process that is a copy of the parent process.

What is a thread pool? Where are they commonly used?

Create a number of threads in a pool where they await work commonly used in web servers and application servers.


Conjuntos de estudio relacionados

AP World History Ch. 7-12 Period 2

View Set

Econ 353 Chapter 5 Exam Second Half

View Set

Intro to Business Unit Three Test

View Set

Legal Terminology - Administrative Law

View Set

CH'S 6-11 terms to know for Test 2

View Set