CS 3733 Operating Systems, Spring 2003 Assignment 0


Due Thursday, January 23, 2003

Assignment 0 has 6 parts.


Part 0:
Access the web site: /classes/cs3733s2003 and find out about assignment 1.

Part 1:
Make sure that you have had your picture taken. If it was not done after the first or second class, come to my office.

Part 2
If you have not already done so, create a web page for yourself.
The address of your web page should be http://www.cs.utsa.edu/~username. Create a course web page with web address http://www.cs.utsa.edu/~username/cs3733/index.html. This should be globally accessible. Your course web page should be very simple without much graphics so that it will load quickly over a phone line.

The permissions of the public_html and cs3733 directories should be drwxr-xr-x and the permissions of the index.html file should be -rw-r--r--.

If you are not familiar with creating HTML files, you may want to use the template available in here. Put the file index.html in your ~username/public_html/cs3733 directory. Edit this file and insert your name in two places.

Part 3:
Make sure you can send and receive mail using your CS account. You may have the mail sent to your CS account forwarded to another address, but be sure that the address is valid. If you send me email from another account, please make sure you identify yourself as a student in CS 3733. I will be sending mail to the class on a regular basis from the CS3733 account. Please do not respond to this email or send email to this account. The class web site will contain copies of this mail. If you are not receiving this mail, you must notify me.
Do not include any attachements in email to me, unless you are specifically asked to do so. Make sure you know how to include a small ASCII file in an email message without using an attachment.

Part 4:
Write a function with the following prototype:
int readline(int fd, char *buf, int nbytes);
       fd will be an open file descriptor
       buf is a buffer of size at least nbytes
This function will read bytes from fd into buf until one of the following occurs:
       an error
       an end of file
       a newline symbol has been read
       nbytes-1 have been read.
If an error occurs, return -1.
If an end of file occurs, return 0 if no bytes have been read yet. Otherwise, return -1.
If a newline is read, insert the newline in the buffer, followed by a string terminator and return the number of bytes read.
If nbytes-1 bytes have been read without receiving a newline, return -1.
Debug your function as well as you can. The function sould not perform any I/O other than reading from the given file descriptor. It should have no side effects, and in no circumstances should it write more than nbytes to the buffer.
Your goal in writing this function is to make it correct and simple to understand.

Part 5:
When you have completed the other parts of the assignment and have received at least one class email, send me email at srobbins@cs.utsa.edu informing me that you have completed all parts of Assignment 0. The subject line should be
CS 3733 Assignment 0
This email must be sent directly from your CS Sun account.
The body of your mail message should contain a statement indicating that you have completed the prerequisites for the course and indicate how you satisfied each prerequisite. For example you can state that you took CS 2413 at UTSA last semester and took CS 2734 and CS 3233 the semester before.
Alternatively, you can attach a copy of an email message from me to you in which I state that you may take the course without having formally completed the prerequisites. This course is oversubscribed and those without the prerequisites will need to wait until another semester to take this course.

Also include a statement about your C programming ability. The ability to program in C and to be able to manipulate strings and pointers is a requirement for this course.

At the end of your email, insert the code for your readline function. Remember, this should not be an attachment.

If you are not prompted for a subject line when you send mail, insert an alias in your .cshrc as follows:
alias mail mailx
source your .cshrc and try again.