The suggested behaviour is for the operating system to prompt the user for a filename via the XFC OPEN_MAC_FILE. If the call returns successfully, then the selected file is loaded and executed. The symbol table information shoul be attached via an XFC CREATE_USER_SYMBOL_TABLE.
MacVAX Loads the new process.
For the new process; MACVax sets up the P0 Page Table (code and data), the P1 page table (Stacks) and the system page table. A process control block is created and the process is loaded into memory. The processes symbol table information is stored in macintosh memory by MacVAX. The processor is put into User Mode. The process remains in a halted state until the user selects "Go" from the "Run" menu. When starting in this mode, only one process is loaded at any one time.
The Code segment is always allocated in multiples of pages (512 Bytes), so there will usually be a small gap between the end of the code and the start of the data. The Assember handles the rellocation of the Data to the first page boundary after the code.
The System base Register (SBR) is set to Physical address 0x00000200 and is mapped to the Virtual Address 0x80000A00. One Real Page (512 Bytes) is allocated for the System Page table with permissions User Readable.
A bitmap of allocated Pysical Pages is created at virtual address 0x80000C00. Each bit in the Page is either Set, if the physical page is being used by the system, or Clear, if the page is available. This page is User mode Readable, Kernel mode Read/Write.
The users processes P0 page table is located at address 0x80001000. It is one page long and is User mode Readable, Kernel mode Read/Write.
The users processes P1 page table is located at address 0x80001A00. It is one page long and is User mode Readable, Kernel mode Read/Write.
Stacks for all modes are created, bounded by inaccessible pages, at addresses; Interrupt Stack 0x80000800, Kernel Stack 0x7FFFFC00, Executive Stack 0x7FFFF000, Supervisor Stack 0x7FFFF000 and User Stack 0x7FFFEA00. Each stack is 2 pages long (1K) and has the permissions User Mode Readable, Stack mode Read/Write (The Interrupt Stack is set to User Mode Readable, Kernel mode Read/Write).
The process Control Block (PCB) is allocated at the Virtual address 0x7FFFFE00 and the Physical address is stored in IPR(PCBB). One page is allocated with the permissions User Mode Readable, Kernel mode Read/Write.
The System Control Block (SCB) is allocated at Physical address 0x00000000 and mapped to vitrual address 0x80000000. It is one page long and set to User Mode Read/Write (The intent is to allow users to write their own interrupt handlers).
The "halt" instruction does not cause a reserved operand fault, but instead stops execution.
The XFC calls "ALLOC_MEM" and "FREE_MEM" can be used to extend or decrease the number of P0 pages available.
The system control block vectors are writable in user mode so that a user process can be written to handle interrupts. If no interrupt vector is specified and an interrupt occurs, a dialog box displaying the cause of the interrupt is displayed and the processor is halted. As interrupt routine run in kernel mode, this will also allow a user processes to gain kernel access and override the default setup.
The SYSTEM XFC's are not available to the user mode process (see XXX).