<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 98.1 release (February 19th, 1998) originally by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Common Pitfalls</TITLE> <META NAME="description" CONTENT="Common Pitfalls"> <META NAME="keywords" CONTENT="mpg"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <LINK REL="STYLESHEET" HREF="mpg.css"> <LINK REL="next" HREF="node28.html"> <LINK REL="previous" HREF="node26.html"> <LINK REL="up" HREF="mpg.html"> <LINK REL="next" HREF="node28.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html706" HREF="node28.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next_motif.gif"></A> <A NAME="tex2html702" HREF="mpg.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_motif.gif"></A> <A NAME="tex2html696" HREF="node26.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="previous_motif.gif"></A> <A NAME="tex2html704" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents_motif.gif"></A> <A NAME="tex2html705" HREF="node34.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index_motif.gif"></A> <BR> <B> Next:</B> <A NAME="tex2html707" HREF="node28.html">Changes between 2.0 and</A> <B> Up:</B> <A NAME="tex2html703" HREF="mpg.html">Linux Kernel Module Programming</A> <B> Previous:</B> <A NAME="tex2html697" HREF="node26.html">Symmetrical Multi-Processing</A> <BR> <BR> <!--End of Navigation Panel--> <H1><A NAME="SECTION001500000000000000000"> </A><A NAME="bad-ideas"> </A> <BR> Common Pitfalls </H1> <P> Before I send you on your way to go out into the world and write kernel modules, there are a few things I need to warn you about. If I fail to warn you and something bad happen, please report the problem to me for a full refund of the amount I got paid for your copy of the book. <A NAME="727"> </A> <P> <DL COMPACT> <DD><P> <DT>1. <DD><B>Using standard libraries</B> You can't do that. In a kernel module you can only use kernel functions, which are the functions you can see in <TT>/proc/ksyms</TT>. <A NAME="731"> </A><A NAME="732"> </A> <A NAME="733"> </A><A NAME="734"> </A> <P> <DT>2. <DD><B>Disabling interrupts</B> You might need to do this for a short time and that is OK, but if you don't enable them afterwards, your system will be stuck and you'll have to power it off. <A NAME="736"> </A> <P> <DT>3. <DD><B>Sticking your head inside a large carnivore</B> I probably don't have to warn you about this, but I figured I will anyway, just in case. <P> </DL> <P> <P> <BR><HR> <ADDRESS> <I></I> <BR><I>1999-05-19</I> </ADDRESS> </BODY> </HTML>