ECS150: Introduction to Operating Systems

Submitting Code

None of the machines in the MINIX lab are networked; thus, in order to get a hardcopy of your source code, you must copy those files to a floppy. The MINIX lab floppies are 1.44 MB disks and are accessed through device /dev/fd0.

Using an unformatted disk (TAR)

Copying Code to a Floppy

To submit your files on an unformatted floppy, it is probably best to copy them straight to disk, because the amount of code you submit will not be a lot (eliminating the need for compressing and archiving data). For example, assuming your files are in a subdirectory called assignment1 in your current directory:

# tar cvf /dev/fd0 assignment1

This should create a disk image of your files.

Copying Code from a Floppy

Once your code is on a floppy, it would be nice to get it back off again. Any PC should be able to access the disk, but accessing it from the CSIF labs would be prefered. Below, I describe how to access the disk from a DEC ULTRIX machine.

The DEC's in the CSIF labs are equipped with 2.88 MB floppies; these will accept a standard 1.44 MB floppy as well. The floppy drive is accessed via /dev/fd0a on the ULTRIX machine. To copy a file from the disk, from your directory type:

# tar xvf /dev/fd0a

Using a Formatted Disk (CP)

If you have created a floppy disk with a MINIX partition on it (for example, if you have a bootable floppy or you created a floppy filesystem using the mkfs(1) command), you cannot use tar to copy the file over as this will destroy your data. In this case, you must mount the drive. To do this, do the following:

! mount /dev/fd0 /mnt

Note that mounting a MINIX drive will only work if the floppy is in the machine and it has a MINIX parition on it. Once you have mounted the floppy, you can copy as normal.

! cp file1.c /mnt  # copies to the disk
! cp /mnt/file1.c . # copies from the disk

Once you are done using the disk, you should unmount it using the umount command:

! umount /dev/fd0

After you unmount the drive, it will be inaccessible.

Note: If you are mounting a floppy, remember to use the "sync" command to flush data to the disk, otherwise you could end up losing your work.

Note 2: You will not be able to mount a Minix disk from a DEC ULTRIX machine. I strongly suggest that you put copies of your code in your CSIF accounts, since we have had problems with code being lost. In order to do this, of course, you will need to use the first method (which uses tar).

Printing

If you are on the DEC's, I suggest using enscript to print out your documents:

! enscript -2rGh file1.c

enscript prints two pages per single sheet of paper, thus saving your quota.