+ +If you are interested in a particular type of symbols (e.g functions), use +the type links below. If you are interested in a particular directory in +FreeBSD, choose the directory link below.
+ +Follow the links until you reach the source code you are interested in.
+ +
+ +The final code should have hyperlinks that allow you to follow references +to other symbols in the tree (e.g calls to bread() etc). This is difficult +given C's scoping rules, and I don't want to write a C grammar parser. +Until I can think of a clean way, I'll omit the desired hyperlinks.
+
+
diff --git a/doc/tools/src2html1.4a/FreeBSD/ddb.hdr b/doc/tools/src2html1.4a/FreeBSD/ddb.hdr new file mode 100644 index 0000000000..2882f3dfa8 --- /dev/null +++ b/doc/tools/src2html1.4a/FreeBSD/ddb.hdr @@ -0,0 +1,6 @@ +The ddb directory holds routines used to debug the kernel. +The 4.3BSD Internals book by Leffler, McKusick, Karels and Quarterman +doesn't really cover this directory. However, some information has been +presented by Kirk KcKusick and Keith Bostic in their "UNIX Kernel Internals" +notes, which they have presented in many places in the past few years. +
diff --git a/doc/tools/src2html1.4a/FreeBSD/i386.i386.hdr b/doc/tools/src2html1.4a/FreeBSD/i386.i386.hdr new file mode 100644 index 0000000000..72ea58d1f1 --- /dev/null +++ b/doc/tools/src2html1.4a/FreeBSD/i386.i386.hdr @@ -0,0 +1,5 @@ +The i386/i386 directory holds the routines that deal with the Intel +386/486 CPU in the PC architecture. +The 4.3BSD Internals book by Leffler, McKusick, Karels and Quarterman +doesn't describe this anywhere at all, because this is machine-specific. +
diff --git a/doc/tools/src2html1.4a/FreeBSD/i386.include.hdr b/doc/tools/src2html1.4a/FreeBSD/i386.include.hdr new file mode 100644 index 0000000000..7acfb0ec1b --- /dev/null +++ b/doc/tools/src2html1.4a/FreeBSD/i386.include.hdr @@ -0,0 +1,5 @@ +The i386/include directory holds C-language include files that +define things that are specific about the PC architecture.
+ +The 4.3BSD Internals book by Leffler, McKusick, Karels and Quarterman +doesn't describe this anywhere at all.
diff --git a/doc/tools/src2html1.4a/FreeBSD/i386.isa.hdr b/doc/tools/src2html1.4a/FreeBSD/i386.isa.hdr new file mode 100644 index 0000000000..ec13230f00 --- /dev/null +++ b/doc/tools/src2html1.4a/FreeBSD/i386.isa.hdr @@ -0,0 +1,10 @@ +The i386/isa directory holds the routines that deal with the ISA +I/O bus in the PC architecture. +The 4.3BSD Internals book by Leffler, McKusick, Karels and Quarterman +doesn't describe this anywhere at all, because this is machine-specific. +You can however glean some information from the following chapter: + +
diff --git a/doc/tools/src2html1.4a/FreeBSD/i386.stand.hdr b/doc/tools/src2html1.4a/FreeBSD/i386.stand.hdr new file mode 100644 index 0000000000..c548c044b0 --- /dev/null +++ b/doc/tools/src2html1.4a/FreeBSD/i386.stand.hdr @@ -0,0 +1,14 @@ +The i386/stand directory holds functions that are useful, but cannot +be called from the kernel. For example printf() is great, but if the kernel +called printf() it would generate a TRAP and wind up back in the kernel.
+ +The functions here emulate these functions by dealing directly with the +hardware on the system.
+ +The 4.3BSD Internals book by Leffler, McKusick, Karels and Quarterman +covers machine-independent stand functionality in: + +
diff --git a/doc/tools/src2html1.4a/FreeBSD/kern.hdr b/doc/tools/src2html1.4a/FreeBSD/kern.hdr new file mode 100644 index 0000000000..f8ec13e4a1 --- /dev/null +++ b/doc/tools/src2html1.4a/FreeBSD/kern.hdr @@ -0,0 +1,18 @@ +The kern directory holds the core functionality of FreeBSD: +system startup, core system calls and syscall dispatching, process +management, scheduling, signals, file descriptors, top-level filesystem +code, interprocess communication and terminal handling.
+ +The 4.3BSD Internals book by Leffler, McKusick, Karels and Quarterman +covers kern in: + +
diff --git a/doc/tools/src2html1.4a/FreeBSD/net.hdr b/doc/tools/src2html1.4a/FreeBSD/net.hdr new file mode 100644 index 0000000000..59c1f67741 --- /dev/null +++ b/doc/tools/src2html1.4a/FreeBSD/net.hdr @@ -0,0 +1,11 @@ +The net directory holds the network functionality of FreeBSD that +deals with routing and generic interfaces: SLIP, PPP, Ethernet, packet +filters. + +The 4.3BSD Internals book by Leffler, McKusick, Karels and Quarterman +covers kern in: + +
diff --git a/doc/tools/src2html1.4a/FreeBSD/netinet.hdr b/doc/tools/src2html1.4a/FreeBSD/netinet.hdr new file mode 100644 index 0000000000..19cdffa577 --- /dev/null +++ b/doc/tools/src2html1.4a/FreeBSD/netinet.hdr @@ -0,0 +1,10 @@ +The netinet directory holds the code for the Internet network +protocols used in FreeBSD: TCP, IP, ICMP, ARP.
+ +The 4.3BSD Internals book by Leffler, McKusick, Karels and Quarterman +covers netinet in: + +
diff --git a/doc/tools/src2html1.4a/FreeBSD/nfs.hdr b/doc/tools/src2html1.4a/FreeBSD/nfs.hdr new file mode 100644 index 0000000000..f9aeab2bbb --- /dev/null +++ b/doc/tools/src2html1.4a/FreeBSD/nfs.hdr @@ -0,0 +1,7 @@ +The nfs directory holds the code for the Network File System. +The code was developed from a specification of NFS from Sun Microsystems.
+ +The 4.3BSD Internals book by Leffler, McKusick, Karels and Quarterman +doesn't cover nfs. You probably don't really want to delve into +it too much, but there is an RFC around describing the protocol, but not +the code here.
diff --git a/doc/tools/src2html1.4a/FreeBSD/stand.hdr b/doc/tools/src2html1.4a/FreeBSD/stand.hdr new file mode 100644 index 0000000000..9e7df8861f --- /dev/null +++ b/doc/tools/src2html1.4a/FreeBSD/stand.hdr @@ -0,0 +1,14 @@ +The stand directory holds functions that are useful, but cannot be +called from the kernel. For example printf() is great, but if the kernel +called printf() it would generate a TRAP and wind up back in the kernel.
+ +The functions here emulate these functions by dealing directly with the +hardware on the system.
+ +The 4.3BSD Internals book by Leffler, McKusick, Karels and Quarterman +covers stand in: + +
diff --git a/doc/tools/src2html1.4a/FreeBSD/sys.hdr b/doc/tools/src2html1.4a/FreeBSD/sys.hdr new file mode 100644 index 0000000000..2624741a87 --- /dev/null +++ b/doc/tools/src2html1.4a/FreeBSD/sys.hdr @@ -0,0 +1,6 @@ +The sys directory holds C-language include files that are used +by all parts of the FreeBSD source tree.
+ +The 4.3BSD Internals book by Leffler, McKusick, Karels and Quarterman +doesn't cover these files specifically, but discussion of their contents +crops up everywhere.
diff --git a/doc/tools/src2html1.4a/FreeBSD/ufs.hdr b/doc/tools/src2html1.4a/FreeBSD/ufs.hdr new file mode 100644 index 0000000000..8cec8cddac --- /dev/null +++ b/doc/tools/src2html1.4a/FreeBSD/ufs.hdr @@ -0,0 +1,10 @@ +The ufs directory holds the code for the Berkeley Fast Filesystem, +which is the filesystem used on locally mounted hard and floppy disks.
+ +The 4.3BSD Internals book by Leffler, McKusick, Karels and Quarterman +covers ufs in: + +
diff --git a/doc/tools/src2html1.4a/FreeBSD/vm.hdr b/doc/tools/src2html1.4a/FreeBSD/vm.hdr new file mode 100644 index 0000000000..26205175a8 --- /dev/null +++ b/doc/tools/src2html1.4a/FreeBSD/vm.hdr @@ -0,0 +1,9 @@ +The vm directory holds the virtual memory subsystem used by +FreeBSD. This was derived from the VM system used in the Mach kernel, +with the interface to the rest of the kernel rewritten. As such, it is +not described in the +4.3BSD Internals book by Leffler, McKusick, Karels and Quarterman, +but it is described by Kirk KcKusick and Keith Bostic in their +"UNIX Kernel Internals" +notes, which they have presented in many places in the past few years. +
diff --git a/doc/tools/src2html1.4a/Readme b/doc/tools/src2html1.4a/Readme
new file mode 100644
index 0000000000..2153411891
--- /dev/null
+++ b/doc/tools/src2html1.4a/Readme
@@ -0,0 +1,65 @@
+ src2html - Hyperlink a C source code tree using HTML, Version 1.3-alpha
+
+ Warren Toomey wkt@cs.adfa.oz.au June 1995
+
+
+Src2html is a program which takes a C source tree and creates a set of
+HTML hypertext documents that allows the most important symbols in the
+source tree to be found easily. As well, a HTML version of the source
+tree is created, with the symbols given in bold font where they are defined
+in the source.
+
+
+REQUIREMENTS
+
+You will need:
+
+ + Perl 4.x
+ + a standard Unix sort(1) command.
+ + a mkdir(1) that supports recursive creation of directories.
+ src2html is configured to use `mkdir -p' to do this.
+ + an egrep(1) if you're going to use the search facility.
+ + httpd(1) if you're going to use the search facility.
+ + Ctags-new, which is bundled with src2html, and a C compiler
+ to compile it.
+
+
+INSTALLATION
+
+Extract the src2html archive, including the Ctags-new and Example directories;
+you probably have already done that. Go into the Ctags-new directory and make
+ctags-new. This should be very straight-forward.
+
+Install ctags-new and src2html in a directory on your path, make them
+executable and install their man pages as well. If your mkdir(1) uses a
+different option to -p, edit src2html to fix this.
+
+If you want to use the search facility, you need to install src2html.cgi
+in your httpd script directory, and edit it to reflect the root of your
+HTML documents, as set in DirectryRoot in conf/srm.conf.
+
+Make sure that ctags-new, src2html and src2html.cgi are executable, and
+that the latter two can find the Perl interpreter. Installation is complete.
+
+
+USING SRC2HTML
+
+Using src2html is pretty straight-forward. Print out and read the man page
+before trying anything. In the FreeBSD directory I have included the config
+file and header files for my src2html conversion of the FreeBSD-2.0.5 source
+tree; read the man page and FreeBSD/FreeBSD.s2h in tandem. The root document of
+this HTML tree is at http://minnie.cs.adfa.oz.au/FreeBSD-srctree/FreeBSD.html.
+
+
+COMMENTS AND QUESTIONS
+
+Surprisingly, src2html is reasonably fast even on large source trees. This was
+my first Perl program, so it could probably be made faster and smaller. I've
+placed comments in the source to give you an idea of what each section does. If
+you have any questions or comments, please email them to me at
+wkt@cs.adfa.oz.au. Now that it's finished I'm not that keen on overhauling it
+etc. I consider it as a good prototype. Getting inter-source hyperlinks done
+would be great, but I really don't want to write a C parser myself.
+
+Cheers,
+ Warren Toomey
diff --git a/doc/tools/src2html1.4a/src2html b/doc/tools/src2html1.4a/src2html
new file mode 100644
index 0000000000..df238ba76c
--- /dev/null
+++ b/doc/tools/src2html1.4a/src2html
@@ -0,0 +1,589 @@
+#!/usr/local/bin/perl
+# Src2html: Take a source tree and generate Html documents that have hyperlinks
+# to the definition of structures, variables, functions, and preprocessor
+# definitions. Read the manual page for details on how to use the program.
+#
+# Version 1.4-alpha. Written by Warren Toomey wkt@cs.adfa.oz.au
+#
+# 19th January 1996
+#
+
+if ($#ARGV <= 0 || $#ARGV > 4) { # Check arg count
+ print(STDERR "Usage: $0 [-na] [-nl] [-d num] input_description\n");
+ print(STDERR " -na: Don't produce top-level category files\n");
+ print(STDERR " -nl: Don't produce per-letter files\n");
+ print(STDERR " -d: Set debugging to given number (0-3)\n");
+ exit(1);
+}
+
+# Set up default option values
+$NoLetters= 0;
+$NoAll= 0;
+$Debug=0;
+$Top= $ARGV[$#ARGV];
+$Top=~ s/\.s2h$//;
+
+# Parse the options
+for ($i=0; $i<= $#ARGV; $i++) {
+ if ($ARGV[$i] eq "-na") { $NoAll= 1; next; }
+ if ($ARGV[$i] eq "-nl") { $NoLetters= 1; next; }
+ if ($ARGV[$i] eq "-d") { $i++; $Debug= $ARGV[$i]; next; }
+}
+
+$Title{"m"}= "Macros";
+$Title{"d"}= "Defines";
+$Title{"f"}= "Functions";
+$Title{"v"}= "Variables";
+$Title{"s"}= "Structs";
+$Title{"u"}= "Unions";
+$Title{"t"}= "Typedefs";
+$Title{"e"}= "Enums";
+$Title{"g"}= "All symbols";
+
+&get_s2h; # Read the description file
+&make_dirs; # Make directories as needed
+&make_ctags; # Generate ctags for all src
+&parse_ctags; # Parse ctags, generate html ptr files
+foreach $i (keys(%Dirinfo))
+{ &rewrite_src($i); } # Rewrite the src code
+exit(0); # and exit
+
+
+## get_s2h: Opens the source description file, reads it, and sets up some
+## variables describing where some directories are, and the source directories
+## to process. Variables used are:
+## Srctree - The root of the source tree we are processing
+## Htmlroot - The directory where all WWW documents are kept
+## Htmldir - The directory under Htmlroot for this source tree
+## Htmltree - The root of the destination tree for the Html code
+## Newsrctree - The directory in Htmltree to store the new Htmlised code
+## Headers - The directory where we keep information to prepend in some docs
+## Formdir - The place to put the index searching script
+## Dirinfo{} - The list of dirs and the info about the directory
+## Dotdir{} - The directory name with /'s -> .'s
+
+sub get_s2h {
+ $Newsrctree= 'newsrc'; # Set up as default
+ $Headers= '.';
+
+
+ #########################################################
+ # make sure we dump out the last bit of the last file....
+
+ # Print out the remainder of the
+ # current file, incl. the buffered line
+ if ($In_file == 1) {
+ if ("$line" ne "") { print OUT $line; }
+ while (