Operating Sys Test 1 Flashcards

1
Q

What is UNIX and why is it considered a multi-user operating system?

A

UNIX is an operating system that is the parent of many operating systems, including MINIX. It is considered a multi-user operating system because it allows multiple users to interact with the system simultaneously. Also because it has there is user mode and a kernel mode.

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

Define the term “super-user” in the context of Unix systems. Why is the super-user also called the system admin?

A

The super-user, also known as the system admin, is a special user in Unix systems with elevated privileges. This user can perform administrative tasks, configure the system, and has unrestricted access to system resources.

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

Explain the concept of virtual terminals and how they are used in Unix systems.

A

Virtual terminals in Unix allow users to access the system remotely or simultaneously from different locations. Users can open multiple virtual terminals, each running a separate Unix shell, to interact with the system.

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

Why is studying the Unix shell important? List three reasons mentioned in the lecture.

A

Not every computer system has a GUI.
GUIs offer limited automation capabilities; the shell can be scripted.
There are more than 1000 system tools and utilities available on the command line compared to the GUI.

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

Briefly describe the role of the shell in a Unix system.

A

The shell is a program that allows users to launch other programs, efficiently navigate the filesystem, and provides conveniences for increased system usability. It enables users to write and execute scripts, making automation possible.

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

What is the basic Unix prompt for normal users and the root user? Can the prompt be customized?

A

The basic Unix prompt for normal users is typically $ or %, and for the root user, it is #. The prompt can be customized to include user names, current directory, time, machine name, or other combinations.

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

Explain the significance of stdin and stdout in command-line programs. Provide an example.

A

Command-line programs receive input from stdin (standard input) and produce output to stdout (standard output). For example, the command wc -l myfile uses stdin to read the contents of myfile and stdout to display the line count.

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

How can you redirect stdin and stdout using the < and > operators?

A

You can redirect stdin using the < operator, and stdout using the > operator. For instance, wc -l myfile > output.txt redirects the output of the wc command to a file called output.txt.

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

Describe the structure of the macOS filesystem. What is the root directory, and what are folders called in the shell?

A

The macOS filesystem is an upside-down tree of directories and files. The root directory is represented by “/”, and directories in the shell are called directories, not folders.

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

Explain the purpose of the cd, ls, and pwd commands in Unix shell navigation.

A

cd: Change directory, used to move to a different directory.
ls: List files and directories in the current directory.
pwd: Print working directory, displays the current working directory.

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

What does the tilde (~) symbol represent in the shell? How can you use it in commands?

A

The tilde (~) symbol represents a user’s home directory. For example, ls ~ lists files in the user’s home directory, and cd ~ takes the user to their home directory.

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

Define and provide examples of wildcard characters in Unix shell commands.

A

Wildcards are symbols representing groups of characters in filenames. Examples include * (matches zero or more characters) and ? (matches a single character).

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

How does wildcard expansion work in Unix, and why is it useful?

A

Wildcard expansion converts wildcard specifiers to lists of files by the shell before executing the associated command. It allows users to specify groups of files conveniently.

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

What is the purpose of the search path in Unix? How can you display the current search path?

A

The search path is where the shell looks for executable commands. You can display the current search path using the command echo $PATH.

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

Explain the concept of pipes in Unix. Provide an example of using a pipe to connect two commands.

A

Pipes (|) allow redirecting the output of one program as the input of another. For example, ls -l *.txt | wc -l lists all .txt files, and the output is counted by wc -l.

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

What is a filter in Unix, and how does it differ from a regular command? What are there filters you have learned?

A

A filter is a Unix command that accepts text input, manipulates it, and produces output. Not all Unix commands are filters; filters specifically transform input text.

Three filters I have learned are awk, grep and wc

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

Give an example of using the awk command as a filter. What does the provided example command achieve?

A

An example of using awk as a filter is ls -l | awk ‘{print $5}’, which prints the size of files in the current directory, as the size appears in column #5 of the ls -l output.

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

What is the difference between * and ?

A
    • matches zero or more characters
      / - matches a single character
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are the three groups of file permissions? What are the permissions?

A

users, group and others. read, write and execute (rwx)

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

Describe the meaning of file permissions in Unix. How can you use the chmod command to change file permissions?

A

File permissions in Unix determine who can read, write, and execute a file. The chmod command is used to change permissions, e.g., chmod myProg o+w grants write permission to others on myProg.

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

