PC-DOCT device driver
To use the PC-DOCT card while running Windows NT, it has been necessary to develop a new device driver. This drive has been kept as simple as possible, due to the difficulties in debugging a Windows NT device driver.
The PC-DOCT driver is implemented a 64k word file. To access the information simply use the standard file operations CreateFile, ReadFile, and WriteFile. Please remember that access to a file is dine in bytes. When the driver receives a read or write request, the address, and length of the data block is translated to words before communicating with the RAM on the PCDOCT. To do the translation from words to bytes, the position and the length is divided by two.
Blow is a simple example on opening a file handle to the PC-DOCT driver. The driver opens the first instance of the driver, and reads the PC-DOCT BIOS version information.
// Open the PcDoct0 device m_hPcDoct = CreateFile("\\\\.\\PcDoct0", GENERIC_WRITE | GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING, NULL); if( m_hPcDoct == INVALID_HANDLE_VALUE ){ CString message; message.Format("Unable to open \\\\.\\PcDoct0 (error = %u)", GetLastError()); MessageBox(message, "LoadError"); }; ULONG size = 0; OVERLAPPED overlapped; ZeroMemory(&overlapped, sizeof(overlapped) ); // Read the PcDoct card description up from the card overlapped.Offset = 0x8000*2; // Offset in bytes CHAR description[256]; if( !ReadFile(m_hPcDoct, &description, sizeof(CHAR)*255, &size, &overlapped) ){ CString message; message.Format("Unable to read from \\\\.\\PcDoct0 (error = %u)", GetLastError()); MessageBox(message, "ReadError"); };
The addresses to use when accessing the information on the PC-DOCT is listed in the PC-DOCT specifications.
Information on how the PC-DOCT driver is implemented, is documented in the Windows NT Device Driver Cookbook.
References:
Specifications
Last Modified 11 January 2019