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.
UCT / COURSE CONTEXT / 2024
CSC3002F · Computer Science 3002
Operating-system organisation and computer networks, with an Internet-protocol focus.
2026 PORTFOLIO RECREATIONS
Inside an addressFIXED PAGE TABLE / 128-BYTE PAGES
Inside an address.
Virtual 68 → physical 324 / 0x144
000OFFSET / 7 BITS1000100010SAME OFFSET1000100page = address >> 7
offset = address & 127
physical = (table[page] << 7) + offsetNew 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.
Decode a record
Read a complete little-endian eight-byte address.
- Page and offset
- A seven-bit offset selects a byte within a 128-byte page.
- Mapping
- The supplied seven-entry page table chooses the physical frame; the offset is preserved.
- Input contracts
- Out-of-range pages and incomplete records must be rejected rather than producing misleading output.
What the demonstration establishes
The browser model exposes page/frame/offset changes. The cleaned Java adds labelled boundary checks; this is not a TLB, page replacement algorithm or full memory manager.
Evidence behind this page
Named OS1Assignment.java, reproduced fixture translations and explicit cleanup validation.
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.