Background and General Tools
I assume that everyone in the class has reasonably strong programming
skills and that you are comfortable using the basic tools of the trade
(debuggers, makefiles, etc.) Here are some references if you need to
brush
up on any of these basic skills.
- make
You
should know how to use make!
- Version control (keeping track of old versions of software before
you
added
the last bug) is essential for large software projects. CVS and SVN are
sophisticated tools for allowing concurrent editing in a
multi-programmer
project.
- etags
In this project, you will need to navigate a number of files, some of
which were written by someone other than you. Etags (for emacs or ctags
for vi) makes it easy to jump to where a function, type, or global
variable is defined and will simplify your life.
- GDB
and GDB
reference card: If you currently debug with printf's, spend a
couple
hours learning GDB. It's not hard, and I promise you will save time in
the long (or not-so-long) run. DDD is a graphical front end to
GDB: http://www.gnu.org/software/ddd.
- Find an editor that makes it easy to open up multiple files and
switch among them. Emacs, for example.
C++ References
- Tom Anderson's A Quick Introduction to C++
introduces a subset of C++ that can be "learned in a day." It is aimed
at someone who knows C and wants to learn C++, but it should also be
comprehensible for someone who knows Java and wants to learn C++.
C References
- The classic reference for C: The C programming language by
Kernighan and Ritchie. Prentice
Hall, Inc., 1988. ISBN 0-13-110362-8, 1998.
- The best introduction to C for people that know other languages
that I know of is "ANSI
C for Programmers on UNIX Systems" by Tim Love. [local
.pdf copy]
- Chapter 3 "Reading C Programs" of Lions Commentary
on the 6th Edition of the UNIX Operating System provides a quick (6
page) overview of C syntax, with a particular emphasis on some of the
gnarley constructs OS writers sometimes like to use when they are
feeling clever. Some of the dialect and style is a bit archiac, but
making sure you understand these examples will save you much pain in
the labs.
Classic UNIX references
x86 Emulation
- Bochs - An x86
platform
and CPU emulator.
- User
manual
- Debugger
reference
- Notes on setting up the tools for
this class
- A big advantage you will have over last year's class: I
finally managed to get GDB working with bochs. In the CS department,
run /u/dahlin/bin/bochs-gdb (instead of
/lusr/opt/bochs-2.1.1/bochs) and see this
description on how to attach GDB to your bochs process.
- QEMU - A
new, much faster but less mature PC emulator. Use in CS372 at your own
risk.
x86 Assembly Language
PC Hardware Programming
- General PC architecture information
- General BIOS and PC bootstrap
- VGA display - kern/console.c
- Keyboard and Mouse - kern/console.c
- 8253/8254 Programmable Interval Timer (PIT) - inc/timerreg.h
- 8259/8259A Programmable Interrupt Controller (PIC) - kern/picirq.*
- Real-Time Clock (RTC) - kern/kclock.*
- 16550 UART Serial Port - kern/console.c
- IEEE 1284 Parallel Port - kern/console.c
- IDE hard drive controller - fs/ide.c
- Sound cards (not supported in 6.828 kernel, but you're welcome
to do it as a challenge problem!)