Logo/

Flashcard Deck

Log in

Made with ScholarlyMake flashcards like these from your own notes

Flashcard Deck

Questions and answers

182 cards
  1. Question:Program execution

    Answer:The operating system gives users the ability to run applications and programs.

  2. Question:I/O operations

    Answer:The applications and programs run by users require input and produce output, the operating system provides the environment for this.

  3. Question:File systems

    Answer:Users and their software can create, delete, read, modify, rename, search, list, share, and protect files and directories, the operating system provides support for all of this.

  4. Question:Protection and security

    Answer:Users need control over who can access their data, the operating system provides security and protection for files and executing programs.

  5. Question:Error detection and recovery

    Answer:The operating system provides services for detecting and recovering from errors, such as when files get corrupted or programs crash.

  6. Question:Accounting

    Answer:The operating system performs accounting to monitor disk usage, memory usage, networking traffic, and other system resources.

  7. Question:Resource management

    Answer:The operating system manages resources, such as prioritizing certain programs or restricting access to certain file systems.

  8. Question:What is a command-line interface (CLI)?

    Answer:A type of user interface where a user enters a command by entering plain text followed by a newline character.

  9. Question:What is a command-line interpreter?

    Answer:A stand-alone program that can be used to interact with the operating system.

  10. Question:What is a shell?

    Answer:In UNIX, a command line interpreter is called a shell. It is not just a command line interpreter, but a full-fledged programming language.

  11. Question:What is a text terminal?

    Answer:A terminal that transmits data one character at a time and can only display characters.

  12. Question:How are commands in a CLI executed?

    Answer:Commands in a CLI can be executed in either of two ways: as a built-in command within the shell or as a system program in a separate executable file.

  13. Question:What is a built-in command?

    Answer:A built-in command is a command that is implemented within the shell itself.

  14. Question:Give an example of a built-in command in bash.

    Answer:An example of a built-in command in bash is the 'cd' command.

  15. Question:Give an example of a built-in command in bash.

    Answer:An example of a built-in command in bash is the 'read' command.

  16. Question:What is a system program?

    Answer:A system program is a command that is implemented in a separate, executable file.

  17. Question:Give an example of a system program in Linux systems.

    Answer:An example of a system program in Linux systems is the 'grep' command, which is located in the file '/bin/grep'.

  18. Question:Give an example of a system program in Linux systems.

    Answer:An example of a system program in Linux systems is the 'date' command, which is located in the file '/bin/date'.

  19. Question:Are there commands that can be implemented both as a built-in command and as a system program?

    Answer:Yes, there are commands that can be implemented both as a built-in command and as a system program.

  20. Question:Give examples of commands that can be implemented both as a built-in command and as a system program.

    Answer:Examples of commands that can be implemented both as a built-in command and as a system program are 'echo', 'kill', and 'pwd'.

  21. Question:What is a system call?

    Answer:A call to code inside the kernel of the operating system made via a software interrupt or trap.

  22. Question:What is the purpose of a system call?

    Answer:To allow a user process to explicitly request a service from the kernel.

  23. Question:Do user programs directly invoke system calls?

    Answer:No, user programs typically call wrapper functions that invoke system calls.

  24. Question:What is a wrapper function?

    Answer:A function whose only purpose is to make a call to another function, often a system call.

  25. Question:Where does the wrapper function run?

    Answer:In user mode as part of a user level library.

  26. Question:Where does the actual system call run?

    Answer:In kernel mode inside the operating system's kernel.

  27. Question:What is an API?

    Answer:An Application Programming Interface (API) is a definition or collection of definitions that specify how a program is to obtain the services provided by some other piece of software.

  28. Question:What is the API in the context of operating systems and the kernel?

    Answer:In the context of operating systems and the kernel, an API is the set of specifications of functions for obtaining the services of the kernel.

  29. Question:Why do programming languages provide wrapper functions for system calls?

    Answer:Programming language libraries usually provide wrapper functions for system calls to allow programs written in that language to obtain kernel services.

  30. Question:What is an example of a programming language library that contains wrapper functions for system calls in GNU Linux?

    Answer:The GNU C library, glibc, contains wrapper functions for all of the system calls in GNU Linux.

  31. Question:What are the three most common APIs mentioned in the text?

    Answer:The three most common APIs mentioned are the WinAPI for Windows, POSIX API for POSIX-based systems (including UNIX, Linux, and macOS), and Lava API for the Lava virtual machine (IVM).

  32. Question:Function that program calls to obtain services from the kernel

    Answer:Wrapper function in the API

  33. Question:Function that program calls to obtain services from the kernel

    Answer:Not a system call, but the wrapper function defined in the API

  34. Question:System call

    Answer:The actual system call invoked within the wrapper itself

  35. Question:String 'SYSCALL'

    Answer:Placeholder for the code that would switch to kernel mode and jump to the system call handler

  36. Question:When we say that a program calls a system call

    Answer:It means that the program calls the corresponding wrapper function in the user-level library

  37. Question:When a trap occurs as a result of a system call, what happens?

    Answer:The mode bit is switched to kernel mode and a system call handler runs.

  38. Question:How does the system call handler know which system call to invoke?

    Answer:Each system call has a number associated with it, which is read from a register (e.g., in Linux it is in the eax register).

  39. Question:What does the system call dispatch table contain?

    Answer:The address of the start of each system call in the kernel.

  40. Question:What does the system-call handler do?

    Answer:It invokes the actual kernel function, which runs in kernel mode. When the kernel function is finished, control is returned back to the handler.

  41. Question:When a program makes a call to a system call function like read(fd, buffer, 256), how are the arguments of this function made available to the kernel?

    Answer:The arguments are passed to the kernel via registers or the stack, depending on the specific calling convention used.

  42. Question:Register Method

    Answer:The simplest method for passing arguments of system calls is to put them into known registers in a specific order.

  43. Question:Block Method

    Answer:In the block method, the parameters are stored in a block of consecutive bytes in memory and the address of the block is passed in a register.

  44. Question:Stack Method

    Answer:In the stack method, the parameters are pushed onto the stack by the program and popped off the stack by the kernel.

  45. Question:Limitations of Register Method

    Answer:The register method may not work when the number of parameters exceeds the number of available registers or if the lengths of these parameters exceed the size of the registers.

  46. Question:Limitations of Stack Method

    Answer:The stack method is usually slower because there are separate stacks for the user program and the kernel, and popping from one and pushing to the other is time-consuming.

  47. Question:Combination of Register Method and Block Method in Linux

    Answer:Linux uses a combination of the register method and the block method. If the parameters fit into the registers, it uses them; otherwise, it uses the block method.

  48. Question:Parameter Limit in Linux System Calls

    Answer:In the current version of Linux, no more than six parameters are allowed for a system call.

  49. Question:System programs

    Answer:Programs shipped or downloaded when the operating system is installed and can only be invoked as commands on the command line.

  50. Question:Application

    Answer:A program that can be run from the command line but is not a system program.

  51. Question:Fuzzy distinction

    Answer:The distinction between an application and a system program is not clearly defined and can be subjective.

  52. Question:System Programs

    Answer:Programs that extend the functionality of the operating system and make it convenient to develop software on the system.

  53. Question:Applications

    Answer:Word processors, game programs, spreadsheets, web browsers, and integrated development environments.

  54. Question:Shell programs

    Answer:Programs that provide a command-line interface for interacting with the operating system.

  55. Question:Linkers and loaders

    Answer:Programs that handle the process of linking together multiple object files and loading them into memory to create an executable program.

  56. Question:File manipulation commands

    Answer:Commands that allow you to manipulate files, such as copying, renaming, deleting, etc.

  57. Question:Process management commands

    Answer:Commands that allow you to check the status of running processes, terminate rogue processes, etc.

  58. Question:Memory management commands

    Answer:Commands that allow you to check for memory leaks and manage memory allocation.

  59. Question:File and directory manipulation

    Answer:Creation, deletion, modification, printing, renaming, copying, checking and changing attributes

  60. Question:Status information

    Answer:Obtaining system information such as time, date (date), resource utilization (memusage), process status (ps), device status

  61. Question:Software development

    Answer:Compilers (gcc), linkers (1d), assemblers (as), interpreters and shells (bash), debuggers (gdb), tracers, profilers, version control, etc.

  62. Question:Program loading and execution

    Answer:Absolute loaders, relocatable loaders, dynamic linker/loaders (1d-linux), object dumpers (objdump), system call tracers (strace), library call tracers (ltrace), etc.

  63. Question:Communication and network services

    Answer:Remote logins (ssh), communicating with servers (curl), remote file transfer (sftp, scp), send messages to a screen (write)

  64. Question:Background services

    Answer:Services that run in the background include ssh daemons (sshd), printer daemons (lpd, cupsd), various other network daemons, and so on. They are started up at boot time and usually remain running until shutdown.

  65. Question:What are program development tools?

    Answer:Program development tools are software tools used for program development, such as editors, pre-processors, compilers, linkers, debuggers, profilers, and dynamic linker/loaders.

  66. Question:Why do we single out program development tools?

    Answer:Program development tools were initially targeted towards making program development environments more productive. Understanding these tools helps in understanding the design decisions of operating systems.

  67. Question:What are some examples of program development tools?

    Answer:Some examples of program development tools include editors, pre-processors, compilers, linkers, debuggers, profilers, and dynamic linker/loaders.

  68. Question:Why is it important to understand the steps involved in turning source code into a running process?

    Answer:Understanding the steps involved in program execution helps in understanding the reasons behind design decisions in operating systems.

  69. Question:Software library

    Answer:A file containing compiled code and possibly data that can be used by other programs.

  70. Question:Stand-alone executable

    Answer:An executable program that can be run independently without any additional files or libraries.

  71. Question:Functions

    Answer:Reusable blocks of code that perform a specific task.

  72. Question:Type definitions

    Answer:Specifications of the data type and its characteristics.

  73. Question:Constants

    Answer:Fixed values that do not change during program execution.

  74. Question:C standard I/O library

    Answer:A library in the C programming language that provides functions for input and output operations.

  75. Question:C++ iostreams library

    Answer:A library in the C++ programming language that provides objects and functions for input and output operations.

  76. Question:Loader

    Answer:A program that loads a binary executable file into memory.

  77. Question:Relocatable code

    Answer:Code that can be loaded at different memory locations and still execute correctly.

  78. Question:Static linking

    Answer:The process of combining libraries into the program executable by the linker when creating the executable.

  79. Question:Dynamic linking

    Answer:The process of linking libraries at run-time, where the libraries are loaded into memory when needed.

  80. Question:Static libraries

    Answer:Libraries with the extension '.a' that are used for static linking.

  81. Question:Dynamic libraries

    Answer:Libraries with the extension '.so' (shared objects) that are used for dynamic linking.

  82. Question:gcc -o myprog main.o utilities.o mathstuff.o io.o -lm

    Answer:A command to compile and link a program named 'myprog', including the object files 'main.o', 'utilities.o', 'mathstuff.o', 'io.o', and the math library '-lm'.

  83. Question:Why is dynamic linking preferred?

    Answer:Dynamic linking is preferred because it allows for better use of memory and faster load times. It also eliminates the need for recompilation or rebinding when libraries change.

  84. Question:Why does the UNIX world call dynamically linkable libraries 'shared objects'?

    Answer:The UNIX world calls dynamically linkable libraries 'shared objects' because they can be designed to be shareable, meaning only one copy is needed in memory.

  85. Question:What are the advantages of dynamic linking?

    Answer:The advantages of dynamic linking include faster load times, better use of memory, and the ability to avoid recompilation or rebinding when libraries change.

  86. Question:Advantages of Static Linking

    Answer:1. Portability: Executables whose libraries are all statically linked can be run on any machine with the same architecture without requiring the presence of the exact library they were compiled against. 2. Performance: Statically-linked programs are faster as they don't incur the performance cost associated with references to shared library routines. 3. Other minor advantages related to concepts of virtual memory.

  87. Question:Portability

    Answer:Executables whose libraries are all statically linked can be run on any machine with the same architecture without requiring the presence of the exact library they were compiled against.

  88. Question:Performance

    Answer:Statically-linked programs are faster as they don't incur the performance cost associated with references to shared library routines.

  89. Question:Other minor advantages

    Answer:There are other minor advantages related to concepts of virtual memory.

  90. Question:Portability

    Answer:The ability of an executable to run on multiple platforms.

  91. Question:Binary Format

    Answer:The format for applications that dictates the layout of the header, instructions, and variables.

  92. Question:ELF

    Answer:Executable and Linkable Format, the standard format for executable and relocatable files in Linux.

  93. Question:PE

    Answer:Portable Executable format, used by Windows systems.

  94. Question:Mach. O

    Answer:Executable format used by macOS.

  95. Question:APIs

    Answer:Application Programming Interfaces, specify how the source code should be written.

  96. Question:System Calls

    Answer:Actions performed by an application to request services from the operating system.

  97. Question:Compiler

    Answer:A program that translates source code into machine code.

  98. Question:Linker

    Answer:A program that combines multiple object files into a single executable file.

  99. Question:Hardware Platforms

    Answer:Different computer architectures and systems on which an executable can run.

  100. Question:Solution 1: Compile and link according to an ABI

    Answer:An ABI defines how the components of the binary code can interface with a given kernel and CPU architecture.

  101. Question:Solution 2: Write code in an interpreted language

    Answer:Interpreted languages like Python can run slowly compared to compiled languages.

  102. Question:Solution 3: Write code in a language that uses a virtual machine

    Answer:Languages like Java with a virtual machine (Java Runtime Environment) can result in slower programs.

  103. Question:Solution 4: Manual porting to each operating system

    Answer:This involves porting the application manually to each operating system, which is time-consuming and needs to be repeated with each new version.

  104. Question:Information hiding

    Answer:Separating the methods that implement a particular component from the design of that component itself makes system maintenance and modification easier.

  105. Question:Levels or layers of abstraction

    Answer:System software can be simplified and verified by organizing the functions as a hierarchy that can make only downward calls and upward returns.

  106. Question:Virtual machines

    Answer:A set of related functions can be implemented as a simulation of a machine whose interface is an 'instruction set' and whose internal structure and data are hidden.

  107. Question:Principle of least privilege

    Answer:In a particular abstraction layer of a computing environment, every entity (process, user, program, etc.) must have only the privilege needed to access only the information and resources that are necessary for its legitimate purpose.

  108. Question:Principle of locality

    Answer:Processes use small subsets of their address spaces for extended periods.

  109. Question:Policy

    Answer:A set of rules that guides and determines decisions

  110. Question:Mechanism

    Answer:A process, technique, or system for achieving a result

  111. Question:Separation of Policy and Mechanism

    Answer:A principle in software engineering that states policies should be separate from mechanisms

  112. Question:Flexibility of Mechanisms

    Answer:Mechanisms should be flexible enough to work with different policies

  113. Question:Windows vs Linux

    Answer:In Windows, mechanism and policy are tied together, while in Linux, anyone can make changes to mechanisms and propose changes to policies

  114. Question:In what languages are operating systems written?

    Answer:Early operating systems were written in assembly language. The first operating system to be written exclusively in a high-level language was the Burroughs MCP, in 1961. Others followed in PL1 and other systems languages. UNIX was the first operating system to be implemented in C. Now, most operating systems are written in a mix of assembly and C and/or C++. The kernel is usually written in assembly and C, while the libraries and systems programs are written in C and/or C++. Some systems programs are also written in scripting languages such as Perl, Python, and shell languages such as Bash.

  115. Question:What was the first operating system to be written exclusively in a high-level language?

    Answer:The Burroughs MCP, in 1961.

  116. Question:What was the first operating system to be implemented in C?

    Answer:UNIX.

  117. Question:What are the common languages used to write operating systems?

    Answer:Most operating systems are written in a mix of assembly and C and/or C++. The kernel is usually written in assembly and C, while the libraries and systems programs are written in C and/or C++. Some systems programs are also written in scripting languages such as Perl, Python, and shell languages such as Bash.

  118. Question:What are the advantages and disadvantages of implementing an operating system in a higher-level language?

    Answer:The main advantage is increased productivity and a higher level of abstraction. However, the drawback is reduced speed, although modern compilers and processors have mitigated this to some extent.

  119. Question:What is the structure of an operating system?

    Answer:The arrangement and interrelationships among its separate executable modules.

  120. Question:What does the structure of an operating system refer to?

    Answer:How the binary files are interrelated, not how the source code files are written and organized.

  121. Question:How can the structure of an operating system be implemented?

    Answer:It can be implemented as a single file with a single address space, multiple files forming layers or rings, or using small files with message passing.

  122. Question:Monolithic Structure

    Answer:All functionality of the kernel is in a single, static binary file that runs in a single address space.

  123. Question:Early versions of UNIX

    Answer:Monolithic structure

  124. Question:Early versions of Linux

    Answer:Monolithic structure

  125. Question:Original UNIX operating system

    Answer:Monolithic structure

  126. Question:Layered Structure

    Answer:The operating system is divided into a number of layers, with successively higher layers built upon and dependent upon lower layers.

  127. Question:Ring Structure

    Answer:The operating system is organized as a set of concentric rings, with outer rings built upon and dependent upon inner rings.

  128. Question:Ring 0

    Answer:The innermost ring in the ring structure, representing the hardware.

  129. Question:User Interfaces

    Answer:The outermost ring in the ring structure, representing the set of user interfaces.

  130. Question:Drivers

    Answer:The intermediate rings in the ring structure, responsible for managing hardware devices.

  131. Question:Kernel

    Answer:A ring in the ring structure, implementing core operating system functionality.

  132. Question:Multics

    Answer:An example of a system that used a ring structure as a design principle for protection.

  133. Question:What is the disadvantage of incorporating services into a monolithic kernel?

    Answer:Modifying them requires careful work to prevent side effects in the kernel, and being able to start and stop services without changes to the state of the kernel requires design changes within the kernel itself. Large kernels are also hard to maintain.

  134. Question:Who created the RC 4000 Multiprogramming System?

    Answer:Per Brinch Hansen and his team of developers.

  135. Question:What is the concept of a microkernel design?

    Answer:To make the kernel as small as possible, containing only absolutely essential functionality that needs to run in privileged mode. All other functionality is put into separate programs that run in user mode, communicating through message-passing.

  136. Question:Benefits of Microkernels

    Answer:Advantages of creating a microkernel with only essential functions and everything else in separate programs.

  137. Question:Easier to extend

    Answer:Extending a microkernel-based operating system is easier because most of the extension is in separate programs rather than inside the kernel.

  138. Question:Easier to port

    Answer:Porting the operating system to new architectures is easier with a microkernel because there is less code to modify.

  139. Question:More reliable

    Answer:A microkernel-based operating system is more reliable because the kernel is smaller, easier to debug, and maintain.

  140. Question:More secure

    Answer:A microkernel-based operating system is more secure as the smaller kernel is easier to analyze for security flaws and satisfies the principle of least privilege.

  141. Question:What services were included in the earliest microkernels?

    Answer:inter-process communication system, process scheduling, and memory management

  142. Question:Where were other services like file systems, device drivers, and application interface located in the earliest microkernels?

    Answer:user-space processes

  143. Question:Who designed and built MINIX?

    Answer:Andrew S. Tanenbaum

  144. Question:Where is Andrew S. Tanenbaum a professor of computer science?

    Answer:Vrie Universiteit Amsterdam

  145. Question:Where was MINIX designed and built?

    Answer:Netherlands

  146. Question:What was the processor MINIX 1.0 designed to run on?

    Answer:Intel 8088

  147. Question:Which version of Unix was MINIX 1.0 system-call compatible with?

    Answer:Seventh Edition Unix

  148. Question:Where can the source code of MINIX 1.0 be found?

    Answer:In Andrew S. Tanenbaum's book, Operating Systems: Design and Implementation

  149. Question:What is the most well-known example of a microkernel-based operating system today?

    Answer:The Mach kernel

  150. Question:Where was the Mach kernel developed?

    Answer:Carnegie Mellon University

  151. Question:Which operating system uses the Mach kernel?

    Answer:macOS

  152. Question:What components are included in the Mach kernel?

    Answer:IPC mechanism, memory management, and process scheduler

  153. Question:How do user programs interact with the Mach kernel?

    Answer:Through message passing

  154. Question:What is Redox?

    Answer:An open source, Unix-based operating system written in Rust

  155. Question:Where can Redox be found?

    Answer:GitHub

  156. Question:What is sel4?

    Answer:A formally verified microkernel

  157. Question:Is sel4 open source?

    Answer:Yes

  158. Question:Which foundation supports sel4?

    Answer:L4 Foundation

  159. Question:Loadable Kernel Modules

    Answer:An alternative that offers a compromise between microkernels and monolithic systems is to use loadable kernel modules.

  160. Question:Kernel Size in Loadable Kernel Modules

    Answer:The idea is to keep the kernel small, but not as small as a microkernel. The kernel provides core services, and the other services are loadable dynamically as needed, while the kernel is running.

  161. Question:Kernel Modules

    Answer:Other services are provided in kernel modules, which are executable files that can be loaded and linked into the kernel at run-time.

  162. Question:Linux and Loadable Kernel Modules

    Answer:Linux uses loadable kernel modules for a variety of services, ranging from device drivers to file systems to cryptographic services.

  163. Question:Inserting and Removing Kernel Modules

    Answer:Kernel modules can be inserted into and removed from the kernel from the command line.

  164. Question:Hybrid Operating Systems

    Answer:Most operating systems are hybrids of two or more models.

  165. Question:Linux

    Answer:A monolithic system but it also uses loadable kernel modules.

  166. Question:Windows operating systems

    Answer:Mostly monolithic but provide support for separate subsystems.

  167. Question:macOS

    Answer:A complex, partially layered system built on top of the Darwin kernel.

  168. Question:Darwin kernel

    Answer:The core of macOS, consisting of an open source Mach microkernel and elements of FreeBSD UNIX.

  169. Question:What is the process of starting a computer by loading the kernel called?

    Answer:Bootstrapping or booting the system

  170. Question:Where does execution start when a machine is powered on?

    Answer:At a small boot loader in nonvolatile firmware

  171. Question:What are the two types of nonvolatile firmware used in systems?

    Answer:BIOS (in older systems) and UEFI (in newer systems)

  172. Question:What tests does the boot loader usually run?

    Answer:Diagnostic tests such as inspecting memory and the CPU, and discovering devices

  173. Question:What is the second boot loader called?

    Answer:The boot block

  174. Question:What does the program stored in the boot block do?

    Answer:Loads the kernel into memory

  175. Question:What is the Linux kernel image?

    Answer:A compressed file that needs to be extracted after it is loaded into memory

  176. Question:What is GRUB?

    Answer:An open source bootstrap program for Linux and UNIX systems

  177. Question:What can be done using GRUB at boot time?

    Answer:Changes can be made, such as selecting which kernel to load

  178. Question:What happens after the kernel is loaded?

    Answer:The bootstrap program transfers control to the kernel.

  179. Question:What happens next after the bootstrap program transfers control to the kernel?

    Answer:It is kernel-dependent, but most systems will load drivers, start services, and eventually display a user interface.

  180. Question:What does the Linux kernel do after it is loaded?

    Answer:It loads necessary drivers, switches the root file system, creates the initial process (systemd), and starts servers.

  181. Question:What services may the Linux kernel start after loading?

    Answer:Web servers, SSH servers, print services, etc.

  182. Question:What is displayed eventually after the Linux kernel loads?

    Answer:A login prompt.