Writing a GEOM Class
|  | Next

## Writing a GEOM Class

### Ivan Voras

`<ivoras@FreeBSD.org>`

Revision: 41645
Legal Notice
Last modified on 2013-05-17 by gabor.
Abstract

This text documents some starting points in developing GEOM classes, and kernel modules in general. It is assumed that the reader is familiar with C userland programming.

## 1. Introduction

### 1.1. Documentation

Documentation on kernel programming is scarce — it is one of few areas where there is nearly nothing in the way of friendly tutorials, and the phrase “use the source!” really holds true. However, there are some bits and pieces (some of them seriously outdated) floating around that should be studied before beginning to code:

- The FreeBSD Developer's Handbook — part of the documentation project, it does not contain anything specific to kernel programming, but rather some general useful information.

- The FreeBSD Architecture Handbook — also from the documentation project, contains descriptions of several low-level facilities and procedures. The most important chapter is 13, Writing FreeBSD device drivers.

- The Blueprints section of FreeBSD Diary web site — contains several interesting articles on kernel facilities.

- The man pages in section 9 — for important documentation on kernel functions.

- The geom(4) man page and PHK's GEOM slides — for general introduction of the GEOM subsystem.

- Man pages g_bio(9), g_event(9), g_data(9), g_geom(9), g_provider(9) g_consumer(9), g_access(9) & others linked from those, for documentation on specific functionalities.

- The style(9) man page — for documentation on the coding-style conventions which must be followed for any code which is to be committed to the FreeBSD Subversion tree.

|  | Next
|  | 2. Preliminaries

This, and other documents, can be downloaded from http://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>.