Problem with bootable floppy emulator
From: Ivar (ivar_at_tigma.ee)
Date: 01/21/04
- Next message: John Collyer: "Can I legally do this syntax?"
- Previous message: Bob Masta: "Re: Assembler to 80C188"
- Next in thread: Tim Roberts: "Re: Problem with bootable floppy emulator"
- Reply: Tim Roberts: "Re: Problem with bootable floppy emulator"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 21 Jan 2004 19:02:43 +0000 (UTC)
Hi, my bootable floppy emulation works, but not with some special programs,
like
ghost2003, IMB DriveFitnessTest, OntrackDataAdvisor and also with
Smartdrv.exe
Where is problem, I just can't understand. I load my code into vectortable
0:1E0h where
is free space (without allocated interrupts), because programs don't look
into biosdata 40:13 and also not into CMOS. Maybe problem is still in
vectortable (still in use) or
my emulation don't emulate all features. Ok, "get drive parameters" don't
important
because I can put into A also real floppy and it's the same geometry and
int13h extension don't in use with floppy drives in my opinion.
My code is here:
.386P
EMU equ 1Eh
HEA equ 2
SEC equ 18
MAXFLOPABSSEC equ 0B3Fh
_EMU segment use16 'FAR_DATA'
assume cs:_EMU,ds:_EMU
_emustart:
mov cs:_ax_,ax
mov cs:_ds_,ds
mov ax,EMU
mov ds,ax
mov _es_,es
mov _bx_,bx
mov _cx_,cx
mov _dx_,dx
mov _di_,di
mov _bp_,bp
cmp byte ptr _dx_,0 ; A-draiv
jne no_A
cmp byte ptr cs:_ax_+1,0 ;reset (AH)
je short _00h
cmp byte ptr cs:_ax_+1,10h ;ready (AH)
je short _10h
cmp byte ptr cs:_ax_+1,16h ;disk change ststus (AH)
jne short no_16h
_00h:
_10h:
mov al,_drive
mov byte ptr _dx_,al
jmp short change_transfer
no_16h:
cmp byte ptr cs:_ax_+1,02h ;read (AH)
je short _02h
cmp byte ptr cs:_ax_+1,03h ;write (AH)
je short _03h
cmp byte ptr cs:_ax_+1,04h ;verify (AH)
jne short no_04h
_02h:
_03h:
mov dx,_cx_
mov bl,dl
and bl,111111b ;sector
shr dl,6
xchg dh,dl ;cyl
mov bh,byte ptr _dx_+1 ;head
mov al,SEC
mul bh
mov cx,ax
mov ax,HEA*SEC
mul dx
add ax,cx
xor bh,bh
add ax,bx
dec ax
cmp ax,MAXFLOPABSSEC
ja short err_over
movzx ecx,ax
add ecx,_flopimg_startabssec
mov al,_sec
mov dl,_hea
mul dl
xchg ax,cx
shld edx,ecx,16
div cx
shl ah,6
xchg ah,al
mov _cx_,ax ;cylinder
mov ax,dx
mov dl,_sec
div dl
mov byte ptr _dx_+1,al
inc ah
or byte ptr _cx_,ah
mov al,_drive
mov byte ptr _dx_,al
no_04h:
no_A:
change_transfer:
call restore
jmp cs:_orig_vect
err_over:
mov cs:_ax_,0D00h
mov bp,sp
or word ptr [bp+4],1 ;set CF
call restore
iret
restore proc C
mov bx,_bx_
mov cx,_cx_
mov dx,_dx_
mov bp,_bp_
mov ax,cs:_ax_
mov di,_di_
mov es,_es_
mov ds,cs:_ds_
ret
restore endp
_ds_ dw ?
_ax_ dw ?
_orig_vect dd ?
_es_ dw ?
_bx_ dw ?
_cx_ dw ?
_dx_ dw ?
_di_ dw ?
_bp_ dw ?
_drive db ?
_flopimg_startabssec dd ? ; enne initsialiseerimist peab kontrollima et
; absoluutaadress+flopyimage CHS-adresseering
; ei uletaks cyl*hea*sec
_hea db ?
_sec db ?
_emuend:
_EMU ends
- Next message: John Collyer: "Can I legally do this syntax?"
- Previous message: Bob Masta: "Re: Assembler to 80C188"
- Next in thread: Tim Roberts: "Re: Problem with bootable floppy emulator"
- Reply: Tim Roberts: "Re: Problem with bootable floppy emulator"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|