Midterm 1 Flashcards

1
Q

What is an Operating System (OS)?

A

An OS is a program that acts as an intermediary between a user of a computer and the computer hardware.

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

What are the goals of an Operating System?

A

Execute user programs, make the computer system easy to use, utilize hardware efficiently.

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

What is the relationship in a computer system?

A

Computer system: Hardware ↔ OS ↔ Applications ↔ Users.

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

What are the two main roles of an OS?

A

Resource allocator and control program.

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

What is the kernel?

A

The one program running at all times on the computer.

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

What is a bootstrap program?

A

Loaded at power-up or reboot, initializes all aspects of the system, loads OS kernel and starts execution.

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

Where is the bootstrap program stored?

A

Stored in ROM or EPROM (known as firmware).

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

Can I/O and CPU execute concurrently?

A

Yes, I/O and CPU can execute concurrently.

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

How do device controllers inform the CPU?

A

By causing an interrupt.

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

What is a trap in the context of interrupts?

A

A software-generated interrupt caused by an error or user request.

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

What is a system call?

A

A request to the operating system to allow the user to wait for I/O completion.

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

What does the device-status table contain?

A

An entry for each I/O device indicating its type, address, and state.

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

What are the two types of storage structures?

A

Main memory (random access, volatile) and secondary storage (large non-volatile storage).

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

What is caching?

A

Copying information into a faster storage system.

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

What are multiprocessor systems?

A

Systems that increase throughput, economy of scale, and reliability.

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

What is multiprogramming?

A

Provides efficiency via job scheduling by switching to another job when the OS has to wait.

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

What is timesharing?

A

CPU switches jobs so frequently that each user can interact with each job while it is running.

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

What is dual-mode operation?

A

Allows OS to protect itself and other system components with user mode and kernel mode.

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

What is the difference between single-threaded and multi-threaded processes?

A

Single-threaded processes have one program counter, while multi-threaded processes have one PC per thread.

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

What is protection in an OS?

A

A mechanism for controlling access of processes or users to resources defined by the OS.

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

What is security in an OS?

A

Defense of a system against attacks.

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

What are User IDs (UID) and Group IDs?

A

Identifiers that determine which users and groups of users have which privileges.

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

What are the types of User Interfaces (UI)?

A

Command-Line Interface (CLI), Graphics User Interface (GUI), or Batch.

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

What are some system services helpful to users?

A

Program execution, I/O operations, file-system manipulation, communications, and error detection.

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

What services ensure efficient OS operation?

A

Resource allocation, accounting, protection, and security.

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

How are most system calls accessed?

A

By Application Program Interface (API) such as Win32, POSIX, Java.

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

How are parameters passed to the OS during a system call?

A

By passing in registers, address of parameter stored in a block, or pushed onto the stack.

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

What is the OS layered approach?

A

The OS is divided into layers, each built on top of lower layers, with the bottom layer being hardware.

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

What is a virtual machine?

A

Uses layered approach, treating hardware and OS kernel as though they were all hardware.

30
Q

What can application failures generate?

A

A core dump file capturing memory of the process.

31
Q

What can operating system failures generate?

A

A crash dump file containing kernel memory.

32
Q

What is the purpose of system calls?

A

System calls allow user-level processes to request services of the operating system.

33
Q

What is the purpose of the command interpreter?

A

It reads commands from the user or from a file of commands and executes them, usually by turning them into one or more system calls.

It is usually not part of the kernel because the command interpreter is subject to changes.

34
Q

What system calls have to be executed by a command interpreter or shell to start a new process on a UNIX system?

A

A fork() system call and an exec() system call need to be performed to start a new process.

The fork() call clones the currently executing process, while the exec() call overlays a new process based on a different executable over the calling process.

35
Q

What is the purpose of system programs?

A

System programs can be thought of as bundles of useful system calls. They provide basic functionality to users so that users do not need to write their own programs to solve common problems.

36
Q

What is the main advantage of the layered approach to system design?

A

The system is easier to debug and modify because changes affect only limited sections of the system rather than touching all sections.

Information is kept only where it is needed and is accessible only within a defined and restricted area.

37
Q

What are the disadvantages of the layered approach?

A

The primary disadvantage to the layered approach is the poor performance due to the overhead of traversing through the different layers to obtain a service provided by the operating system.

38
Q

List five services provided by an operating system.

A

The five services are:

a. Program execution.
b. I/O operations.
c. File-system manipulation.
d. Communications.
e. Error detection.

39
Q

How does program execution create convenience for users?

A

The operating system loads the contents of a file into memory and begins its execution.

A user-level program could not be trusted to properly allocate CPU time.

40
Q

How do I/O operations create convenience for users?

A

The user need only specify the device and the operation to perform on it, and the system converts that request into device- or controller-specific commands.

User-level programs cannot be trusted to access only devices they should have access to.

41
Q

How does file-system manipulation create convenience for users?

A

There are many details in file creation, deletion, allocation, and naming that users should not have to perform.

User programs could neither ensure adherence to protection methods nor be trusted to allocate only free blocks.

42
Q

How do communications create convenience for users?

A

Message passing between systems requires messages to be turned into packets of information, sent to the network controller, transmitted across a communications medium, and reassembled by the destination system.

User programs might not coordinate access to the network device.

43
Q

How does error detection create convenience for users?

A

Error detection occurs at both the hardware and software levels to ensure data integrity.

There must be a global program (the operating system) that handles all types of errors.

44
Q

How could a system be designed to allow a choice of operating systems from which to boot?

A

A special program (boot manager) will determine which operating system to boot into during system startup.

Boot managers often provide the user with a selection of systems to boot into.

45
Q

What is the purpose of direct memory access (DMA)?

A

DMA is used for high-speed I/O devices to avoid increasing the CPU’s execution load.

46
Q

How does the CPU interface with the device to coordinate the transfer?

A

The CPU initiates a DMA operation by writing values into special registers that can be independently accessed by the device.

47
Q

How does the CPU know when the memory operations are complete?

A

The device interrupts the CPU to indicate the completion of the operation.

48
Q

Can the CPU execute other programs while the DMA controller is transferring data?

A

Yes, the CPU can execute other programs while the DMA controller is transferring data.

49
Q

Does the DMA process interfere with the execution of user programs?

A

Yes, the CPU might be unable to issue memory operations at peak speeds due to competition with the device for access to the memory bus.

50
Q

Rank the following storage systems from slowest to fastest: Hard-disk drive, Registers, Optical disk, Main memory, Nonvolatile memory, Magnetic tapes, Cache.

A

f. Magnetic tapes
c. Optical disk
a. Hard-disk drive
e. Nonvolatile memory
d. Main memory
g. Cache
b. Registers

51
Q

What are two ways a computing cluster can manage access to data on the disk?

A

Asymmetric clustering and symmetric clustering.

52
Q

What is asymmetric clustering?

A

One host runs the database application while the other monitors it. If the server fails, the monitoring host becomes the active server.

53
Q

What are the benefits and disadvantages of asymmetric clustering?

A

Benefits include redundancy. Disadvantages include not utilizing the processing power of both hosts.

54
Q

What is symmetric clustering?

A

The database application can run in parallel on both hosts.

55
Q

What is a challenge of symmetric clustering?

A

Providing a distributed locking mechanism for files on the shared disk.

56
Q

How can HZ and jiffies be used to determine how long the system has been running?

A

The number of seconds since the system was booted is calculated as jiffies/HZ.

57
Q

How does cached data coherence manifest in single-processor systems?

A

Memory needs to be updated when a processor issues updates to cached values, either immediately or lazily.

58
Q

How does cached data coherence manifest in multiprocessor systems?

A

Different processors might cache the same memory location, requiring invalidation or updates to other cached locations when updates are made.

59
Q

How does cached data coherence manifest in distributed systems?

A

Consistency of cached memory values is not an issue, but problems may arise when a client caches file data.

60
Q

Describe Why Android uses Ahead-Of-Time (AOT) instead of Just-In-Time (JIT) compilation

A

AOT compilation compiles Java code when it is installed on a device. This is a time and energy-saving strategy which is important for mobile devices

61
Q

What are the two models of interprocess communication? What are the strengths and weaknesses

A

Message-Passing Model: Good for exchanging smaller amount of data, no conflicts need to be avoided, and easier to implement
Shared Memory: Maximum speed and convenience since it can be done at memory transfer speeds. However, it has problems with protection and synchronization

62
Q

Compare and contrast an Application Programming Interface (API) and an Application Binary Interface (ABI)

A

An API is used by application programmers to ensure that they invoke system calls and other functions properly. An ABI exists at the architecture level, and it ensures that a binary executable file can interact with a given operating system running on a specific architecture

63
Q

Why is the separation of mechanism and policy desirable?

A

Mechanism and policy must be separate to ensure that systems are easy to modify. No two system installations are the same, so each installation may want to tune the operating system to suit its needs. With a separation, the policy can be changed at will while the mechanism stays unchanged

64
Q

Identify a scenario where it is unclear how to layer two system components that require tight coupling of their functionalities

A

The virtual memory subsystem and the storage subsystem are usually tightly couples and require careful design in a layers system due to the following interactions. Many systems allow files to be mapped into the virtual memory space of an executing process. But also the virtual memory subsystem typically uses the storage system to provide the backing store for pages that don’t reside in memory

65
Q

What is the advantage of a microkernel? How do user programs and system services interact in a microkernel architecture? What are some disadvantages?

A

Benefits: adding new service doesn’t require modifying the kernel, more secure as more operations are done in user mode rather than kernel mode, simpler design makes the OS more reliable
Programs and system services interact through interprocess communication mechanisms like messaging, the messaging being conveyed by the OS.
The primary disadvantages are the overheads associated with interprocess communication and needing to use the OS messaging functions to enable the user process and system service to interact

66
Q

What are the advantages of loadable kernel modules?

A

Functionality can be added or removed while the kernel is running, there is no need to recompile or reboot the kernel

67
Q

How are iOS and Android similar?

A
  • Both are based on existing kernels (Linux and macOS)
  • Both have architecture that uses software stacks
  • Both provide frameworks for developers
68
Q

How are iOS and Android different?

A
  • iOS is closed source, Android is open source
  • iOS applications are developed in Objective-C, Android in Java
  • Android uses a virtual machine, and iOS executes code natively
69
Q

Describe a mechanism for enforcing memory protection to prevent a program from modifying the memory associated with other programs

A

The processor could keep track of what locations are associated with each process and limit access to locations that are outside of the programs location. Information regarding the extent of a program’s memory could be maintained by using base and limit registers and by performing a check for every memory access

70
Q

Describe some challenges of designing OS for mobile compared to PCs

A

Challenges are: less storage capacity means the OS must manage memory carefully, the OS must also managed power consumption carefully, less processing power plus fewer processors mean the operating system must carefully apportion processors to Applications

71
Q

Advantages of peer-to-peer systems over client-server systems

A

Peer-to-peer systems are useful because services are distributed across a collection of peers, rather than residing in a single centralized server. The scheme provides both tolerance and redundancy. Also because peers constantly migrate, they can provide a higher level of security than a server that always exists at a known location on the internet. P2P systems can also potentially provide higher network bandwidth because they can collectively use all the bandwidth of peers, rather than the single bandwidth that is available to a single server