Compare the two methods of specifying file permissions using numbers and symbols.

A

Using numbers: chmod 751 someFile sets permissions to 7 (rwx) for the owner, 5 (r-x) for the group, and 1 (–) for others. Using symbols: chmod u=rwx,g=rx,o=x someFile achieves the same result.

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

Briefly explain five shell commands, providing their primary functionalities.

cd, ls, pwd, cp, and echo

A

change directory, list files and directories, print working directory, copy files or directories print text to the screen

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

Define the following terms: OS, Super user, Terminal, Shell, GUI.

A

OS: Operating System; intermediary between software applications and hardware.
Super user: User with special privileges, often the system admin.
Terminal: Program allowing users to execute a shell.
Shell: Program enabling users to launch other programs, navigate the filesystem, and script.
GUI: Graphical User Interface; visual interaction with a system.

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

Explain the significance of stdin and stdout in command-line programs. Provide an example.

A

stdin (standard input) is the keyboard, and stdout (standard output) is the screen. Example: wc -l myfile reads from stdin (keyboard) and writes to stdout (screen).

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

Differentiate between the root directory, sub-directory, and parent directory in the Unix filesystem.

A

root directory: Top of the directory tree, represented by “/”.
Sub-directory: A directory within another directory.
Parent directory: The directory containing a sub-directory.

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

What is the purpose of the wildcard expansion? Provide an example.

A

Wildcard expansion converts wildcard specifiers to file lists before executing a command. Example: echo * lists all files in the current directory.

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

Define and give an example of a filter in Unix.

A

A filter is a command that accepts text input, manipulates it, and produces output. Example: grep “pattern” filename filters lines containing a specific pattern from a file.

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

What is the primary function of an Operating System?
A. Running application programs
B. Providing hardware abstraction
C. Managing data files
D. Handling network interfaces

A

B. Providing hardware abstraction

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

Where does the Operating System fit into the computer system?
A. Realm of Mere Mortal Users
B. Realm of Software Developers
C. Realm of Computer Engineers
D. All of the above

A

D. All of the above

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

freebie

A

freebie

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

What are the components of a modern computer?
A. CPU, RAM, Disks, I/O devices
B. Monitor, Keyboard, Mouse, Printer
C. Software, Hardware, Firmware, Network
D. Database, Compiler, Operating System, Web Browser

A

A. CPU, RAM, Disks, I/O devices

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

Explain the CPU instruction cycle.
A. Fetch, Execute, Decode
B. Execute, Decode, Fetch
C. Fetch, Decode, Execute
D. Decode, Fetch, Execute

A

C. Fetch, Decode, Execute

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

A. A wire that carries electricity in the motherboard.
B. A wire used to pass information between devices one bit at a time.
C. A wire that connects the CPU to the RAM.
D. A wire responsible for data storage in hard drives.

A

B. A wire used to pass information between devices one bit at a time.

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

Define and give examples of conceptual and logical abstractions.
A. Conceptual: Real system complexities; Logical: Framework for data organization.
B. Conceptual: Framework for data organization; Logical: Real system complexities.
C. Conceptual: Hides complexities; Logical: Discusses complexities.
D. Conceptual: Discusses complexities; Logical: Hides complexities.

A

A. Conceptual: Real system complexities; Logical: Framework for data organization.

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

Which of the following is NOT part of the Operating System?
A. Utilities like ls, cd, rm, etc.
B. Graphical User Interface
C. Compilers
D. Web Browsers

A

D. Web Browsers

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

What is the role of the kernel in an Operating System?
A. It manages user applications.
B. It provides hardware abstraction.
C. It is responsible for scheduling and managing processes, memory, and file systems.
D. It handles graphical user interfaces.

A

C. It is responsible for scheduling and managing processes, memory, and file systems.

37
Q

Explain the concept of CPU modes and their significance.
A. CPU modes determine the clock speed of the processor.
B. CPU modes control the access level to instructions and hardware.
C. CPU modes are related to the number of cores in a processor.
D. CPU modes define the type of tasks the processor can perform.

A

B. CPU modes control the access level to instructions and hardware.

38
Q

What is an interrupt, and how does it affect the operation of an Operating System?
A. An interrupt is a delay in CPU processing.
B. An interrupt is a signal indicating an event needing immediate attention, causing the CPU to switch to a different task.
C. An interrupt is a hardware failure in the CPU.
D. An interrupt is a software bug in the Operating System.

