Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Assignment Study Guide for Operating Systems | CMSI 387, Assignments of Operating Systems

Material Type: Assignment; Professor: Dionisio; Class: Operating Systems; Subject: Computer Science; University: Loyola Marymount University; Term: Spring 2008;

Typology: Assignments

Pre 2010

Uploaded on 08/18/2009

koofers-user-e1t-1
koofers-user-e1t-1 🇺🇸

5

(1)

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CMSI 387
OPERATING SY S T E M S
Spring 2008
Assignment 0403
Here, finally, is the concrete assignment for getting your hands nice and dirty with the ext2 file system.
Not for Submission
For the current class material on process manage-
ment, read SGG Chapters 3–7. For this week, we
covered Chapters 3 and 4.
For Submission
The Short Version
Make an ext2 disk image, mount it, put some files
on it, print the user view of the file system (i.e., a
series of ls invocations), dump the disk image to
hex, print and annotate the dump, then turn in
your listings and annotated dump on hardcopy.
The Long Version
1. To create the disk image, you’ll need to learn
how to use the dd (“disk dump”) command.
The following example creates a new file called
image consisting of 1024 default-size blocks,
and initializes its contents with zeroes:
dd if=/dev/zero of=image count=1024
2. You should now have a file that is equivalent to
a brand-new, unformatted disk. “Format” it be
installing an empty ext2 file system on it:
mke2fs image
3. Mount the disk image — since this is typically a
privileged operation, Caskey has made “special
arrangments” for you to do this:
a. You can only do this on stewart.cs.lmu.edu.
b. To mount the disk image, use the special
mount-loop script in ~metropolis/sbin:
~metropolis/sbin/mount-loop image
c. This mounts the file system on /mnt/<your-
username>. To unmount, invoke:
~metropolis/sbin/umount-loop
d. That should do the trick; if these scripts
don’t work, let us know ASAP.
4. Create the following items within that mounted
file system:
a. A non-empty text file at the top-level di-
rectory of the file system
b. A directory at the top-level directory of the
file system
c. A second non-empty text file inside that
subdirectory (give it different content so
you can differentiate the two files)
d. A symbolic link inside that subdirectory to
the text file in the top-level directory
e. A hard link from the top-level directory to
the text file in the subdirectory
5. Run a series of ls commands on the now-
populated file system, and print the output.
Feel free to use various ls switches (e.g., -F, -l,
-a, -i, etc.) to show as much interesting informa-
tion as possible.
6. Dump the disk image file to hex via hexdump
-C, print out the hex dump, then annotate it to
identify these items:
a. The disk image’s superblock
b. The directory entries for the files, links, and
directories that you created
c. Where applicable, the inodes for the items
that you created
d. Where applicable, the data blocks occupied
by these items
How to Turn It In
Submit your file listings and annotated dump on
hardcopy. You may commit any of the digital arti-
facts you create to CVS if you wish, but for this
assignment I’ll focus on the hardcopy.

Partial preview of the text

Download Assignment Study Guide for Operating Systems | CMSI 387 and more Assignments Operating Systems in PDF only on Docsity!

CMSI 387

O P E R A T I N G S Y S T E M S

Spring 2008

Assignment 0403

Here, finally, is the concrete assignment for getting your hands nice and dirty with the ext2 file system.

Not for Submission

For the current class material on process manage- ment, read SGG Chapters 3–7. For this week, we covered Chapters 3 and 4.

For Submission

The Short Version

Make an ext2 disk image, mount it, put some files on it, print the user view of the file system (i.e., a series of ls invocations), dump the disk image to hex, print and annotate the dump, then turn in your listings and annotated dump on hardcopy.

The Long Version

  1. To create the disk image, you’ll need to learn how to use the dd (“disk dump”) command. The following example creates a new file called image consisting of 1024 default-size blocks, and initializes its contents with zeroes: dd if=/dev/zero of=image count=
  2. You should now have a file that is equivalent to a brand-new, unformatted disk. “Format” it be installing an empty ext2 file system on it: mke2fs image
  3. Mount the disk image — since this is typically a privileged operation, Caskey has made “special arrangments” for you to do this: a. You can only do this on stewart.cs.lmu.edu. b. To mount the disk image, use the special mount-loop script in ~metropolis/sbin : ~metropolis/sbin/mount-loop image c. This mounts the file system on /mnt/<your- username>. To unmount, invoke: ~metropolis/sbin/umount-loop d. That should do the trick; if these scripts don’t work, let us know ASAP.
  4. Create the following items within that mounted file system: a. A non-empty text file at the top-level di- rectory of the file system b. A directory at the top-level directory of the file system c. A second non-empty text file inside that subdirectory (give it different content so you can differentiate the two files) d. A symbolic link inside that subdirectory to the text file in the top-level directory e. A hard link from the top-level directory to the text file in the subdirectory
  5. Run a series of ls commands on the now- populated file system, and print the output. Feel free to use various ls switches (e.g., -F , -l , -a , -i , etc.) to show as much interesting informa- tion as possible.
  6. Dump the disk image file to hex via hexdump -C , print out the hex dump, then annotate it to identify these items: a. The disk image’s superblock b. The directory entries for the files, links, and directories that you created c. Where applicable, the inodes for the items that you created d. Where applicable, the data blocks occupied by these items

How to Turn It In

Submit your file listings and annotated dump on hardcopy. You may commit any of the digital arti- facts you create to CVS if you wish, but for this assignment I’ll focus on the hardcopy.