OSLab: Module 2 - Memory Management


Overview

Module 2 contains the memory management software and the monitor output software. The monitor output software is included in this module because the PC is designed so that its output is memory-mapped.

The memory management software implements a simple segmentation algorithm, dividing some 320kb into five segment sizes. When a process requests memory, the address of the first available segment with sufficient memory to satisfy the request is returned. Memory is allocated as follows:

Size Number Address Range
512 128 0x50000 -- 0x5ffff
1024 64 0x60000 -- 0x6ffff
2048 32 0x70000 -- 0x7ffff
4096 16 0x80000 -- 0x8ffff
16384 4 0x90000 -- 0x9ffff

There are two target executables: M2M.EXE, for exercising the memory management software, and M2D.EXE, for testing the display. M2D.EXE, when run, invites the user to type as many characters as possible within 15 seconds (module 1's devices are used in this executable).

Support Files

The .H (header) files contain data structures required for this module. The .C files contain the source code for:

Note that neither of the executables are used outside this module.