Here are useful materials and references about the tools and topics covered in CS107.
Textbooks
Here are some references for the C programming language:
- Nick Parlante's Essential C
- The CS107 guide to the C standard library functions
- Kernighan and Ritchie's classic text The C Programming Language (requires authentication, accesses Stanford's subscription to Safari Books Online in the left sidebar)
Stanford Libraries also includes some excellent online book collections, such as Safari Books Online (includes Nutshell books on Linux, programming tools, languages) and Books 24x7 ITPro (includes "for Dummies" series, Sams, Osbourne/McGraw-Hill, MIT Press, Peachpit Press, and Sybex). Search Stanford's online book collection
Chris Gregg, one of the CS107 instructors, also wrote an additional CS107-specific course reader that may be a helpful extra reference: click here.
Development Tools
In CS107, we will be working remotely on the myth
machines in the Gates building with the following tools to write, compile, and debug our programs.
Here is a guide for how to remotely log in to the Myth computers: click here
Once you are remotely logged in, you can use the various tools we have installed to work on your programs. Here is some more information about each of these tools. There are walkthrough videos for many of the tools listed below - visit each page for a link. You can also view all the walkthrough videos here.
- Emacs (text editor)
- Make (compiles your program for you using a set of commands)
- GCC (how to manually compile C programs)
- GDB and Debugging (how to debug your programs)
- Valgrind Memcheck (finds memory leaks and memory errors)
- Valgrind Callgrind (CPU/cache profiling)
- Extra: Git (manage versions of your work)
Common Unix Commands
There are walkthrough videos for many of the commands listed below - visit each page for a link. You can also view all the walkthrough videos here.
Navigating the File System
- Overview
- The
.backup
directory - The working directory and
pwd
- What is the difference between an absolute and a relative path?
cd
(change directory)cat
(print a file to the screen)ls
(list a folder's contents)- Extra:
pushd
andpopd
(easily move back and forth between folders) - Extra: Symbolic Links (create a link to a file in a different directory)
Other Commands
man
(view manual pages)cp
andmv
(copy and move files and folders)mkdir
(create new folders)rm
andrmdir
(delete files and folders)grep
(search files for text)find
(search for files)diff
(view differences between two text fileswc
(count the chars/words/lines in a file)- View and re-execute your previous unix commands
- Speed up typing unix commands with tab-completion
- Chain commands, and save output to a file, with
<
,>
and|
- Extra:
tar
(archive and unarchive)
Assembly Language
Assembly language is one of the topics covered during the quarter. Here are some assembly references:
- The CS107 guide to x86-64 basics
- The CS107 x86-64 reference sheet that lists commonly used instructions and addressing modes.
- There are a lot of additional books/web sites on x86-64 but one quirky thing to note is there are two distinct assembler syntaxes in use so best to stick with resources that use the same syntax we did (that would be GNU/att, not Intel).