The Möbius Operating System: driver_t struct Reference
HOME DOWNLOAD DOCUMENTATION SCREENSHOTS  

driver_t Struct Reference
[Device Driver Interface]

Device driver structure. More...

#include <driver.h>


Data Fields

module_t * mod
driver_tprev
driver_tnext
void(* add_device )(driver_t *driver, const wchar_t *name, dev_config_t *config)
 Called when a device supported by the driver is added.

fsd_t *(* mount_fs )(driver_t *driver, const wchar_t *dest)
 Called when a file system supported by the driver is mounted.


Detailed Description

Device driver structure.

The device manager maintains one of these for every driver. It is created by DevInstallNewDriver and freed by DevRemove.


Field Documentation

void(* driver_t::add_device)(driver_t *driver, const wchar_t *name, dev_config_t *config)
 

Called when a device supported by the driver is added.

This function is provided by the driver; it needs to determine the device type required, allocate a device object and initialize the hardware. The device will deallocate itself in response to a DEV_REMOVE request.

Parameters:
driver Driver object (the same one passed to DrvInit )
name Name of the device (may be NULL )
config Device configuration (may be NULL )
Returns:
A pointer to a device object

struct fsd_t*(* driver_t::mount_fs)(driver_t *driver, const wchar_t *dest)
 

Called when a file system supported by the driver is mounted.

This function fulfils much the same purpose as driver_t::mount_fs, except that it is called when FsMount needs to mount a file system. The file system driver needs to determine the format of the file system, allocate a file system device object and mount the file system. The FSD will deallocate itself in response to a DEV_REMOVE request.

Parameters:
driver Driver object (the same one passed to DrvInit )
path Path where the file system is to be mounted
dev Device that on which the file system is to be fount
Returns:
A pointer to a file system device object


The documentation for this struct was generated from the following file:
Post a comment

From: