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
Next revisionBoth sides next revision
x68000:writing_drivers [2014/07/11 00:47] eidisx68000:writing_drivers [2014/07/11 00:56] eidis
Line 13: Line 13:
  
 **Note :** the following contains very hard stuff ! I might be confusing sometimes, sorry in advance. Don't hesitate to ask for help if you do not understand something. Thank you. **Note :** the following contains very hard stuff ! I might be confusing sometimes, sorry in advance. Don't hesitate to ask for help if you do not understand something. Thank you.
- 
  
 **Terminology :** **Terminology :**
Line 21: Line 20:
   * Char : 1 character = 1 byte   * Char : 1 character = 1 byte
   * All data types are CPU specific : M68K family. So, byte ordering is always "Big Endian" and a pointer is 32 bits (long).   * All data types are CPU specific : M68K family. So, byte ordering is always "Big Endian" and a pointer is 32 bits (long).
- 
  
 ====== Compilation flags, libraries and startup code ====== ====== Compilation flags, libraries and startup code ======
Line 49: Line 47:
  
   * __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 59: Line 58:
     * 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 415: Line 417:
  
  
-BIOS Parameter Block (BPB)+====== BIOS Parameter Block (BPB) ====== 
 I will not explain this structure as there is plenty of informations about it on the internet. I will not explain this structure as there is plenty of informations about it on the internet.
 +
 Starting from wikipedia : http://en.wikipedia.org/wiki/BIOS_parameter_block Starting from wikipedia : http://en.wikipedia.org/wiki/BIOS_parameter_block
 +
 Just read everything you can about FAT12 and FAT16. 95% of these also apply to Human68k. Just read everything you can about FAT12 and FAT16. 95% of these also apply to Human68k.
-Most of difference is the byte ordering, which is big endian instead of little endian. The structure is also a bit different. From my ddk.h file : 
-Code: [Select] 
  
 +Most of difference is the byte ordering, which is big endian instead of little endian. The structure is also a bit different.
 +
 +From my ddk.h file :
 +
 +<file>
 struct bpb { struct bpb {
   UWORD bpb_nbyte; /* Bytes per sector */   UWORD bpb_nbyte; /* Bytes per sector */
Line 433: Line 441:
   ULONG bpb_huge; /* Size in sectors if bpb_nsize == 0 (32 bits) */   ULONG bpb_huge; /* Size in sectors if bpb_nsize == 0 (32 bits) */
 }; };
 +</file>
  
 See ? Only the "number of FAT" and "number of reserved sectors" members are swapped. See ? Only the "number of FAT" and "number of reserved sectors" members are swapped.
  
x68000/writing_drivers.txt · Last modified: 2019/08/27 20:45 by 127.0.0.1