Difference between revisions of "84PCE:Ports:001D"

From WikiTI
Jump to: navigation, search
Line 5: Line 5:
 
'''Function:''' Stores the highest address of privileged executable code
 
'''Function:''' Stores the highest address of privileged executable code
  
These ports control which region of memory is allowed to execute port commands. It is set to the end of the OS during the boot sequence, and is unmapped for what appear to be security reasons.
+
These ports contain the address of the first byte of unprivileged code (LSB in 1D, MSB in 1F).
 +
All code before this address is treated as privileged, and all code at and after this address is treated as unprivileged.
 +
The boot code sets this to the end of the boot code (020000), after which the OS sets it to the end of the OS (0AXXXX, varies by OS version).
 +
Privileged code is allowed to execute port commands (in and out) and read/write to the [[84PCE:Ports:0020|protected memory region]].
 +
Unprivileged code always input/read a 0 and get an nmi on output/write.
 +
 
 +
'''Note:''' when determining whether or not an instruction is privileged, the address ''after'' the instruction is used.

Revision as of 21:50, 26 August 2016

Synopsis

Port Number: 001D-001F

Function: Stores the highest address of privileged executable code

These ports contain the address of the first byte of unprivileged code (LSB in 1D, MSB in 1F). All code before this address is treated as privileged, and all code at and after this address is treated as unprivileged. The boot code sets this to the end of the boot code (020000), after which the OS sets it to the end of the OS (0AXXXX, varies by OS version). Privileged code is allowed to execute port commands (in and out) and read/write to the protected memory region. Unprivileged code always input/read a 0 and get an nmi on output/write.

Note: when determining whether or not an instruction is privileged, the address after the instruction is used.