CS604 Operating System Quiz

AffirmativeJasper1951 avatar
AffirmativeJasper1951
·
·
Download

Start Quiz

Study Flashcards

40 Questions

What are the major high-level components of a computer system according to the document?

Hardware, Operating system, Applications programs, Users

What are some of the main issues involved in executing executable programs on a computer system?

Loading executable from disk into main memory

An operating system serves as an intermediary between a user and computer hardware.

True

In a single-user system, a computer system that allows only 1 user to use the computer at a given time.

one

Match the following system types with their descriptions:

Batch systems = Early computers using card readers and line printers for input/output Time-sharing systems = Multiple users sharing the system resources simultaneously Real time systems = Systems designed to respond to events immediately Single-user systems = Systems allowing only one user to access the computer at a time

What type of systems are executed in a 'batch' one after the other?

Batch systems

In a batch system, the CPU is often idle due to mechanical I/O devices being slower than electronic devices.

True

What is the major task of an operating system in a batch system?

Transfer control automatically from one job to the next

Multi-programming increases CPU utilization by organizing jobs so that the CPU always has one to ______.

execute

Match the following system types with their descriptions:

Real-time systems = Used when rigid time requirements are placed on processor operation Time-sharing systems = Multi-user, multi-process, and interactive systems Multi-programmed systems = Increase CPU utilization by having multiple jobs in memory simultaneously Batch systems = Execute jobs with similar needs one after the other

What is the purpose of the base register in memory protection?

It holds the smallest legal physical memory address for a process.

What are some responsibilities of an operating system in memory management?

All of the above

A timer is used in CPU protection to prevent a program from running too short.

False

A _______ interrupt is generated that transfers control from the current process to the next scheduled process.

timer

What are the four events that cause execution of a piece of code in the kernel?

System call

What are system calls?

System calls provide the interface between a process and the OS, allowing processes and users to manipulate system resources.

The bottom layer in a typical OS layered structure is ____________.

hardware

Match the following categories with their descriptions:

Process Control = Manipulate processes File Management = Manage files Device Management = Control devices Information maintenance = Maintain system information Communications = Deal with communication

The microkernel approach removes all non-essential components from the kernel.

True

What is the significance of the root directory in a Linux file system?

The root directory is the directory that contains all other directories, and it is at the top of the directory structure.

Which command is used to display the contents of a directory in Linux?

ls

Hidden files in Linux are also known as dot files.

True

In Linux, the ________ directory stores system boot files including the kernel image.

/boot

Match the Linux directory with its purpose:

/etc = Stores system configuration files /home = Personal directory for each user /usr = Contains user applications and supporting files /var = Contains variable data files such as logs and mail

What is the primary role of the short-term scheduler in an operating system?

Select which process should be executed next and allocate CPU

Why must the short-term scheduler be fast?

To select a new process for the CPU frequently due to the short time between executions

What is the primary role of the long-term scheduler?

Control the degree of multiprogramming

The long-term scheduler executes more frequently than the short-term scheduler.

False

A medium-term scheduler may remove processes from memory to reduce the ____________.

degree of multiprogramming

What is the command to display the absolute pathname of your working directory?

pwd

Which command is used to copy a file named file1 to another file named file2?

cp file1 file2

What is the command to move a file named file1 to another file named file2?

mv file1 file2

How do you remove a file named file1 using the command line?

rm file1

Which states can a process be in according to the process state diagram?

Waiting

Context switching is the process of saving the context of the current process and loading the state of a new process.

True

What is a zombie process?

A process that has terminated but whose exit status has not yet been received by its parent process or by init.

What does the execlp() system call do?

Replaces the process' memory space with a new program

The fork() system call creates a new process by copying the current process.

True

What are the advantages of cooperating processes? Information sharing: Since several users may be interested in the same piece of information, we must provide an environment to allow concurrent users to access these types of resources. Computation speedup: If we want a particular task to run faster, we must break it into ____________.

subtasks

Match the following communication characteristics with their descriptions:

Blocking send = The sending process is blocked until the receiving process or the mailbox receives the message. Non-blocking receive = The receiver receives either a valid message or a null. Bounded Capacity = A communication queue with finite length where sender blocks if queue is full. Unbounded Capacity = A communication queue with infinite length where sender never blocks.

