include	clib.inc
include	disk.inc
include	string.inc
include	errno.inc

PPROC	_disk_ready, disk:WORD
	push WORD PTR sys_erproc
	mov WORD PTR sys_erproc,0
	mov ax,disk
	add al,'A'
	call @drvexist
	pop dx
	mov WORD PTR sys_erproc,dx
	.if !ax && !(sys_erflag & __ISDEVICE) && errno == 2
	    mov sys_erflag,al
	    mov sys_erdrive,al
	    mov sys_ercode,ax
	.endif
	ret
PEND	_disk_ready

	END
