0% found this document useful (0 votes)
2 views

os assignment

The document discusses the concept of paging in operating systems, explaining how it manages memory through fixed-size blocks called pages and frames, along with the address translation process. It also outlines the various states of a process during its lifecycle, including New, Ready, Running, Waiting, and Terminated, along with their transitions. The advantages and disadvantages of both paging and process state management are highlighted.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

os assignment

The document discusses the concept of paging in operating systems, explaining how it manages memory through fixed-size blocks called pages and frames, along with the address translation process. It also outlines the various states of a process during its lifecycle, including New, Ready, Running, Waiting, and Terminated, along with their transitions. The advantages and disadvantages of both paging and process state management are highlighted.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

MONGU TRADES TRAINING INSTITUTE MANAGEMENT BOARD

BUSINESS STUDIES DEPARTMENT OF IT SECTION

ADVANCED CERTIFICATE IN COMPUTER STUDIES

TERM ONE ASSIGNMENT ONE

PROGRAM : DIPLOMA IN COMPUTER STUDIES

COURSE : OPERATING SOFTWARE

NAME : WAMULUME VINCENT MUBITA

NRC NO. : 383462/82/1

EXAM NO. : 831116

LECTURER : MR Luyengo
Concept of Paging in an Operating System

Paging is a technique used by operating systems to manage memory efficiently. It allows a


process’s memory to be non-contiguous, divided into fixed-size blocks called pages. Physical
memory is divided into corresponding blocks called frames.

#### Key Concepts:


- **Pages**: Fixed-size blocks of virtual memory.
- **Frames**: Fixed-size blocks of physical memory.
- **Page Table**: Maps virtual addresses to physical addresses.

#### Address Translation:


1. CPU generates a virtual address.
2. OS translates the virtual address using the page table.
3. The virtual address is mapped to a physical address.

**Example**:
- Virtual address space: 16 KB, Page size: 4 KB.
- Virtual address space divided into 4 pages (Page 0, Page 1, Page 2, Page 3).
- Physical memory has 4 frames (Frame 0, Frame 1, Frame 2, Frame 3).

Page Table:
```
Page | Frame
0 | 2
1 | 0
2 | 3
3 | 1
```

If the process accesses a virtual address in Page 1, the OS finds that Page 1 is mapped to Frame 0
and retrieves data from Frame 0.
#### Advantages:
- Eliminates external fragmentation.
- Efficient memory use by loading only needed pages.
- Simplifies memory allocation and deallocation.

#### Disadvantages:
- Overhead of maintaining the page table.
- Internal fragmentation if the process size isn’t a multiple of the page size.

### 2. States of a Process in an Operating System

A process is an instance of a program in execution. It goes through several states during its
lifecycle, representing its current activity.

#### Process States:


1. **New**: Process is being created.
2. **Ready**: Process is loaded into memory, waiting for CPU time.
3. **Running**: Process is being executed by the CPU.
4. **Waiting**: Process is waiting for an event or resource.
5. **Terminated**: Process has finished execution and is being removed from memory.

#### State Transitions:


- **New → Ready**: Process creation completed, moved to the ready queue.
- **Ready → Running**: CPU scheduler selects the process for execution.
- **Running → Ready**: Process is preempted and moved back to the ready queue.
- **Running → Waiting**: Process requests I/O or waits for an event.
- **Waiting → Ready**: Event occurs, process is ready to execute again.
- **Running → Terminated**: Process completes execution or is terminated by the OS.

#### Diagram:
```
+--------+ +--------+ +---------+
| New | -- | Ready | -- | Running |
+--------+ +--------+ +---------+
| |
| |
V v
+---------+ +-----------+
| Waiting | | Terminated |
+---------+ +-----------+
```

#### Example:
1. User starts a text editor (New → Ready).
2. Text editor is loaded into memory and waits for CPU time (Ready → Running).
3. Text editor waits for user input (Running → Waiting).
4. User types, and the editor resumes execution (Waiting → Ready → Running).
5. User closes the editor, and the process terminates (Running → Terminated).

#### Advantages:
- Efficient resource management by the OS.
- Clear structure for scheduling and execution.

#### Disadvantages:
- Overhead of managing state transitions.
- Potential for deadlocks if not managed properly. (QuillBot)

Works Cited
QuillBot, 2025. “QuillBot Flow.” (Mar 2025 Version) [Large Language Model], 2025, quillbot.com/flow.

You might also like