The Möbius Operating System: Driver Book
HOME DOWNLOAD DOCUMENTATION SCREENSHOTS  

Initialisation

Back: Driver Book | Next: Device Drivers

Your driver starts execution at the DrvEntry routine:

bool DrvInit(driver_t *drv)
{
    drv->add_device = SampleAddDevice;	/* for device drivers */
    drv->mount_fs = SampleMountFs;	/* for file system drivers */
}

It is passed one parameter by the device manager (driver_t*), which identifies your device driver. Here you need to set the entry point(s) for your own device enumeration functions:

  • drv->add_device for adding block and character devices
  • drv->mount_fs for mounting file systems

You'd normally only initialize one of these, depending on what kind of driver you were writing.

Back: Driver Book | Next: Device Drivers

Post a comment

From: