Welcome to CS258, Winter 2017. Previous years' materials are in directories 2009/ -- 2016/. IMPORTANT: make sure that my email sergey !AT! cs . dartmouth . edu is whitelisted in your Dartmouth email. In the past, our MS Exchange threw my class mailings into spam. So much for "cloud" email. Grading policies: 50% midterm, 50% final project. The final project will be take-home. You will be expected to produce working kernel code for a real-life OS (Linux, Illumos/OpenSolaris, Android, or even Windows) implementing or in-depth exploring an "advanced" OS feature. For some sample topics, see project-topics.txt. 1. Listen to Bryan Cantrill's talk on the history of innovation in Solaris: http://www.youtube.com/watch?v=-zRN7XLCRhc (blog link with slides: http://smartos.org/2011/12/15/fork-yeah-the-rise-and-development-of-illumos-2/) This talk, besides a history of adavnced features we are going to study has much wisdom on project management and history of Unix. 2. Unless you are using a Linux computer, install a Linux distribution in a virtual machine. I will be using VirtualBox (http://virtualbox.org) with Ubuntu (http://www.ubuntu.com/) and/or Debian (http://debina.org/) and then with OpenIndiana (http://openindiana.org/) distributions. I'll expect you to go along with my shell sessions in class. 3. If you haven't encountered x86 assembly before, read A Tiny Guide to Programming in 32-bit x86 Assembly Language, by Adam Ferrari http://www.cs.dartmouth.edu/~sergey/cs258/tiny-guide-to-x86-assembly.pdf 4. More about the x86 architecture is in the Solaris on x86 book, solaris-on-x86.pdf. Read Chapters 2.1, 2.3 and 3.1--3.3 (you may skip 2.2 if you understand endianness; you may skip 3.3.3). You will find a simple program in examples/print5.c , together with disassemblies (done with "objdump -d") of its versions compiled for 64 bits ("gcc -m64 -Wall -o print5 print5.c") and 32 bits (use "-m32" instead) in print5-objdump.txt and print5-32-objdump.txt. Look for the functions main and printmsg (labeled "
:" and ":") and try to read them. [What's all that other code, like "_init" and "plt"?? We'll get to that.] Note: in the 32-bit version of main, you will see some code before the standard "push %ebp; mov %esp, %ebp" preamble. This is new in GCC, we have not seen it in class. Ignore it for now; it aligns the stack pointer on a 16-byte boundary. Note: disassembled code on your machine may differ---it depends on the compiler version, a lot. 5. Other resources/links I mentioned today are in resources.txt (in this class directory) 6. Books: Textbook: Solaris Internals by Richard McDougall and Jim Mauro (Second edition) (http://www.amazon.com/Solaris-Internals-OpenSolaris-Kernel-Architecture/dp/0131482092) Currently, many vendors on Amazon offer this book used, at significant savings; watch that you have the right (second) edition. Other reading: Linkers and Loaders, John Levine Free online: http://www.iecc.com/linker/ or http://www.amazon.com/Linkers-Kaufmann-Software-Engineering-Programming/dp/1558604960 Supplemental reading if you are new to PC internals & architecture: Linux Assembly Language Programming, by Bob Neveln http://www.amazon.com/Linux-Assembly-Language-Programming-Neveln/dp/0130879401 This book is unique in its approach. It is not really about "assembly programming for Linux", it actually explains computing from the ground up, from the basic physics of implementing a bit in memory, to core PC IO. Linux and assembly are only icing on the cake. If you are interested in Linux kernel programming for your project, consider http://www.amazon.com/Linux-Kernel-Programming-Michael-Beck/dp/0201719754 or http://www.amazon.com/Linux-Kernel-Development-3rd-Edition/dp/0672329468/