grid disk device info data is sent with dma transfer (except the last byte in transfer, which has EOI set) any write to area of unknown size at e0000 (or dfa00) is transferred thru GPIB bus // this is sent to gpib bus to do some command struct floppy2_desc_t { uint8_t command; // command number (see below) uint16_t connection; // unused in this protocol uint32_t sectorNumber; // sector number! uint16_t blockSize; // data size uint8_t mode; // not used in this case } __attribute__((packed)); command numbers: 1 - get device information // device sends this as response (size is limited to blockSize): ParameterStatus STRUC pageSize DW ? // page == sector logpageSize DW ? numPages DW ? driveReady DB ? bitMap DW ? dirFID DW ? minDirPages DW ? flush DB ? devName DB 32 DUP(?) bytesPerSector DW ? sectorsPerTrack DW ? tracksPerCylinder DW ? interleaveFactor DB ? secondSideCount DB ? numCylinders DW ? ParameterStatus ENDS // sometimes compass asks for two bytes more than size of this struct. // i don't remember what should be done in this case, but afaik it sends some garbage. this raw structure data is from portable floppy (some data in the end is lost, but it doesn't seem to be used): static unsigned char d1[0x34] = {0x00, 0x02, 0xf8, 0x01, 0xD0, 0x02, 0x01, 0x20, 0x01, 0x21, 0x01, 0x01, 0x00, 0x00, 0x34, 0x38, 0x20, 0x54, 0x50, 0x49, 0x20, 0x44, 0x53, 0x20, 0x44, 0x44, 0x20, 0x46, 0x4c, 0x4f, 0x50, 0x50, 0x59, 0x20, 0x20, 0x20, 0x20, 0x33, 0x30, 0x32, 0x33, 0x37, 0x2d, 0x30, 0x30, 0x00, 0x02, 0x09, 0x00}; 2 and 3 - never saw it being used but it seems to work in similar way as 4 and 5 (related to logpageSize from command 1 struct?) FIX: it's ddOpen and ddClose; it's NEVER used with block devices 4 - read sector // device sends sector data as response UPD: device reads data into internal buffer and sends an SRQ; on success, 0x0F is sent as serial poll response on error, something else if everything is okay, device is addressed as a talker and sends sector data as response 5 - write sector // unsure, after it system sends sector data? UPD: system sends sector data; then device sends an SRQ when it's done writing data; serial poll response is same as in read sector command EOI is sent after each transfer. Note that write command and data are separate transfers. Error handling is based on service requests but the mechanism of it is unknown (device asserts SRQ, system does a serial poll and... further process is unknown). NOTE: grid itself has no address on bus, it just uses address 0x1F which is defined to be null address in GPIB spec this is usually not supported by most GPIB board drivers, but some drivers supporting that way of addressing can be found here: https://www.hp9845.net/9845/projects/hpdrive/ (don't attempt to use their HPDrive, its protocol seems to be COMPLETELY different) NOTE: device resets when you send DCL or SDC bus command to it