📄 biosptch.asm
字号:
Title Smartcopy Device Driver - smartcop.sys
dev_init_hdr STRUCT
packet_leng byte ?
dev_unit byte ?
dev_cmd byte ?
dev_status word ?
byte 8 Dup(?)
num_units byte ?
break_adrs word ?
break_seg word ?
BPB_adrs word ?
BPB_seg word ?
frst_aval_drv byte ?
dev_init_hdr ENDS
seg_a SEGMENT para public 'code'
ASSUME cs:seg_a,ds:seg_a
begin dword -1
access_code word 8000h
strategy word offset strat
init_driver word offset initilize
byte 'FLOPATCH'
word 0
in_ros:
cmp dl,7fh ;if bit 7 set then this if for a harddisk so do normal int 13h
ja first_uit
cmp ah,4 ;only used for read, write, and verify
ja first_uit
cmp ah,2
jb first_uit
push ds
push bx
xor bx,bx
mov ds,bx
lds bx,ds:[78h]
mov byte ptr [bx+4],27 ;may need to increase to 42 for a 2.88M drive. This is the last sector
pop bx
pushf
call dword ptr cs:[back_call] ;do normal int 13h
jc sec_uit ;if error try again
pop ds ;in the diskette parameters from int 1eh
retf 2
nop
nop
back_call dword 0
for_uit:
xor byte ptr [bx+90h],20h ;switch media known bit in 0040:0090 0040:0091 for the drive
pop bx
pop ds
jmp dword ptr cs:[back_call] ;try again
sec_uit:
push bx
mov bx,40h
mov ds,bx
mov bl,dl
cmp ch,44 ;this may also have to be changed for 2.88M drives
jb for_uit
and byte ptr [bx+90h],0dfh ;if track number is more than 43 set media unknown
pop bx
pop ds
first_uit:
jmp dword ptr cs:[back_call] ;try again
strat:
mov word ptr cs:[stat_dw],bx
mov word ptr cs:[stat_dw+2],es
retf
stat_dw dword 0
initilize:
push ax
push ds
push es
push bx
push dx
pushf
les bx,cs:[stat_dw]
xor ax,ax
cmp al,es:dev_init_hdr.dev_cmd[bx]
jnz sl_l ;not initilize command so post error
mov ds,ax
mov ax,offset in_ros - offset begin ;point int 13h to the code patch
xchg ax,ds:[4ch]
mov word ptr cs:[back_call],ax ;setup internal call pointer to old int 13h
mov ax,cs
mov es:dev_init_hdr.break_adrs[bx],offset strat - offset begin
mov es:dev_init_hdr.break_seg[bx],ax ;pointer to end of resident code. The code that
xchg ax,ds:[4eh] ;follows this point is reclamed by DOS.
mov word ptr cs:[back_call+2],ax
mov ax,100h ;post initilize complete
jmp short nieuw_it
sl_l:
mov ax,8103h
nieuw_it:
mov es:dev_init_hdr.dev_status[bx],ax
mov ax,cs
mov ds,ax
mov dx,offset sign_on - offset begin
mov ah,9
int 21h
popf
pop dx
pop bx
pop es
pop ds
pop ax
retf
sign_on byte 'SMARTCOP.SYS Floppy drive track/sector extender',10,13,'$'
start:
seg_a ENDS
END start
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -