You are expected to understand this. CS 111 Operating Systems Principles, Spring 2005

Digging Deeper

This page links to some useful, and hopefully interesting, information on topics we've discussed in class. I hope you have fun digging!

This information is provided for your enjoyment! Please do not feel you have to read it, unless you're specifically told otherwise.

If you'd like help understanding or installing any of the information or software on this page, please ask us!

x86 Instruction Set - PC Emulators - Hardware Links

x86 Instruction Set and Assembly Language

Operating systems need to use special machine support to enforce protection and to interface with hardware devices. These support mechanisms differ from machine architecture to machine architecture, of course; you wouldn't expect PC binary code to run without change on a Macintosh! To keep things real, we'll present real examples from the Intel PC architecture from time to time. Although many people look down on Intel's instruction set, it has several important advantages: PCs are common and cheap; you've almost certainly used one before; you will use PCs in the labs; and good PC emulators are available, so if you like you can fool around with toy operating systems without rebooting your computer!

So you want to learn x86 assembly language? Here are some tutorials to get you started.

PC Assembly Language, Paul A. Carter, November 2003. 188pp. (PDF copy) (PDF copy, printed 2 pages per sheet)
A clear description of x86 assembly language and assembly language in general, including some stuff you hopefully know already. You might prefer to read this on line, rather than print it out. Warning: This book uses "Intel" assembly syntax, in which instructions are written "instr dst, src"; we will use "AT&T" assembly syntax, in which they are written "instr src, dst".
Brennan's Guide to Inline Assembly, Brennan "Bas" Underwood. (local copy)
A short and sweet description of how to use inline assembly instructions with GCC. Includes a description of the "AT&T" assembly syntax used by GCC.

These reference manuals will help you understand the precise semantics of any instruction we've discussed in class.

Intel 80386 Programmer's Reference Manual (PDF version)
This concise 1986 reference manual describes the features of the 386, which is the first serious x86 architecture from Intel -- it's the first one that supports page-table memory protection, for example. (We'll discuss page tables in more detail in Week 5.)
IA-32 Intel Architecture Software Developer's Manuals
The current Intel architecture manuals are much longer, and describe features of the 486, Pentium, Pentium Pro, and so forth, as well as the 386. These manuals are slightly better written than the 1986 manual, but they are much longer and harder to navigate. There are four volumes:
Volume 1, Basic Architecture
The basics: how procedures are called, the register set, and so forth.
Volume 2A, Instruction Set Reference A-M
Volume 2B, Instruction Set Reference N-Z
The effect of every instruction, listed alphabetically by instruction.
Volume 3, System Programming Guide
Most OS-specific programming will require a dip into this manual, which specifies how to use all the special features of the architecture -- memory management, interrupts, system calls, and so forth.

PC Emulators

These programs let you run operating systems in a virtual sandbox, allowing you to experiment without screwing up your real hardware.

QEMU
A fast emulator (not quite as mature as Bochs, but 50x faster is a big deal). Can run x86 and PowerPC operating systems, among others. Windows and Mac OS X binaries are available.
Bochs
A slow, but stable PC emulator. Windows binaries are available.

PC Hardware

This page has links to a bunch of information on common PC hardware, including disks and the console.