This chapter is woefully incomplete. The OSKit FreeBSD device library provides an infrastructure for using unmodified FreeBSD 2.1.7 device drivers.
The FreeBSD device library currently supports only the system console and a few ISA-based serial port interfaces all exporting the oskit_ttystream interface. Only the system console and PS/2 mouse have been tested.
Following is a list of supported drivers. The tag is the name used by the device library to refer to the devices (see Section 17.3 for details on device naming).
#include <oskit/dev/freebsd.h>
Contains common definitions and function prototypes for the OSKit’s FreeBSD device interfaces described in the next section.
OS Component
Initializes the support code for FreeBSD device drivers.
Currently the oskit_freebsd_init_driver routines take care of invoking any required freebsd device initialization functions, including this one. This may change in the future.
OS Component
Initialize and register all available FreeBSD device drivers.
Warning messages will be printed with osenv_log for drivers which cannot be initialized but the initialization process will continue.
osenv_log
OS Component
Initialize and register all available FreeBSD ISA bus device drivers. See <oskit/dev/freebsd_isa.h> for the currently available devices.
Warning messages will be printed with osenv_log for drivers which cannot be initialized but the initialization process will continue.
Currently the oskit_freebsd_init_driver routines take care of invoking any required freebsd device initialization functions, including this one. This may change in the future.
osenv_log
OS Component
Initialize a single FreeBSD device driver. Possible values for driver are listed in Section 44.2.
Returns 0 on success, an error code specified in <oskit/dev/error.h> on error.
“Back door” interfaces are intended for users which have some builtin knowledge of FreeBSD internals and want to convert that knowledge to interface-level equivalents.
#include <oskit/dev/freebsd.h>
oskit_error_t oskit_freebsd_chardev_open(int major, int minor, int flags, [out] oskit_ttystream_t **tty_stream);
OS Component
Opens a character device given a FreeBSD major and minor device value. Returns a pointer to an oskit_ttystream_t interface as though oskit_ttydev_open was called on an OSKit oskit_ttydev_t interface.
Returns 0 on success, an error from <oskit/dev/error.h> otherwise.
OS Component
Translates a FreeBSD error number into an OSKit error number.
Returns an equivalent error value from <oskit/dev/error.h>, or OSKIT_E_UNEXPECTED if there is no suitable translation.