Cheap website hosting service by Active-Venture.com
  

Domain Registration -
Domain registration and domain transfer  service from just
$5.95/year only

 

Domain Name Registration -
Cheap domain name registration by Cheap Domain Name Registrar.

 Back to Index

5.2 SYSINIT Operation

SYSINIT relies on the ability of the linker to take static data declared at multiple locations throughout a program's source and group it together as a single contiguous chunk of data. This linker technique is called a ``linker set''. SYSINIT uses two linker sets to maintain two data sets containing each consumer's call order, function, and a pointer to the data to pass to that function.

SYSINIT uses two priorities when ordering the functions for execution. The first priority is a subsystem ID giving an overall order for SYSINIT's dispatch of functions. Current predeclared ID's are in <sys/kernel.h> in the enum list sysinit_sub_id. The second priority used is an element order within the subsystem. Current predeclared subsystem element orders are in <sys/kernel.h> in the enum list sysinit_elem_order.

There are currently two uses for SYSINIT. Function dispatch at system startup and kernel module loads, and function dispatch at system shutdown and kernel module unload. Kernel subsystems often use system startup SYSINIT's to initialize data structures, for example the process scheduling subsystem uses a SYSINIT to initialize the run queue data structure. Device drivers should avoid using SYSINIT() directly. Instead drivers for real devices that are part of a bus structure should use DRIVER_MODULE() to provide a function that detects the device and, if it is present, initializes the device. It will do a few things specific to devices and then call SYSINIT() itself. For pseudo-devices, which are not part of a bus structure, use DEV_MODULE().

 

  

 

 

© 2002-2004 Active-Venture.com Website Hosting Service

 

Disclaimer: This documentation is provided only for the benefits of our website hosting customers.
For authoritative source of the documentation, please refer to http://www.freebsd.org