./p4.x disk.img IPC~1.HTMshould copy the file named IPC~1.HTML from the root directory of the file system whose image is stored in disk.img. The files copied can be of any length.
(Advanced) For files not in the root directory, the path will be given in upper case with a forward slash (/) separating the directories. There should be no separator at the beginning of the path. For example,
./p4.x disk.img F2003/INDEX~1.HTMshould copy the INDEX~1.HTM file from the F2003 subdirectory of the image file to a file called INDEX~1.HTM in the current directory.
Here is a partial list of the files in the image. Directories are listed followed by the files and subdirectories they contain. Most of these files should be human-readable.
F2003
EXAMPLES
EXECVP.C
ZOMBIE.C
ADDRES~1.C
INDEX~1.HTM
HOMEWORK
INDEX~1.HTM
HWK4~1.HTM
SCORES
PROJECTS
P1
PROJ1~1.HTM
FACTOR~1.CPP
INTQUEUE.CPP
INDEX~1.HTM
P2
PROJ2.TAR
PROJ2~1.HTM
MAIN.CPP
HTML
DOXYGEN.PNG
INDEX~1.HTM
ANNOTA~1.HTM
P2.OUT
P3
PROJ3~1.HTM
S2004
INDEX~1.HTM
PROJECTS
INDEX~1.HTM
P2
PROJ2~1.HTM
BUFFER.H
BUFFER.CPP
P1
PROJ1~1.HTM
P3
P3TAR~1.GZ
PROJ3~1.HTM
SCORES
IPC~1.HTM
DEADLO~1.HTM
Here are copies of a few of the files to compare your output to:
mkdir /mnt/image mount -o loop ~knoppix/disk.img /mnt/imageand then browse the /mnt/image directory to see what other files are in the image. These commands must be issued in the root shell, so press Control-Alt-F2 to switch to the root shell and then Alt-F5 to switch back.
Beware that the MS-DOS names may be different than the long file names. For example, the file processes.html would be called PROCES~1.HTM.
Read all relevant file system parameters from the boot sector -- don't assume parameters will be the same for every file system.
Under g++, short is the 16-bit integer type and char can be used for a 8-bit integer.
If you read data into a char array but you need to get a 16-bit or larger value, you will have to use some typecasts. For example if boot is an array of chars containing data read from the boot sector, then *((unsigned short *)(boot + 11)) will get the sector size (a 16-bit integer stored at offset 11 in the boot sector). An alternate method is to use a struct whose fields are aligned in the same way as the fields on disk. Beware, however, that g++ insists on aligning arrays and 16-bit (or larger) values on even offsets. See the example of reading the boot sector in read_boot.cpp.
Remember that normal directory entries won't have 15 (0F hex) as their attribute byte and won't have names that start with a null character (which is used to indicate the end of a directory) or character 229 (E5 hex) (which is used to mark deleted files).