Study Set 1
What are the three main goals of an operating system?
1. The fundamental goal of computer systems is to execute user programs and to make solving user problems easier. 2. Make the computer system convenient to use. 3. Use the computer hardware in an efficient manner.
What is the difference between a program and a process?
A program does nothing unless its instructions are executed by a cpu. A program in execution, as mentioned is a process. A time-shared user program such as a compiler is a pricess. The difference between a program and a process is a program is a set of codes while the execution of program is the process.
What is a virtual machine?
A virtual machine (VM) is a program that provides environment for running a guest OS on a host OS. It treats hardware and the operating system kernel as though they were all hardware
Explain what is meant by stating that modern operating systems are interrupt-driven.
If there are no processes to execute, no i/o devices to service, and no users to whom to respond, an operating system will sit quietly, waiting for something to happen. Events are almost always signaled by the occurrence of an interrupt or a trap. For each type of interupt, seperate segments of code in the operating systems determine what actions should be taken.
Describe synchronous and asynchronous communication (input / output; I/O) between the OS and a device.
In a synchronous communication between the OS and a device, after the I/O starts, control returns to user program only upon I/O completion. The wait instruction idles the cpu until the next interrupt. Wait loop (spinning). At most one I/O request is outstanding at a time, no simultaneous I/O processing. There is an alternate mechanism to waiting: blocking, in which the program set aside until the end of I/O In a Asynchronous communication between the OS and a device, after I/O starts, control returns to user program without waiting for I/O completion. System call is a request to the operating system to perform restricted operation; here: to request I/O operation and to be notified upon its completion. The Device status table contains entry for each I/O device indicating its type, address and state. Operating system indexes into I/O device table to determine device status and to modify table entry to include information needed to handle interrupt.
What is the purpose of interrupts? What are the differences between a trap and an interrupt? Can traps be generated intentionally by a user program? If so, for what purpose?
Interrupt is a mechanism that allows hardware to communicate to software that a system event that needs attention has occurred. A trap is a software-generated interrupt caused either by an error or a user request. Yes traps can be generated intentionally by a user program. If the user accidently creates a program that causes the computer to go through an infinite loop, it can cause an issue, so the purpose of intentially triggering a trap is to fix issues like that so the computer wont crash and there is an escape or warning before it freezes
What is memory management and what are the main memory management activities?
Memory management determines what and when is in memory, Optimizing cpu utilization and computer response to users. The memory management activities are: 1. Keeping track of which parts of memory are currently being used and by whom 2. deciding which processes and data to move into and out of memory 3. Allocating and deallocating memory space as needed
Describe what multiprogramming is and why is it used in modern computers.
Multiprogramming increases CPU utilization by organizing jobs so that the CPU always has one to execute. It is used in modern computers because a single program cannot, in general, keep either the cpu or the i/o devices busy at all times. Single users frequently have multiple programs running
What is a system call?
System calls provide the means for the user program to ask the operating system to perform tasks reserved for the operating system on the user program's behalf.
Describe the challenges in using cached data.
The challenges in using cached data is that the cache is smaller than storage being cached. In a multitasking environments mst be careful to use most recent version of the data, no matter where it is stored in the storage hierarchy. In a distributed environment , multiple data can exist.
How does the distinction between kernel mode and user mode function as a rudimentary form of protection (security) system?
The distinction between kernel mode and user mode function as a rudimentary form of protection system by having the hardware switch from user mode to kernal mode when a trap or interrupt occur. Whenever the operating system gains control of the computer, its in kernel mode. The system always switches to user mode before passing control to a user program. In a sense, it won't allow the user to make certain changes that will affect the operating system and will split back an error.
What is a an operating system kernel?
The operating system is the one program running at all times on the computer.
Describe the role of an operating system as a resource allocator and as a control program.
The operating systems manages all resources, facing numerous and possibly conflictig requests for resources, the operating system must decide how to allocate them to specific programs and users so that it can operate the computer system efficiently and fairly. The control program manages the execution of user programs to prevent errors and imporper use of the computer. It is especially concerned with the operation and control of I/o Devices.
What are process management activities of operating systems?
The process management activities of operating systems are: 1. Scheduling processes and threads on the CPUs 2. Creating and deleting both user and system processes 3. Suspending and resuming processes 4. Providing mechanisms for process synchronization 5. Providing mechanisms for process communication
Give two reasons why caches are useful. What problems do they solve? What problems do they cause? If a cache can be made as large as the device for which it is caching (for instance, a cache as large as a disk), why not make it that large and eliminate the device?
The two reasons why caches are useful are faster storage and information in use is copied from slower to faster storage temporarily. The main problem they solve is speed when it comes to data that is being used over and over since it does not have to search and find the actual storage location, it just checks the cache first to make sure that the information is there and uses it, if not it pulls from the source and saves it onto the cache. The main problem with cache is the limited size. Also in a multitaskign envoronment, it has to becareful and grab the most up to date data that it needs. In a distributed environment, multiple copies of that data will be saved in multiple locations which can causes issues if it does not take the most up to date data. A cache is very small so it won't be able to store much. We don't want to make the cache as large as the device and eliminate the device because the cache is a temporary storage.
What is system concurrency?
Typically a system has many processes some user, some operating system, running concurrently on one or more CPUs. Concurrency is achieved by multiplexing the cpu among a number of processes/ threads.