Introduction to Operating Systems Flashcards
Virtualization
Concurrency
Persistence
What happens when a program runs?
it executes instructions.
- the processor fetches an instruction from memory
- decodes the instruction (which instruction is this?)
- executes the instruction
- the processor fetches the next instruction, and repeats steps 2 - 4 until there are no further instructions
the simple model most programs use:
- instructions execute one at a time, in an orderly and sequential fashion
What is the Basic Von-Neumann Structure?
the Von-Neumann structure uses a single processor, uses one memory for both instructions and data, and executes programs following the fetch-decode-execute cycle
What are the components of the Von-Neumann Model?
Central-Processing Unit: electric circuit responsible for performing most of the data processing operations. CPU performs variety of functions dictated by the instructions that are incorporated into the computer.
Buses: the means by which information is shared between the registers in a multiple-register configuration system. A bus structure consists of common lines, one for each bit of a register, through which binary information is transferred one at a time. Control signals determine which register is selected by the bus during each particular register transfer
Memory Unit: a collection of storage cells together with associated circuits needed to transfer information in and out of storage. The memory stores binary information in groups of bits called words.
Operating System
is a body of software responsible for making it easy to run programs, allows programs to share a memory, enabling programs to interact with devices
The operating system is a body of software in charge of making sure the system operates correctly and efficiently in an easy-to-use manner.
The primary way the OS does this is by a technique called Virtualization.
The OS also acts a resource manager, managing the resources such as CPU, memory unit, and disk.
1st Component of Operating Systems: What is Virtualization?
the OS takes a physical resource, such as the processor, memory unit, or a disk, and transforms it into a more general, powerful, and easy-to-use virtual form of itself - hence, referring to the OS as a virtual machine
How does the user interact with the OS to instruct the OS? (like, instruct the OS to run a program, allocate memory, or access a file)
The OS provides interfaces (APIs) the user can call. The OS exports roughly 200 system calls that are available to applications. The OS provides a standard library to applications.
The CRUX of the problem: How do operating systems virtualize resources?
First, we start with why. Why does the OS virtualize its resources? Because it makes the system easier to use
Second, we focus on the HOW. What mechanisms and policies are implemented by the OS to attain virtualization? How does the OS do so efficiently? What hardware support is needed?
Virtualizing the CPU
there’s an illusion that the system has a large number of CPUS. The illusion is turning a single CPU into a seemingly infinite number of CPUs
Virtualizing Memory
Memory is just an array of bytes.
To READ memory: one must specify an address to be able to access the data stored there
To WRITE/UPDATE memory: one must specify the data to be written at the specific address
Memory is accessed all the time when a program is running. A program keeps all of its data structures and instructions in memory. Therefore, when the processor needs to fetch instructions, it goes to memory. Then, when it goes to execute the instructions which involve a data structure from the program, it access that data structure in memory.
Virtualizing memory provides each process its own private virtual address space in memory, which the OS somehow maps onto the physical memory of the machine
Why is it important for me to learn about the Operating System?
Because it helps me understand computer programming from the ground up. It allows me to put a bound on this gap in knowledge. It allows me to put a bound around this knowledge. On one end there’s the finished software application that the end user is using, on the other end there’s a system with limited resources that need to be managed properly as I build this software, so that the software can run as expected.
This gives me concrete, simple building blocks to work with.
2nd Component of Operating Systems: Concurrency
concurrency refers to the host of problems that arise, and must be addressed, when working on many things at once(concurrently) in the same program.