Study Notes

Introduction to Operating Systems

  • An operating system is a program that acts as an intermediary between a user and the computer hardware.
  • It manages hardware and software resources, provides services to users, and controls the execution of programs.

Organization of a Computer System

  • A computer system consists of:
    • Hardware: provides basic computing resources (CPU, memory, I/O devices)
    • Operating system: manages the use of hardware among application programs and provides a simple interface for users
    • Application programs: define the ways in which system resources are used to solve computing problems
    • Users: people, machines, or other computers

Purpose of a Computer System

  • The primary purpose of a computer system is to execute programs efficiently and allow users to solve problems.
  • The operating system provides services to achieve this purpose, including:
    • Managing secondary storage devices
    • Managing primary storage (memory)
    • Managing processes
    • Providing file management
    • Providing security and integrity of data

Types of Operating Systems

  • Single-user systems: allow only one user to use the computer at a time, maximizing user convenience and responsiveness.
  • Batch systems: execute jobs in batches, where a job consists of a program, data, and control information.
  • Multi-programmed systems: keep multiple jobs in memory simultaneously, increasing CPU utilization and throughput.
  • Time-sharing systems: allow multiple users to use the computer simultaneously, with each user interacting with their processes.
  • Real-time systems: have rigid time requirements, used in dedicated applications such as scientific experiments, medical imaging, and industrial control.

Interrupts, Traps, and Software Interrupts

  • Interrupts: signals generated by hardware devices to get the CPU's attention.
  • Traps (or exceptions): software-generated interrupts caused by errors or user requests for operating system services.
  • Signals: events generated to get the attention of a process, such as SIGINT (Interrupt signal).### Hardware Protection
  • To ensure proper operation, we must protect the operating system and other programs from malfunctioning programs.
  • Issues of hardware protection include I/O protection, memory protection, and CPU protection.

Dual-Mode Operation

  • To differentiate between a user process and the operating system code, we need two separate modes of operation: user mode and monitor mode (also called supervisor mode, system mode, or privileged mode).
  • A bit, called the mode bit, is added to the hardware of the computer to indicate the current mode.

I/O Protection

  • To prevent users from performing illegal I/O, all I/O instructions are defined as privileged instructions.
  • Users cannot issue I/O instructions directly; they must do it through the operating system.
  • I/O protection is complete if a user program can never gain control of the computer in monitor mode.

Memory Protection

  • Memory protection is ensured by using two CPU registers: base register and limit register.
  • Base register holds the smallest legal physical memory address for a process.
  • Limit register contains the size of the process.
  • The CPU checks that every address generated by the process falls within the memory range defined by the values stored in the base and limit registers.

CPU Protection

  • To maintain control, we must ensure that the operating system maintains control.
  • A timer is used to prevent a program from running too long.
  • The timer period may be variable or fixed.

Operating System Components

  • Process management:
    • Creating and terminating processes
    • Suspending and resuming processes
    • Providing mechanisms for process synchronization and communication
  • Main memory management:
    • Keeping track of free memory space
    • Keeping track of which parts of memory are currently being used and by whom
    • Deciding which processes are to be loaded into memory when memory space becomes available
  • Secondary storage management:
    • Free-space management
    • Storage allocation and deallocation
    • Disk scheduling
  • I/O system management:
    • A memory management component
    • A general device-driver interface
    • Drivers for specific hardware devices
  • File management:
    • Creating and deleting files
    • Creating and deleting directories
    • Supporting primitives for manipulating files and directories
  • Protection system:
    • Controlling access of programs, processes, or users to the resources defined by a computer system
  • Networking:
    • Message routing and connection strategies
    • Contention and security
  • Command-line interpreter (shells):
    • Reading user commands and executing them
    • Providing an interface between the user and the operating system

