The remainder of this section explains the function of each of the entry points. Other routines internal to the driver may also be included in the driver. The install routine is responsible for allocating and initializing data structures and the device hardware, if present. It receives the address of a device information structure which hold the parameters for a major device. The install routine for a character driver should follow this pseudo-code.
Every open system call results in the invocation of the open entry point.
The open entry point is not re-entrant, therefore only one user task can be executing this entry point's code at any time for a particular device. Unless you have a slow device, most likely it will never be needed. The ioctl entry point is invoked when the ioctl system call is invoked for a particular file descriptor. This entry point is used to set certain parameters in the device or to obtain information about the state of the device. Any dynamically allocated memory or interrupt vectors set in the install entry point should be freed in this entry point.