Operating Systems (COL331/ COL633), II Sem, 2015-16
Lab Assignments
Setup
Please ensure you have latest version of:
qemu (package: qemu qemu-system)
g++ (package: g++-multilib >=4.7)
git (package: git-all)
grub2 (package: grub2 grub-pc-bin)
coreutils(for makefile)
In debian/ubuntu, do:
bash$ sudo apt-get install qemu qemu-system g++-multilib git-all grub2 grub-pc-bin
If you are working in GCL, the packages are already pre-installed.
From lab2 onwards, a patched version of qemu would be useful for debugging. Please install the patch version as per the instruction below (on GCL, the package is pre-installed. We just need to refer to appropriate path).
On GCL:
Modify the path variable as (you can add this in your ~/.bashrc file):
export PATH=/home/phd/kedia/os_TA/install/bin:$PATH
On local machine:
wget www.cse.iitd.ac.in/~kedia/os/qemu_patch.tar.gz
On Linux, you may need to install the SDL development libraries to get a graphical VGA window. On Debian/Ubuntu, this is the libsdl-console-dev package.
Configure the source code:
Linux: ./configure --disable-kvm [--prefix=PFX] [--target-list="i386-softmmu x86_64-softmmu"]
OS X: ./configure --disable-kvm --disable-sdl [--prefix=PFX] [--target-list="i386-softmmu x86_64-softmmu"]
The prefix argument specifies where to install QEMU; without it QEMU will install to /usr/local by default. You need to export the same prefix path to your PATH in bashrc.
Run make && make install
Common Instructions for all labs
Submissions: All submissions are to be done on moodle. The submission link will be enabled before the assignment submission deadline and informed. On submitting, an automatic sanity check will be performed and the student will be given feedback on the compliance to submission guidelines. Students are required to look at the feedback and if required, do appropriate corrections and resubmit.
We will be evaluating the submissions on GCL machines. Hence it is must that you check your code to be working on GCL machine before submitting.
Lab Tools Guide is available at the following link.
Piazza: We will be using Piazza for discussing queries and posting updates related to labs. Please register yourself on Piazza at the following link. Students are encouraged to contribute to discussions on Piazza and would be given credits for the same.
Commands:
Commands for cloning the git repository:
On GCL machines, use git clone /home/phd/kedia/os_TA/lab.git
On other machines, use
git clone username@palasi.cse.iitd.ernet.in:/home/phd/kedia/os_TA/lab.git
cd into the lab directory created after running the above command
Run make to build the sources
Run make qemu to boot the kernel into qemu
Once the coding is complete, Run make grade to check for the correctness using automated tests. Fix the errors and rerun the command until you are satisfied with your score.
Perform git commit -m “Meaningful message for commit” when done with the assignment.
When ready to submit, run make tarball to create a tar.gz of the repository. You need to upload this tar.gz file onto moodle at appropriate submission link.
Submission Checklist:
Run your code on a GCL machine and check if it works correctly.
Run "git pull" to fetch the latest environment.
Run “make grade” to ensure the automatic checking passes.
Do "make tarball".
Submit the code on the appropriate moodle link for the lab submission.
Check for feedback provided to you on moodle. If submission is not accepted, rectify the mistake and re-submit.
Lab Exercises
Lab-1 (Due date: 21/01/2016, 11.55 am): Boot, bootloader and printf to console.
Homework-1 (Due date: 27/01/2016, 3PM): Shell and system calls.
Lab-2 (Due date: 17/02/2016, 11.50PM): Memory Management
Late submission penalty: 10% marks will be deducted for every late day.
Homework-2 (Due date: 24/02/2016, 6PM): User Threads.
Lab-3 (Due date: 12/03/2016, 3PM): User Environments
Late submission penalty: 10% marks will be deducted for every late day.
Lab-4 (Due date: 05/04/2016, 3PM): Preemptive Multitasking
Late submission penalty: 10% marks will be deducted for every late day.
Lab-5 (Due date: 13/04/2016, 3PM): Lab5/Project.
Late submission penalty: 10% marks will be deducted for every late day for Shell.
Reading Materials:
Getting Started with x86 assembly
If you are not already familiar with x86 assembly language, you will quickly become familiar with it during this course! The PC Assembly Language Book is an excellent place to start. Hopefully, the book contains mixture of new and old material for you.
Warning: Unfortunately the examples in the book are written for the NASM assembler, whereas we will be using the GNU assembler. NASM uses the so-called Intel syntax while GNU uses the AT&T syntax. While semantically equivalent, an assembly file will differ quite a lot, at least superficially, depending on which syntax is used. Luckily the conversion between the two is pretty simple, and is covered in Brennan's Guide to Inline Assembly.
Familiarize yourself with the assembly language materials mentioned below. You don't have to read them now, but you'll almost certainly want to refer to some of this material when reading and writing x86 assembly.
We do recommend reading the section "The Syntax" in Brennan's Guide to Inline Assembly. It gives a good (and quite brief) description of the AT&T assembly syntax we'll be using with the GNU assembler in JOS.
Certainly the definitive reference for x86 assembly language programming is Intel's instruction set architecture reference, an HTML edition of the old 80386 Programmer's Reference Manual, which is much shorter and easier to navigate than more recent manuals but describes all of the x86 processor features that we will make use of in the course; and the full, latest and greatest IA-32 Intel Architecture Software Developer's Manuals from Intel, covering all the features of the most recent processors that we won't need in class but you may be interested in learning about. An equivalent (and often friendlier) set of manuals is available from AMD. Save the Intel/AMD architecture manuals for later or use them for reference when you want to look up the definitive explanation of a particular processor feature or instruction.
Acknowledgements: This lab series has been taken from MIT course 6.828 on Operating Systems.