Instruction manual

16.6 Console Service Routine Overview
The console supplies console service routines that can be used by system software.
These routines provide an architecturally consistent interface to the underlying
hardware. The console routine block contains the interface to the console service
routines.
The FIXUP routine is called when system software needs to virtually relocate all
the console routines and any data or I/O references used by the console service
routine. The DISPATCH routine is called to dispatch to the appropriate console
function.
16.6.1 The FIXUP Routine
System software can use any console service routine that can be accessed through
the DISPATCH routine after control is passed to it. The console ensures that
all necessary setup and virtual mapping in initial boot address space has been
performed. Once the system software has taken over control of the machine, it
may virtually remap and adjust the console service routines to virtual pages other
than the boot address space only once.
The system software must do the following to remap the console service routines:
1. Remap the console service routines.
2. Remap the HWRPB and ensure that all PTEs have been updated and all
appropriate translation buffer entries have been invalidated.
3. Call the FIXUP routine.
The FIXUP routine relocates references in the HWRPB and any other data
stuctures, such as the console function blocks. After the routine completes,
references point to the new virtual address space specified by the system
software.
4. If the FIXUP routine completes succesfully, system software must step
through the CRB in the following fashion:
FOR each map entry in the CRB DO
: Invalidate the PTE entry corresponding to the current value of the
Phys/Vir map entry
: Invalidate the TB entry corresponding to the current value of the
map entry
: Write the new starting virtual address of the map entry
: Remap the physical pages to point to this new starting virtual address
: IF we are mapping the console service routines THEN
: : Set the pages for Kernel mode RWE Access
: ELSE
: : Set the pages for Kernel mode RW Access
: ENDIF
: Make sure the Fault On bits are identical to the old PTE
ENDFOR
5. Once these steps are performed, the routines may be used by the system
software.
Console 16–53