; Configuration and common defs for avrcpm BIOS and IPL ; Copyright (C) 2010 Leo C. ; ; This program is free software: you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation, either version 3 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program. If not, see . ; ; $Id:$ ; msize equ 62 ;size of available RAM in k bias equ (msize-20) * 1024 ccp equ 3400h+bias ;base of cpm ccp bdos equ ccp+806h ;base of bdos bios equ ccp+1600h ;base of bios cdisk equ 0004h ;current disk number (0 ... 15) iobyte equ 0003h ;intel iobyte buff equ 0080h ;default buffer address retry equ 3 ;max retries on disk i/o before error ;copy from avr/virt_ports.asm: ; Port Direction Function ;hex dez ;------------------------------------------------------------------------- ;00 0 in - Con status. ; Returns 0xFF if the UART has a byte, 0 otherwise. ;01 1 in/out - Console input, aka UDR. / Console Output ;02 2 out - Console Output (deprecated) ;03 3 in - "UART" status: bit 0 = rx, bit 1 = tx ;04 4 in - "UART" data register, no wait ; ;------------------------ Virtual I2C interface -------------------------- ;05 5 out - Control Port: 1 = Start read operation ; 2 = Start write operation ;05 5 in - Status of last Transfer: 0 = ok, else fail ;06 6 in/out - Number of bytes to transfer, including Slave address ;07,08 7,8 in/out - Read/Write address low/high ; ;------------------------ Disk I/O --------------------------------------- ;0D,0E 13,14 in/out - Set address of Bios Controll Block ;0F 15 in/out - Disk select ;10,11 16,17 in/out - Track select ;12,13 18,19 in/out - Sector select ;14,15 20,21 in/out - Write addr ; ;16 22 out - Trigger disk i/o operations ; Bit 7 = 1: Read sector ; Bit 6 = 1: Write sector ; Bit 5 = 1: BIOS WBOOT ; Bit 4 = 1: BIOS Home ; Only one of bits 4..7 may be set. ; If Write function (bit 6=1): ; Bits 0..2: 0 - write to allocated ; 1 - write to directory ; 2 - write unallocated ; 3 - write to directory ; ;16 22 in - Result of last read/write operation. ; 0x00 = ok, 0xff = error (--> Bad Sector) ; ; ; ;------------------------ Wall Clock and Timers -------------------------- ;40 64-71 in/out - Timer/Clock control. ;41-46 ; ;47-4D clock - BCD format: ss, mm, hh, DD, MM, YYl, YYh ; ;------------------------ Ports ------------------------------------------ ;80-87 in/out - Port-Expander PCF8574 (max. 8 Chips) ;88-8F in/out - Port-Expander PCF8574A (not implemented yet!) READ_FUNC equ 7 WRITE_FUNC equ 6 BOOT_FUNC equ 5 HOME_FUNC equ 4 TIMERCTL equ 040h TIMER_MSECS equ TIMERCTL+1 TIMER_SECS equ TIMER_MSECS+2 starttimercmd equ 1 quitTimerCmd equ 2 printTimerCmd equ 15 uptimeCmd equ 16 CLOCKPORT equ TIMERCTL+7 DEBUGPORT equ 04FH StartTraceCmd equ 1 StopTraceCmd equ 0