Error Log Flashcards
(16 cards)
When might an operating system intentionally “waste” resources?
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)
Why are some resource wasted by the OS aren’t truly wasteful?
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 do GUI animations justify extra CPU cycles?
They make interfaces more intuitive and accessible
Smooth transitions help users track state changes and reduce errors
How does preloading or caching applications trade memory for responsiveness?
Uses extra RAM to keep likely-used code/data in memory
Cuts load times on app launch, yielding a snappier experience
In what ways can brief idle-time scheduling or “wasted” CPU time be beneficial on mobile devices?
Prevents resource contention by throttling busy threads
Allows the CPU to enter low-power modes, extending battery life
Why would an OS spend cycles on encryption or malware monitoring?
To ensure data confidentiality and integrity
To detect and block threats before they compromise the system
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
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.
Can a switch from user to kernel mode be made in the user mode?
Yes. It is not a privileged instruction.
What is a Program?
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.
What is a Process?
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 does a Program differ from a Process in terms of activity?
Program is passive (just code on disk).
Process is active (loaded and executing in memory).
How does a Program differ from a Process in terms of lifespan?
Program exists indefinitely at a single location until deleted.
Process exists only for the duration of its execution and is terminated afterward.
How do resource requirements differ between a Program and a Process?
Program requires only memory space to store instructions.
Process requires CPU time, memory addresses, I/O resources, etc., during its lifetime.
What structural element does a Process have that a Program does not?
A Process has a control block (PCB) containing its context (state, registers, scheduling info).
A Program has no control block or runtime context.
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?
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 many CPU cycles occur between DMA steals?
cycles_per_transfer = CPU rate (cycles per second) / R_DMA (number of DMA transfers per second)