Engineering Lab

UCT CSC3002 / 2024

From virtual address to physical frame

Translate eight-byte address records using a seven-bit page offset and a fixed page table.

JavaBit operationsPage tablesLittle-endian I/O

UCT / COURSE CONTEXT / 2024

CSC3002F · Computer Science 3002

Operating-system organisation and computer networks, with an Internet-protocol focus.

Science handbook · 2024

FIXED PAGE TABLE / 128-BYTE PAGES

Inside an address.

Virtual 68 → physical 324 / 0x144

VIRTUAL / PAGE000OFFSET / 7 BITS1000100
PAGE 02FRAME
PAGE 14FRAME
PAGE 21FRAME
PAGE 37FRAME
PAGE 43FRAME
PAGE 55FRAME
PAGE 66FRAME
PHYSICAL / FRAME010SAME OFFSET1000100
PAGE0
OFFSET68
FRAME2
PHYSICAL324
page = address >> 7
offset = address & 127
physical = (table[page] << 7) + offset

New binary explorer using the exact fixed table and bit operations in OS1Assignment.java. Seven valid virtual pages; no page replacement, faults or measured memory latency.

ENGINEERING PERSPECTIVE

Inside the work

Connect address bits to memory layout. This bounded exercise shows how a virtual page and an unchanged offset produce a physical address through an explicit table lookup.

Java / bit operations
Split the address with a seven-bit mask and shift.
Little-endian binary I/O
Decode and emit eight-byte address records.
STEP 1 / 3

Decode a record

Read a complete little-endian eight-byte address.

Source-derived walkthrough

How it works

Decode little-endian input into a long, compute page = address >> 7 and offset = address & 0x7F, look up frame [2,4,1,7,3,5,6], then emit (frame << 7) + offset.

Results & recovery

  • Source compiled and translated the fixture to 0x144, 0x1a4, 0xe8, 0x28c, 0x25c, 0x1b4, 0x218 and 0x250.

Technical limitations

No page replacement, TLB or page faults are implemented. The original submission omitted out-of-range and truncated-record validation; the bounded cleaned copy now adds those checks as explicit portfolio improvements.

What I would improve now

Retain the new range, exact-record and boundary checks. Add broader property tests while keeping this fixed-table exercise distinct from a complete memory-management system.

NEXT IN THE ARCHIVESignals through a filter