System definitions
The sysdefs file contains the characteristics of the specific architecture, such as the definition of the MMU, devices etc.
opt -l
ttl System Type Definitions for the Dragon 128
page
****************************************
ifeq CPUType-DRG128
************************************************************
*
* Dynamic Address Translator Definitions
*
***************
*
* Note that DAT.BlCt is also understood by AllProc and
* Chain (in OS9-P2) to be the number of blocks available
* to each task. If less than 64k is available, these
* routines must be modified to put DAT.Free in the
* blocks that can be allocated, and the required values
* into the other blocks, (eg the I/O block), to complete
* the DAT image.
*
DAT.BlCt equ 16 D.A.T. blocks/address space available
*
***************
DAT.BlUs equ 15 blocks available for RAM in address space
DAT.GBlk equ DAT.BlCt*2 number of graphics blocks
DAT.Blsz equ $1000 D.A.T. block size in bytes
DAT.ImSz equ DAT.BlCt*2 D.A.T. Image size
***************
*
* DAT.Addr calculates a mask for the top bits of the
* logical address that are mapped by the MMU
DAT.Addr equ -(DAT.BlSz/256) D.A.T. MSB Address bits
*
***************
***************
*
* This version is assuming that the MMU access
* and operate keys are the same register
DAT.Task equ $FCC0 Task register address
DAT.TMsk equ $0F bits of register for task number
DAT.Uniq equ 1 bits of DAT Task register are not used for other things
*
***************
DAT.TkCt equ 16 task maps in the MMU
DAT.Regs equ $FE00 DAT RAM base address
***************
*
* One block number must be guaranteed never to
* contain memory, (ROM or RAM). That block number
* is used by OS9 in the block map and DAT images
* to indicate an unallocated logical block
DAT.Free equ $C0
*
***************
DAT.BlMx equ $FF maximum block number
DAT.BMSz equ $100 Block Map size (one byte per block)
DAT.WrPr equ 0 no Block Write Protect bit
DAT.WrEn equ 0 no Block Write Enable bit
***************
*
* A task number of 0 is used to indicate
* 'no DAT task map allocated'. Therefore
* no actual DAT task number can be 0. The easiest
* thing to do is to set a bit in SysTask that
* has no effect on the DAT. If the DAT register
* cares about all 8 bits, then DATInit, SvcRet,
* PassSWI, LDABX, STABX, LDBBX, Mover00, SetDAT00,
* and Switch, (all at the end of OS9-P1), must be
* altered to ensure that the bits are correctly
* set
* For the Dragon 128, the chosen value of SysTask
* includes fixed outputs, LMap and DPIRQ.
SysTask equ $80 System Task number
*
***************
IOBlock equ $FF The block number for the I/O
***************
*
* OS9-P1 ColdStart initially sets up the system map
* with RAM block 0 at $0000, a ROMBlock at $E000,
* and the IOBlock at $F000.
ROMBlock equ $FE ROM block mapped in on ColdStart at $E000
ROMCount equ 1 number of blocks of ROM to so map in
RAMCount equ 1 initial blocks of RAM
*
***************
ROMCheck equ Limited check only top 64k for ROM
RAMCheck equ BlockTyp check only first bytes of RAM blocks
LastRAM equ $BF maximum RAM block number
***************
*
* If the I/O is addressed whenever the top
* address lines of the micro, (ie the logical
* bus), take a certain value, rather than being
* addressed through the DAT, then MappedIO must
* be set false (0)
MappedIO equ 1
*
***************
**********
* Several system modules expect to be
* able to abort the startup procedure
* and retry, by jumping through a ROM
* vector (usually the reset vector).
*
D$REBOOT equ $FFEE use an unused vector
*
**********
ClocType set VSYNC
TickSec set 50 ticks per second (50 for UK, 60 for USA)
Cx2Int set 1 CA2 (CB2) interrupt input
FPort set $FCE0 floppy disk controller
HPort set $FD00 hard disk controller
DrvCnt set 4 four drives
DPort set FPort
A.T1 set $FC40 serial port address
A.T.Init set $15 default ACIA initialisation byte
A.P set $FC20 address of parallel printer port
A.P1 set A.T1 address of serial printer port
A.KBD set A.P+2 keyboard port address
A.KLoad set A.KBD port whose control reg has keyboard LOAD
A.GCon equ DAT.Task+2 graphics control port
A.Cont equ DAT.Task+1 control reg with CONTROL bit
A.Clock set A.GCon clock VSYNC interrupts come in on CB2
A.Crtc equ $FC80 address of 6845 CRTC
A.ColMap equ $FCA0 address of colour map
A.Mouse equ $FC24 mouse and disk select
A.DskSel equ A.Mouse disk select port
A.Beeper equ A.DskSel+2 port with beeper on it
A.ChrSet equ A.Beeper port with 'character set select'
A.Baud equ A.Beeper port with baud rate setting
B.DPHalt equ $80 DMA processor HALT bit in disk Select port
B.DPNMI equ $80 DMA processor interrupt bit in DAT Task reg
B.Bell equ 1 beeper bit
B.Contrl equ $08 CA2 is CONTROL bit
B.ChrSet equ $40 character set select bit
B.MPHalt equ 2 Main Processor HALT bit
B.PDir equ $80 printer port buffer direction bit
endc
opt l