Exam 1 Review - Chapters 1 to 3, Computer Organization Review, Tutorials 1 and 2 Flashcards
What is the simplest way to describe a computer?
HW + OS + Apps + Users
What is the user view like?
Single-user, at a terminal/mainframe, uses embedded systems
What is system view?
OS is a resource allocator, control program, the one program running at all times (AKA the kernel)
What is a bootstrap program?
A program loaded at power-up or reboot, stored in ROM/EPROM, AKA firmware, initializes all aspects of the OS
Can I/O devices and the CPU execute concurrently?
Yes, 1/+ CPUs, and device controllers, connect through a common bus providing access to shared memory
What do device drivers do?
Provides uniform interface between controller and the kernel
How does the OS discover the occurrence of an event?
Through polling (CPU constantly loops to see whether the device is ready) or interrupt (CPU works on other tasks until an interrupt is received)
What’s a HW interrupt?
A signal is sent to the CPU
What is a SW interrupt?
Known as trap/exception, includes SW errors, requests for an OS service, system call
What is the storage hierarchy based on?
Based on speed, cost, volatility
How is the storage hierarchy organized?
Magnetic tapes, optical disk, hard disk, SSD, main memory, cache, registers
What kind of systems exist concerning processors?
Single-processor (single general-purpose processor with one general-purpose CPU), multiprocessor (can be a multicore system), and clustered (Independent with shared common storage)
What kinds of multiprocessor systems exist?
Asymmetric (each processor assigned a specific task, batch processor controls the system) and symmetric (each processor performs all tasks)
What is a batch system?
Multiprogramming, users do not interact with the system, organizes jobs so CPU always has one to execute
What is time sharing?
Multitasking, users can interact with the system, each user has at least one program executing in memory, if processes don’t fit in memory, swapping moves them in and out to run
Describe dual mode operation
User (mode bit = 1) and kernel mode (0), allows OS to protect itself and other system components, kernel mode can only be entered by making system calls and is the only one that can execute certain machine instructions
How is a system call implemented?
1) The user’s program makes an indirect system call
2) A number is associated with each system call
3) An entry of the index table points to the detailed implementation of the system call
Describe message passing
Suitable for transferring smaller amounts of data (imagine an envelope containing just one letter) and has simpler implementation of communication
Describe shared memory
Has a maximum transfer rate but has problems like synchronization and security (imagine sharing a PO box with a friend or even a stranger)
Can an OS be perfect and meet all requirements?
No, there is no unique solution for meeting all requirements, must select own personal most important requirements
Describe policy and mechanism in terms of principle
Policy is “what will be done?” and mechanism is “How will the policy be implemented?”; Policy is changeable without needing to rewrite code but mechanism is fixed
What is a simple structure?
Provides most functionality in least space, no distinction between user and kernel modes, not divided into modules for MS-DOS layered structure; System programs and kernel separated for UNIX partially-layered structure
What is a layered approach structure?
OS divided into layers, each built on top of lower layers. Very simple for constructing and debugging but each layer adds overhead to a system call
What is a microkernel structure?
Removes all nonessential components from the kernel, and implement them as system applications instead, portable and very secure
Describe the command interpreter
A form of emulation, usable as a program such as shell, command line uses argv (arguments vector) and argc (arguments counter)
What is the difference between a process and a program?
A process is a program in execution, active, and a program is a passive entity stored in memory as an executable file
Describe a process in terms of memory
Has multiple parts: stack (contains temporary data such as function parameters and local variables), heap (used for dynamic memory allocation), data (stores global and static variables), and text (compiled program code)
Describe process states (new, ready, running, waiting, terminated)
New (process being created), ready (process waiting to be assigned to a processor), running (instructions being executed), waiting (process is waiting for some event to occur), terminated (process finished execution)
What is a process control block (PCB)?
Stores process-specific information, contains: process state, process number, CPU registers and scheduling information, program counter, registers, memory limits, and list of open files
Describe the different types of scheduling queues of processes (job, ready, device)
Job queue (set of all processes in the system), ready queue (set of all process residing in main memory, waiting), device queues (set of processes waiting for an I/O device)
Difference between long-term (job) scheduler and short-term (CPU) scheduler?
Long-term selects which processes should be brought into the ready queue, infrequently invoked, while short-term selects which process should be executed next and allocates CPU, frequently invoked
What is a context switch?
Loads saved state for a new process and saves states of an old process when CPU switches to another process. Is overhead, system does no useful work while switching
What is a daemon?
A background process that normally runs indefinitely
Describe multiprogramming
The number of processes that are in the memory, maximizes CPU use
The difference between I/O-bound and CPU-bound processes
I/O-bound processes spends more time doing I/O and has many short CPU bursts while CPU-bound processes spends more time doing computations and has few long CPU bursts
Why is a good process mix of I/O and CPU necessary?
To keep both CPU and devices fully utilized
What are zombie processes?
A terminated process whose parent has not yet called wait()
What are orphan processes?
An orphan process is a process whose parent process has finished/terminated, though it remains running itself