Operating System Services

  • Program execution:
    • Loading a program into memory
    • Running the program
    • Ending the program's execution
  • I/O operations:
    • Reading and writing files
    • I/O device management
  • File system manipulation:
    • Creating and deleting files
    • Creating and deleting directories
  • Communications:
    • Exchanging information between processes
    • Communication via shared memory or message passing
  • Error detection:
    • Detecting errors in the CPU and memory hardware
    • Detecting errors in I/O devices and user programs
  • Resource allocation:
    • Scheduling jobs
    • Allocating plotters, modems, and other peripheral devices
  • Accounting:
    • Keeping track of which users use how many and which kinds of computer resources
  • Protection:
    • Controlling access to system resources
    • Ensuring that all access to system resources is controlled### Operating System Structures
  • Simple/Monolithic Structure: no structure, written for functionality and efficiency; examples are DOS and UNIX.
  • In UNIX, the kernel is separated into interfaces and device drivers, providing OS functions through system calls.
  • The kernel is difficult to enhance due to its enormous functionality.

Layered Approach

  • Breaks the OS into layers or levels, each built on top of the lower layer.
  • The bottom layer is the hardware, and the highest layer is the user interface.
  • Each layer consists of data structures and routines that can be invoked by higher-level layers.
  • Advantages: modularity, simplified debugging, and system verification.
  • Disadvantages: careful definition of layers, added overhead, and longer system calls.

Micro Kernels

  • Structures the OS by removing non-essential components from the kernel and implementing them as system and user-level programs.
  • Provides a smaller kernel with minimum process and memory management, and a communication facility.
  • Advantages: ease of extending the OS, fewer modifications, easier porting, more security, and reliability.
  • Examples: Mach, MacOS X Server, QNX, OS/2, and Windows NT.

Virtual Machines

  • Conceptually, a computer system is made up of layers, with the kernel using hardware instructions to create system calls.
  • System programs use either system calls or hardware instructions, and application programs view everything under them as part of the machine.
  • Virtual machine (VM) approach: creates an illusion of a process having its own memory and virtual machine.
  • Advantages: provides a robust level of security and allows system development without disrupting normal system operation.
  • Examples: IBM VM operating system, Java Virtual Machine (JVM), and VMWare.

System Design and Implementation

  • Design goals: user goals (easy to use, reliable, safe, and fast) and system goals (easy to design, implement, and maintain).
  • Separation of mechanisms and policies: mechanisms determine how to do something, and policies determine what will be done.
  • Implementation: traditionally written in assembly language, now in higher-level languages like C/C++ for faster development, compactness, and ease of understanding.

UNIX/Linux Directory Structure

  • Hierarchical file system structure with a root directory (/) and other directories and files beneath it.
  • Directories and files are represented by paths and filenames.
  • Pathname: a list of directories separated by slashes (/).
  • The last component of a path may be a file or directory.
  • Types of pathnames: absolute (starts with the root directory), relative (starts with the home directory, current directory, or parent directory).

Directory Structure

  • Important directories in the Linux directory hierarchy:
    • /: The root directory.
    • /bin: Essential binary executable files.
    • /boot: System boot files.
    • /dev: Devices available to Linux.
    • /etc: System configuration files.
    • /home: Personal directories for users.
    • /lib: Shared libraries and kernel modules.
    • /lost+found: Files restored after a crash or improper shutdown.
    • /mnt: Temporary file systems.
    • /opt: Large application packages.
    • /proc: Virtual directory for system processes.
    • /root: Home directory for the superuser.
    • /sbin: System administration utilities.
    • /tmp: Temporary files.
    • /usr: Shareable, read-only directory for user applications.
    • /var: Variable data files.

Browsing UNIX/Linux Directory Structure

  • Commands for browsing the directory structure:
    • ls: Displays the contents of a directory.
    • ls -a: Displays all files in a directory, including hidden files.
    • ls -l: Displays the long listing for the contents of a directory.
  • Understanding the UNIX/Linux directory structure is essential for working with the system.

This quiz covers the concepts and topics related to operating systems, covering the basics, process management, memory management, and more. It is designed for CS604 students at Virtual University of Pakistan.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Introduction to Operating Systems
25 questions

Introduction to Operating Systems

UndisputableProtactinium avatar
UndisputableProtactinium
Operating Systems Basics
18 questions

Operating Systems Basics

ReachableYtterbium avatar
ReachableYtterbium
Operating System Concepts Chapter 3
15 questions
Use Quizgecko on...
Browser
Browser