Week 6 & 7 - Processes, Runtime Memory & Jumps Flashcards

1
Q

What is POSIX?

A

Portable Operating System Interface, made by the IEEE Computer Society; 1998

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Who was the UNIX certification done by?

A

The Open Group; 1995

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the two officially certified Linux OS’s?

A

Inspur K-UX and EulerOS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What form the de facto standards for Linux?

A

Red Hat Linux and Ubuntu

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does POSIX enable developers to do?

A

Write portable applications as is a family of related standards for maintaining compatibility between variants of UNIX and other OS’s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does POSIX define?

A

Application programming interface (API)
Command line shells
Utility interfaces

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What fundamental services needed for applications does POSIX describe?

A

An interface, written in C
A command interpreter (the shell)
Common utility programs
Standard semantics and syntax

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When and why was The Open Group established?

A

In 1995 to create a single UNIX specification to ensure compatibility across platforms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Who are the platinum members of The Open Group?

A

Capgemini
Hewlett Packard (HP) Enterprise
Huawei Technologies
IBM
Oracle Corporation
Philips

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the fully certified varieties of UNIX?

A

Oracle: Solaris
Hewlett Packard: HP-UX
IBM: AIX
Apple: MacOS X, version 10.5 onwards
Inspur: K-UX
Huawei: Euler OS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are “mostly compliant” varieties of UNIX?

A

Most Linux distributions
Android
Cygwin

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the three layers/elements of UNIX (not including hardware)?

A

Kernel, shell and programs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is everything in UNIX categorised in to?

A

A file (passive, e.g. program code) or a process (active, e.g. a running program)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does each process have?

A

A unique PID
Exactly one parent (apart from the system swapper)
Zero or more children

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does PID stand for?

A

Process IDentifier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does the system swapper do?

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

When is a child created (“spawned”) in UNIX?

A

When the system fork command is called

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What does the UNIX command ‘ps’ do? Include common flag details.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What does the UNIX command ‘top’ do?

A

Real-time list of processes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What does the UNIX command ‘&’ do?

A

Run processes in the background

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What does the UNIX command ‘jobs’ do?

A

List of the background child processes of current processes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What does the UNIX command ‘bg’ do?

A

Put a paused job into the background

23
Q

What does the UNIX command ‘fg’ do?

A

Bring a background job into the foreground

24
Q

What does the UNIX command ‘kill’ do?

A

Kills a process - forces it to finish

25
Q

What does the UNIX command ‘nohup’ do?

A

Keeps a child process running even when the parent process finishes

26
Q

What does the UNIX command ‘nice’ do?

A

Lower the priority of a child process as you spawn it

27
Q

What does the UNIX command ‘renice’ do?

A

Lower the priority of a current process

28
Q

What does the UNIX command ‘|’ do?

A

Pipe

29
Q

What does the UNIX command ‘>’ do?

A

Redirect stdout to a new file

30
Q

What does the UNIX command ‘<’ do?

A

Redirect stdin from a file

31
Q

What does the UNIX command ‘grep’ do?

A

Search using RegEx

32
Q

In UNIX, how would you show all processes whose command line includes the text “python”, ignoring case?

A

ps -ef | grep -i python

33
Q

In UNIX, how would you show the parent/child hierarchy of all processes?

A

ps -efH | less

34
Q

What does it mean when a process is running in the foreground?

A

The shell waits until the process has finished

35
Q

What does it mean when a process is running in the background?

A

You can continue to interact with the shell while the process runs. The process is killed if the parent process finishes

36
Q

At what priority should background processes be run?

A

At a lower priority than foreground ones.

37
Q

In UNIX, how can a process replace itself?

A

By calling one of the exec functions, which are all wrappers for the execve function

38
Q

When must a pipe be opened in UNIX?

A

Before a fork, so that a parent and child could share it

39
Q

What does the kill command actually do in UNIX?

A

Sending a signal to a process

40
Q

How does communicating between processes in UNIX work in terms of signals?

A

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

41
Q

How does communicating between processes in UNIX work in terms of files?

A

One process writes a file, the other reads it (need to consider file locking), data can be transferred, receiving process has to keep checking

42
Q

How does communicating between processes in UNIX work in terms of pipes?

A

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

43
Q

What is runtime memory?

A

Virtual address space, the stack, the heap

44
Q

What are jumps?

A

Error “catching”, coroutines

45
Q

What is the C disassembler command?

A

objdump -d

46
Q

What is BIOS?

A

Basic Input/Output System - it boots the operating system

47
Q

What memory address does each virtual address space start at?

A

Zero

48
Q

What does MMU stand for?

A

Memory Management Unit

49
Q

What does TLB stand for?

A

Translation Lookaside Buffer (cache of recently-used mappings)

50
Q

What does BSS stand for?

A

Block Started by Symbol

51
Q

What is bp(fp)?

A

Base (frame) pointer

52
Q

What is sp?

A

Stack pointer

53
Q

On a 64-bit machine, what is %rsp and %rbp?

A

%rsp is the stack pointer register

%rbp is the base (frame) pointer register

54
Q

In ANSI C, what does __asm__ perform?

A

Assembler instructions