x68000:writing_drivers
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
x68000:writing_drivers [2014/07/11 00:47] – eidis | x68000: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" | * All data types are CPU specific : M68K family. So, byte ordering is always "Big Endian" | ||
- | |||
====== 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' | * 0x8000 : Character device driver (any driver that' | ||
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) | + | ====== |
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:// | Starting from wikipedia : http:// | ||
+ | |||
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 : | ||
+ | |||
+ | < | ||
struct bpb { | struct bpb { | ||
UWORD bpb_nbyte; | UWORD bpb_nbyte; | ||
Line 433: | Line 441: | ||
ULONG bpb_huge; | ULONG bpb_huge; | ||
}; | }; | ||
+ | </ | ||
See ? Only the " | See ? Only the " | ||
x68000/writing_drivers.txt · Last modified: 2019/08/27 20:45 by 127.0.0.1