mirror of
https://github.com/FDOS/kernel.git
synced 2025-07-23 05:44:41 +02:00
Implement floppy change notification via int2f/ax=4a00 (originally by
Tom Ehlert). Add forgotten bit of NLS int2f.asm change. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1314 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
f2823f9f27
commit
2618be338f
23
kernel/dsk.c
23
kernel/dsk.c
@ -54,12 +54,14 @@ VOID ASMPASCAL fl_readkey(VOID);
|
||||
extern COUNT ASMPASCAL fl_lba_ReadWrite(BYTE drive, WORD mode,
|
||||
struct _bios_LBA_address_packet FAR
|
||||
* dap_p);
|
||||
UWORD ASMPASCAL floppy_change(UWORD);
|
||||
#ifdef __WATCOMC__
|
||||
#pragma aux (pascal) fl_reset modify exact [ax dx]
|
||||
#pragma aux (pascal) fl_diskchanged modify exact [ax dx]
|
||||
#pragma aux (pascal) fl_setdisktype modify exact [ax bx dx]
|
||||
#pragma aux (pascal) fl_readkey modify exact [ax]
|
||||
#pragma aux (pascal) fl_lba_ReadWrite modify exact [ax dx]
|
||||
#pragma aux (pascal) floppy_change modify exact [ax cx dx]
|
||||
#endif
|
||||
|
||||
STATIC int LBA_Transfer(ddt * pddt, UWORD mode, VOID FAR * buffer,
|
||||
@ -203,13 +205,20 @@ STATIC WORD play_dj(ddt * pddt)
|
||||
}
|
||||
else
|
||||
{
|
||||
template_string[DRIVE_POS] = 'A' + pddt2->ddt_logdriveno;
|
||||
put_string(template_string);
|
||||
put_string("Insert");
|
||||
template_string[DRIVE_POS] = 'A' + pddt->ddt_logdriveno;
|
||||
put_string(template_string + 6);
|
||||
put_string("Press the any key to continue ... \n");
|
||||
fl_readkey();
|
||||
xreg dx;
|
||||
dx.b.l = pddt->ddt_logdriveno;
|
||||
dx.b.h = pddt2->ddt_logdriveno;
|
||||
/* call int2f/ax=4a00 */
|
||||
if (floppy_change(dx.x) != 0xffff) {
|
||||
/* if someone else does not make a nice dialog... */
|
||||
template_string[DRIVE_POS] = 'A' + pddt2->ddt_logdriveno;
|
||||
put_string(template_string);
|
||||
put_string("Insert");
|
||||
template_string[DRIVE_POS] = 'A' + pddt->ddt_logdriveno;
|
||||
put_string(template_string + 6);
|
||||
put_string("Press the any key to continue ... \n");
|
||||
fl_readkey();
|
||||
}
|
||||
pddt2->ddt_descflags &= ~DF_CURLOG;
|
||||
pddt->ddt_descflags |= DF_CURLOG;
|
||||
pokeb(0, 0x504, pddt->ddt_logdriveno);
|
||||
|
@ -107,9 +107,9 @@ DriverSysCal:
|
||||
jmp short Int2f?iret
|
||||
|
||||
|
||||
;***********************************************************
|
||||
; internal doscalls INT2F/11xx - handled through C
|
||||
;***********************************************************
|
||||
;**********************************************************************
|
||||
; internal dos calls INT2F/12xx and INT2F/4A01,4A02 - handled through C
|
||||
;**********************************************************************
|
||||
IntDosCal:
|
||||
; set up register frame
|
||||
;struct int2f12regs
|
||||
@ -404,34 +404,44 @@ int2f_restore_ds:
|
||||
pop ds
|
||||
jmp short ret_set_ax_to_carry
|
||||
|
||||
; extern UWORD ASMCFUNC call_nls(UWORD subfct, struct nlsInfoBlock *nlsinfo,
|
||||
; UWORD bp, UWORD cp, UWORD cntry, UWORD bufsize, UWORD FAR *buf, UWORD *id);
|
||||
; extern UWORD ASMPASCAL call_nls(UWORD bp, UWORD FAR *buf,
|
||||
; UWORD subfct, UWORD cp, UWORD cntry, UWORD bufsize);
|
||||
|
||||
global _call_nls
|
||||
_call_nls:
|
||||
extern _nlsInfo:wrt DGROUP
|
||||
global CALL_NLS
|
||||
CALL_NLS:
|
||||
pop es ; ret addr
|
||||
pop cx ; bufsize
|
||||
pop dx ; cntry
|
||||
pop bx ; cp
|
||||
pop ax ; sub fct
|
||||
mov ah, 0x14
|
||||
push es ; ret addr
|
||||
push bp
|
||||
mov bp, sp
|
||||
push si
|
||||
push di
|
||||
mov al, [bp + 4] ; subfct
|
||||
mov ah, 0x14
|
||||
mov si, [bp + 6] ; nlsinfo
|
||||
mov bx, [bp + 10] ; cp
|
||||
mov dx, [bp + 12] ; cntry
|
||||
mov cx, [bp + 14] ; bufsize
|
||||
les di, [bp + 16] ; buf
|
||||
push bp
|
||||
mov si, _nlsInfo ; nlsinfo
|
||||
les di, [bp + 4] ; buf
|
||||
mov bp, [bp + 8] ; bp
|
||||
int 0x2f
|
||||
pop bp
|
||||
mov bp, [bp + 20] ; store id (in SS:) unless it's NULL
|
||||
or bp, bp
|
||||
jz nostore
|
||||
mov [bp], bx
|
||||
nostore:
|
||||
mov dx, bx ; return id in high word
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret 6
|
||||
|
||||
; extern UWORD ASMPASCAL floppy_change(UWORD drives)
|
||||
|
||||
global FLOPPY_CHANGE
|
||||
FLOPPY_CHANGE:
|
||||
pop cx ; ret addr
|
||||
pop dx ; drives
|
||||
push cx ; ret addr
|
||||
mov ax, 0x4a00
|
||||
xor cx, cx
|
||||
int 0x2f
|
||||
mov ax, cx ; return
|
||||
ret
|
||||
|
||||
;
|
||||
|
Loading…
x
Reference in New Issue
Block a user