1/30
concepts ranging from HWs 1&2; Quiz 0&1; Lab 0
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What is a process?
an instance of a running program that is an abstraction of the operating system
What is the importance of having certain operations like read() and write() managed by the operating system instead of individual processes?
1. Prevent user level processes from manipulating hardware 2. Program will have good portability across machines 3. Processes do not have to have redundant code
what are the three aspects to a process?
what is the operating system?
the system software that manages hardware/software resources to ensure efficiency
how would you examine the assembly code of a program in your terminal?
gcc -S the_source_file.c -o the_assembly_file.s
what is virtualization?
the process of the OS creating virtual versions of computer hardware
how does a process access system resources?
it does a system call
what is a system call?
the mechanism by which user-level programs ask the OS to do things for them
what is the kernel?
the core part of the OS that bridges the software and hardware
what are the disadvantages of user mode?
no direct access to system resources, kernel programs, nor memory not manually allocated in user mode
what are the advantages of kernel mode?
unrestricted access to system resources, user and kernel programs, and memory blocks
what are the three ways to invoke the kernel?
system call, exception call, interrupt call
what is a PID?
the unique process identifier of the running program.
how do you create a new process?
fork()
what are the 3 main purposes of the OS?
takes physical resources and virtualizes them
handles concurrency
stores files consistently
what is concurrency?
the ability to execute multiple threads and processes simultaneously
how to create a thread?
pthread.create()
what type does fork return?
the pid_t of the child process is returned in the parent, and 0 is returned in the child
what if fork returns -1?
the system call failed
what does the child process inherit from the parent process?
program code, program counter, memory, opened files
what deviates between child and parent process?
different ret value, pid, parent, running time, file lock
if the child process is a duplicate of the program the parent process comes from, why wouldn’t this result in infinite creation of processes?
the child has the same code but only executes code after the initial fork line
who runs first between parent and child?
that depends on process scheduling
how can we ensure a child process is done first?
wait()
what is the shell?
program that creates programs and lets users interact with the kernel, usually via command-line
what is process control block
data struct where OS keeps information about a process
How does the operating system create the illusion that every process has its own private set of CPU registers?
the kernel saves registers of current process in its PCB before switching to another process
what does PCB have:
the pid, state, user id, ip, opened files, open files, VM structs, registers
what is time sharing:
the act of concurrent processes being executed through virtualization via PCB to cut down runtime
what is context switch
the act of switching between processes using PCB
what is zombie state
a child has exited, but the parent isn't given its exit status so the OS doesn't cleanup its PCB