Midterm 1 Flashcards

1
Q

What is an operating system?

A

Hard to define precisely, but basically allows other programs and people to make the hardware useful

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

What does a modern OS do?

A

Provides abstractions
Provides standard interface
Mediates resource usage
Consume resources

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

What three parts make up the operating systems?

A

Kernel – schedules programs the user wants to run

Userspace – allows a person to run programs

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

What types of things should the kernel do?

A

Interrupt handlers
Scheduler – who is currently on the block
(This is the part of the OS always in memory)

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

True or false. Tasks and processes are the same

A

True

However, multitasking and multiprocessing are different

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

What is a shell?

A

A task that functions as an interface between the user and an operating system, or an interface between programs.

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

If we have the option to use #define (preprocessor) or the compiler, which should we use?

A

Compiler

Compiler variable will always take less than or equal to the memory of the #define variable. Errors with the variable will also be very confusing if its done with the preprocessor.

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

What does on OS pass to an new task’s main function?

A

Two variables, argc and argv

argc is the size of the argv array and it can never be zero

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

What is required of the “host” for our OS to work properly?

A

Non-blocking access to an input (keyboard) character

An assembly instruction to change the computer’s stack pointer

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

What is a systems program?

A

Program associated with the OS

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

What is an applications program?

A

Program not associated with the OS

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

What is middleware?

A

Not an OS, not an application, its in the middle
Additional frameworks for developers
Another level of abstraction between the application and the OS
Code that might protect me, do multiple actions on a single commands, etc

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

What is firmware?

A

Hardware initialization software

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

What is a bootstrap program?

A

Initial program executed on PU (physical unit)

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

What is a daemon?

A

Kernel associated services

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

What is a device driver?

A

Device controller software

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

What is asymmetric multiprocessing? Symmetric multiprocessing?

A

Each processor is assigned as specific task in asymmetric multiprocessing
Symmetric multiprocessing is when any processor can do any task, or in other words, they use the same shared memory

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

What is a processor?

A

Controls the operation of the computer and performs its data processing functions. When there is only one processor, it is often referred to as the central processing unit (CPU).

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

What is main memory?

A

Stores data and programs. This memory is typically volatile; that is, when the computer is shut down, the contents of the memory are lost. In contrast, the contents of disk memory are retained even when the computer system is shut down. Main memory is also referred to as real memory or primary memory.

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

What are I/O modules?

A

They move data between the computer and its external environment. The external environment consists of a variety of devices, including secondary memory devices (e.g., disks), communications equipment, and terminals.

21
Q

What is the system bus?

A

Provides for communication among processors, main memory, and I/O modules.

22
Q

What is a chip?

A

Also called a socket, it contains multiple processors (called cores), which each have multiple threads to work on.

23
Q

What is an instruction cycle?

A

The processing required for the fetching and execution of a single instruction

24
Q

What is the PC?

A

Program counter

Holds the address of the next instruction to be executed. Goes sequentially throughout the program, fetching an instruction, storing it in the IR, and executing. The bits stored in the IR tell the computer what to do.

25
Q

In general, what are the four categories processor instructions fall into?

A

Processor-memory: Data may be transferred from processor to memory or from memory to processor.

Processor-I/O: Data may be transferred to or from a peripheral device by transferring between the processor and an I/O module.

Data processing: The processor may perform some arithmetic or logic operation on data.

Control: An instruction may specify that the sequence of execution be altered. For example, the processor may fetch an instruction from location 149, which specifies that the next instruction will be from location 182. The processor sets the program counter to 182. Thus, on the next fetch stage, the instruction will be fetched from location 182 rather than 150.

An instruction can also do a combination of the above actions

26
Q

How does a processor handle multiple interrupts?

A

1) On execution of one interrupt, interrupts become disabled. Right before returning to normal execution of instructions, interrupts are enabled again to process the rest. Interrupts are processed in sequential order this way (doesn’t set priorities).
2) Gives interrupts priority. Interrupts are executed but higher interrupts can interrupt those and take over. Before returning to the user program, an interrupt with higher priority than the user program will stop it and execute before returning to the program.

27
Q

What is a signal?

A