A

B. An interrupt is a signal indicating an event needing immediate attention, causing the CPU to switch to a different task.

39
Q

Provide examples of Operating Systems.
A. Windows 95/98/ME, Linux, iOS, MacOS
B. Firefox OS, CP/M, ROS, Symbian
C. Windows NT/XP/7/8, Android, FreeBSD, Solaris
D. All of the above

A

D. All of the above

40
Q
  1. Explain the concept of virtualization engines and virtual machines.
    A. Virtualization engines emulate the physical hardware, and virtual machines are the result of installing an OS on the emulated hardware.
    B. Virtualization engines are hardware components, and virtual machines are software programs.
    C. Virtualization engines and virtual machines are the same thing.
    D. Virtualization engines emulate software, and virtual machines emulate hardware.
A

A. Virtualization engines emulate the physical hardware, and virtual machines are the result of installing an OS on the emulated hardware.

41
Q

Convert the following units: 1 Kilobyte to Megabytes.
A. 0.001 Megabytes
B. 1 Megabyte
C. 1024 Megabytes
D. 1000 Megabytes

A

D. 1000 Megabytes

42
Q

1 Terabyte is equivalent to how many Exabytes?
A. 0.001 Exabytes
B. 1000 Exabytes
C. 1 Exabyte
D. 1000000 Exabytes

A

A. 0.001 Exabytes

43
Q

What is the primary purpose of a Virtual Machine?
A. To emulate the physical hardware of a computer system.
B. To provide hardware abstraction.
C. To execute operating systems.
D. To manage memory resources.

A

C. To execute operating systems.

44
Q

What is the purpose of the TRAP instruction in the context of operating systems? Explain how a user-mode program transitions to kernel mode when making a system call.

A

Purpose of TRAP Instruction: The TRAP instruction is used by user-mode programs to make a system call. When executed, it switches the CPU from user mode to kernel mode, allowing the operating system to perform privileged operations on behalf of the user.
Transition to Kernel Mode: The transition to kernel mode occurs when a user-mode program executes a system call. The TRAP instruction is a common mechanism for this transition. The CPU switches to kernel mode to execute the associated interrupt service routine (ISR) in the operating system.

45
Q

Provide examples of conceptual and logical abstractions used in operating systems.

A

Conceptual abstraction hides complexities not important in a particular context, while logical abstraction provides a framework for discussing the logical organization of data or things.

46
Q

Explain how the operating system abstracts hardware resources to manage them effectively.

A

The file abstraction is an example of logical abstraction, as it organizes the collection of 0s and 1s on a disk into files, managing the hardware resource.

47
Q

Describe the datapath of the CPU during the fetch stage of the instruction cycle.

A

During the fetch stage, the CPU fetches the instruction from memory using the system bus (Data + Address).

48
Q

What role does the Memory Management Unit (MMU) play in the execution of instructions?

A

The MMU translates virtual addresses to physical addresses during the fetch stage. The control unit decodes the opcode (operation code) and identifies the operation the instruction is meant to perform. the actual operation specified by the instruction is performed

49
Q

What is a rootkit, and what is it used for?

A

A rootkit is a type of malicious software that is designed to conceal its presence or the presence of other malicious software on a computer system. It is used to gain unauthorized access to a computer or to maintain privileged access while avoiding detection. Rootkits are often used for stealthy and persistent unauthorized access.

50
Q

what is a interrupt? What are three (3) sources that can raise an interrupt?

A

An interrupt is a signal sent to a CPU indicating an event that requires immediate attention. Interrupts are mechanisms used to divert the CPU’s attention from its current task to handle a specific event or condition.

51
Q

What are three (3) sources that can raise an interrupt?

A

Three Sources of Interrupts:
Hardware Interrupts: Generated by external hardware devices to signal events like data arrival, completion of I/O operations, or hardware errors.
Software Interrupts: Invoked by software or programs to request services from the operating system. System calls, such as those triggered by the TRAP instruction, are examples.
Exception Interrupts: Generated in response to exceptional conditions, such as division by zero or invalid memory access. Exceptions may be caused by both hardware and software issues.

Examples Include: system timers, disk I/O,
power-off signals, data ready (from serial, USB
or Ethernet), keyboard key pressed, hardware
failure, etc.

52
Q

