Fall 2005 |
Clay Shields |
Project 1 - Disk Capacity Calculator
Assigned: Sept. 21 |
Disk Space CalculatorThis semester we will be doing some projects that relate to computer forensics. Computer forensics is the art and science of examining a computer to find evidence about what the computers users have been doing. As we know, the computer hard drive is the only place on the computer where information remains after the power is turned off. A single hard drive might have tens or hundreds of thousands of different files on it, in addition to other informative artifacts left by programs and the operating system in the course of their normal operation. There are a surprising number of disk artifacts which include the times and dates files were viewed, moved or deleted; copies or remnants of deleted files; files that have been printed, even if they were not saved; automatically stored versions of web pages, images, and e-mails the user saw; transcripts of chat sessions; and information from programs that were running in memory but were saved to disk temporarily. For this first assignment, we are going to learn about hard drives and how they work. First, you should read this description of hard drives from HowStuffWorks.com to understand what is going on inside the drive. You can also read the Wikipedia entry for more detail. A computer hard drive consists of a stack of flat platters, commonly made of glass coated with a magnetic material. It also has a number of arms that have magnetic read/write heads can read and write magentic bits onto the surface of the platters. The platter surface is organized into tracks, which are data traces that run in concentric circles on the platter. The series of tracks across the stack of platters makes up a cylinder. Each cylinder is divided into sectors. To find the capacity of the drive, we can multiply the number of heads in the drive by the number of cylinders by the number of sectors per track to find the total number of sectors on the drive. Each sector holds 512 bytes of data. Multiply these two together to find the capacity of the drive in bytes. Drive manufacturers market drives based on their capacity. The number of bytes per drive is pretty huge, so rather than print the total number of bytes, drives are marketed as having a number of gigabytes, a gigabyte being several billion bytes. They quite naturally make their drives look as large as possible, so they use decimal gigbytes, or 109 bytes. Computer operating systems, however, use binary gigabytes properly named gibibytes which are 230 bytes. The table below shows decimal and binary measures of bytes.
Your AssignmentFor this project, you will write a program that takes for input the number of cylinders, sectors, and heads on a hard drive. It will then compute the capacity of the drive in bytes, and then output the capacity in both decimal and binary measurements. Below is the output of a program that does this:gusun> ./disks You can also run a version of a program that does this yourself, by logging onto gusun and typing ~clay/disks. This can be helpful in testing your own program. Part 1 - Design DocumentFor the first part you are to submit a design document showing the algorithm you plan to implement. Write it out neatly using a language which is similar to that from Homework 1 and has the following terms:
statement ... statement end
Part 2 - Program Source CodeImportant: Your output and input should be very similar to that shown in the example program. Please ask for the input in exactly the same order shown and only request the same items shown - do not ask for any other input. This will assist in grading your program.Include the following header in your source code. // // Project 1 // Name: <your name> // E-mail: <your e-mail address> // COSC 071 // // In accordance with the class policies and Georgetown's Honor Code, // I certify that I have neither given nor received any assistance // on this project with the exceptions of the lecture notes and those // items noted below. // // Description: <Describe your program> //
You will submit your To submit your program, make sure there is a copy of the source code on your account on gusun. You may name your program what you like - let's assume that it is called disks.cc. To submit your program electronically, use the submit program like we did in Homework 2, but with the command: submit -a p1 -f disks.cc I will not be enabling the electronic submission until after the design documents are in, so don't try to submit too early. |