User Tools

Site Tools


x68000:writing_drivers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
x68000:writing_drivers [2014/07/11 00:56] eidisx68000:writing_drivers [2019/08/27 20:45] (current) – external edit 127.0.0.1
Line 2: Line 2:
  
 The following information was kindly contributed by our forum member **Lydux**. The following information was kindly contributed by our forum member **Lydux**.
 +
 +Original thread can be found here:
 +http://nfggames.com/forum2/index.php?topic=5417.0
  
 So I've decided to share with you some of my study and work. So I've decided to share with you some of my study and work.
Line 47: Line 50:
  
   * __next header__ (long) : A single .SYS or .X file may contains more than one drivers, so this a pointer to the next driver header within this file. Set this member to -1 (0xFFFFFFFF) if this driver entry is the last one in the chain.   * __next header__ (long) : A single .SYS or .X file may contains more than one drivers, so this a pointer to the next driver header within this file. Set this member to -1 (0xFFFFFFFF) if this driver entry is the last one in the chain.
- 
   * __attributes__ (word): This 16 bits (1 word) member are flags that give informations about the driver behavior. Valid flags are :   * __attributes__ (word): This 16 bits (1 word) member are flags that give informations about the driver behavior. Valid flags are :
     * 0x8000 : Character device driver (any driver that'll **NOT** talk to storage device, generally a disk containing a FAT filesystem). Unset this for a block device driver.     * 0x8000 : Character device driver (any driver that'll **NOT** talk to storage device, generally a disk containing a FAT filesystem). Unset this for a block device driver.
Line 58: Line 60:
     * 0x0002 : STDOUT device. The driver will redefine the stdout, for example : screen, serial output, printers,...     * 0x0002 : STDOUT device. The driver will redefine the stdout, for example : screen, serial output, printers,...
     * 0x0001 : STDIN device. The driver will redefine the stdin : keyboard or serial input.     * 0x0001 : STDIN device. The driver will redefine the stdin : keyboard or serial input.
- 
   * __strategy routine (long)__: A pointer to the very first routine the kernel will execute ! This will initiate the driver loading.   * __strategy routine (long)__: A pointer to the very first routine the kernel will execute ! This will initiate the driver loading.
- 
   * __interrupt routine (long)__: A pointer to a routine that will perform the communication between the kernel and the device.   * __interrupt routine (long)__: A pointer to a routine that will perform the communication between the kernel and the device.
- 
   * __driver name (8 chars)__: An unique identifier, also used by userspace application when executing IOCTL commands.   * __driver name (8 chars)__: An unique identifier, also used by userspace application when executing IOCTL commands.
  
Line 91: Line 90:
 **Command execution result flags :** **Command execution result flags :**
  
-This list contains all acceptable values to fill the result status flags in the request packet header. S_**** flags will display (or hide) the "A"bort, "R"etry and "I"gnore line, and E_**** will show an appropriate error message. "Result status" member can be any combination of S_**** flags (ORed together), but only one E_**** can be set.+This list contains all acceptable values to fill the result status flags in the request packet header. S_**** flags will display (or hide) the "A"bort, "R"etry and "I"gnore line, and E_**** will show an appropriate error message. 
 + 
 +"Result status" member can be any combination of S_**** flags (ORed together), but only one E_**** can be set.
  
   * 0x1000 - S_ABORT : "A"bort the whole request.   * 0x1000 - S_ABORT : "A"bort the whole request.
Line 157: Line 158:
  
   
-Output parameters :+**Output parameters :**
  
 ^  Position  ^  Type  ^  Description  ^ ^  Position  ^  Type  ^  Description  ^
Line 222: Line 223:
  
 ^  Position  ^  Type  ^  Description  ^ ^  Position  ^  Type  ^  Description  ^
-|  14  |  Long  |  Pointer to a buffer that'll contain readed data from the unit. The driver is responsible of filling this buffer. +|  14  |  Long  |Pointer to a buffer that'll contain readed data from the unit. The driver is responsible of filling this buffer. 
-|  18  |  Long  |  Buffer size  |+|  18  |  Long  |Buffer size  |
   
 **Output parameters :** none **Output parameters :** none
Line 229: Line 230:
 ===== 0x04 - Input (read) ===== ===== 0x04 - Input (read) =====
  
-Command ID : 0x04 (C_INPUT)+**Command ID :** 0x04 (C_INPUT)
  
 **Availability :** Block/Character **Availability :** Block/Character
Line 240: Line 241:
 |  13  |  Byte  |Block device driver only. Media type.  |     |  13  |  Byte  |Block device driver only. Media type.  |    
 |  14  |  Long  |Pointer to a buffer that'll contain the readed data from the unit.The driver is responsible of filling this buffer.  | |  14  |  Long  |Pointer to a buffer that'll contain the readed data from the unit.The driver is responsible of filling this buffer.  |
-|  18  |  Long  |Block device driver : number of sector to read. A sector length is normally specified by the BPB. +|  18  |  Long  |Block device driver : number of sector to read. A sector length is normally specified by the BPB.  | 
-Character device driver : Buffer size.  | +| | |Character device driver : Buffer size.  |
 |  22  |  Long  |Block device driver only : logical start sector to read from.  | |  22  |  Long  |Block device driver only : logical start sector to read from.  |
  
Line 250: Line 251:
 ===== 0x05 - Read no wait ===== ===== 0x05 - Read no wait =====
  
-Command ID : 0x05 (C_NDREAD)+**Command ID :** 0x05 (C_NDREAD)
  
 **Availability :** Character **Availability :** Character
Line 269: Line 270:
 **Availability :** Block **Availability :** Block
  
-**Description :** To check furthermore. This seems to be really X68000 specific floppy drive command, or some kind of kernel hack by Human68k developpers. It does some kind of IOCTL, but internally to the kernel to dis/allow and control of FDD ejection, LEDs or media write protection control...+**Description :** //To check furthermore.// This seems to be really X68000 specific floppy drive command, or some kind of kernel hack by Human68k developpers. It does some kind of IOCTL, but internally to the kernel to dis/allow and control of FDD ejection, LEDs or media write protection control...
  
 ===== 0x06 - Input status ===== ===== 0x06 - Input status =====
Line 307: Line 308:
 ^  Position  ^  Type  ^  Description  ^ ^  Position  ^  Type  ^  Description  ^
 |  14  |  Long  |Pointer to a buffer that contains data to write to the unit.| |  14  |  Long  |Pointer to a buffer that contains data to write to the unit.|
-|  18  |  Long  |Block device driver : number of sector to write. A sector length is normally specified by the BPB.  |||Character device driver : Buffer size.  | +|  18  |  Long  |Block device driver : number of sector to write. A sector length is normally specified by the BPB.  
 +| | |Character device driver : Buffer size.  |
 |  22  |  Long  |Block device driver only : logical start sector to write to.  |  |  22  |  Long  |Block device driver only : logical start sector to write to.  |
- +
 **Output parameters :** none **Output parameters :** none
  
x68000/writing_drivers.1405004181.txt.gz · Last modified: 2019/08/27 20:44 (external edit)