3 - Basic OS (Hardware, Booting, Cache, Kernel) Flashcards
Describe the CPU
The ‘brain’ of the computer
- On board registers for fast computation
- GPRs for data & addresses
- Special Purpose Registers for PC, SP and status register
- FPR etc.
What are the operations for a basic CPU cycle?
Fetch
Decode
Execute
What is the bottleneck of a CPU cycle?
Fetching from memory
What is a solution to the performance hit of fetching from memory?
Pipeline
Caches
What are the advantages and disadvantages of a pipeline?
Benefits: - The cpu can execute more than one instruction at a time - 'hide' the memory access time Cons: - increased complexity
What is a superscaler cpu
Multiple pipelines (Fetch and Decode) feeding into a buffer with multiple execute units at the output
What are 3 ideal memory characteristics?
Fast
Large
Cheap
In practice, we can only ever get 2/3 of these
What is a typical memory hierarchy?
Registers
Cache
Main memory
Disk
What is the typical access time and capacity of registers?
1 nsec
<1KB
What is the typical access time and capacity of caches?
2 nsec
4MB
What is the typical access time and capacity of main memory?
10 nsec
1-8GB
What is the typical access time and capacity of disk?
10 msec
1 - 4TB
Describe main memory
RAM - random access memory
An array of words each with its own unique address
Operations - Load/Store
Slow compared to CPU
What is a Cache?
What is it used for?
Stores the most heavily used data and instructions in fast memory close to core
Goal is to increase performance
Fast but expensive
What is a cache hit?
The data needed by the CPU is in the cache
What is a cache miss?
The CPU needs to fetch the data from main memory
Describe a typical cache hierarchy
L1 (~32KiB) Fastest, private per core
L2 (~0.5MiB) Slower than L1, may be shared by multiple cores
L3 (xMB) Faster than main mem, usually shared by all cores
What are some issues with the concept of a cache?
- when to put a new item into the cache
- which cache line to put the new item in
- which item to remove from the cache when cache is full
- where to put a newly evicted item in the larger memory
- multiple cache synchronization
- how long is the data in cache valid (expiration)