[Tux3] Tux3 kernel port - introduction
phillips at phunq.net
Tue Aug 26 16:04:32 PDT 2008
Faithful readers of the Tux3 list, please make sure to block out some
time over the next couple of weeks to study up on Linux kernel
porting. I know some of you are highly skilled C programmers, but
probably few if any have really studied Linux kernel internals or gone
delving into the mysteries of the various kernel subsystems that will
be involved in the port. It is not very hard. The biggest difficulty
is finding out about the many unwritten or unadvertised facts about the
kernel that experienced kernel hacks tend to learn from lore as much as
Fortunately there are some excellent resources available:
Anything written by Jon Corbet, especially "Linux Device Drivers"
(LDD) and the LWN kernel api documentation series.
"Understanding the Linux Kernel", Bovet and Cesati, for a general
introduction and overview with some useful insights.
The most important resource: http://lxr.linux.no
Nearly everything you need to know about porting Tux3 to kernel is
Besides that, learning about dentries and bios is essential. Ext2 is
useful source material because it implements all the essential features
of a full Posix filesystem with additional Linux-specific functionality.
Ext3 is useful because, relying on buffers as its main currency of
interaction with block devices as it does, it aligns better with the
Tux3 style than Ext2 does, which has been somewhat unsuccessfully
hacked to bypass buffers and work directly with pages. Once you are
aware of this it is easy to spot the differences and compare styles.
Suffice to say that the page model of filesystem interface only works
well for the simplest of filesystems, such as Ext2.
Most of the additional complexity of Ext3 is due to journalling, which
is surprisingly complex in its details, particularly in dealing with
the various problems that arise due to the limited size of the journal.
Stephen Tweedie has written and spoken (transcriptions available) about
these difficulties at length. Tux3 intends to bypass much of the
complexity using techniques I described in the Hammer thread with Matt
Dillon, and which I will demonstrate in the Tux3 userspace prototype
over the next couple of weeks.
Hopefully while I am doing that, some of you will be preparing
yourselves to assist with the kernel port. I expect that I will check
in a stub Tux3 filesystem this week which is essentially a cut and
paste of ramfs that calls itself Tux3. The process of porting Tux3
then consists mainly of using bits of code we have developed in
userspace to implement the same interfaces that Ext2 implements. We
will also be adding locking at that time and implementing asychronous
IO using the bio block device interface.
Tux3 mailing list
Tux3 at tux3.org
More information about the Tux3