Operating System Functions

When you edit a document while music plays and a file downloads, several programs need the same computer resources. An operating system is system software that manages hardware resources and provides services to programs. Its functions include sharing processor time, managing memory, organizing files, and coordinating devices. Understanding these functions helps you explain what happens when a program waits, requests more memory, saves work, or encounters an access restriction.

Coordinating shared hardware

Applications request services from the operating system instead of each independently controlling every hardware resource. This coordination makes it practical for programs to share a computer while keeping track of which resources each program may use.


Applications connect through the operating system to the processor, memory, and devices or storage.


The main functions answer different questions:


Function

What it manages

Example decision

Process management

Programs currently being executed

Which ready program receives processor time?

Memory management

Working memory assigned to programs and the system

Is enough memory available for an allocation?

File management

Stored data, names, folders, and access rules

May this program modify this file?

Device management

Communication with hardware devices

How should pending output reach the printer?


These functions cooperate. Saving a document involves a running program, data held in memory, a destination file, and a storage device.

Sharing processor time and memory

A process is an instance of a program being executed, together with its execution state and assigned resources. Opening the same application twice can create separate processes. The stored program and its running instances are different things.


The operating system schedules processes for the CPU. With one processing core, several processes can make progress by taking turns. Rapid switching can make applications appear to run together, although the core executes one process's instructions at a time in this simplified model.


A process waiting for a device does not need to occupy the processor throughout that wait. The operating system can schedule another ready process. Waiting for input or output is different from executing instructions.



Memory management assigns space in RAM. The operating system also enforces memory access rules, helping prevent a faulty process from overwriting another process's protected memory.


For a simplified physical-memory budget:


Mfree=Mtotal−MOS−∑MprocessesM_{\text{free}}=M_{\text{total}}-M_{\text{OS}}-\sum M_{\text{processes}}


Here, the terms represent free memory, total memory, memory used by the operating system, and the combined process allocations. Use matching units, include all stated allocations, and assume nothing is counted twice. Real systems can use additional memory-management techniques; this budget answers only the stated allocation question.

Managing files and devices

File management organizes stored information into named files and folders. It tracks where data belongs and applies access rules. Reading a file and changing it are separate operations: permission to read does not automatically grant permission to write.


Successfully saved data normally remains in storage after its application closes. Unsaved changes held only in RAM do not have that same persistence. Closing a program can release its working memory without deleting its saved files.


Device management coordinates communication with hardware such as keyboards, printers, and storage drives. A device driver supplies device-specific support. The operating system can track pending requests and respond when a device reports completion. A queued print job, for example, has been accepted for later handling; that alone does not establish that paper has been printed.



What to remember

  • Processes receive processor time and memory under operating-system control.
  • A waiting process can allow another ready process to execute.
  • File management handles stored information and access rules.
  • Device management coordinates hardware requests and their completion.

Example: Opening another application in a school lab

A school computer has 4096 MiB of physical RAM. The operating system uses 1024 MiB, an editor uses 1280 MiB, and a browser uses 512 MiB. A design application needs another 1536 MiB to start.


For this physical-memory budget, account for the total RAM available and every allocation that occupies it. Assume the stated allocations do not overlap, account for all used RAM, and remain unchanged. The design application must fit entirely in the remaining physical RAM; no existing allocation can be moved out to make room. The computer has one processing core.


a) How much RAM remains before the design application starts?


First, combine the operating system and editor allocations. Their subtotal is ________. Adding the browser gives a total existing allocation of ________.


Mused=1024+1280+512=2816 MiBM_{\text{used}}=1024+1280+512=2816\ \text{MiB}


Then subtract that allocation from the total physical RAM:


Mfree=4096−2816=1280 MiBM_{\text{free}}=4096-2816=1280\ \text{MiB}


Answer: 1280 MiB remains unassigned. The check is that used memory plus free memory equals the original 4096 MiB.


b) Can the design application start under these assumptions? If not, find the memory shortfall.


Compare the application's required allocation with the free memory:


1536 MiB>1280 MiB1536\ \text{MiB}>1280\ \text{MiB}


Equivalently, the existing allocations plus the new request would require ________:


Mrequired=2816+1536=4352 MiBM_{\text{required}}=2816+1536=4352\ \text{MiB}


Subtract the physical capacity to calculate the shortfall:


Mshortfall=4352−4096=256 MiBM_{\text{shortfall}}=4352-4096=256\ \text{MiB}


Answer: No; the request exceeds the available RAM by 256 MiB. This conclusion follows from the fixed-budget assumptions. It does not claim that every real operating system handles a memory shortage in the same way.


c) The browser now waits for network data while the editor is ready to execute. The network request can progress without browser instructions executing. Explain whether the editor can receive processor time during this wait.


First, identify the browser's condition: it is waiting for data rather than needing continuous processor execution. The outstanding network request can progress independently under the stated assumption.


Next, identify the editor's condition: it is ready to execute. The operating system can schedule the editor on the core while the browser waits. When the data arrives, the browser can become ready for a later turn.


Answer: Yes; the editor can receive processor time while the browser waits. This improves useful processor activity without requiring both applications' instructions to execute simultaneously on the single core.

A computer runs several applications that share its hardware. Match each operating-system function to the responsibility that best describes its role in coordinating those applications.

Match each term
A.

Coordinates communication with hardware such as printers

B.

Selects which ready program instance receives processor time

C.

Assigns working space and enforces boundaries between allocations

D.

Organizes named stored data and applies access rules

File management

Memory management

Process management

Device management

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A student launches the same text editor twice. The operating system tracks each active instance separately, including its memory and execution state. Complete the statements using the appropriate operating-system terms.


The stored set of editor instructions is a . Each active instance managed by the operating system is a .

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A computer has 8192 MiB of physical RAM. The operating system uses 2048 MiB, a video application uses 1536 MiB, and a browser uses 1024 MiB. These non-overlapping allocations account for all used RAM. How much RAM remains unassigned? Answer in MiB, to zero decimal places.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Extra Practice