MTD internal API documentation - overview

Structure

The MTD system is divided into two types of module: "users" and "drivers".

Drivers are the modules which provide raw read/write/erase access to physical memory devices.

Users are the modules which use MTD drivers and provide a higher-level interface to user-space.

We currently have four 'user' modules available: FTL, NFTL, JFFS and MTDBLOCK. FTL and NFTL both provide a pseudo-block device on which a 'normal' filesystem is placed. JFFS is a filesystem which runs directly on the flash, and MTDBLOCK performs no translation - just provides a block device interface directly to the underlying MTD driver.

Just because I use the word 'module', it doesn't mean that these have to be loadable modules. You can link them statically into your kernel.

Writing a driver module

Instructions for writing a driver are very simple:

Oh yes - you have to actually write the access routines too, which have to conform to the rules.

Writing a user module

This is only slightly more complex:

This ought to call your notifier function immediately for all drivers which are already present in the system. But it doesn't yet. Currently, drivers scan through calling get_mtd_device() to find previously-loaded drivers. This is bad and will be fixed soon.

David Woodhouse
$Id: overview.html,v 1.1 2005/03/12 13:43:49 gleixner Exp $