Week 6 & 7 - Processes, Runtime Memory & Jumps Flashcards
What is POSIX?
Portable Operating System Interface, made by the IEEE Computer Society; 1998
Who was the UNIX certification done by?
The Open Group; 1995
What are the two officially certified Linux OS’s?
Inspur K-UX and EulerOS
What form the de facto standards for Linux?
Red Hat Linux and Ubuntu
What does POSIX enable developers to do?
Write portable applications as is a family of related standards for maintaining compatibility between variants of UNIX and other OS’s
What does POSIX define?
Application programming interface (API)
Command line shells
Utility interfaces
What fundamental services needed for applications does POSIX describe?
An interface, written in C
A command interpreter (the shell)
Common utility programs
Standard semantics and syntax
When and why was The Open Group established?
In 1995 to create a single UNIX specification to ensure compatibility across platforms
Who are the platinum members of The Open Group?
Capgemini
Hewlett Packard (HP) Enterprise
Huawei Technologies
IBM
Oracle Corporation
Philips
What are the fully certified varieties of UNIX?
Oracle: Solaris
Hewlett Packard: HP-UX
IBM: AIX
Apple: MacOS X, version 10.5 onwards
Inspur: K-UX
Huawei: Euler OS
What are “mostly compliant” varieties of UNIX?
Most Linux distributions
Android
Cygwin
What are the three layers/elements of UNIX (not including hardware)?
Kernel, shell and programs
What is everything in UNIX categorised in to?
A file (passive, e.g. program code) or a process (active, e.g. a running program)
What does each process have?
A unique PID
Exactly one parent (apart from the system swapper)
Zero or more children
What does PID stand for?
Process IDentifier
What does the system swapper do?
It is the ancestor of every process, and is part of the Linux kernel. It has PID 0 (init or systemd with PID 1 on Linux)
When is a child created (“spawned”) in UNIX?
When the system fork command is called
What does the UNIX command ‘ps’ do? Include common flag details.
Process snapshot - shows a snapshot of all processes from the same terminal. -f shows full details, -e selects all processes, -i means ignore case, -H shows process hierarchy
What does the UNIX command ‘top’ do?
Real-time list of processes
What does the UNIX command ‘&’ do?
Run processes in the background
What does the UNIX command ‘jobs’ do?
List of the background child processes of current processes
What does the UNIX command ‘bg’ do?
Put a paused job into the background
What does the UNIX command ‘fg’ do?
Bring a background job into the foreground
What does the UNIX command ‘kill’ do?
Kills a process - forces it to finish
What does the UNIX command ‘nohup’ do?
Keeps a child process running even when the parent process finishes
What does the UNIX command ‘nice’ do?
Lower the priority of a child process as you spawn it
What does the UNIX command ‘renice’ do?
Lower the priority of a current process
What does the UNIX command ‘|’ do?
Pipe
What does the UNIX command ‘>’ do?
Redirect stdout to a new file
What does the UNIX command ‘<’ do?
Redirect stdin from a file
What does the UNIX command ‘grep’ do?
Search using RegEx
In UNIX, how would you show all processes whose command line includes the text “python”, ignoring case?
ps -ef | grep -i python
In UNIX, how would you show the parent/child hierarchy of all processes?
ps -efH | less
What does it mean when a process is running in the foreground?
The shell waits until the process has finished
What does it mean when a process is running in the background?
You can continue to interact with the shell while the process runs. The process is killed if the parent process finishes
At what priority should background processes be run?
At a lower priority than foreground ones.
In UNIX, how can a process replace itself?
By calling one of the exec functions, which are all wrappers for the execve function
When must a pipe be opened in UNIX?
Before a fork, so that a parent and child could share it
What does the kill command actually do in UNIX?
Sending a signal to a process
How does communicating between processes in UNIX work in terms of signals?
Signals need to know the PID of processes you are signalling, no data can be transferred, and the receiving process does not need to keep checking
How does communicating between processes in UNIX work in terms of files?
One process writes a file, the other reads it (need to consider file locking), data can be transferred, receiving process has to keep checking
How does communicating between processes in UNIX work in terms of pipes?
Each process opens one end of an unidirectional “pipe” down which data is sent. The processes must be parent and child, or siblings. Data can be transferred and the receiving process has to keep charging
What is runtime memory?
Virtual address space, the stack, the heap
What are jumps?
Error “catching”, coroutines
What is the C disassembler command?
objdump -d
What is BIOS?
Basic Input/Output System - it boots the operating system
What memory address does each virtual address space start at?
Zero
What does MMU stand for?
Memory Management Unit
What does TLB stand for?
Translation Lookaside Buffer (cache of recently-used mappings)
What does BSS stand for?
Block Started by Symbol
What is bp(fp)?
Base (frame) pointer
What is sp?
Stack pointer
On a 64-bit machine, what is %rsp and %rbp?
%rsp is the stack pointer register
%rbp is the base (frame) pointer register
In ANSI C, what does __asm__ perform?
Assembler instructions