2018-08-07 01:22:33 +00:00
|
|
|
#ifndef DRIVER_H
|
|
|
|
#define DRIVER_H
|
|
|
|
|
|
|
|
#include <types.h>
|
|
|
|
|
2018-08-13 23:36:24 +00:00
|
|
|
#define DEVICE_MFM_DRIVE 0x0017 /* This is the ID used for FDHD SuperDrives */
|
2018-08-07 01:22:33 +00:00
|
|
|
|
|
|
|
#define NDIBS 16
|
|
|
|
|
2018-08-09 01:12:03 +00:00
|
|
|
/* device information block */
|
2018-08-07 01:22:33 +00:00
|
|
|
struct DIB {
|
|
|
|
void *linkPtr;
|
|
|
|
void *entryPtr;
|
|
|
|
Word characteristics;
|
|
|
|
LongWord blockCount;
|
|
|
|
char devName[32];
|
|
|
|
Word slotNum;
|
|
|
|
Word unitNum;
|
|
|
|
Word version;
|
|
|
|
Word deviceID;
|
|
|
|
Word headlink;
|
|
|
|
Word forwardLink;
|
|
|
|
void *extendedDIBPtr;
|
|
|
|
Word DIBDevNum;
|
|
|
|
};
|
|
|
|
|
2018-08-09 01:12:03 +00:00
|
|
|
/* list of DIBs (argument to INSTALL_DRIVER) */
|
2018-08-07 01:22:33 +00:00
|
|
|
struct DIBList {
|
|
|
|
LongWord count;
|
|
|
|
struct DIB *dibPointers[NDIBS];
|
|
|
|
};
|
|
|
|
|
2018-08-09 01:12:03 +00:00
|
|
|
/* GS/OS direct page structure */
|
|
|
|
struct GSOSDP {
|
|
|
|
Word deviceNum;
|
|
|
|
Word callNum;
|
2018-10-07 22:41:19 +00:00
|
|
|
Byte *bufferPtr;
|
2018-08-09 01:12:03 +00:00
|
|
|
LongWord requestCount;
|
|
|
|
LongWord transferCount;
|
|
|
|
LongWord blockNum;
|
|
|
|
Word blockSize;
|
|
|
|
Word fstNum;
|
|
|
|
Word volumeID;
|
|
|
|
Word cachePriority;
|
|
|
|
void *cachePointer;
|
|
|
|
struct DIB *dibPointer;
|
|
|
|
};
|
|
|
|
#define statusListPtr bufferPtr
|
|
|
|
#define statusCode fstNum
|
|
|
|
#define controlListPtr bufferPtr
|
|
|
|
#define controlCode fstNum
|
|
|
|
|
|
|
|
/* GS/OS driver call numbers */
|
|
|
|
#define Driver_Startup 0x0000
|
|
|
|
#define Driver_Open 0x0001
|
|
|
|
#define Driver_Read 0x0002
|
|
|
|
#define Driver_Write 0x0003
|
|
|
|
#define Driver_Close 0x0004
|
|
|
|
#define Driver_Status 0x0005
|
|
|
|
#define Driver_Control 0x0006
|
|
|
|
#define Driver_Flush 0x0007
|
|
|
|
#define Driver_Shutdown 0x0008
|
|
|
|
|
|
|
|
/* Driver_Status subcalls */
|
|
|
|
#define Get_Device_Status 0x0000
|
|
|
|
#define Get_Config_Parameters 0x0001
|
|
|
|
#define Get_Wait_Status 0x0002
|
|
|
|
#define Get_Format_Options 0x0003
|
|
|
|
#define Get_Partition_Map 0x0004
|
|
|
|
|
2018-10-08 04:59:00 +00:00
|
|
|
/* Custom Driver_Control subcalls */
|
2018-08-10 22:53:09 +00:00
|
|
|
#define Mount_URL 0x8080
|
2018-10-08 04:59:00 +00:00
|
|
|
#define Switch_To_DOS_Order 0x8081
|
|
|
|
|
2018-08-10 22:53:09 +00:00
|
|
|
|
2018-08-09 01:12:03 +00:00
|
|
|
/* Status list record for Get_DeviceStatus */
|
|
|
|
typedef struct DeviceStatusRec {
|
|
|
|
Word statusWord;
|
|
|
|
LongWord numBlocks;
|
|
|
|
} DeviceStatusRec;
|
|
|
|
|
2018-08-07 01:22:33 +00:00
|
|
|
extern struct DIB dibs[NDIBS];
|
|
|
|
extern struct DIBList dibList;
|
|
|
|
|
|
|
|
extern void *gsosDP;
|
|
|
|
|
|
|
|
void InitDIBs(void);
|
2018-08-09 01:12:03 +00:00
|
|
|
Word DriverDispatch(Word callNum, struct GSOSDP *dp);
|
2018-08-07 01:22:33 +00:00
|
|
|
|
|
|
|
#endif
|