Unit 1: Operating Systems: Structure and Services — Short Questions
10th Class Computer Science · Unit 1: Operating Systems: Structure and Services
Introduction to Operating System (OS)
Ans. An Operating System (OS) is a type of system software that manages hardware, runs application software, and provides a user interface, like MS Windows, macOS, Linux, Android, and iOS.
Ans. An operating system works like a traffic controller for the computer. It decides which task should be done first, how the computer's memory is used, and which devices (like a printer or speakers) should be active at a given time. It makes sure the computer works smoothly even when multiple tasks are running at the same time.
Ans. The operating system acts as a translator between the user, applications and the hardware system. When you click an icon or type something, the OS changes those actions into instructions that the hardware can understand.
Ans. When you press the letter A on a keyboard, the operating system converts it into a special binary code:
- The letter 'A' in binary is (01000001)₂.
- This code is sent to the computer screen, which displays A.
- This happens so quickly that it feels instant to the user.
Ans. No, humans and computers do not understand the same language. Humans speak languages like Urdu or English, whereas computers understand only binary language, which works using ON OFF states represented by 1 and 0 respectively.
Ans. 'A' is a character which has ASCII (American Standard Code for Information Interchange) 65. Convert 65 into binary by successive division by 2, recording remainders, then reading remainders from bottom to top.
A = (65)₁₀ = (01000001)₂
Ans. The OS ensures
- Creation and management of separate user accounts.
- Keeps each user's files and information private.
- Shares the computer's resources equally so no one slows down the system.
- Protects shared resources from unauthorized access.
Ans. The OS allows separate accounts for different users, each with its own desktop, Files, settings, and passwords.
Example: In a computer lab, students log in with a username and password provided by the school. This keeps each student's work separate and private. In modern OS like Windows, a new account can be created through Settings or Control Panel by selecting User Accounts, choosing Add New User, and entering details like username, password, and account type (Standard, Administrative, Guest).
Architecture of an Operating System
Ans. The architecture of an operating system is the way how its parts are organized and how they work together. Each part has a special role, and together they make the computer work smoothly just like a school has different departments that perform specific duties but work together for the smooth working of the school.
Ans. The kernel is the core part of the operating system, that directly controls the computer's system software and hardware such as the CPU, memory, and devices. It decides how and when different programs can use these resources.
Ans. When you open a file, the kernel manages the process of reading it from the hard drive and sending it to the screen.
Example: Like Engine of a car work is kernel and accessories like steering wheel, dashboard is shell.
Ans. The shell is the outer part of the OS that interacts with the user. It receives commands from the user and passes them to the kernel.
Ans. Graphical shells (like Windows desktop) and Command-line shells (like the Command Prompt or Terminal).
Ans. The lower layer works directly with hardware devices like the CPU, RAM, secondary storage (i.e hard disk). They manage and control hardware resources.
Ans. The middle layer of the OS manages system resources (such as CPU, memory, and devices) and ensures that programs can access and use them efficiently when needed.
Ans. Upper-layer run applications and provide the interface that the user views on the screen.
Ans. System libraries are collections of ready-made instructions that programs can use to perform common tasks, such as opening files or showing text on the screen.
Ans. Device drivers are special programs that allow the operating system to communicate with hardware devices such as printers and graphics cards.
Process Management in Operating Systems (OS)
Ans. The operating system is responsible for managing all the programs that run on a computer. In this context, these running programs are called processes. Process management ensures that each process gets the resources it needs, even when multiple processes are active. Process management is one of the most important jobs of an operating system because it ensures all processes run smoothly without disturbing each other.
Ans. A process goes through several stages during its life cycle: Creation, Execution, and Termination.
Ans. This happens when you start any program (like MS Word). The OS loads the program into memory and gives it the resources (like CPU time and memory) it needs.
Ans. During execution phase the process is actively running and performing tasks effectively.
Ans. The process finishes its task and is closed by the user or the system. The OS release the resources so they can be used by other processes.
Ans. The operating system allows more than one program to be open and usable by a single user at the same time. You can easily switch between them whenever you need.
Ans. Concurrency in an operating system means that more than one process is active at the same time. The CPU switches between processes very quickly.
Ans. Since the CPU cannot run all processes at the same time, the operating system must decide which process should run first and how long each process should run. This process is called scheduling.
Ans. In the FCFS method, the CPU processes tasks in the exact order they arrive. The first process to arrive is completed first, and the next process starts only after the previous one finishes.
Ans. P1 arrives first and runs from 0s to 5s, P2 runs from 5s to 8s, and P3 runs from 8s to 10s. Even though P3 has the shortest duration, it must wait until P1 and P2 have finished.
Ans. The advantages of FCFS are:
- Easy to understand and implement.
- Processes are served in the exact order they arrive.
- No process is skipped.
Ans. The disadvantages of FCFS are:
- Short processes may have to wait a long time if queued behind longer processes (known as the "convoy effect").
- This can affect the overall efficiency of the system.
Memory
Ans. Memory is a fundamental component of a computer system, used to store data and instructions required for processing. It ensures that the CPU can access information quickly during program execution.
Ans. Primary memory, also called Random Access Memory (RAM) or Volatile Memory, is the main working area of a computer. It is a fast storage area where the computer keeps the data and instructions temporarily. Its data is erased when the computer is turned off.
Ans. When you open a Word document, the computer quickly places the program and the document into RAM so the CPU can work on them right away.
Ans. When the RAM is full, the operating system uses part of the computer's storage device (like Hard Drives, Solid-State Drives (SSD), or Non-Volatile Memory Express (NVMe)) as virtual memory.
Ans. The primary purpose of virtual memory is to extend a computer's usable memory from secondary storage like hard disk drive.
Ans. Storage drives operate at lower data transfer speeds and have higher access times as compared to RAM; that's why the use of virtual memory can result in reduced system performance.
Processes vs Threads
Ans. The operating system may transfer data from less active programs to virtual memory. This frees up space in RAM for the programs you are currently using, but may make those fewer active programs slower to respond.
Ans. A process is an independent program that is currently being executed by the computer. It has its own memory space, CPU time, and other resources to run.
Ans. A thread is the smallest unit of execution within a process. Multiple threads can exist inside a single process, performing different tasks while sharing the same memory and resources.
Ans. Processes have their own memory space, CPU time, and other resources such as files or network connections. Threads share the same memory and resources within the process.
Ans. Processes are isolated from one another to ensure stability and security, so a problem in one process does not affect another. Threads operate independently but are not isolated, sharing resources within the same process.
Ans. The purpose of a process is to ensure stability in the system. A problem in one process generally does not affect the execution of other processes.
System Calls
Ans. Threads allow multiple tasks within the same process to run simultaneously. This ensures that tasks can progress without waiting for each other to finish, improving efficiency.
Ans. A web browser as a whole is one process. The entire application runs independently with its own memory and resources allocated by the operating system.
Ans. Example of threads within a process:
- Loading a webpage
- Playing audio or video
- Downloading files
Ans. Multithreading is an operating system technique that allows a single process to perform multiple tasks at the same time by dividing its work into smaller units.
Ans. Multithreading enhances performance by allowing tasks to run in parallel, improving system efficiency. It also improves responsiveness, supports concurrent operations, and uses system resources more efficiently since threads share the same memory and resources of the parent process.
Ans. A system call is a request made by a program to the operating system to perform a specific task that the program cannot do directly. They act as a bridge between user programs and the kernel, allowing applications to access hardware and core OS functions safely.
Ans. Without system calls, programs that directly control hardware can be unsafe and complex. They allow safe interaction between programs and the operating system.
Ans. When you save a file in a text editor, the program uses a system call to tell the operating system to write the data to the storage drive, like a Hard drive.
Ans. The open system call opens a file for reading or writing.
Example: Opening a music file to play
Ans. The read system call retrieves data from a file or input device.
Example: Reading text from a document.
Ans. The write system call sends data to a file or output device.
Example: Saving an image to the computer.
Ans. The fork system call creates a new process by duplicating an existing one.
Example: Opening a new browser tab, where the OS may use fork to create another process.
Ans. Linux and macOS have a few hundred system calls.
Ans. Windows uses nearly 2,000 system calls that handle everything from opening files to running apps and showing graphics in the background while you work.
File System Structure and Management
Ans. System calls allow programs to access hardware and core OS functions safely, acting as a bridge between user programs and the kernel.
Ans. An operating system not only runs programs but also stores and organizes the user's data. This is achieved through the file system, which provides a structured way for users and applications to store, locate, and manage information on storage devices.
Ans. A file is a collection of related data stored on a computer. It may contain text, images, audio, video, or program instructions.
Ans. A folder (also called a directory) is a container used to organize files and other folders in a logical structure, making it easier to locate and manage information.
Ans. Metadata refers to details about a file or folder, such as its name, type, size, date of creation, and date of last modification. This information helps both the operating system and the user identify and manage files and folders without opening them.
Ans. A file system is the way an operating system stores and organizes files on a storage device, such as a hard drive, SSD, or USB. It decides where each file will be kept and saves its location so it can be accessed later.
Ans. FAT32 (File Allocation Table 32): Used in USB flash drives.
NTFS (New Technology File System): Used by Windows OS.
APFS (Apple File System) /HFS + (Hierarchical File System Plus): Used by macOS.
EXT4 (Fourth Extended File System): Commonly used by Linux OS.
Ans. The choice of file system affects performance, storage capacity, and security features.
Ans. If you save a photo on your computer, the file system makes sure it is stored in the right place and knows exactly where to find it when you open it again, just like a librarian placing a book in the right section and knowing where to locate it later.
Ans. A well-designed file system ensures that data remains organized, secure, and easily retrievable, even when there are thousands of files containing complex data.
Ans. A file may contain text, images, audio, video, or program instructions.
Types of Operating Systems
Ans. Operating systems are designed according to the needs of the device and the work it performs. Each type serves a different purpose and is optimized for specific tasks.
Ans. A Real-Time Operating System is designed to process data and respond within a strict time limit, known as a deadline. It is used where even a tiny delay can cause system failure or serious consequences.
Ans. The key features of Real Time Operating System (RTOS) are:
- Processes tasks immediately as they arrive.
- Without long waiting times.
Ans. RTOS is used where critical systems such as air traffic control, heart-monitoring devices, or industrial robots' tasks must be completed within strict time limits.
Ans. An Embedded OS is a small and efficient operating system built into a highly efficient operating system built into a specific device to control only the functions it needs. It is not meant for general-purpose computing but is optimized for one task or a small set of tasks.
Ans. The key features of EOS are: uses very little memory, power, and is often stored permanently inside the device.
Ans. EOS are commonly used in home appliances (microwaves, washing machines), printers, smart TVs, and ATMs.
Ans. A Network OS manages and supports multiple computers connected through a network. It enables the sharing of resources like files, printers, and internet connections among users.
Ans. The key feature of NOS is that it focuses on communication and coordination between computers in a network.
Ans. In a school computer lab, students use different computers, but all can save files to the same server and print from the same printer.
Ans. Mobile OS is designed for smartphones, tablets, and other handheld devices. It is optimized for touch-screen use, battery saving, and mobile apps.
Ans. It supports wireless connectivity, cameras, sensors, and app stores, allowing mobile devices to run apps and communicate effectively.
Ans. Mobile phone OS is commonly used in:
- Smartphones
- Tablets
- Smartwatches