Week 5 - Operating System Fundamental (Part 2) Flashcards

1
Q

What happens when a computer is started or rebooted regarding the bootstrap process?

A

When a computer is started or rebooted, a small bootstrap program is loaded into memory to initiate the startup process.

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

What is the meaning behind the term “bootstrap”?

A

The term “bootstrap” comes from the saying “to pull oneself up by one’s bootstraps,” referring to a seemingly impossible task and describing a self-sustaining process that proceeds without external help.

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

Who first coined the term “bootstrap” in computing, and in what context?

A

The term “bootstrap” was first coined in 1953 by computer scientist Werner Buchholz when describing the “self-loading procedure” of the IBM Type 701 Computer.

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

Where is the bootstrap program stored, and why?

A

The bootstrap program is stored in Read-Only Memory (ROM) or Electrically Erasable Programmable Read-Only Memory (EEPROM) because these types of memory cannot be easily infected by a virus.

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

What is another name for the bootstrap program stored in ROM or EEPROM?

A

The bootstrap program stored in ROM or EEPROM is also known as firmware.

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

What system components does the bootstrap program initialise?

A

The bootstrap program initializes the CPU registers, device controllers, and the contents of memory.

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

What does the bootstrap program do after initializing the system hardware?

A

After initialisation, the bootstrap program loads the operating system kernel into memory to start the full operating environment.

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

What happens after the firmware is loaded during system startup?

A

After the firmware is loaded, some services are provided outside of the kernel. These services are loaded at boot time and become system processes or system daemons that run for the entire time the kernel is active.

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

What is the first system process loaded on UNIX systems?

A

On UNIX systems, the first system process loaded is called “init.”

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

What does the operating system do once everything is loaded?

A

Once the system processes and daemons are loaded, the operating system sits idle and waits for events to occur, ready to respond as needed.

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

What are examples of events that can happen after the operating system is loaded?

A

Examples of events include a user clicking a mouse or a program trying to access a file, both of which require the system to respond.

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

What are these events called, and how can they be triggered?

A

These events are called interrupts, and they can be triggered by either hardware or software.

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

How does hardware trigger an interrupt?

A

Hardware triggers an interrupt at any time by sending a signal directly to the CPU.

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

How does software trigger an interrupt?

A

Software triggers an interrupt by executing a special operation called a system call.

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

What does the CPU do when an interrupt occurs?

A

When an interrupt occurs, the CPU stops whatever it is currently doing and immediately transfers execution to a fixed location in memory.

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

What is located at the fixed memory location the CPU jumps to after an interrupt?

A

The fixed memory location usually contains the starting address of the service routine that handles the interrupt.

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

What happens after the interrupt service routine executes?

A

After the interrupt service routine finishes execution, the CPU resumes the computation that was interrupted.

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

What is the structure of Main Memory?

A

What is the structure of Main Memory?

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

What are Read-Only Memory (ROM) and Electrically Erasable Programmable ROM (EEPROM)?

A

Read-Only Memory (ROM) and Electrically Erasable Programmable ROM (EEPROM) are types of non-volatile memory. ROM cannot be modified and is suitable for storing things like bootstrap programs or game cartridges. EEPROM can be changed, but only infrequently, and is often used to store factory-bundled programs in smartphones.

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

What type of memory does the CPU need to read and write to?

A

The CPU requires Random-Access Memory (RAM), which is memory it can read from and write to. RAM is implemented using Dynamic RAM (DRAM) technology, which is a type of semiconductor memory.

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

What are Registers in terms of memory?

A

Registers are a type of memory that is directly accessed by the CPU to store temporary data and instructions during processing.

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

What happens to Main Memory when the machine is turned off?

A

Main memory is volatile, meaning it is erased when the machine is powered off.

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

What is Secondary Storage, and what are some examples?

A

Secondary storage is non-volatile memory used to store data long-term. Examples include magnetic disks, optical disks, and tapes.

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

What is Cache Memory, and why is it important?

A

