# Writing a GEOM Class

### Ivan Voras

`<ivoras@FreeBSD.org>`

$FreeBSD: doc/en_US.ISO8859-1/articles/geom-class/article.sgml,v 1.8 2007/05/04 12:45:05 ceri Exp $

Legal Notice

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.

[ Split HTML / Single HTML ]

# 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 CVS tree.

|  | Next
|  | Preliminaries