in_celebration

Rick Hohensee (humbubba@smarty.smart.net)
Fri, 30 Jun 100 13:44:49 -0400 (EDT)


The DocBook effort and so on in 2.4 are very positive things, and are
typical of what I believe is crucial to the future of open source software
generally. It's nice to see this pro-active "We're still serious about
openness" in 2.4. Reminds me of finding html in the Bash 2 package. The
wares themselves must be the best docs.

Documentation is the great frontier of open source unix particularly, and
will determine how it fares against more popular systems, and how much it
will influence systems as yet unimagined. Much of what's new in 2.4
doesn't make much difference to my client-use low-resource orientation,
but docs effect everything.

In celebration of the open tone of 2.4, I release the following per the
GPL. These may or may not be redundant to existing stuff, but are small,
low-dependancy and high-modularity. At a glance I don't see anything I use
here that make config ; make bzImage doesn't need.

The cLIeNUX Linux 2.4 Party Favors(TM)

#####################################################################

funmap -- Make the map for fun (immediately following). Make a
global_function<-to->file_it's_coded_in map of a built kernel.
fun happens to work a bit cleaner if you do "make relink" from
an earlier l-k post of mine before making FUNMAP. To be run in
/path/to/linux.

.....................................................................

rm FUNMAP
export F
for F in `find -name "*.o"`
do
nm -g -o $F >> FUNMAP
done

#####################################################################

fun -- scan FUNMAP for a string, which will return string matches
followed by the filename the functions matching that string are
defined in. Do just a tad of formatting too.

.....................................................................

grep $1 FUNMAP | grep " T " | awk ' { print $3 "\t" $1 } ' | sort\
| cut -d : -f 1 | \
awk ' { print gensub( /\.o/, ".c", 1) }'

# example sequence
#
#
# cd linux # where all the one-.c-file .o files exist, but preferably
# # where the composite .o files don't.
# funmap
# fun brelse
# fun init
#

####################################################################

snug -- delete extra blank lines, and extraneous whitespace between the
last non-whitespace character on a line and the newline.
Get the whitespace first to get non-empty but visually blank
lines that seem to be common in GNU cpp output.

....................................................................
# Got milk?

## get stdin
cat /.pro/$$/fd/0 | sed -e 's/[ ]*$//g ' |\
awk ' BEGIN { blank = 1 }
{ if (! (( blank == 1 ) && ($0 == "")) )
{
if ( $0 == "" )
{ blank = 1
}
else { blank = 0
}
print $0
}
} '

#####################################################################

source_me -- a couple handy kernel-molestation shell things

....................................................................

I=/usr/include/

# lose the cpp included-from-trace lines
# and re-snug. See "snug" above.
SNUG () {
grep -v "^#" | snug
}

# Does the -D__KERNEL__ make you a kernel hacker?
GCC () {
gcc -D__KERNEL__ -Wall \
-Wstrict-prototypes -O2 -fomit-frame-pointer -pipe \
-fno-strength-reduce -m386 -DCPU=386 -o /tmp/$1.o -c $1
}

# example sequence
#
# . source_me
# cd $I/linux
# cpp fs.h | SNUG| <your_pager>
#

######################################################################

doc2see -- rhymes with Watusi. Officially.
Perlless script to do just the trivially easy docbook-to-html
thingies, which is enough to get legible. With
kernel-hacking.tmpl anyway. Does code OK. Does hyperlinks to
header files, but with just all the same link name. Look at the
prompt line in Lynx :o>

example :;doc2see < kernel-hacking.tmpl > k.html

.....................................................................

## edit <a href=file:\/usr\/src\/linux>/ if necessary

sed ' 1i\
s//

/ s/<\/para>// s//<h3>/ s/<\/title>/<\/h3>/ s/<programlisting>/<pre>/ s/<\/programlisting>/<\/pre>/ s/<function>/<em>/ s/<\/function>/<\/em>/ s/<itemizedlist>/<ul>/ s/<\/itemizedlist>/<\/ul><li>/ s/<\listitem>/<li>/ s/<filename class=headerfile>/<a href=file:\/usr\// s/<\/filename>/>see below<\/a>/ s/<\/term>/<br>/ '| awk ' { if ( $1 == "<pre>") { pre = " " print "" } if ( $1 == "</pre>") pre = "" print pre $0 } ' ###################################################################### All the best in 2.4, y'all. Rick Hohensee rick@cLIeNUX.com www.clienux.com cLIeNUX. Because <YOUR SLOGAN HERE> - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/ <!-- body="end" --> <hr> <p> <ul> <!-- next="start" --> <li> <b>Next message:</b> <a href="1266.html">Philipp Rumpf: "Re: owner field in `struct fs'"</a> <li> <b>Previous message:</b> <a href="1264.html">Chris Lattner: "console_lock too early in printk???"</a> <!-- nextthread="start" --> <!-- reply="end" --> </ul> </font></body>