CSCI 340 OS Systems
What is IPC?
Inter-process communication is the way processes share data
How does the performance overhead of a context switch affect system calls?
System calls uses two context switch, one from the program to the OS, and back from the OS to the program
What is page table?
Table that contains mapping of pages to frames
What is the layout of a process in memory?
Text, data, heap, stack
What is the relationship between C++ variable, RAM and memory address?
The C++ variable gets copied in RAM and it acquires a memory address for that placement in RAM
What does it mean to run the program?
The CPU is executing program code instruction after instruction
How does the speed of the CPU, RAM and hard disk compare to each other?
The CPU is the faster, RAM is second fastest, and hard disk is the slowest
What is CPU core? What does it mean "quad-core CPU", "octa-core CPU" ?
The processor of a CPU. Quad and octa means 4 or 8 processors, respectively, in a CPU.
What is physical address?
The real memory address in the actual RAM memory
How do sizes of pages and frames relate?
The size of the page is equal to the size of the frame
What is data?
The way a computer stores information
How many page tables are there in a system?
There is one page table for every process
Why might we want to create new threads of execution instead of new processes?
They are fast to create, memory efficient, fast content switch, and shared memory appears automatically
Why are physical address inconvenient for modern programs?
They are inconvenient because it makes it inflexible. Every time you change to another physical location, you'd have to modify the addresses of all of your instructions to match what's on that new machine.
What do threads belonging to the same process share? What do they don't share?
Threads share: text section, data section and heap. Threads don't share: stack
What is the purpose of RAM memory?
To store the instructions of programs for the CPU to pull and execute
What is the idea of shared memory?
Two processes can ask OS to create a shared space of memory
List five process states
1. New 2. Ready 3. Running 4. Waiting 5. Terminated
List of operating systems functions. For each item on this list, be ready to give a short description.
1. Running programs: OS starts program and helps CPI prepare to run program 2. Managing CPU: OS determines how programs manage CPU 3. Managing RAM: OS chooses where in RAM a program is located and chooses which programs go from RAM hard disk 4. Managing I/O: programs ask OS for I/O assistance 5. Managing Storage: OS controls the file system made to store the data in hard disk. 6. Networking: OS handles how a computer sends and receives info through the network 7. User Interface: OS manages how the user interacts with other applications 8. Security: OS manages the security for software and hardware 9. Inter-process communication: OS manages the way programs interact with each other
How can we execute program written in higher-level languages?
We need a compiler or interpreter that transforms that language into machine language for the CPU to understand
What is a memory stall?
When the CPU needs data from RAM, but RAM can't deliver data at the time and the CPU must wait
Examples of different operating systems
Windows, Linux, MacOS, ChromeOS, Android, iOS, Unix, VxWorks
What is interpreter? What are interpreter advantages?
transforms or interprets a high-level programming code line by line into code that can be understood by the machine. Can be slow, but can run in different platforms
What are the advantages and disadvantages of Message Passing?
Advantage: Safe, due to OS's involvement in the system calls Disadvantage: Slow due to system calls needed every time
Why is the IP address along not enough for networking communications?
Although IP address specifies a computer, it does not specify the process that wants to exchange data
What is URL?
An english-like name for an internet resource
What are networking protocols?
An established set of rules that determine how data is transmitted between devices in the same network
What computer component executes programs?
CPU
What is physical address space? How many physical address spaces are there in the system?
Collection of all available physical addresses. There is one physical address space per one RAM memory device
What is logical (a.k.a. virtual) address space? How many logical address spaces are there in the system?
Collection of all logical addresses available to a process. Every process has it's own logical address space.
What does fork() do?
Creates an almost perfect copy of the currently running process. Both process parent and child continue execution after fork command. If the process is a parent then it will return the ID of the child; if it is a child, it will return 0
What is page offset?
Distance from the beginning of the page to the logical address in question
What is paging?
A memory technique where OS assigns processes logical memory
What is a client?
A program in a computer that requests data
What is process?
A program in execution i.e. running program
What is the difference between process and program?
A program is a collection of code required to perform a certain task. A progress is the program in execution
OS definition
A program that manages computer hardware and provides other programs with a running environment
What is a server (like in "web server" or "email server")?
A program that provides data to other processes
What is a program?
A set of instructions that process data
What is operating systems API?
A set of programming tools that OS provides to application programmers
What is TLB? What is its purpose?
A small memory unit inside of MMU that stores the few most useful entries from the page table. It's purpose is to maximize optimization by creating a quick way of obtaining the most useful entries from the page table.
What are drivers?
A small program that translates OS requests to the device language
What is DNS?
A special computer that receives a URL and returns the corresponding IP address
What is multitasking? How is it arranged?
A technique that allows to fake simultaneous execution of multiple programs using a single core CPU. It's arranged in a way that when one program doesn't use the CPU, the CPU runs the another program in the meanwhile
What is virtual memory?
A technique used by OS to fake extension of RAM memory using hard disk
What is networking port?
A unique ID number assigned to every process who wants to exchange data over the network
What is IP address? How does classic IP address (IPv4) look like?
A unique identifier of a computer in the network. The classic IPv4 looks like 12.115.255.56
What is memory address?
A unique number (normally in hexadecimal) that has the location of the data
What are the advantages and disadvantage of shared memory?
Advantage: Fast because they have access in RAM memory Disadvantage: Error prone (OS doesn't get involved after the shared memory is created)
What kind of address does the CPU fetch with instructions?
Logical address
What kind of address does the CPU send to RAM with a read/write request?
Logical address
What is MMU? What is its purpose?
MMU is a piece of hardware that converts logical addresses to physical ones.
What is the language that the CPU understands?
Machine language
What is memory address? How much memory you can address with addresses of a given size (for example, 64-bit addresses)
Memory address is the location of a specific piece of data in ram. You can address as many bits as the address is
Can shared memory kind of IPC communication be used for two processes running on two different computers? Why do you think so?
No, shared memory requires that OS allocates that chunk of shared memory in the same RAM memory
What does wait() do?
Pauses the process and resumes when child terminates. Parent gets the child exit status
What kind of address arrives to RAM with the read/write request?
Physical address
What are well-known ports?
Ports with pre-determined purposes
What is the idea of Message Passing?
Process A can pass a piece of data to process B
List the possible components of a Process Control Block (PCB)
Process ID (PID): name of address Process State: The state the process is in Program Counter: Keeps the value of PC Register Files: copy of general purpose registers Parent ID: The process that created this process CPU Scheduling Info: info needed to choose what process uses CPU next Memory Usage Info: where in RAM is this process located List of resources obtained by process
Why might we want to create a new process instead of new threads?
Processes can use exec() and are independent regarding other processes.
What is PC?
Program counter stores the next instruction that is to be executed by the CPU
Where is the running program stored? What else (other than the program code) is stored there?
RAM. Registers are also stored in RAM
Where does the process go once the I/O request is complete?
Ready Queue
What does exit() do?
Release all resources. Process still exists. Exit status can be collected by parent
What is machine cycle?
Sequence of steps CPU takes to execute a single instruction
What is context switch?
Sequence of steps taken by computer to switch CPU from executing one process to executing another
What are two general classes of IPC?
Shared memory and message passing
What is network?
A bunch of computers connected together for data exchange
What is page?
A bunch of logical addresses of a fixed size
What is frame?
A bunch of physical addresses of a fixed size
What is byte? What is a bit? How many bits are in a byte?
A byte is 8 bits. A bit is the smallest unit of data a computer can process and store
What is compiler? What are compiler advantages?
A compiler takes the high-level language (such as C++) and translates it to CPU machine language. The compiler advantages is that it can run quickly but it can be OS dependable
What is file? What is file system? What is logical disk?
A file is a bunch of data that you want to store in memory. A file system is a collection of information about all files stored in a storage device. A logical disk is a portion of a hard disk described in one separate hard disk
Wat is an executable file?
A file that holds encoded sequence of instructions for a computer to perform
How does memory look like?
A linear array of bytes
Why context switching has a small performance overhead associated with it?
Given running process A and ready process B. Having to pause the execution of process A, save it's context, load process B and resume process B creates a small performance overhead
What long-term storage do we have?
Hard disk
What are User and Kernel Modes?
In User mode, the user can not use kernel instructions. In Kernel mode the use can use kernel instructions, which are instructions that have complete control over everything in the system.
What is a thread of execution (a.k.a. just thread)?
Independent execution of a program code from a separate program counter
What are interrupts? What are interrupt handlers? What issues interrupts? What is the sequence of things that happen when the interrupt arrives?
Interrupts are signals that alerts computer about an important event that requires immediate attention. Interrupt handlers are functions that run when an interruption occurs. I/O devices issues interrupts. The sequence of things that happen when the interrupt arrives are: 1.CPU pauses the currently running program 2. Run interrupt handler (which are function in OS) 3. Continues regular work
How do the properties of heap affect the typically dynamic memory allocation like using the operator "new"?
It can be slow and unpredictable
What do we know about RAM memory?
It has random-access, it is slow, and volatile (it needs a power supply to work)
What are the properties of stack?
It is dense and not fragmented. As functions are called it will push the function and it's resources to the stack, and after function is done running, it will release the resources and pop from the stack
What are the properties of heap?
It is fragmented; full of holes
What does exec() do?
It wipes the current process clean. Places the code and data from the specified file in the process
what happens to processes in reality when process states change
The PCB (Process Control Block) keeps track of what state a process is in. If it is in its running state, the PC will be pointing at code in this process. If is in the I/O Queue the process was issued an interrupt handler.
What is operating system kernel?
The central part of OS that has complete control over everything in the system
What different types of computers exist? How different are operating systems for different computer types?
The different types of computers are desktops, mobiles, servers, and imbedded. The different operating systems are made to optimize the productivity of the computer type.
What is communication protocol?
The language used between clients and servers (?)
1. What is the length of memory address? 2. What does it mean "32-bit address"?
The length of memory address is 32 bits (i.e. 4 bytes). 32-bit address means the address is 32 bits long.
What is logical address?
The memory addresses used by the process
What is TLB hit?
The needed page table entry is in the TLB. Address conversion happens fast
What is TLB miss?
The needed page table entry is not in TLB. It is forced to do RAM memory access operations
What happens to a process when it requests I/O operation (like file reading) in the classic "blocking" scenario?
The process will call an interrupt, which will send the process to the I/O queue
What is I/O queue?
collection of processes waiting to use I/O devices
How many I/O queues do you expect in the system?
expect multiple if there's multiple I/O devices
How many ready queues do you expect in the system?
expect one ready queue in a system, assuming it's a single core CPU
What are the basic steps of machine cycle?
fetch, decode, execute
What is ready queue?
set of all processes that are in RAM, ready and waiting to execute