List the 10^? for each of these names pico, nano, micro, mili, kilo, mega, giga, tera, peta, exa

A

10^-12, 10^-9, 10^-6, 10^-3, 10^3, 10^6, 10^9, 10^12, 10^15, 10^18

they go up by 3!

53
Q

Differentiate between user-focused and system-focused operating system services

A

User-focused services cater to user interaction, program execution, I/O operations, and file-system manipulation. System-focused services involve resource allocation, accounting, protection, and security.

54
Q

plain the types of user interfaces in operating systems

A

User interfaces include Command-Line Interface (CLI), Graphics User Interface (GUI), and Batch interfaces.

55
Q

Provide examples of system-focused services related to resource sharing

A

Resource allocation, accounting, protection, and security are system-focused services related to resource sharing.

56
Q

Describe the system boot process in a typical BIOS/UEFI setup

A

The system boot process involves Power-On Self Test (POST), CMOS/EEPROM Configuration, Bootloader Execution, and loading the OS from the disk.

57
Q

Define system calls and their significance in the interaction between user programs and the operating system

A

System calls are functions carried out by the operating system on behalf of a running program. They serve as an interface between user programs and the OS, allowing programs to access hardware resources.

58
Q

Explain the concept of POSIX and its role in maintaining compatibility between operating systems:

A

POSIX is a standard for maintaining compatibility between operating systems by defining a common API. A POSIX-compliant function should compile on various POSIX-compliant OSes.

59
Q

Differentiate between the BIOS and UEFI boot processes:

A

BIOS/UEFI boot processes involve POST, CMOS/EEPROM configuration, bootloader execution, and OS loading. UEFI is a modern replacement for BIOS, providing a more advanced and flexible boot process.

60
Q

Discuss the importance of error detection in operating systems

A

Error detection is crucial for maintaining correct and consistent computing. Operating systems constantly monitor for errors in CPU, memory, I/O devices, and user programs, taking appropriate actions to address them.

61
Q

Provide examples of I/O operations that a running program might require

A

Examples of I/O operations include reading from and writing to files, interacting with input/output devices (such as printers or scanners), and communication between processes over a network.

62
Q

Discuss the significance of protection and security in a multiuser or networked computer system

A

In a multiuser or networked system, protection ensures controlled access to system resources. Security involves defending the system from unauthorized access and protecting information. Both are crucial to prevent interference between concurrent processes and safeguard against external threats.

63
Q

What is POSIX? Why is it important?

A

POSIX, which stands for Portable Operating System Interface, is a standard that defines a set of common application programming interface (API) functions shared by POSIX-compliant operating systems. It is important because it promotes compatibility between different operating systems, allowing programs written with POSIX-compliant system calls to compile and run across various OS environments, including Windows, Linux, and macOS.

64
Q

Describe the process of making a system call

A

The process involves the calling program, the O/S API, the kernel, and the CPU’s operating mode:
The calling program invokes a system call through a high-level API provided by the operating system.
The API passes function parameters to the kernel on behalf of the program.
The kernel, in kernel mode, checks for proper permissions and executes a TRAP instruction to switch the CPU to kernel mode.
The CPU executes the trusted library function within the kernel.
Once the function completes, control returns to the kernel, which switches the CPU back to user mode before returning control to the calling program.

65
Q

For which of these tasks will a program likely require the services of the O/S? Circle all that apply
1. retrieving a webpage from the internet
2. playing a ‘ding’ sound when the user makes an error
3. squaring a 13-digit number
4 presenting the user with a pop up ‘ok’ or ‘cancel’ dialog box
5. dynamically allocating space for an array of 10 million integers

A

Programs are likely to require the services of the O/S for:
retrieving a webpage from the internet
playing a ‘ding’ sound when the user makes an error
presenting the user with a pop-up ‘ok’ or ‘cancel’ dialog box
dynamically allocating space for an array of 10 million integers

66
Q

True or False
to a calling program, system calls appear no different than regular library function calls
only privileged processes can make system calls
regular function calls are typically more computationally expensive than system calls
accessing RAM always requires a system call

A

true

false

false

false

67
Q

How many micrograms are in a kilogram?

A

There are 1,000,000 micrograms in a kilogram.

68
Q

How many megabytes are in a gigabyte?

A

There are 1,024 megabytes in a gigabyte.

69
Q

Arrange from least to greatest (1 = least, 4 = greatest):
_____ 0.0038 kiloseconds
_____ 38,000 milliseconds
_____ 0.38 seconds
_____ 38,000 microseconds

