Error Log Flashcards

(16 cards)

1
Q

When might an operating system intentionally “waste” resources?

A

To enhance user experience (e.g. GUI visual effects/animations)

To improve responsiveness (e.g. memory caching & preloading of apps)

To manage contention & conserve power (e.g. running idle threads, brief idle CPU slices)

To bolster security (e.g. encrypting data, real-time malware monitoring)

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

Why are some resource wasted by the OS aren’t truly wasteful?

A

It delivers a better overall user experience (intuitive, visually rich interfaces)

It speeds up frequent operations (cached data & preloaded apps launch faster)

It stabilizes system behavior (avoids thread contention, reduces power draw on mobile)

It protects the system (encryption & monitoring prevent breaches)

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

How do GUI animations justify extra CPU cycles?

A

They make interfaces more intuitive and accessible

Smooth transitions help users track state changes and reduce errors

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

How does preloading or caching applications trade memory for responsiveness?

A

Uses extra RAM to keep likely-used code/data in memory

Cuts load times on app launch, yielding a snappier experience

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

In what ways can brief idle-time scheduling or “wasted” CPU time be beneficial on mobile devices?

A

Prevents resource contention by throttling busy threads

Allows the CPU to enter low-power modes, extending battery life

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

Why would an OS spend cycles on encryption or malware monitoring?

A

To ensure data confidentiality and integrity

To detect and block threats before they compromise the system

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

Q#7: Which of the following instructions should be privileged?
a) Set value of timer
b) Read the clock
c) Clear memory
d) Issue a trap instruction
e) Turn off interrupts
f) Modify entries in device-status table
g) Switch from user to kernel mode
h) Access I/O device

A

The following operations need to be privileged:
a) Set value of timer
c) Clear memory
e) Turn off interrupts
f) Modify entries in device-status table
h) Access I/O device.
The rest can be performed in the user mode.

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

Can a switch from user to kernel mode be made in the user mode?

A

Yes. It is not a privileged instruction.

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

What is a Program?

A

A group of instructions to carry out a specified task.

Passive entity residing on secondary storage (e.g. a disk file).

One program can give rise to multiple processes when executed.

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

What is a Process?

A

A program in execution—an active entity loaded into main memory and run by the CPU.
Has its own execution context (registers, program counter, stack, open files).
An instance of a program running on a processor.

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

How does a Program differ from a Process in terms of activity?

A

Program is passive (just code on disk).
Process is active (loaded and executing in memory).

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

How does a Program differ from a Process in terms of lifespan?

A

Program exists indefinitely at a single location until deleted.
Process exists only for the duration of its execution and is terminated afterward.

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

How do resource requirements differ between a Program and a Process?

A

Program requires only memory space to store instructions.
Process requires CPU time, memory addresses, I/O resources, etc., during its lifetime.

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

What structural element does a Process have that a Program does not?

A

A Process has a control block (PCB) containing its context (state, registers, scheduling info).
A Program has no control block or runtime context.

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

Q#4: Assuming that a CPU is operating at 1 MHz, and is able to execute one instruction / clock cycle
by taking benefit of pipelining. You can assume that the processor does not undertake any data
read/write operations and only fetches (reads) instructions from memory.

The DMA module on the same system is transferring characters (one byte at a time) to the main
memory from an external device transmitting at 9600 bits per second.

By approximately how much the
processor will be slowed down due to the DMA activity?

A

As mentioned, we ignore data read/write operations and assume that the processor only fetches
instructions from memory. Then the processor needs access to main memory once every microsecond:

1 / 1 MHz = 1 / 1,000,000 = 0.000001 sec = 1 μs

The DMA module is transferring characters at a rate of 9600 bps = 1200 characters per second, or one
every 833.33 μs. The DMA therefore “steals” every 833rd cycle. This slows down the processor
approximately 1 / 833 * 100 = 0.12%

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

How many CPU cycles occur between DMA steals?

A

cycles_per_transfer = CPU rate (cycles per second) / R_DMA (number of DMA transfers per second)