Category : C Source Code
Archive   : C-FDC.ZIP
Filename : DASD.C
Output of file : DASD.C contained in archive : C-FDC.ZIP
* Get/Set DASD functions
*
* getdasd() returns: 00 - drive not present
* 01 - diskette, no change line
* 02 - diskette, change line available
* 03 - fixed disk
*
* setdasd() accepts a drive and type. The type is:
* 00 - not used
* 01 - 320/360 diskette in 320/360 drive
* 02 - 320/360 diskette in 1.2M drive
* 03 - 1.2M diskette in 1.2M drive
*/
#include
#include
#include "fdc.h"
int getdasd(int drive)
{
extern int errno;
struct REGVAL r;
r.ax = READDASD;
r.dx = drive;
if(sysint(DISKINT, &r, &r) & 1) {
errno = (int)(r.ax >> 8);
return(-1);
} else {
return(r.ax & 0xff);
}
}
int setdasd(int drive, int type)
{
extern int errno;
struct REGVAL r;
r.ax = SETDASD | type;
r.dx = drive;
if(sysint(DISKINT, &r, &r) & 1) {
errno = (int)(r.ax >> 8);
return(-1);
} else {
return(0);
}
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/