Mail Archives: djgpp-workers/2001/01/07/05:38:20
r: is my CDROM/DVD-ROM drive.
If I run "df" with a CDROM in it it works fine. If I run "df" with a
DVD-ROM it skips the r: drive. If I call "statfs("r:/", &buf)" (with a
DVD-ROM) it works. If I run "df r:/" (with a DVD-ROM) it works.
I've traced the problem to this fragment of function cdrom_drive_ready
in src/libc/compat/mntent/mntent.c:
/* Put control block into the transfer buffer. */
_farpokeb(_dos_ds, __tb, 6); /* read device status */
_farpokel(_dos_ds, __tb + 1, 0); /* zero out the result field */
/* Put request header into the transfer buffer and call the driver. */
dosmemput(request_header, sizeof (request_header), __tb + 5);
r.x.ax = 0x1510;
r.x.cx = drive_num - 1;
r.x.es = __tb_segment;
r.x.bx = __tb_offset + 5;
__dpmi_int(0x2f, &r);
status = _farpeekw(_dos_ds, __tb + 5 + 3);
dev_status = _farpeekl(_dos_ds, __tb + 1);
if (status == 0x100 && _farpeekw (_dos_ds, __tb + 5 + 0x12) == 5
&& (dev_status & 0x801) == 0) /* door open and drive empty bits */
return 1;
return 0;
I've inserted print-outs of status and dev_status.
For a CDROM I get status = 256, dev_status = 912. For a DVD-ROM I get
status = 768, dev_status = 1940, unless I previously had a CDROM in
the drive. In that case I get status = 256, dev_status = 1940!
For an audio CD I get status = 768, dev_status = 17296, unless I'm
very quick with df. Then I get 256, dev_status = 912.
The first thing that should be adjusted is "status == 0x100" above to
"( status & 0x100 )".
Any comments?
Right,
MartinS
- Raw text -