74 lines
3.2 KiB
Markdown
74 lines
3.2 KiB
Markdown
# Nightloader Driver Structure
|
|
|
|
This documentation file explains the format of a native driver slot
|
|
for the Nightloader on the i386 architecture.
|
|
|
|
| Offset | Length | Name of Field |
|
|
| ------ | --------- | --------------------------------- |
|
|
| 0 | 8 | Driver Identifier |
|
|
| 8 | 2 | Format Version |
|
|
| 10 | 2 | Driver Version |
|
|
| 12 | 2 | Number of Functionalities |
|
|
| 16 | 4 | Functionality Table Offset |
|
|
|
|
1. Driver Identifier
|
|
The driver identifier is used to uniquely identify a driver. It can
|
|
be chosen by a driver's developer, but should suggest what kind of
|
|
driver is contained in that slot, for the sake of clarity.
|
|
|
|
2. Format Version
|
|
The version of the driver slot's standardized structures such as
|
|
the rest of the header, the functionality table and others that
|
|
the future might bring.
|
|
The first byte of this structure tells the major version, the
|
|
second one tells the minor version. No version patches are needed.
|
|
|
|
3. Driver Version
|
|
Version of the driver, as seen by the driver's developer.
|
|
The first byte of this structure should be the major version, the
|
|
second one the minor version. No version patches are needed.
|
|
|
|
4. Number of Functionalities
|
|
How many entries the functionality table contains. The table of
|
|
functionalities contains functions with standardized arguments,
|
|
actions and return types for interfacing with the driver.
|
|
|
|
5. Functionality Table Offset
|
|
Offset *from the start of the driver slot* to the functionality
|
|
table. It may be wise to keep this a bit further away from the
|
|
header to prevent the need for more changes if the header structure
|
|
changes in a future version.
|
|
|
|
## Functionality Structure
|
|
|
|
Functionalities in the functionality table have a structure defined in
|
|
the following table:
|
|
|
|
| Offset | Length | Name of Field |
|
|
| ------ | --------- | --------------------------------- |
|
|
| 0 | 2 | Function Category |
|
|
| 2 | 2 | Exact Function |
|
|
| 4 | 4 | Function Pointer |
|
|
|
|
> The functionality table as it is found in any correct driver is a
|
|
> tightly packed array of those structures with as many elements as
|
|
> were promised in the corresponding header field.
|
|
|
|
## Driver Functionality Categories
|
|
|
|
The table below contains links to the driver functionality categories:
|
|
|
|
| Id | Category |
|
|
| ------ | --------------------------------------------- |
|
|
| 0x1 | [Basic Text](./textwriter-functions.md) |
|
|
| 0x2 | [Text Window](./window-functions.md) |
|
|
| 0x3 | [Logger](./logger-functions.md) |
|
|
| 0x4 | [Pixel Graphics](./graphic-functions.md) |
|
|
| 0x5 | [Pixel Fonts](./pixel-font-functions.md) |
|
|
| 0x10 | [PCI](./pci-functions.md) |
|
|
| 0x11 | [PCIe](./pcie-functions.md) |
|
|
| 0x12 | [NVMe](./pcie-functions.md) |
|
|
| 0x20 | [USB](.usb/-functions.md) |
|
|
| 0x30 | [Storage](./storage-functions.md) |
|
|
| 0x40 | [Filesystem](./filesystem-functions.md) |
|