Skip to content

Stage 7

ABI

The INIT program must be modified to comply with the XEXE format. 8 words are reserved for the header and the code should start from the 4th page.

Modifications to OS Startup Code

Load the Library Code from the disk to memory

  • The shared library must be loaded to disk blocks 13 and 14 of the disk. During the OS startup, the OS is supposed to load this code into memory pages 63 and 64. This library code must be attached to logical page 0 and 1 of every process.

  • The library provides a common code interface for all system calls. This means to invoke a system call, the application can call the corresponding library function and the library will in turn invoke the system call. (Also implements dynamic memory allocation and de-allocation).

A total of 16 page tables can be stored starting from 29696, each page table will have 20 entries

The stack must point tot the second of word of the header - Entry Point

load INIT
load INT10
load ExceptionHandler
PTBR = PAGE_TABLE_BASE;
PTLR = 10;
// set up the page table of the process
// push 2 word of header to the User Stack
SP = [User Stack Address]
ireturn;