Shared Flashcard Set

Details

Operating systems mid term exam 1
study guide
190
Computer Science
Undergraduate 4
02/21/2012

Additional Computer Science Flashcards

 


 

Cards

Term
What is an operating system?
Definition
program that acts as an intermediary between user of a computer and hardware
Term
What do users want in an operating system? what do they not care about
Definition
ease of use
resource utilization
Term
what is a kernal?
Definition
one program running at all times on the computer
Term
what way is the computer a resource allocator?
Definition
manages resources of computer and resolves conflicts of use
Term
how is an operating system a control program?
Definition
prevents errors and improper use of the computer
Term
what is a bootstrap program?
Definition
firmware loaded upon startup or reboot that loads the operating system kernal and begins execution
Term
what is firmware?
Definition
code in the computer that is permanent
Term
what do device controllers do?
Definition
act as intermediaries between hardware and memory
Term
what is an interrupt?
Definition
informs the cpu that a device controller (hardware or software) has finished its operation
Term
what is an interrupt vector? and what must it do?
Definition
contains the addresses of all service routines.
must save the address of the interrupted instruction
Term
how are interrupts handled?
Definition
1.address of interrupted instruciton is saved
2. incoming interupts are disabled
3. type of interrupt received is determined
4. interrupt is handled
Term
what is a trap?
Definition
a software-generated interrupt caused by an error or user request
Term
what is interrupt driven?
Definition
an operating system
Term
what does volatile mean?
Definition
memory is not powered
Term
what does random access memory allow for?
Definition
we can go straight to that location in memory
Term
what is nonvolatile?
Definition
is not erased when computer loses power orf reboots, does not run on power
Term
how is a hard disk divided?
Definition
tracks, and then into sectors
Term
what is a disk controller?
Definition
determines the logical interaction between device and computer
Term
what is caching?
Definition
copying informaiton into faster storage system
Term
what is the fastest memory, 2nd
Definition
registers, cache
Term
what are multiprocessors systems also known as? (2 things)
Definition
parallel systems, tightly-coupled systems
Term
3 advantages of multiprocessor systems?
Definition
1. increased throughput (more horsepower)
2. economy of scale
3. increased reliability (graceful degredation or fault tolerance
Term
what is the difference between asymmetric multiprocessing and symmetric multi processing?
Definition
asymmetric processing has one dominant processor and symmetric processing has processors the work together as peers
Term
what is fault tolerance?
Definition
there is a backup if one fails
Term
what is multiprogramming?
Definition
organizes jobs so CPU always has a job to execute and things are done as efficiently as possible
Term
what is timesharing?
Definition
switching between jobs to allow the user to interact with each job even when a process is running
Term
what is a process?
Definition
a program executing in memory
Term
what is the difference between user and kernal mode?
Definition
kernal mode has privleged instructions that interact with the hardware, user mode does not directly interact with the hardware
Term
what type of entity is a program, process?
Definition
passive,
active
Term
what is protection?
Definition
any mechanism for controlling access to processes or users to resources defined by OS
Term
what is security?
Definition
defense against external attacks
Term
user id and group id do what?
Definition
identify users and groups to associate privledges to a user
Term
what are 2 types of user interfaces?
Definition
command-line interface (CLI) and graphical user interface (GUI)
Term
what are two ways a CLI can be implemented?
Definition
inside the kernal where the kernal understands the instructions

other method is systems programs which the CLI only understands the file to be executed
Term
how are most systems programs accessed by developers?
Definition
application programming interfaces (APIs)
Term
what are APIs more useful than systems calls?
Definition
less complicated, and can work on a variety of systmes
Term
What does the api allow in terms of what the user needs to know when making systems calls?
Definition
user just needs to know what will happen with a given system call
Term
what are the 3 ways to pass parameters ot the OS?
Definition
1. registers
2. blocks
3. stacks
Term
what are system goals for designing operating systems? (4 goals)
Definition
1. easy to design, implement, and maintain
2. reliable
3. error-free
4. efficient
Term
what is a policy?
Definition
what will be done
Term
what is a mechanism?
Definition
how to do something
Term
why do you need to seperate policies from mechanisms?
Definition
you must determine policies before developing mechanisms to acheive those policies
Term
what must policies be, and what must mechanisms be?
Definition
policies must be specific
mechanisms must be flexible
Term
one example of policy that has changed over years in windows systems
Definition
functionality for multiple users has been added
Term
What are the 4 approaches to OS design?
Definition
1. simple
2. layered
3. micokernal
4. modular
Term
what is the simple design of an operating system?
Definition
a big program with little seperation between componenets
Term
what is the layered design for operating systems? how are layers accessed?
Definition
operating system is divided into levels
bottom layer is hardware
top is the user interface
each layer accesses layers below it
Term
what are advantages to layered approach?
disadvantages?
Definition
adv: more structured design to prevent bugs
disadv: slower running, very big
needs to talk between layers
Term
what is a microkernal system?
Definition
most of kernal is in user space
message passing between modules
Term
adv of micro kernal
dis of micro kernal
Definition
adv: really small kernal allows faster runtime of kernal
dis: system is slowed doswn
Term
what do modular systems do?
Definition
allow access between all modules without the need for message passing

components reside in kernal space
Term
name an example of a module in the modular approach
Definition
device drivers are located in the kernal
Term
virtual machines do what?
Definition
provide an interface identical to underlying hardware
Term
what do viritual system hosts do for the user?
Definition
create the illusion that a process has its own processor
Term
what do guests on a virtual system have?
Definition
virtual copy of the underlying computer
Term
main benefit of VM?
Definition
consolidations of resources into onto one hardware
Term
what is the main problem with vmware?
Definition
slow, there is another layer the computer needs to deal with
Term
debugging
Definition
finding and fixing errors or bugs
Term
log files
Definition
generated by the os containing error info
Term
what is a core dump?
Definition
when an applicaiton fails a core dump is generated capturting memory of the process
Term
crash dump
Definition
kernal memory is captured when operating system failure occurs
Term
bootstrap loader?
Definition
locates kernal, loads it into memory, and starts it
Term
boot block
Definition
second-step in two step startup bootloader loats boot block
Term
process?
Definition
a program in execution
Term
what are the states of a process (5)?
Definition
new,
running,
waiting (for event)
ready (to be assigned)
terminated
Term
context switch
Definition
when cpu switches process, must save state of one and load new
Term
what is important about context switch time
Definition
it is overhead
Term
timeslice
Definition
amount of time alloted for a process to finish
Term
process scheduler
Definition
maintinas scheduling log to keep track of various queues
Term
i/o bound process
Definition
does more i/o than calucaitons, short cpu bursts
Term
cpu-bound
Definition
more calculations than i/o, long cpu bursts
Term
what is a parent process?
Definition
creator of children processes
Term
what does every process have?
Definition
PID process id
Term
unbounded buffer
Definition
no limit to size of buffer
Term
bounded buffer
Definition
limited size, producer cannot over fill quie, and user cannot empty and more
Term
direct message communicaiton
Definition
sender and receiver process
Term
indirect communicaiton
Definition
uses a mailbox in memory shared by both processes
Term
blocking
Definition
is synchronous sender sends til message recieved, receiver waits til available
Term
non blocking
Definition
sender sends and moves on, receiver receives message or null
Term
How does an operating system get loaded into memory when a computer is powered on?
Definition
bootstrap program is loaded at powerup/reboot and intializes all aspects of system and begins execution of kernal
Term
Explain the purpose of an interrupt vector.
Definition
Interrupt vector contains all addresses of service routiners to deal with interrupt requests and how to handle them
Term
There are two different ways that commands can be processed by a command interpreter. One way is to allow the command interpreter to contain the code needed to execute the command. The other way is to implement the commands through system programs. Compare and contrast the two approaches.
Definition
Key answer: can dynamically load programs and extend command interface

If the command was a monolithic program, then it would be hard to update, which you would mean that you would have to access the operating system.

Command interpretor dynamically loads commands. Commands are stored as single commands in the operating system. If it loads commands, we can create new commands and we can extend the system.
Term
what is a thread?
Definition
allows for multiple tasks to be run within a single process
Term
how would threading help a web browser?
Definition
you could send keyboard input without pausing the download of an image, and update the GUI
Term
what advantages does thread creation have against process creation?
Definition
process creations is heavier and thread creation can share resources
Term
What are 4 benefits of threading?
Definition
1. responsiveness
2. resource sharing
3. economy
4. scalability
Term
what is the responsiveness benefit of multithreading?
Definition
you can do multipel things at once: i.e. download an image while moving hte mouse and reading from I/O devices
Term
what is the advatnage of resource sharing from multithreading?
Definition
memory is shared between threads and you do not need to have message passing
Term
what is the economy benefit of multithreading?
Definition
you do not need to copy data. since memory is shared, each thread has access to the same data
Term
what is the scalabily benefit of multithreading?
Definition
if you add more processors, work can be completed faster, allows for work to be done on multiple tasks rather than one process at a time
Term
what are 3 models for multithreading?
Definition
1. many to one
2. one to one
3. many to many
Term
what is the many to one model of multithreading? one disadvantage?
Definition
multiple user threads correspond to one kernal thread.

dis: if your process blocks, then all threads will be stopped
Term
what is the one to one model of threading?

what is one disadvantage?
Definition
one user thread to each kernal thread

dis: there is a greate deal of overhead created from the context switches between processes
Term
what is the many to many model of multithreading?
Definition
there are equal or less number of kernal threads for every user thread, kernal threads are created when needed
Term
what are the two types of thread cancellation?
Definition
asynchronus and defferred
Term
what is asynchronus thread cancelation? why is it dangerous?
Definition
one thread is immediately terminated

it is dangerous because if resources are associated with a thread, then they are no longer available
Term
what is deffered thread cancelation?
Definition
the target thread periodically checks to see if it should terminate
Term
what are signals?
Definition
notificaitons that an event has occured on a UNIX system
Term
what are the waysto handling a signal by a multithreaded process? (4 ways)
Definition
1. deliver signal to thread which applies
2. deliver signal to every thread in process
3. devliver signal to specific threads in process
4. assign a specific thread to receive all signals for the process
Term
What can classify as an operating system?
Definition
the one program running at all times, or everything the vendor ships with the os
Term
What is a systems program?
Definition
a program that is associated with the operating system and can have access to hardware, but not part of kernal
Term
What are the two types of programs outside of the operating system?
Definition
system programs and applicaitons programs
Term
what is an applications program?
Definition
all programs not associated with the operating system
Term
what are examples of device controllers? name 3
Definition
disk drive, audio devices, video displays
Term
what is a device controller?
Definition
in charge of handling devices with the CPU
Term
what is secondary storage?
Definition
extenion of main memory (volatile)
Term
what is most common form of secondary storage?
Definition
magnetic disk
Term
what is the storage-device heiarchy (top to bottom)? 7 levels
Definition
1. registers
2. cache
3. main memory
4. electronic disk
5. magnetic disk
6. optical disk
7. magentic tapes
Term
what is fault tolerance?
Definition
can suffer a failure of any given component and still operate
Term
what is graceful degredation?
Definition
to continue servicing proportional to surviving hardware
Term
what does multiprogramming aim to do?
Definition
organize jobs efficiently so CPU always has one to execute
Term
what happens if there is nothing to do?
Definition
if there is nothing to do, operating system will wait until a user request from a user program or error occurs
Term
what does being interrrupt driven mean?
Definition
that the compute will wait until events occur, and will then respond to those events
Term
what are the two modes presented by an operating system?
Definition
user mode and system mode
Term
what is user mode?
Definition
no access to operating system or hardware
Term
what is system mode?
Definition
privleged instructions made accessing hardware
Term
how does dual-mode relate to protection?
Definition
it prevents privleged instructions from being made and harming the computer by reserving the os to make them
Term
what does the program counter do?
Definition
specifies the next instruciton to execute
Term
What is the difference between protection and security?
Definition
protection is any mechanism for controlling hte access of processes or users to the resources defined by a computer system

security prevents external and internarl attacks
Term
what does linux use to protect files?
Definition
Linux uses privledges to protect files, and assigns privleges to appropriate users
Term
how does the CLI interface work with linux? does the command line prompt understand?
Definition
1. the user chooses a shell to use
2. enters a command to be exucted by the system
the command line prompt does not understand the program, but identifies the specified file which executes the program through use of systems programs
Term
what is s aystem call? and example of use with selecting files?
Definition
provides an interface to servies made available by the operating system

user need opens file using a graphical user interface, opening the file occurs through I/O system calls, then opening input and creating output also require calls
Term
How does an API relate to systems calls? what does this do for the user?
Definition
an api provides functions that usually implement systems calls. less complex environment to operate
cross platform functionality
Term
What are the 5 types of systmes calls and a little info on each
Definition
1. process control-ending creating processes
2. file management-opening, closing, deleting, readingfiles
3. device management-attach/detach devices, read from
4. information maintainance-get time or date, get process attributes status
5. communicaitons-create connctions, send/receive messages
Term
goals of os design? 5 of them
Definition
1. convenient
2. easy to learn
3. reliable
4. safe
5. fast
Term
simple stucture adv. and disadv
Definition
no real benefits
dis: not well-defined, system crashes and vulnerabilties
Term
layerd approach adv and dis:
Definition
adv: better debugging and simplicity, individual layers debugged one at a time
dis: less efficient than
Term
microkernal adv and dis:
Definition
adv: easily extendable because it primarily uses systems programs, just tack on another program
dis: decreased performance due to system overhead
Term
modual adv and dis:
Definition
adv: small kernal which acts a communicator between moduales, easily extendable
dis: none really
Term
what are benefits of virtual machines 3 of them
Definition
1.host is protected, client program operate in isolaiton, so no way to go after host or other clients
2. allows swithcing between operating systems
3. runs multiple machines on one set of hardware
Term
what are approcahes to virtual machines?
Definition
1. simulation-use of an emulator to run outdated systems products
2. paravirtulizaiton- working on similar systems
Term
what is big problem with virtual machines?
Definition
it takes time because you are operating with another layer
Term
parts of process and descr. 5 parts
Definition
1. text section- the program code
2. program counter-current activity
3. stack-contains temporary data
4. data section-contains global variables
5. heap-memory is dynamically allocated during process runtime
Term
what are 5 process states and descrp.
Definition
1. new-being created
2. running-instructions being executed
3. waiting-waiting for event
4. ready-ready to be assigned to processor
5. terminated-finished execution
Term
what is a process control block and what info does it hold? 7 parts
Definition
contains information about processes
1. process state-running? waiting?
2. program counter- address of next instruciton to execute
3. CPU registers-variety of data inluding info during switches
4. CPU-scheduling info-process priority and scheucling info
5. memory management info-info regarding limits on memory
6. accounting-statistics re: process
7. I/O status informaiton-list of devices to a process
Term
long term scheduler
Definition
deals with tasks that will run a long time, and is careful when scheduling to maximize efficiency
Term
short term scheduler
Definition
quickly running, switches between programs frequently, shorts programs usually
Term
medium scheduler
Definition
swapping is introduced, swapping out processes in execution for better ones
Term
what is cascading termination?
Definition
if parent does not exist, then child is terminated as well
Term
what is symmetry in addressing?
Definition
both receiver and sender are required to provide info on other process to communicate
Term
what is asymmetry in addressing?
Definition
only sender needs to know receiver, receiver doesnt care
Term
4 types of synchronization and des
Definition
1. blocking send-sending process blocked until message received by process or mailbox
2. nonblocking send-sending process sends and resumes
3. blocking receive-reciver blocks until message is available
4. nonblocking recieve-reciever retrieve valid or null message
Term
sockets in message passing?
Definition
provide uniquie id, IP address
Term
what is a threads library?
Definition
provides api for programmer to use in creating and managing threads
Term
what are 3 appraoches to thread libraries?
Definition
1. provide library in user space w/o kernal support
2. kernal-level library provided by operating system
Term
when does a process go from running to waiting?
Definition
when it needs input from i/o
Term
what would happen if time slice were problomatically short?
Definition
too much overehead would be created from the context switches
Term
what is char*
Definition
pointer to a character type
used in definition of arrays
Term
what is *x where x is an int
Definition
pointer to value held in x
Term
what is x when x is relating to pointers
Definition
the pointer pointing to an int
Term
what is &x mean
Definition
pointer to address of x
Term
if int*y= &x
what is y?
Definition
pointer to an integer
Term
if int*y= &x
what is *y?
Definition
integer
Term
if int*y= &x
&y
Definition
pointer to a pointer of an int
Term
how to use scanf()
Definition
(type "%d", address of variable to store in "&lim)
Term
how to use printf()
Definition
(type "%d", variable to be printed)
Term
how to change permissions using command line?
Definition
chmod
Term
what does a shell allow?
Definition
allows the user to interact with the kernal
Term
how do you access the bourne shell? and what is it in comparison to the bourne again shell?
Definition
sh
predecessor
Term
how do you access the bourne again shell?
Definition
bash
Term
how do you see the programs you have running?
Definition
ps
Term
what does the "which" command do?
Definition
finds location of executable
Term
what two parameters are part of main function reading command line arguements?
what do they represent?
Definition
int argc and char**argv
number of commnads
the commands themselves (a space designates new command)
Term
what must you do with files at end of prgram?
Definition
fclose(file name)
Term
how do you open a file?
Definition
fopen(name of file, how to open ("r" would mean reading only))
Term
how do you read and write individual characters?q
Definition
fputc and fgetc
Term
how do you read chuncks of characters?
Definition
fread and fwrite()
Term
what are adv of fread and fwrite?
Definition
you can use buffers
Term
what must happen in a fork before a parent process executes?
Definition
the child must finish executing first
Term
what pid represents child in a fork()?
Definition
0
Term
what type of communicaiton is communicaiton between two sockets?
Definition
two way
Term
what type of communication is pipes? and what do they do?
Definition
one way
filter out data presented from command
Term
what does *-- in pthreads library mean?
Definition
pointer to location of function in meemory
Term
& in pethreads use?
Definition
address of function
Term
what does the exec() command do?
after a fork() call?
Definition
exec command replaces an entire process and all threads

after a fork call it replaces the newly created process with the process listed in the parameter
Term
what is a shell?
Definition
interpretor of command line commands
Term
use fgetc and fputc in code
Definition
do example
Term
how to do file reading and writing with fread() and fwrite()
Definition
same as other, but currsize=current size of buffer, which fread returns
size=size of buffer
Term
how do use use scanf()
Definition
scanf(type,address of variable to store)
Term
what is stdin?

what is one way we have used it when reading files with buffers?
Definition
standard input, commands input from the keyboard in cli

hit new line to show next 5 lines of code
Term
in terms of diagrams, what does the child process and the parent process do?
Definition
child: executes and exits
parent: waits until child exits then runns
Term
what is a pipe?

where do we see them?
Definition
standard method of communication between processes

between the command line output and input of another program to be printed
Term
what thread library uses pthreads()?
Definition
POSIX
Term
what are differences between fork() and exec()?
Definition
fork creates a new process
exec replaces process and containing threads
Term
what is one way to look at fork() example with letter
Definition
if it is "!pid", then it is the parent
Term
what is a cooperating process?
Definition
process that can affect or be affected by other processes
Term
what does strace() do?
Definition
sees what system calls are made
Term
what could be a problem with useing the same system call interface for files and devices?
Definition
they are similar, and the user may not realize differences in how they are handled
Term
how are commands interpreted in linux?
Definition
through a shell in user space
Term
what are the two primary forms of interprocess communication?
Definition
message passing and shared memory
Supporting users have an ad free experience!