Lecture 04 Flashcards

1
Q

How much memory address space is given on a 32-bit machine?

A

4GB (2^32)

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

How much memory address space is given on a 16-bit machine?

A

64KB (2^16)

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

How much memory is ‘Kernel Space’ on 32-bit Linux?

A

1GB

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

How much memory is ‘User Space’ on 32-bit Linux?

A

3GB

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

How much virtual address space does Intel 54 architecture support?

A

48-bit, or 256TB

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

How much memory is ‘Kernel Space’ on 64-bit Linux?

A

128TB

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

How much memory is ‘User Space’ on 64-bit Linux?

A

128TB

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

On 64-bit Linux, addresses are 64-bits long. How many bits of this are used for addressing, and what is done with the other bits?

A

Only the lower order 48 bits are used for addressing.

Bits 63-48 must be all 1 or all 0.

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

What are the five memory segments that a Linux process is divided into?

A
  • Code Segment
  • Data segment
  • Block Started by Symbol (BSS)
  • Stack Segment
  • Heap
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the Code Segment of a Linux Process?

A

The program text

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

What is the Data Segment of a Linux Process?

A

Initialised global/static variables and data structures.

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

What is the Block Started by Symbol (BSS) Segment of a Linux Process?

A

The uninitialised global/static variables and data structures.

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

What happens when one or more processes have their own, varying data at the same internal memory address?

A

Nothing.

Each process has its own independent address space so they cannot interfere with one another.

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

What is a page table?

A

A table which maps an address in process memory to a physical memory address.

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

Do processes have direct access to physical memory?

A

No, the CPU performs these accesses.

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

How many ‘Protection Rings’ does a CPU have?

A

3.

17
Q

What is ‘Protection Ring 0’ on a CPU?

A

Full access. Can edit physical memory and edit the page table.

18
Q

What is ‘Protection Ring 3’ on a CPU?

A

Indirect memory access via the page table only.

Does not have the ability to edit the table and is blocked from some CPU instructions.

19
Q

What causes a ‘segmentation fault’?

A

When a process tries to access a memory location which is not currently mapped in the page table.

20
Q

What is the ‘exec’ system call used for?

A

Replacing the current program with a new program.

21
Q

When ‘exec’ is called on a process, what is NOT overwritten? (Pick as many as you think)

  • Process ID
  • Text
  • Stack
  • Heap
  • Data
  • Open file descriptors
A

Process ID and open file descriptors

22
Q

A pipe provides which level of communication?
Full-duplex
Half-duplex
Simplex

A

Half-duplex

23
Q

Do pipes allow one-way communication, or two way?

A

One way

24
Q

What is the function prototype for the ‘pipe’ function?

A

int pipe(int filedes[2]);