OS Lab Account Assignment

Please refer to the table below for your personal OS lab account. The first column shows the last four characters of your matriculation number. The second column shows an integer X. Your username to login into your personal OS lab account is userX. The password is also userX.

For example, if the second column shows X is 234, then your userid is user234 and your password is user234.

Remember, you need to do two things immediately after logging in (please refer to previous post https://blog.nus.edu.sg/cs2106/2011/08/26/os-lab-accounts/): (i) change your password using yppasswd, (ii) disable caching in Firefox.
Continue reading

OS Lab Accounts

You will be given a personal OS Lab account to login to the Linux machines in the OS Lab this week. This account is different from SoC UNIX account that you use to log into SunFire, and is different from the common OS Lab account you use in Lab 1.

Here are the differences.

SoC UNIX account: You get this account either automatically (if you are an SoC student) or through application online. With this account, you can ssh into SunFire, a server machine running SunOS, from any other computers running any OSes, including your home computer, as long as you have an ssh client.

Common OS Lab account: The username for this account is oslab-user. You can use this account to login into any of the computers in the OS Lab running Fedora 14. This is a common account, meaning if you leave your files in your account, other users who has access to this common account can access it. From Lab 2 onwards, we will not be using common OS lab account anymore so you can forget about this.

Personal OS Lab account: This is the account we are giving out today (see the next post). With this account, you can login into any of the computers in the OS Lab running Fedora 14. If you should set a password known only to you, other users cannot login to the machines and access your files. Furthermore, you can login into any of the machines in the OS Lab, and get access to your files (we are running NFS). The Personal OS Lab account comes with a quota of 50 MB disk space.

The first thing you do after you login is to change your password using the command yppasswd.

Using Firefox would easily eat up all your disk quota (due to caching). So the second thing you should do after you login is to disable caching in Firefox. Do the following in Firefox to disable caching.

1. Type about:config in your address bar

2. Type ‘cache’ in the search bar, and look for network.http.use-cache, and double click it to set it to false.

If some files are already created by Firefox, you can issue the following command to remove the files and save some disk space.

r­m -rf ~/.mozilla

When working with your Personal OS Lab account, you should save and backup your files often. If you hit the disk quota and run out of space, you files might not be saved correctly!

Lecture 3: Processes and Threads

26 August, 2011

The lecture will start with a continuation of our unfinished discussion on C programming.

Then, we will delve deeper into process management and introduce the concepts of threads. After this lecture, students should be familiar with the concepts of processes, process control block, process table, context switching, process ID, process management system calls, and multi-threaded processes.

Having a hardcopy of slides during lecture would be helpful. Be prepare to take notes during lecture.

Download Slides: PDF

Download example code here.

Reading:

  • Section 2.1 (up to and include 2.1.6): Process
  • Section 2.2 (up to and include 2.2.2): Threads

Related Wikipedia entries are listed below. These are for students who are keen to go beyond what is covered in CS2106. Read the articles with a critical mind since Wikipedia is editable by anyone.

Here are related man pages: wait | exec | exit | fork

Lab 1

Here is your Lab 1.

Lab 1 is ungraded and you need not submit you lab sheet. It aims to familiarize with basic UNIX commands, the C programming language (particular, pointers), and C programming tools on UNIX (compiler and debugger).

Lecture 2: Basic OS Concepts and Programming in C

19 August, 2011

In this lecture, we will first go through some basic concepts in an OS, including process, address space, file, and shell. We will then revisit how a system call is implemented in more detail. In the second half of the lecture, we will briefly introduce C programming, with an emphasis on pointers.

Download Slides: PDF

Having a hardcopy of slides during lecture would be helpful. Be prepare to take notes during lecture.

Reading:

  • Section 1.5: Concepts in OS.
  • Section 1.6: System calls (1.6.1 onwards are FYI at the moment — will visit them in details later in the semester).
  • Section 1.8: The world according to C.
  • Section 10.1, 10.2: Basic background on Linux (FYI)

Useful Materials on C for Java Programmers (from other universities)

Related Wikipedia entries are listed below. These are for students who are keen to go beyond what is covered in CS2106. Read the articles with a critical mind since Wikipedia is editable by anyone.

Pre-class Activity 2

Perform the following on either MS Windows, Mac OS X, or Linux:

  • MS Windows: Type Ctrl-Shift-Esc to bring up the Task Manager and choose the tab “Applications” and “Processes”
  • Mac OS X: Run Activity Monitor (found under Applications / Utilities) and choose the tab “CPU”.
  • Linux: Open the terminal and type ps -eaf.

What do you see? What are the attributes shown? What do they mean? Explore the options/preferences/command line arguments for the respective tools you used.