Asynchronous event notification to a process or multiple processes that something needs to be done. A software interrupt. Anybody can signal – hardware or software.

28
Q

When is a signal acknowledged?

A

When the signal is unblocked

29
Q

How are signals delivered to a process?

A

Every process has a signal variable. If a signal bit is set, it does the appropriate operation. Checks the signal bit every time the program does a context switch, which should be often.

30
Q

What operations are illegal within a signal handler?

A

Blocking operations

31
Q

How are parameters passed to a signal?

A

You can pass them through environment variables

32
Q

What signals might a process not handle?

A

Harmless signals like SIGSTOP

33
Q

How many signals might a signal support?

A

Usually 64, 1 per bit in the signal variable

34
Q

What is the difference between an interrupt and a trap?

A

An interrupt is coded while a trap is caused by hardware. A trap happens when, for example, an exception needs to be thrown.

Traps also deal with the current line of code being executed, like when there is an error with it. An interrupt does not have to do with the next line of code to be executed, but simply jumps to do something else.

35
Q

What is the purpose of an interrupt?

A

It allows the computer to run more efficiently. For example, if relatively slow hardware needs to do a subtask before it can use the next piece of information, an interrupt can leave the task behind to do something else while the hardware finishes. It will then return to finish the task.

36
Q

What is the purpose of interrupts intentionally coded into a user program?

A

It gives a person more control over the computer. A user can make custom interrupt handlers to do specific things.

37
Q

Describe spatial and temporal locality. What are these ideas used for?

A

Spatial locality is the idea that if one point in memory is accessed, it is more likely that memory in close proximity around it will also be accessed soon.

Temporal locality is the idea that if something is accessed in memory now, it will likely be accessed again in the near future.

38
Q

How do caches take advantage of spatial and temporal locality?

A

For spatial locality, if a memory point is accessed, the cache will store a whole block of memory around the accessed point instead of just the one variable in anticipation that those other points will be used soon.

Temporal locality is the same, except this only applies to the accessed variable in anticipation of the same variable to be called again in the near future.

39
Q

What are the 3 tradeoff relationships when it comes to memory and access speed?

A

Faster access time, greater cost per bit

Greater memory capacity, lower cost per bit

Greater memory capacity, slower access time

40
Q

What memory structures make up inboard memory?

A

Registers – highest speed, smallest capacity
Cache – higher speed, smaller capacity
Main memory – slower speed, higher capacity

41
Q

What three section are there in the memory hierarchy?

A

Inboard memory
Outboard storage
Off-line storage

42
Q

What kinds of things comprise outboard storage?

A

CD’s

External hard drives

43
Q

What does SMP stand for? What is it?

A

Symmetric multiprocessor
It is a computer with these characteristics:
1) Has 2 or more processors with comparable capabilities
2) The processors share the same main memory and I/O facilities and are connected such that they can access things in similar time
3) They share access to I/O devices
4) All processors can perform the same functions (symmetric)
5) The system is control by an OS that provides interaction between the processors at data element levels (other systems can only interact at file level for example)

44
Q

What benefits does an SMP have over a uniprocessor?

A

Better performance
Availability – if one processor fails, the system still functions (with a drop in performance from the lost processor)
Incremental growth – can add another processor for better performance
Scaling – vendors can offer better computers for more money by increasing processors implemented

45
Q

What are the three main objectives of an operating system?

A

Convenience – make the computer more convenient to use
Efficiency – use the resources the most efficient way possible
Ability to evolve – can add more functionality if desired

46
Q

List some services an operating system provides

A

Program development, program execution, access to I/O devices (easy reads and writes without knowing complex details of the I/O device), controlled access to files and the system, error detection and response, accounting (like a task manager), ISA, ABI, API.

47
Q

Why will a major OS evolve over time?

A

New types of hardware or hardware upgrades
New services
Fixes

48
Q

Map the “new building construction” components to the computer components, namely the builder (general contractor), workers, materials, tools, and the new building.

A

Builder (general contractor) – operating system
Workers – Threads, cores/processors times threads per processor
Materials – Resources
Tools – Libraries
New building – task or process (or carrying them out I suppose)