EEC2102-Week 6-Lecture-Chapter-5
EEC2102-Week 6-Lecture-Chapter-5
TECHNOLOGY
Presented by
Dr. Linus A. Aloo, PhD
References
Course Text Books
1. Campbell, J., Ciampa, M., Freund, S. M., Frydenberg, M., Sebok, S., Vermaat, M. E., Clemens, B. (2022).
2. Discovering Computers: Digital Technology, Data, and Devices. Cengage Learning: ISBN-10: 0357675363 ISBN-13:
9780357675366
3. Parsons, J. J. (2023). New perspectives on computer concepts 2016, comprehensive (21st ed.). Cengage Learning, Asia.
ISBN-13: 9780357674611
References Textbooks and Materials
1. Nagpal, D. P. (2008). Computer fundamentals. S. Chand Publishing. ISBN: 8121923883.
2. Microsoft Office documentation; support site, https://support.office.com
3. Microsoft Windows documentation; [online], Available: https://www.microsoft.com/en-us/store/b/software-
support
4. Stallings W., (2010) Computer Organization and Architecture: Designing for Performance, Prentice Hall 10th
Edition
5. Performing with Computers by Iris Blanc.
Chapter Objectives:
Discuss the evolution of OS for early simple batch systems to modern complex systems.
Understand the reason for memory partitioning and explain the various techniques that are used.
Medium-term The decision to add to the number of processes that are partially or fully in main memory. Medium-term
scheduling scheduling is based on the swapping function.
Short-term The decision as to which available process will be executed by the processor. The short-term scheduler,
scheduling also known as the dispatcher, executes frequently and makes the fine-grained decision of which job to execute
next. The operation of a short-term scheduler is based on the concept of process state.
I/O scheduling The decision as to which process’s pending I/O request shall be handled by an available I/O device.
Partitioning of the available memory as shown in Fig. 5.7, can be carried out in
fixed-size partitions but not necessarily of equal sizes. In this case, a process
brought into the memory is made to occupy the smallest available partition that can
accommodate it.
But this creates memory gaps leading to wastage of useful memory space.
For instance, a process that requires 3M bytes of memory would be placed in the 4M
partition of Figure 5.10b, wasting 1M that could be used by another process.
A more efficient approach is to use variable-size partitions.
When a process is brought into memory, it is allocated exactly as much memory as it
requires and no more.
But this can lead to a more fragmented memory, which although can be tackled by
Figure 5.7 Example of Fixed
compaction, is not sufficient.
Partitioning of a 64-Mbyte Memory
10/15/2024 EEC 2102 Computer Systems Lecture Notes by Dr. L. A. Aloo 16
CHAPTER 5: OPERATING SYSTEM SUPPORT
5.5 Memory Management
Paging
Both unequal fixed-size and variable-size partitions are inefficient in the use
of memory.
Suppose, however, that memory is partitioned into equal fixed-size chunks that
are relatively small, and that each process is also divided into small fixed-size
chunks of some size.
Then the chunks of a program, known as pages, could be assigned to available
chunks of memory, known as frames, or page frames.
At most, the wasted space in memory for that process is a fraction of the last page.
Figure 5.8 shows an example of the use of pages and frames.
At a given point in time, some of the frames in memory are in use and some are
free. The list of free frames is maintained by the OS. Process A, stored on disk,
consists of four pages. Figure 5.8 Allocation of Free Frames
Segmentation
There is another way in which addressable memory can be subdivided, known as segmentation.
Whereas paging is invisible to the programmer and serves the purpose of providing the programmer with a larger
address space, segmentation is usually visible to the programmer.
Segmentation allows the programmer to view memory as consisting of multiple address spaces or segments.
Segments are of variable, indeed dynamic size. Typically, the programmer or the OS will assign programs and data to
different segments.
This organization has a number of advantages to the programmer over a non-segmented address space:
1. It simplifies the handling of growing data structures.
2. It allows programs to be altered and recompiled independently without requiring that an entire set of programs be
relinked and reloaded.
3. It lends itself to sharing among processes.
4. It lends itself to protection.