This is an archive of past FreeBSD releases; it's part of the FreeBSD Documentation Archive.

Sysinit Operation

13.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 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.

This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/.

For questions about FreeBSD, read the documentation before contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.