3 - Basic OS (Hardware, Booting, Cache, Kernel) Flashcards

1
Q

Describe the CPU

A

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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the operations for a basic CPU cycle?

A

Fetch
Decode
Execute

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

What is the bottleneck of a CPU cycle?

A

Fetching from memory

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

What is a solution to the performance hit of fetching from memory?

A

Pipeline

Caches

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

What are the advantages and disadvantages of a pipeline?

A
Benefits:
 - The cpu can execute more than one instruction at a time
 - 'hide' the memory access time
Cons:
 - increased complexity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a superscaler cpu

A

Multiple pipelines (Fetch and Decode) feeding into a buffer with multiple execute units at the output

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

What are 3 ideal memory characteristics?

A

Fast
Large
Cheap

In practice, we can only ever get 2/3 of these

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

What is a typical memory hierarchy?

A

Registers
Cache
Main memory
Disk

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

What is the typical access time and capacity of registers?

A

1 nsec

<1KB

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

What is the typical access time and capacity of caches?

A

2 nsec

4MB

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

What is the typical access time and capacity of main memory?

A

10 nsec

1-8GB

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

What is the typical access time and capacity of disk?

A

10 msec

1 - 4TB

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

Describe main memory

A

RAM - random access memory
An array of words each with its own unique address
Operations - Load/Store
Slow compared to CPU

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

What is a Cache?

What is it used for?

A

Stores the most heavily used data and instructions in fast memory close to core
Goal is to increase performance
Fast but expensive

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

What is a cache hit?

A

The data needed by the CPU is in the cache

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

What is a cache miss?

A

The CPU needs to fetch the data from main memory

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

Describe a typical cache hierarchy

A

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

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

What are some issues with the concept of a cache?

A
  • 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)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is memoization?

A

Similar to caching

Optimization technique used to speed up programs by storing results of expensive computations

20
Q

What are the two parts of a typical I/O device?

A

Device Controller

Device

21
Q

What is the Device Controller?

A
A chip(s) that physically controls the device
Presents a simpler interface to OS
22
Q

What is a device (For hardware IO)

A

Connects to computer through controller

Follows some agreed upon standard of communication

23
Q

What is the Device Driver?

A

Software that talks to the device controller

Can be implemented as kernel modules and loaded on demand

24
Q

What is a BUS

A

A communication system for transferring data between different computer systems
Modern systems have multiple buses

25
Q

What is Booting? How does it work?

A
  1. when the computer is booted, the BIOS is started
    (Basic Input Output System) is a program stored on
    motherboard
  2. check the RAM, keyboard, other devices by scanning
    the ISA and PCI buses
  3. record interrupt levels and I/O addresses of devices, or
    configure new ones
  4. determine the boot device (ie. try list of devices stored
    in CMOS)
  5. read & run primary boot loader program from first
    sector of boot device
  6. read & run secondary boot loader from potentially
    another device
  7. read in the OS from the active partition and start it
  8. OS queries the BIOS to get the configuration
    information and initialize all device drivers in the kernel
  9. OS creates a device table, and necessary background
    processes, then waits for I/O events
26
Q

What does BIOS stand for?

A

Basic Input Output System

27
Q

What does MBR stand for?

A

Master Boot Record - is the information in the first sector of any hard disk or diskette that identifies how and where an operating system is located so that it can be boot (loaded) into the computer’s main storage or random access memory.

28
Q

What does GRUB stand for?

A

GRand Unified Bootloader

29
Q

What does the OS do after it has been read in?

A

OS queries the BIOS to get the configuration
information and initialize all device drivers in the kernel
OS creates a device table, and necessary background
processes, then waits for I/O events

30
Q

What is the kernel?

A

‘Heart’ of the OS
Running at all times
Provides services to applications via system calls
Handles all interrupts

31
Q

Where is the kernel located

A

Located and started by a bootstrap program (boot loader)

32
Q

Are application programs part of the OS?

A

NO

33
Q

Are system programs part of the OS? The Kernel?

A

YES

NO

34
Q

What are the two privilege levels of a CPU?

A

Kernel mode

User mode

35
Q

Which register controls the CPU mode?

A

Status register

36
Q

What is allowed in Kernel Mode?

A
  • all instructions are allowed
  • all I/O operations are allowed
  • all memory can be accessed
  • note: most of the kernel runs in kernel mode
37
Q

What is allowed in User Mode?

A

• only subset of operations are allowed
• eg. accessing the status register is disallowed (of course),
I/O instructions not allowed, access to some parts of memory not
allowed, …
• illegal instructions result in traps (exceptions)

38
Q

Which applications run in kernel mode?

A

All of them - System and Application programs

39
Q

Why would a program want to talk to the kernel?

A

To do I/O

40
Q

What is a system call?

A

A function that a program can call to interact with the operating system

41
Q

What is a trap?

A

An exception in a user process. caused by div/0 or invalid memory access or to invoke a system call

42
Q

When a trap is called what mode is the cpu in?

A

Kernel mode

43
Q

Invoking a system call will invoke a trap

True or False?

A

True

44
Q

Applications run in user mode.

True or False?

A

True

45
Q

Device Drivers run in kernel mode.

True or False?

A

Both. Usually in kernel mode, but could be user mode as well.