There are restrictions on the use of the Lab facilities:
Note: I strongly encourage you to subscribe with your Stony Brook CS account. This will ensure that mail will arrive to you more quickly, and that you are less likely to run out of your mail quota than if you were using some other ISP's mail service. If I post an important message to the class list, and you don't get it because your mail quota has exceeded, I may get a bounce back saying so, but I will have no way to communicate back with you. It is therefore your responsibility to ensure that you can always read the class mailing list and to stay current with what I post there.
Finally, please do not set your list subscription mode to Digest because digests can take several days to get emailed to you.
Please note that you will get an OSLAB account that will allow you to log into several machines. Do not send email to the TA or the instructor from these machines, nor should you expect to get email sent to you on these machines; they are not configured for email processing. Please do all your email communication through whatever email means and email ID you were using outside these labs (e.g., CS's MS Exchange email system). It is particularly important that you follow these instructions to ensure that you could communicate with the teaching staff promptly.
Note, find out which ESX server you were assigned to. So you can login to that server for your VM. Consult this assignment list.
Note also that you're logging in directly the unix root superuser! You have to be very careful when using the root user, as it is easy to damage your VM. For that reason, the VMs you get by default already have a base snapshot, and you're encouraged to take more snapshots of your VM as needed. Keeping the last couple of snapshots around is useful, but please also don't start snapshotting every five minutes.
You can only login to the vlXXX machine using root, not your AD password. The default root password for your VM will be given to you in class. Please do not share it with anyone else. And please change it as soon as you login, to prevent others from logging into your VM inadvertently.
Lastly, please be nice to your classmates. When you are not actively working on your VM, please shut it down or suspend it; that will release more memory and CPU resources for other VMs. You can bring always bring you VM back up quickly at any time later.
WARNING: Do not share the root VMware password with anyone else outside class!!! In addition, do not use your vmware root privileges for anything other than to perform your homework assignments for this class. Any deviation or abuse of your privileges will be result in your account disabled, a grade of "F" for the class, and a referral to the Academic Judiciary Committee.
Nevertheless, a number of people experienced with Linux sometimes choose to work on their assignments elsewhere: at home, at work, in a dorm, on a personal laptop, etc. That is OK. However, it is solely your responsibility to ensure that your code is working and properly committed on the OSLAB VMware machines! If you choose to develop your code outside the OSLAB, be sure to give yourself enough time to migrate it into the VMware machines, test it there, debug it as needed, commit it to CVS, check out a test copy and test it, etc. Don't assume that just because it worked for you outside the lab, that it'll automatically work in the lab: there could be many reasons why your code may not work in other settings. We will not allow people to bring laptops or other machines to demo their code. We will not accept excuses such as "but it worked for me at home" or "it really works --- I just need to copy it over."
If you do choose to work elsewhere on your assignments, we recommend that you duplicate the same exact environment we have on the VMware machines (Red Hat Linux 9 with all of the latest patches, configured properly). We will try to help you to set up your personal machine appropriately, but please realize that our time and resources are limited to official class matters. Unfortunately, we do not have the time to help each student in the class to set up a separate, personal work environment, especially on esoteric machines. That's why we worked hard to prepare a standard work environment using VMware for the entire class.
The following annotated example shows you step by step the commands needed to build a Linux kernel:
ssh -p 130 root@myhost.cs.stonybrook.eduwhere myhost is the DHCP hostname of your VM (e.g., "vl321" as shown above). You can only login as root to the dNNN machine, with the password that will be given in class; don't try to use your AD password.
Note: from now on, all your commands should be executed inside your own virtual machine, the one you just rebooted.
cd /usr/src
git clone ssh://user@scm.cs.stonybrook.edu:130/scm/cse506git-s19/hw1-userwhere user (twice in the above command) is your AD username. You'll be prompted for your CS AD password.
The initial checking out (or "cloning") of the git repository will take some time. Using your checked out repository afterward will be faster. Note that the first assignment must be done in Linux version 4.x (where "y" is whatever's the latest sub-release). The source code repository cloned for each student already uses a specific kernel version for you to use. Subsequent assignments may be required to use a different version of the kernel. In that case, replace "4.x" in the instructions the follow with the newer version of the kernel.
cd hw1-user
CAUTION: While I provide some detailed instructions below, your general goal is to build the smallest kernel you can, with as few features as possible, such that it does not failed to boot or produce any errors during the boot of the (CentOS) Linux image. If you take off too many features, your system may not boot, or will boot with errors. Note that sometimes it is also important whether a feature is enabled as a loadable module or compiled statically into the kernel image.Use the command below to configure your kernel. You can also use "make config" for line-by-line configuration.
make menuconfig
Note: if you find that certain packages are missing on your VM, you can install them using the "yum" utility. For example, to fully run the menuconfig option, you may have to install the Ncurses development library with:
yum install ncurses-devel
make
Note: in the following instructions, commands which appear in red are executed as root. Then run these commands:
/bin/su -
make modules_install
make install
emacs /etc/grub.conf # or grub2.confThe entry you can add has the following text:
# to boot from the first IDE drive, first partition title test kernel (2.6.30.5 ide) root (hd0,0) kernel /boot/vmlinuz-2.6.30.5 ro root=/dev/hda1 # to boot from the first SCSI drive, first partition title test kernel (2.6.30.5 scsi) root (hd0,0) kernel /boot/vmlinuz-2.6.30.5 ro root=/dev/sda1Be careful not to change anything else in grub.conf, or you could render your system unbootable and then you'll need to reinitialize your vmware. In particular, leave behind the original entry for the default Red Hat kernel. When you're done adding the new kernel entry to grub.conf, save the file, and exit the editor.
rebootWhen the system will boot, you will see a GRUB menu that now lists two possible kernels to boot. The second (default) one is the one that came with the system and is always good to boot into as a backup solution. The first entry should be the one that you just installed. Use the arrow keys to select the first one, the one you just installed, (within 10 seconds) then hit ENTER to select it. Your system should now boot your new kernel. When it comes up, login as yourself to ensure that everything appears to be in working order.
Do not wait until the last minute before submission time to figure out how to submit your homework assignment. Learn these procedures well ahead of time, experiment with them, and try and try again. You can submit your assignment as many times as you'd like, but we will consider the last set of files you've submitted as the ones you want us to grade. Don't be late because we won't accept late submission excuses such as "GIT didn't work for me."
To simplify matters for you we've set up GIT repositories for everyone.
Warning: protect your homework from accidental loss! All of the files you have in your VM directories are not being backed-up. That means that if you remove your files my mistake (happens a lot, often right before a due date), you will lose all of your data and won't have anything to submit. Using GIT you can make a copy of your files and more: record each version of your files as you change them. It is your responsibility to use GIT often. The graders will not accept excuses such as "I just removed all my files and can't submit my homework."
ssh -p 130 root@myhost.cs.stonybrook.eduwhere myhost is the DHCP hostname of your VM (e.g., "vl321" as shown above).
cd /usr/src
git clone ssh://user@scm.cs.stonybrook.edu:130/scm/cse506git-s19/hw1-userwhere user (twice in the above command) is your AD username. You'll be prompted for your CS AD password.
The initial checking out (or "cloning") of the git repository will take some time. Using your checked out repository afterward will be faster. Note again that this checkout procedure must be done only once: repeating it can confuse GIT into using recursive repositories, and your homework could be lost.
git add newfile.cIf you have other files to include in your submission, you should "git add" them as well. But, do not submit or add/commit binaries or other object files: those can be produced easily by running "make".
mkdir test git add test
git diff
git status
git update-index changedfile.c
git commitBe sure to provide a suitably detailed commit message to explain what you did.
git push
git log | more
Lastly, you can check out a second, temporary version of your own committed files and verify that they compile and run as you expect them to:
cd /tmp git clone ... cd hw1-user git log | more # configure/test kernel, etc.