Computer Hardware Flashcards

1
Q

What is the role of an operating system in relation to computer hardware?

A
  • extends the computer’s instruction set,
  • manages its resources, and
  • must have knowledge about the hardware.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the main components of a personal computer as described in the text?

A

The main components are the CPU (Central Processing Unit), memory, and I/O (Input/Output) devices, which are connected by a system bus.

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

What is the function of the CPU in a computer?

A

CPUs have registers to hold key variables and temporary results. Accessing memory is slower than executing an instruction, so registers provide a faster way to store and retrieve data during computation.

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

What are some of the special registers found in most computers?

A

program counter: which holds the memory address of the next instruction to be fetched;

the stack pointer: which points to the top of the current stack in memory;

and the PSW (Program Status Word): which contains condition code bits, CPU priority, mode (user or kernel), and other control bits.

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

Why is the PSW important for the operating system?

A

plays an important role in system calls and I/O operations. It contains information about the program’s execution state, such as the mode (user or kernel) and condition code bits set by comparison instructions.

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

Why does the operating system need to save and restore registers?

A

When time multiplexing the CPU (switching between programs), the operating system often stops a running program and starts another. To ensure the program’s state is preserved, the operating system needs to save all the registers of the current program so they can be restored when the program runs again.

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

What is the purpose of a pipeline in CPU design?

A

Pipelining allows CPUs to execute multiple instructions simultaneously. By dividing the fetch, decode, and execute stages into separate units, instructions can be processed in parallel, improving overall performance.

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

How does a superscalar CPU differ from a pipeline design?

A

A superscalar CPU has multiple execution units specialized for different types of operations.

It fetches and decodes multiple instructions at once and executes them as soon as an execution unit becomes available.

Instructions may be executed out of order, which introduces additional complexity for both compiler and operating system writers.

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

What are the two modes found in most CPUs, and what are their purposes?

A

Kernel mode: allows the CPU to execute every instruction and access all hardware features. The operating system typically runs in kernel mode, providing complete control over the hardware.

User mode: restricts the instructions that can be executed and the features that can be accessed, ensuring user programs cannot interfere with critical system operations.

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

How does a user program interact with the operating system?

A
  1. To obtain services from the operating system, a user program must make a system call.
  2. This traps the program into kernel mode and invokes the operating system.
  3. After completing the requested task, control is returned to the user program.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What approach is taken to address the conflicting goals of memory speed, capacity, and cost?

A

The memory system is constructed as a hierarchy of layers, with each layer having different characteristics in terms of speed, capacity, and cost per bit. This hierarchy includes registers, cache memory, and main memory.

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

What is the top layer of the memory hierarchy, and how is it accessed?

A

The top layer consists of registers internal to the CPU. They are made of the same material as the CPU and are accessed without any delay.

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

What is cache memory, and how does it work?

A

Cache memory is a high-speed memory located close to the CPU. It stores frequently accessed data from the main memory in cache lines.

When a memory word is requested, the cache hardware checks if the corresponding cache line is present (cache hit). If found, the request is satisfied from the cache, avoiding the need to access the main memory.

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

Why is cache memory limited in size?

A

higher cost compared to main memory.

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

How is caching used in operating systems?

A

Operating systems often utilize caching to improve performance. For example, frequently accessed files are kept in main memory to avoid repeated disk access.

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

What are some common questions that arise in caching systems?

A

When should a new item be placed in the cache?
Which cache line should the new item be placed in?
Which item should be removed from the cache when a slot is needed?
Where should a newly evicted item be placed in the larger memory?

17
Q

What is the role of caching in computer systems?

A

Caching helps avoid repetitive and time-consuming operations by storing frequently accessed data closer to the processor.

18
Q

What are the challenges in using magnetic disks for storage?

A

slower random access times

19
Q

How do SSDs differ from traditional magnetic disks?

A

do not have moving parts

20
Q

What is virtual memory, and how does it work?

A

allows running programs larger than physical memory by utilizing the disk as an extension of main memory

21
Q

What is the role of device controllers in I/O devices?

A

physically control I/O devices and accept commands from the operating system

22
Q

What is a device driver?

A

software that communicates with a specific controller to control and manage a particular device

23
Q

What is the main bus in a large x86 system according to the text?

A

PCIe (Peripheral Component Interconnect Express)

24
Q

How does PCIe differ from older bus architectures like PCI and ISA?

A

uses dedicated, point-to-point connections, while older bus architectures were parallel and shared.