Cache memory is a faster, smaller storage system that holds frequently used data. If the CPU needs information, it first checks the cache to improve speed and efficiency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Where does the CPU load instructions from?
The CPU can only load instructions from memory. Any programs that need to run must be stored in memory.
26
Is memory typically rewritable, and what type of memory is commonly used?
Yes, memory is generally rewritable. Main memory, often referred to as random-access memory (RAM), is commonly implemented using a semiconductor technology called Dynamic RAM (DRAM).
27
How is memory structured, and how does the CPU interact with it?
Memory is structured as an array of bytes, with each byte having its own unique address. The CPU interacts with memory using load and store instructions.
28
What does the "Load" instruction do in memory interaction?
The "Load" instruction moves a byte from main memory into an internal register within the CPU for processing.
29
What does the "Store" instruction do in memory interaction?
The "Store" instruction writes a byte from the CPU register back to main memory.
30
How does the CPU fetch instructions for execution?
The CPU automatically loads instructions from main memory to execute them during processing.
31
In a perfect world, where would programs and data reside, and what is the challenge?
In a perfect world, programs and data would reside in main memory. However, this is difficult because main memory is small and volatile, meaning it is lost when the system is powered off.
32
What is the solution to the problem of limited main memory?
The solution is secondary storage, which includes magnetic disks, optical disks, and tapes. Programs are stored in secondary storage and loaded into main memory when needed.
33
How do many programs interact with secondary storage?
Many programs use the disk as both the source and destination for processing, reading data from the disk and writing results back to it.
34
What are some different forms of storage systems, and how do they differ?
Different forms of storage systems include cache, CD-ROMs, and magnetic tapes. The differences between them lie in factors such as speed, cost, size, and volatility.
35
How much of the OS code is dedicated to managing I/O?
A large portion of the operating system code is dedicated to managing Input/Output (I/O) operations.
36
Why is managing I/O so important in an operating system?
Managing I/O is crucial because it enables the system to interact with external devices like keyboards, disk drives, printers, and displays. Efficient I/O management is essential for system performance and ensuring that hardware resources are used effectively.
37
How does hardware trigger an interrupt in I/O operations?
Hardware can trigger an interrupt at any time by sending a signal to the CPU, prompting the system to stop its current task and handle the I/O request.
38
How do devices interact with the CPU in I/O operations?
Devices interact with the CPU through a device controller, which is connected to the CPU via a common bus, enabling communication between the CPU and external devices.
39
What is the role of a Small Computer-Systems Interface (SCSI) controller?
The SCSI controller is a hardware component (either a card or a chip) that allows SCSI storage devices to communicate with the operating system through an SCSI bus, enabling data transfer and device management.
40
What does a device controller maintain?
41
What is the role of a device controller in data transfer?
The device controller moves data between the peripheral devices it controls and its local buffer storage, ensuring that data is properly transferred to and from the CPU.
42
What is a device driver in an operating system?
An operating system has a device driver for each device controller. These drivers are typically downloaded and installed to enable communication with the hardware.
43
How does a device driver interact with the device controller?
The device driver understands the device controller and provides the rest of the operating system with a uniform interface to interact with the device, ensuring consistent handling regardless of the specific device.
44
What are the three types of I/O mechanisms?
The three types of I/O mechanisms are: 1.Programmed I/O (also known as Polling) 2. Interrupt Driven I/O 3. Direct Memory Access (DMA)
45
What is Programmed I/O, and how does it work?
Programmed I/O requires the processor to “poll” the status of the I/O module (controller). The processor sends the I/O request to the I/O module and continuously checks whether the I/O module has finished the operation.
46
What happens once the I/O operation is finished in Programmed I/O?
Once the I/O operation is finished, the data is transferred between the I/O module, the processor, and main memory.
47
What special instructions does the processor have in Programmed I/O?
The processor has special instructions to control the I/O device, test the status of the I/O module, and transfer data (read/write) between the I/O module and memory.
48
What is a performance issue with Programmed I/O?
A performance issue with Programmed I/O is that the processor is constantly busy checking the I/O status of the I/O module, which can waste processing time and reduce overall system efficiency.
49
What is Interrupt Driven I/O used for?
Interrupt-driven I/O is effective for moving small amounts of data between the I/O module and the CPU.
50
Why is Interrupt Driven I/O not suitable for bulk data movement?
Interrupt-driven I/O is not suitable for bulk data movement, such as disk I/O, because it involves frequent interrupts, which can create overhead and slow down the transfer of large amounts of data.
51
What is Direct Memory Access (DMA)?
Direct Memory Access (DMA) is a method where the DMA controller transfers data directly from the I/O device to main memory without involving the CPU during the actual data transfer.
52
How is data prepared for DMA transfer?
Before a DMA transfer, buffers, pointers, and counters for the I/O device are set up, allowing the device controller to transfer an entire block of data directly between its own buffer storage and main memory.
53
What is the role of the CPU during a DMA transfer?
During a DMA transfer, there is no intervention by the CPU, freeing it to perform other tasks and improving overall system efficiency.
54
Why is DMA preferable compared to interrupt-driven I/O for data transfer?
DMA is preferable because it generates only a single interrupt for an entire block of data transfer, instead of one interrupt per byte, which is especially beneficial for low-speed devices.
55
How does DMA benefit the CPU?
DMA frees up the CPU to perform other, possibly more important tasks, instead of constantly handling I/O operations.
56
What is a drawback of using DMA during data transfer?
During DMA transfers, both the DMA controller and the processor share the system bus, which can cause the processor to experience slowdowns as it waits for access to the bus.
57
What characterizes a single-processor system?
A single-processor system has one CPU, although it may also include special-purpose processors for specific tasks.
58
What defines a multiprocessor system?
A multiprocessor system, also known as parallel or multicore architecture, involves multiple processors sharing a common bus, clock, memory, and peripherals.
59
Where are multiprocessor systems commonly used, and what benefits do they provide?
Multiprocessor systems are used in servers and smartphones. They offer increased throughput, economy of scale, and better reliability through graceful degradation.
60
When you install an operating system, what main components do you get?
When you install an operating system, you receive system programs such as the program loader and command interpreter, language processors like the C compiler, assembler, and linker, utilities such as a text editor and terminal emulator, and subroutine libraries like the standard C library and math library.
61
What are system calls?
System calls are the programming interface to the services provided by the operating system, allowing programs to request services from the OS.
62
How are system calls usually written and accessed?
System calls are typically written in high-level languages like C or C++, and are mostly accessed through high-level APIs rather than directly.
63
What are the three most common APIs for accessing system calls?
The three most common APIs are: - Win32 API for Windows systems - POSIX API for UNIX, Linux, and Mac OS X - Java API for the Java Virtual Machine (JVM)
64
What is an example of a system call in action?
The command $ cp file1 file2 uses system calls to copy the contents of one file to another.
65
What are typical steps involved when using system calls to copy a file?
1. Open file1 2. Handle possible errors (e.g., print message or abort) 3. Create file2 (rewrite or rename if it exists) 4. Start read and write operations 5. Handle errors like disk space issues or unplugged memory stick 6. Complete read/write operations 7. Close both files
66
Are system calls accessed directly by programs?
No, programs usually access system calls through an API instead of directly calling the system services.
67
What is an API (Application Programming Interface)?
An API specifies a set of functions available to application programmers, including the parameters for each function and the expected return values.
68
How does a programmer access system functions through an API?
A programmer accesses system functions via a library of code provided by the operating system.
69
Give an example of an API call and its system call in Windows.
In Windows, calling CreateProcess() through the Windows API invokes the NTCreateProcess() system call in the Windows kernel, returning 0 or 1 based on success or failure.
70
What is the POSIX API, and which systems use it?
The POSIX API is used by POSIX-based systems such as UNIX, Linux, and macOS. It allows programmers to access system functions via a library of code provided by the OS.
71
What is the read() function in the POSIX API, and what are its inputs?
The read() function reads data from a file descriptor. Input: - int fd: File descriptor to read - *void buf: Pointer to the buffer to store the read data - size_t count: Maximum number of bytes to read
72
What is the output of the read() function in POSIX?
Output: 1. Number of bytes read if successful 2. -1 if an error occurs
73