A

0.0038 kiloseconds
0.38 seconds
38,000 microseconds
38,000 milliseconds

70
Q

What subsystem of the MIPS CPU executes lw and sw instructions?

A

The Execution Unit (EU) executes lw (load word) and sw (store word) instructions.

71
Q

Which subsystem of a CPU administers the instruction cycle?

A

The Control Unit (CU) administers the instruction cycle.

72
Q

List the 3 phases of a CPU’s instruction cycle

A

fetch, decode, execute

73
Q

What is a dual-mode CPU? What are the differences between the 2 modes

A

A dual-mode CPU has two modes: user mode and kernel mode. The user mode restricts certain instructions and resources to protect user programs from interfering with the operating system. Kernel mode allows unrestricted access to the CPU’s instructions and resources, facilitating the execution of privileged tasks by the operating system.

74
Q

Describe the system bus (what it does, and how it works)

A

The system bus is a communication pathway that connects various hardware components in a computer, facilitating the transfer of data and control signals. It consists of an address bus, a data bus ( including the CPU, memory, I/O devices, and controllers), and acontrol bus. The address bus carries information about the memory location, the data bus transfers actual data, and the control bus manages the timing and coordination of data transfer

75
Q

What is the primary vehicle for moving data from the CPU to a peripheral device?

A

The primary vehicle for moving data from the CPU to a peripheral device is the I/O (Input/Output) bus. It acts as an intermediary between the CPU and the peripheral, handling data transfer and communication protocols.

76
Q

What are the four main areas of concern for operating systems?

A
  1. Process management: Creating, scheduling, and terminating processes.
  2. Memory management: Allocating and managing memory for processes.
  3. Device management: Controlling and coordinating access to I/O devices.
  4. File management: Creating, deleting, and managing files and directories.
77
Q

What is the central process of an operating system?

A

The central process of an operating system is the kernel.

78
Q

what is the primary consumer of O/S services?

A

The primary consumer of operating system services is user programs(applications).

79
Q

Describe what a pipe (|) does.

A

A pipe (|) is used to redirect the output of one command as the input to another command in a shell. It facilitates the chaining of commands, allowing them to work together in a sequential manner.

80
Q

An I/O device accessible through the system bus is said to be __________________.

A

An I/O device accessible through the system bus is said to be memory-mapped I/o device

81
Q

Write a shell command to list the 3 largest files in a directory.

A

ls -l | sort -nrk 5 | head -3

This command lists the files, uses sort to order by size (numerical order, -n) in reverse order (-r), uses k 5 to sort based on the fifth column (file size), and displays the top 3 results (head -3).

82
Q

Know how to identify hardware abstractions.

A

Hardware abstractions are identified by the use of high-level programming interfaces and APIs that shield the programmer from low-level hardware details.

83
Q

Define TRAP

A

TRAP is a software interrupt or exception that is triggered intentionally by a program to request a specific service from the operating system.

84
Q

what a virtual machine is and what it does?

A

A virtual machine is a software-based emulation of a physical computer. It allows multiple operating systems to run on the same physical hardware, providing isolation and flexibility.

85
Q

What part of the CPU is responsible for decoding instructions?

A

The Control Unit (CU) is responsible for decoding instructions.

86
Q

how to use ls, cd, pwd, grep, wc, head, tail and what they are

A

ls: List files in a directory.
cd: Change directory.
pwd: Print the current working directory.
grep: Search for a pattern in a file.
wc: Count lines, words, and characters in a file.
head: Display the first few lines of a file.
tail: Display the last few lines of a file.

87
Q

Explanations – rootkits, interrupts, ISRs, system calls.

A

Rootkits: Rootkits are malicious software that aims to gain unauthorized access and control over a computer system while hiding its presence from users and security tools.
Interrupts: Interrupts are signals sent by hardware or software to the CPU to indicate an event that requires immediate attention. They can be used to handle external events or errors.
ISRs (Interrupt Service Routines): ISRs are routines or programs that are executed in response to an interrupt. They handle the specific task associated with the interrupt and ensure proper system functioning.
System Calls: System calls are functions provided by the operating system that allow user programs to request services, such as file operations or process creation, from the kernel.

88
Q

What is the acronym to remember conversions?

A

Pico nan much mili kills mega giga tracks peta exa