X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp-cpm3.git/blobdiff_plain/d628fed86c7f55f9d15e1bc24af4d2bdb42f96d6..7c72cfe363cdc89093e62ddcd47fc2e1df98e5cf:/cbios/bioskrnl.180 diff --git a/cbios/bioskrnl.180 b/cbios/bioskrnl.180 index dc04ed1..834a2fa 100644 --- a/cbios/bioskrnl.180 +++ b/cbios/bioskrnl.180 @@ -44,6 +44,7 @@ ccp equ 0100h ; Console Command Processor gets loaded extrn ?ci,?co,?cist,?cost ; each take device in extrn ?cinit ; (re)initialize device in + extrn ioctl extrn @ctbl ; physical character device table ; disk communication data items @@ -51,7 +52,7 @@ ccp equ 0100h ; Console Command Processor gets loaded extrn @dtbl ; table of pointers to XDPHs public @adrv,@rdrv,@trk,@sect ; parameters for disk I/O public @dma,@dbnk,@cnt ; '' '' '' '' - public @xdph + public @xdph,@op ; memory control @@ -63,7 +64,10 @@ ccp equ 0100h ; Console Command Processor gets loaded extrn ?time ; signal time operation - include modebaud.inc ; define mode bits + extrn stampf + extrn ijphl ; vectored call + + maclib modebaud.inc ; define mode bits ; External names for BIOS entry points @@ -119,9 +123,11 @@ 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 stampf ; stamp system specific functions + ; reserved for system implementor jp 0 ; reserved for future expansion jp 0 ; reserved for future expansion - jp 0 ; reserved for future expansion +?ioctl jp ioctl ; ; BOOT @@ -167,7 +173,7 @@ d$init$loop: ld (@ADRV),bc ; save absolute and relative drive code ld l,(ix-4) ld h,(ix-3) ; get init pointer - call ipchl ; call init routine + call ijphl ; call init routine pop hl ; recover @drv pointer d$init$next: pop bc ; recover counter and drive # @@ -381,12 +387,31 @@ auxin: conin: ld hl,(@civec) + ;check if only one device assigned + + push hl ; save bit vector + ld b,0 +insc_0: + or a ; clear carry + adc hl,hl ; shift out next bit + jr nc,insc_1 ; + jr z,ci$rdy ; single device + jr ci$check ; + +insc_1: + inc b ; else, next device + ld a,h + or l ; see if any more devices + jr nz,insc_0 ; no, + pop hl + in$scan: push hl ; save bit vector ld b,0 ci$next: xor a ; assume next device not ready add hl,hl ; shift out next bit +ci$check: call c,cist1 ; see if the device has a character jr nz,ci$rdy ; this device has a character inc b ; else, next device @@ -404,12 +429,6 @@ ci$rdy: ;------------------------------------------------------------------------------- ; Utility Subroutines - -ipchl: ; vectored CALL point - jp (hl) - - - ; BNKSEL ; Bank Select. Select CPU bank for further execution. @@ -434,6 +453,7 @@ seldsk: ld a,c ; save drive select code ld (@adrv),a xor a + ld (@op),a ld (@cnt),a ld b,a ; create index from drive code ld hl,@dtbl @@ -460,8 +480,7 @@ seldsk: inc hl ld h,(hl) ld l,a - call ipchl ; call LOGIN -notfirst: + call ijphl ; call LOGIN ld hl,(@xdph) ; recover DPH pointer ret @@ -538,6 +557,8 @@ sectrn: ; extended disk parameter header (XDPH). read: + ld a,1 + ld (@op),a ld ix,(@xdph) ; get drive descriptor pointer ld l,(ix-8) ; get read routine entry ld h,(ix-7) @@ -550,6 +571,8 @@ read: ; extended disk parameter header (XDPH). write: + ld a,2 + ld (@op),a ld ix,(@xdph) ; get drive descriptor pointer ld l,(ix-10) ; get write routine entry ld h,(ix- 9) @@ -578,6 +601,7 @@ flush: ; do not change order. sd driver depends on this @xdph: ds 2 ; pointer to currently selected drives dph +@op ds 1 ; current disk operation 0:select, 1:read, 2 write @adrv: ds 1 ; currently selected disk drive @rdrv: ds 1 ; controller relative disk drive @trk: ds 2 ; current track number