fusd HOWTO ========== Shakthi Kannan v1.4, January 5, 2007 ///////////////////////////////////////////////////////////////////// Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; A copy of the license is included in the section entitled "GNU Free Documentation License". ///////////////////////////////////////////////////////////////////// Abstract -------- This documentation provides the necessary steps to build a 2.4.x Linux kernel with devfs support on an x86 machine, and to compile and test the fusd module with user-space driver examples. The Redhat 9.0 (shrike) distribution is used for testing. fusd HOWTO ---------- Step 1 ~~~~~~ Download a stock Linux-2.4.21 Linux kernel [4] to /usr/src from: -------------------------------------------------------------------- http://www.kernel.org/pub/linux/kernel/v2.4/ -------------------------------------------------------------------- Step 2 ~~~~~~ Extract the kernel sources: -------------------------------------------------------------------- cd /usr/src tar xjvf linux-2.4.21.tar.bz2 -------------------------------------------------------------------- Step 3 ~~~~~~ Choose the following kernel options for devfs and compile the kernel: -------------------------------------------------------------------- CONFIG_EXPERIMENTAL=y CONFIG_DEVFS_FS=y make clean make dep make bzImage make modules make modules_install cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.21 mkinitrd /boot/initrd-2.4.21.img 2.4.21 -------------------------------------------------------------------- Step 4 ~~~~~~ Update the boot-loader: Lilo was used and an entry for the new kernel is added to /etc/lilo.conf: -------------------------------------------------------------------- image=/boot/vmlinuz-2.4.21 label=linux-fusd initrd=/boot/initrd-2.4.21.img read-only append="root=/dev/hda1 devfs=nomount" -------------------------------------------------------------------- Run /sbin/lilo to update the lilo. If using grub, just add an entry for vmlinuz and initrd in /boot/grub/menu.lst. devfs cannot understand root=LABEL= directives in the bootloader. Hence, don't use such conventions in the bootloader or in /etc/fstab. By default, we don't want devfs to mount on boot-up, hence passing devfs=nomount will not mount it during boot. Step 5 ~~~~~~ Install devfsd. devfsd is a daemon that needs to be installed. We used the devfsd-2.4.3-12.i386.rpm file. -------------------------------------------------------------------- rpm -ivh devfsd-2.4.3-12.i386.rpm -------------------------------------------------------------------- Step 6 ~~~~~~ Remove any /dev/pts entry in /etc/fstab. devfs will handle /dev/pts so any existing entry in /etc/fstab needs to be removed. Step 7 ~~~~~~ Reboot! Reboot into the new Linux-fusd kernel. If everything looks good, the system will boot. If you missed out on any of the above options, your system will be mounted as a read-only filesystem and might drop you to a console shell or may reboot. Step 8 ~~~~~~ Compile fusd-1.10: Download fusd-1.10 package to say /root, from: -------------------------------------------------------------------- http://www.circlemud.org/pub/jelson/fusd/ -------------------------------------------------------------------- su to root and extract the sources: -------------------------------------------------------------------- cd /root tar xzvf fusd-1.10.tar.gz -------------------------------------------------------------------- Change the kernel source path in the Makefile. Compile the fusd package which will build kfusd.o, libfusd.a and code examples: -------------------------------------------------------------------- cd fusd-1.10 make -------------------------------------------------------------------- If compilation is done cleanly, install it: -------------------------------------------------------------------- make install -------------------------------------------------------------------- Step 9 ~~~~~~ Mount devfs and start devfsd: -------------------------------------------------------------------- mount -n -t devfs none /dev devfsd /dev -------------------------------------------------------------------- Step 10 ~~~~~~~ Load the kfusd.o module The kfusd.o module is present in the objs.i686-linux/ directory in the fusd sources. Load the module: -------------------------------------------------------------------- insmod objs.i686-linux/kfusd.o -------------------------------------------------------------------- Step 11 ~~~~~~~ Test the helloworld example: -------------------------------------------------------------------- objs.i686-linux/helloworld & cat /dev/hello-world -------------------------------------------------------------------- Bibliography ------------ + [[[Doug]]]. Doug Glibert. 2001. Devfs and SCSI. http://sg.torque.net/sg/devfs_scsi.html. + [[[Jeremy]]]. Jeremy Elson. 2003. FUSD - a Linux Framework for User-Space Devices. http://www.circlemud.org/~jelson/software/fusd/. + [[[Richard]]]. Richard Gooch. 2002. Linux Devfs (Device File System) FAQ. http://www.atnf.csiro.au/people/ rgooch/linux/docs/devfs.html. + [[[LinuxKernel]]]. http://www.kernel.org/pub/linux/kernel/v2.4/ ifdef::backend-docbook[] Index ----- //////////////////////////////////////////////////////////////// The index is normally left completely empty, it's contents being generated automatically by the DocBook toolchain. //////////////////////////////////////////////////////////////// endif::backend-docbook[]