From 7c72cfe363cdc89093e62ddcd47fc2e1df98e5cf Mon Sep 17 00:00:00 2001 From: Leo C Date: Sat, 23 Apr 2016 17:21:35 +0200 Subject: [PATCH] WIP --- cbios/Makefile | 2 +- cbios/ascii.180 | 1 - cbios/bioskrnl.180 | 4 +- cbios/boot.180 | 9 +-- cbios/stampf.180 | 29 ++++++++++ cbios/tcflags-sorted.txt | 117 +++++++++++++++++++++++++++++++++++++++ cbios/termios.inc | 64 +++++++++++++++++++++ 7 files changed, 219 insertions(+), 7 deletions(-) create mode 100644 cbios/stampf.180 create mode 100644 cbios/tcflags-sorted.txt create mode 100644 cbios/termios.inc diff --git a/cbios/Makefile b/cbios/Makefile index 6d01dec..53fa589 100644 --- a/cbios/Makefile +++ b/cbios/Makefile @@ -1,6 +1,6 @@ -SRC := bioskrnl.180 boot.180 chario.180 drvtbl.180 +SRC := bioskrnl.180 boot.180 stampf.180 chario.180 drvtbl.180 SRC += move.180 time.180 mm.180 misc.180 utils.180 fifo.180 SRC += msgbuf.180 conbuf.180 ascii.180 asci-cmn.180 SRC += sdio.180 cfio.180 diff --git a/cbios/ascii.180 b/cbios/ascii.180 index 2581bf5..0ee942d 100644 --- a/cbios/ascii.180 +++ b/cbios/ascii.180 @@ -1,4 +1,3 @@ - page 200 ; Interrupt drivers for ASCI0 and ASCI1 diff --git a/cbios/bioskrnl.180 b/cbios/bioskrnl.180 index 0bb3ecc..834a2fa 100644 --- a/cbios/bioskrnl.180 +++ b/cbios/bioskrnl.180 @@ -64,6 +64,7 @@ ccp equ 0100h ; Console Command Processor gets loaded extrn ?time ; signal time operation + extrn stampf extrn ijphl ; vectored call maclib modebaud.inc ; define mode bits @@ -122,7 +123,8 @@ ccp equ 0100h ; Console Command Processor gets loaded ?stbnk: jp setbnk ; select different bank for disk I/O DMA operations ?xmov: jp ?xmove ; set source and destination banks for one operation - jp 0 ; reserved for system implementor + jp stampf ; stamp system specific functions + ; reserved for system implementor jp 0 ; reserved for future expansion jp 0 ; reserved for future expansion ?ioctl jp ioctl ; diff --git a/cbios/boot.180 b/cbios/boot.180 index 766277f..8e41728 100644 --- a/cbios/boot.180 +++ b/cbios/boot.180 @@ -3,7 +3,7 @@ public hwinit,?init,?ldccp,?rlccp - + public signon public f_cpu extrn boot,?conin @@ -13,9 +13,9 @@ extrn @civec,@covec,@aivec,@aovec,@lovec extrn @cbnk,?move,?xmove - include version.inc - include config.inc - include z180reg.inc + maclib z180reg.inc + maclib config.inc + maclib version.inc ccpsize equ 0c80h @@ -78,6 +78,7 @@ hwini_skip: ld (@cbnk),a ; right now in bank 0 call pr.inln ; print signon message +signon: db 13,10,13,10,'CP/M Version 3.0, Z180-Stamp BIOS v' defvers db 13,10 diff --git a/cbios/stampf.180 b/cbios/stampf.180 new file mode 100644 index 0000000..25a891a --- /dev/null +++ b/cbios/stampf.180 @@ -0,0 +1,29 @@ + + public stampf + + maclib z180reg.inc + maclib config.inc + + cseg +stampf: + dec c + jr nz,f2 +; c == 1: return bios version + ld hl,0<<8 + 7 ;h = major, l = minor + jr exit +f2: + dec c + jr nz,f3 +; c == 2: return bios id string + ld hl,id + jr exit +f3: + ld hl,0ffffh ; error +exit: + ld a,l + ret + +id: + db "Stamp BIOS",0 + + end diff --git a/cbios/tcflags-sorted.txt b/cbios/tcflags-sorted.txt new file mode 100644 index 0000000..fdc8f61 --- /dev/null +++ b/cbios/tcflags-sorted.txt @@ -0,0 +1,117 @@ + +IGNBRK equ 00000001B ;Ignore BREAK condition on input. +BRKINT equ 00000010B +INPCK equ 00000100B ;Enable input parity checking. +IGNPAR equ 00001000B ;Ignore framing errors and parity errors. +PARMRK equ 00010000B ;Prefix a character with a parity error or framing error with FFH 00H. +ISTRIP equ 00100000B ;Strip off eighth bit. +PARODD equ 01000000B ;If set, then parity for input and output is odd. + +IXON equ 00000001B ;Enable XON/XOFF flow control on output. +IXANY equ 00000010B ;Typing any character will restart stopped output. +IXOFF equ 00000100B ;Enable XON/XOFF flow control on input. +CRTS_IFLOW equ 00001000B ;RTS flow control of input. +CCTS_OFLOW equ 00010000B ;CTS flow control of output. +CLOCAL equ 00100000B ;Ignore modem control lines. +CREAD equ 01000000B ;Enable receiver. + +CBAUD equ 0x1F ;Baud speed mask + B0 equ 0x00 ;hang up + B50 equ 0x11 + B75 equ 0x12 + B110 equ 0x13 + B134 equ 0x14 + B150 equ 0x05 + B300 equ 0x06 + B600 equ 0x07 + B1200 equ 0x08 + B1800 equ 0x09 + B2400 equ 0x0A + B3600 equ 0x0B + B4800 equ 0x0C + B7200 equ 0x0D + B9600 equ 0x0E + B19200 equ 0x0F + B28800 equ 0x01 + B38400 equ 0x02 + B57600 equ 0x03 + B115200 equ 0x04 + B144000 equ 0x14 + B192000 equ 0x16 + B288000 equ 0x17 + +CSIZE equ 0x20 ;Character size mask. + CS7 equ 0x00 ; + CS8 equ 0x20 ; +CSTOPB equ 0x40 ;Set two stop bits, rather than one. +PARENB equ 0x80 ;Enable parity generation on output and parity checking for input. + + + +checked on input isr: +===================== +IGNBRK equ 00000001B ;Ignore BREAK condition on input. +BRKINT equ 00000010B +INPCK equ 00000100B ;Enable input parity checking. +IGNPAR equ 00001000B ;Ignore framing errors and parity errors. +PARMRK equ 00010000B ;Prefix a character with a parity error or framing error with FFH 00H. + +IXON equ 00000001B ;Enable XON/XOFF flow control on output. +IXANY equ 00000010B ;Typing any character will restart stopped output. +IXOFF equ 00000100B ;Enable XON/XOFF flow control on input. +CRTS_IFLOW equ 00001000B ;RTS flow control of input. + + +checked on input: +================= + + + +checked on output isr +===================== + + + +checked on output +================= +ISTRIP equ 00100000B ;Strip off eighth bit. + + + +config (init) +============= + +CBAUD equ 0x1F ;Baud speed mask + B0 equ 0x00 ;hang up + B50 equ 0x11 + B75 equ 0x12 + B110 equ 0x13 + B134 equ 0x14 + B150 equ 0x05 + B300 equ 0x06 + B600 equ 0x07 + B1200 equ 0x08 + B1800 equ 0x09 + B2400 equ 0x0A + B3600 equ 0x0B + B4800 equ 0x0C + B7200 equ 0x0D + B9600 equ 0x0E + B19200 equ 0x0F + B28800 equ 0x01 + B38400 equ 0x02 + B57600 equ 0x03 + B115200 equ 0x04 + B144000 equ 0x14 + B192000 equ 0x16 + B288000 equ 0x17 +CSIZE equ 0x20 ;Character size mask. + CS7 equ 0x00 ; + CS8 equ 0x20 ; +CSTOPB equ 0x40 ;Set two stop bits, rather than one. +PARENB equ 0x80 ;Enable parity generation on output and parity checking for input. +PARODD equ 01000000B ;If set, then parity for input and output is odd. + +CCTS_OFLOW equ 00010000B ;CTS flow control of output. +CLOCAL equ 00100000B ;Ignore modem control lines. +CREAD equ 01000000B ;Enable receiver. diff --git a/cbios/termios.inc b/cbios/termios.inc new file mode 100644 index 0000000..12b1d3a --- /dev/null +++ b/cbios/termios.inc @@ -0,0 +1,64 @@ +; tcflag_t c_iflag; /* input mode flags */ +IGNBRK equ 00000001B ;Ignore BREAK condition on input. +BRKINT equ 00000010B +IGNPAR equ 00000100B ;Ignore framing errors and parity errors. +PARMRK equ 00001000B ;Prefix a character with a parity error or framing error with FFH 00H. +INPCK equ 00010000B ;Enable input parity checking. +ISTRIP equ 00100000B ;Strip off eighth bit. +IXON equ 01000000B ;Enable XON/XOFF flow control on output. +IXANY equ 10000000B ;Typing any character will restart stopped output. +IXOFF equ 00000000B ;Enable XON/XOFF flow control on input. + +; tcflag_t c_cflag; /* control mode flags */ +CBAUD equ 0x1F ;Baud speed mask + B0 equ 0x00 ;hang up + B50 equ 0x11 + B75 equ 0x12 + B110 equ 0x13 + B134 equ 0x14 + B150 equ 0x05 + B300 equ 0x06 + B600 equ 0x07 + B1200 equ 0x08 + B1800 equ 0x09 + B2400 equ 0x0A + B3600 equ 0x0B + B4800 equ 0x0C + B7200 equ 0x0D + B9600 equ 0x0E + B19200 equ 0x0F + B28800 equ 0x01 + B38400 equ 0x02 + B57600 equ 0x03 + B115200 equ 0x04 + B144000 equ 0x14 + B192000 equ 0x16 + B288000 equ 0x17 +CSIZE equ 00000000B ;Character size mask. + CS7 equ 00000000B ; + CS8 equ 00000000B ; +CSTOPB equ 00000000B ;Set two stop bits, rather than one. +CREAD equ 00000000B ;Enable receiver. +PARENB equ 00000000B ;Enable parity generation on output and parity checking for input. +PARODD equ 00000000B ;If set, then parity for input and output is odd. +CLOCAL equ 00000000B ;Ignore modem control lines. +CRTS_IFLOW equ 00000000B ;RTS flow control of input. +CCTS_OFLOW equ 00000000B ;CTS flow control of output. + +; tcflag_t c_lflag; /* local mode flags */ +ECHO equ 00000001B + + +; tcflow() and TCXONC use these */ +TCOOFF equ 0 +TCOON equ 1 +TCIOFF equ 2 +TCION equ 3 +; tcflush() and TCFLSH use these */ +TCIFLUSH equ 0 +TCOFLUSH equ 1 +TCIOFLUSH equ 2 +; tcsetattr uses these */ +TCSANOW equ 0 +TCSADRAIN equ 1 +TCSAFLUSH equ 2 -- 2.39.2