If you're new to the Solaris OS, an easy way to get a quick exposure to the code is through the OpenSolaris source browser, which is available at http://cvs.opensolaris.org/source/
Take an online tour of the source and you'll discover cleanly written, extensively commented code that reads like a book. If you're interested in working on an OpenSolaris project, you can download the complete codebase; if you
just need to know how some features work in the Solaris OS, the source code
browser provides a convenient alternative.
Search Options
On the home web page for the source browser, you'll find the following search options:
Combining Search Options
The search options can be used individually or in conjunction with one another in a boolean expression. Wildcards can be used as well. See the online help for
more information on search techniques.
Guide to the Source Directory
In addition to the search options, you'll find a description of the source file directory organization under
/usr/src, with
hyperlinks to help you navigate through the file hierarchy.
Hyperlinks to Definitions and Searches
Once in the source, you'll find convenient hyperlinks to give you a full understanding of the code. There are hyperlinks that connect local symbols to their definitions. If definitions are not available, the hyperlink performs a search on
the given string. So for example, if you're examining a
.c
file, you can do a search on an included header file with a
single click.
Search Examples
Let's try out the source browser by looking at how the
pwd command
works. Entering pwd.c in the File Path field displays two results.
We want the pwd that is used to "return
working directory name". Selecting pwd.c in the /usr/src/cmd/pwd/ directory takes us to the source code. Scrolling down to the main
function gives us the code shown in the following figure. You can click on any symbol in the code to initiate a search for that symbol's definition.
| |||||||||||||||||
|
| ||||||||||||