📄 rxdosbio.asm
字号:
add dx, ax
mov es, dx ; seg address to load next module.
mov word ptr [ RxDOSBIOS_INITBLOCK. initLowMemSegment ], es
mov word ptr [ RxDOS_LoadSegment. _segment ], es
xor di, di
mov dx, word ptr [ RXDOS_ClusterAddr ]
call _LoadProgram ; Load RxDOS
ifc RxDOSBIOS_Error
add cx, (PARAGRAPH-1) ; (rounded up)
shr cx, 1
shr cx, 1
shr cx, 1
shr cx, 1 ; paragraphs read
add word ptr [ RxDOSBIOS_INITBLOCK. initLowMemSegment ], cx
push cs
pop es
mov dl, byte ptr BootDrive ; physical drive
mov di, offset RxDOSBIOS_INITBLOCK
JMP dword ptr cs:[ RxDOS_LoadSegment ]
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Strategy Argument ;
;...............................................................;
Strategy dd 0
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Con Definition ;
;...............................................................;
con dd clock
dw ( DEV_CHAR + DEV_STDINPUT + DEV_STDOUTPUT + DEV_FASTCHARIO )
dw _DevStrategy
dw con_interrupt
db 'CON '
dw con_servicetable, 0
con_servicetable db (maxcon - con_servicetable - 1) / 2
dw _NoAction ; = 0, Init
dw _NoAction ; = 1, Media Check
dw _NoAction ; = 2, Build BPB
dw _NoAction ; = 3, IOCTL Read
dw ConRead ; = 4, Read
dw ConNonDestrRead ; = 5, Nondestructive Read
dw ConStatus ; = 6, Input Status
dw ConInputFlush ; = 7, Input Flush
dw ConWrite ; = 8, Write
dw ConWrite ; = 9, Write With Verify
dw _NoAction ; =10, Output Status
maxcon = $
Con_LookAhead dw 0
Con_ScanCode db 0
Con_TabPosition dw 0
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Clock Device Definitions ;
;...............................................................;
clock dd prn
dw ( DEV_CHAR + DEV_CLOCK )
dw _DevStrategy
dw clock_interrupt
db 'CLOCK$ '
dw clock_servicetable, 0
clock_servicetable db (maxclock - clock_servicetable - 1) / 2
dw _NoAction ; = 0, Init
dw _NoAction ; = 1, Media Check
dw _NoAction ; = 2, Build BPB
dw _IllegalFunction ; = 3, IOCTL Read
dw ClockRead ; = 4, Read
dw ClockRead ; = 5, Nondestructive Read
dw _NoAction ; = 6, Input Status
dw _NoAction ; = 7, Input Flush
dw ClockWrite ; = 8, Write
dw ClockWrite ; = 9, Write With Verify
dw _NoAction ; =10, Output Status
maxclock = $
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Print, Lpt1, ... Definitions ;
;...............................................................;
prn dd lpt1
dw ( DEV_CHAR + DEV_OUTPUTTILLBUSY )
dw _DevStrategy
dw prn_interrupt
db 'PRN '
dw prn_servicetable, 0
lpt1 dd lpt2
dw ( DEV_CHAR + DEV_OUTPUTTILLBUSY )
dw _DevStrategy
dw lpt1_interrupt
db 'LPT1 '
dw prn_servicetable, 0
lpt2 dd lpt3
dw ( DEV_CHAR + DEV_OUTPUTTILLBUSY )
dw _DevStrategy
dw lpt2_interrupt
db 'LPT2 '
dw prn_servicetable, 2
lpt3 dd aux
dw ( DEV_CHAR + DEV_OUTPUTTILLBUSY )
dw _DevStrategy
dw lpt3_interrupt
db 'LPT3 '
dw prn_servicetable, 3
prn_servicetable db (maxprn - prn_servicetable - 1) / 2
dw _NoAction ; = 0, Init
dw _NoAction ; = 1, Media Check
dw _NoAction ; = 2, Build BPB
dw _NoAction ; = 3, IOCTL Read
dw _NoAction ; = 4, Read
dw _NoAction ; = 5, Nondestructive Read
dw _NoAction ; = 6, Input Status
dw _NoAction ; = 7, Input Flush
dw PrnWrite ; = 8, Write
dw PrnWrite ; = 9, Write With Verify
dw PrnStatus ; =10, Output Status
dw _NoAction ; =11, Output Flush
dw _NoAction ; =12, IOCTL Write
dw _NoAction ; =13, Open Device
dw _NoAction ; =14, Close Device
dw _NoAction ; =15, Removable Media
dw _NoAction ; =16, Output Until Busy
dw _NoAction ; =17, unused
dw _NoAction ; =18, unused
dw _NoAction ; =19, Generic IOCTL
dw _NoAction ; =20, unused
dw _NoAction ; =21, unused
dw _NoAction ; =22, unused
dw _NoAction ; =23, Get Logical Device
dw _NoAction ; =24, Set Logical Device
dw _NoAction ; =25, IOCTL query
maxprn = $
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Aux, Com1, ... Definitions ;
;...............................................................;
aux dd com1
dw ( DEV_CHAR )
dw _DevStrategy
dw aux_interrupt
db 'AUX '
dw aux_servicetable, 0
com1 dd com2
dw ( DEV_CHAR )
dw _DevStrategy
dw com1_interrupt
db 'COM1 '
dw aux_servicetable, 0
com2 dd block
dw ( DEV_CHAR )
dw _DevStrategy
dw com2_interrupt
db 'COM2 '
dw aux_servicetable, 1
aux_servicetable db (maxaux - aux_servicetable - 1) / 2
dw _NoAction ; = 0, Init
dw _NoAction ; = 1, Media Check
dw _NoAction ; = 2, Build BPB
dw _NoAction ; = 3, IOCTL Read
dw AuxRead ; = 4, Read
dw AuxNonDestrRead ; = 5, Nondestructive Read
dw _NoAction ; = 6, Input Status
dw AuxInputFlush ; = 7, Input Flush
dw AuxWrite ; = 8, Write
dw AuxWrite ; = 9, Write With Verify
dw AuxOutputStatus ; =10, Output Status
maxaux = $
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
; Comm LookAhead Buffer
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Comm_LookAhead db 4 dup(0) ; com1, com2, com3, ...
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Block Device ;
;...............................................................;
block dw -1, 0
dw ( DEV_REMOVABLEMEDIA )
dw _DevStrategy
dw block_interrupt
db 03, 7 dup (0) ; pre-initialized to three devs
dw block_servicetable, 0
block_servicetable db (maxblock - block_servicetable - 1) / 2
dw _hdInit ; = 0, Init
dw _hdMediaCheck ; = 1, Media Check
dw _hdBuildBPB ; = 2, Build BPB
dw _hdIOCTLRead ; = 3, IOCTL Read
dw _hdRead ; = 4, Read
dw _NoAction ; = 5, Nondestructive Read
dw _NoAction ; = 6, Input Status
dw _NoAction ; = 7, Input Flush
dw _hdWrite ; = 8, Write
dw _hdWriteWithVerify ; = 9, Write With Verify
dw _NoAction ; =10, Output Status
dw _NoAction ; =11, Output Flush
dw _hdIOCTLWrite ; =12, IOCTL Write
dw _hdOpenDevice ; =13, Open Device
dw _hdCloseDevice ; =14, Close Device
dw _hdRemovableMedia ; =15, Removable Media
dw _NoAction ; =16, Output Until Busy
dw _NoAction ; =17, unused
dw _NoAction ; =18, unused
dw _hdGenericIOCTL ; =19, Generic IOCTL
dw _NoAction ; =20, unused
dw _NoAction ; =21, unused
dw _NoAction ; =22, unused
dw _hdGetLogicalDevice ; =23, Get Logical Device
dw _hdSetLogicalDevice ; =24, Set Logical Device
dw _hdIOCTLQuery ; =25, IOCTL query
maxblock = $
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Device Strategy ;
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
; ;
; Input: ;
; ES:BX request header ;
;...............................................................;
_DevStrategy proc far
; cli
mov word ptr cs:[ Strategy. _segment ], es
mov word ptr cs:[ Strategy. _pointer ], bx
ret
_DevStrategy endp
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
; Device Interrupt ;
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
; ;
; Input: ;
; ES:BX request header ;
; ;
; on stack pointer to strategy table ;
; on stack logical unit ;
; ;
; This appears to be a function, but is some common code that ;
; *most* but not necessarily all functions jump to. IT MUST ;
; MAKE A FAR RETURN ON EXIT. ;
; ;
;...............................................................;
_DevInterrupt:
Entry
rArg _LogicalUnit, 4
rArg _StrategyTable, 2 ; offset to items in stack
ddef _RequestBlock
def _ServiceAddr
cld
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -