dft v0.0.1j Andrew J Wales (andrew.wales@virgin.net) 1st November 1998 Description ----------- dft is used to transfer files from an ext2 hard disk partition to the current dos partition. The program works in a similar way to ftp. Background ---------- I wanted some way to access my Linux files under Windows without having to reboot into Linux and then back again. Perhaps when dosemu supports Windows seamlessly, this program will be redundant, but for now it represents the only realistic solution. This program was written to give me something to do over the Christmas break. I believed that such a program would be possible, but had no knowledge of any filesystems other than DOS. My inspiration was a Linux program called lde, which is a sort of sector editor for ext2 partitions (among others). Reading the documentation for this, I got an idea of how the ext2 filesystem works. It was then a matter of implementing to program in the DOS environment. Please bear in mind that for this version, only very limited testing has taken place. The program works fine on my PC, and the partdisp program also works on a friend's RiscPC running a strange sort of PC emulator involving a hardware/software combination. To give it the ultimate test, partdisp was tried on an Amstrad 1640 (circa 1987?) with a 20Mb MFM(?) hard drive, and after thinking about it for a while, it worked! But, somebody somewhere will have some strange device that dft will choke on. If this is the case, please write to me. NOTE: dft/partdisp will not read CDROMs/floppies. NOTE: Neither dft nor partdisp ever write to an ext2 partition. NOTE: At the request of a faithful dft user, the check for the magic number has been relaxed. If the magic number is not found, a warning is printed, but it is still possible to proceed, if the partition is opened with the open! command. Operation --------- Please consult the file dft.man, which is in this distribution. Distribution ------------ I have deliberately placed few restrictions on the distribution of dft/partdisp, in keeping with the entire Linux project. Copy it freely. However, for the first few releases, I only want to distribute it by email. The reason for this is so that I can see how much demand there is for this. I also want to maintain a user list, to aid distribution of later versions/information. For this reason, I will not be posting the distribution to any newsgroup, nor uploading to any ftp site. Please don't let this stop you distributing it, however. If somebody you know wants a copy, please give it to them. Ask them to mail me and let me know that they are using it, and I'll add them to the user list. But it's not the end of the world if they don't. Also, please don't rip me off. I have written programs before that others have tried to pass off as theirs. I am getting sick of this, and while I want to encourage distribution of this package, I cannot condone any type of plagiarism. However, I don't care how the program gets around, as long as it does, the credits remain unchanged, and I get some feedback. Source Code ----------- People have asked me why I haven't released the source code, in order to make this a legitimate GNU license program. My usual answer is that few people have a pascal compiler for DOS, so the source code would be next to useless. However, it may be closer to the truth to say that the code is so horribly written I would hate anybody else to see it :) Revision History ---------------- v0.0.1a 11/01/96 * First version, extremely basic v0.0.1b 30/01/96 * Minor changes * Check for magic number no longer enforced * File transfers are timed * Block dumping command added v0.0.1c 15/02/96 * Quite a major revision ;) * Now actually works if the ext2 partition is not the first on the disk * Missing magic number overriding changed v0.0.1d 18/02/96 * DOS shell commands added. Precede a DOS command with ! * Auto-open * Display of current path (partially complete) v0.0.1e 04/03/96 * Fixed DOS shell bug * Error message displayed if invalid command typed * ini file * Colour ls * fakeget command * Multiple directory cd * Piping of ls output * Reads the hard drives in reverse order (to fix a minor problem) * Some smart buffering of the DOS output * echo command (really only useful in ini file) v0.0.1f 07/03/96 * New (internal) readln command. Additional line editing features available (when I write them) * Now supports files with holes. Did I really miss this? * Parse command fixed (entering a command consisting just of spaces no longer crashes) * cdi directory display bug fixed * Switches added to ls command, e.g., ls -al, ls -l, ls -a, ls * Fixed a silly silly silly bug regarding files with lengths of multiples of 1024 bytes v0.0.1g 14/04/96 * Some internal optimisations, which decreased transfer times by over 20% * Fixed a minor problem with ls * Some more internal optimisations (throughput increased by another 10%) * Fixed the bug with fakeget * df command * The ini file has been renamed to an rc file, which seems a much more appropriate choice v0.0.1h 18/04/96 * partdisp now detects if an invalid parameter is given * It is no longer necessary to close a partition before quitting v0.0.1i 31/10/98 * Debugging commands (showblock, debug, dumpfs, ofs) * Big bug fixed - now works on most systems. Exceptions include where ext2fs is in extended DOS partition or where block size is not 1024 * Windows 95 long filename support. Downloads to the true filename if running in a 95 DOS prompt. Should work in 98 * DOS shell command renamed to ", or press ^Z * Command history - ! command or scroll up/down with cursor keys * Extra line editing keys: ^A, ^E, ^U, Home, End, left/right cursor keys, del * Filename completion. Press esc, tab or ^D v0.0.1j 01/11/98 * cat command * Filename completion bugs fixed Speed ----- For some simple speed tests, I copied my Windows swap file back and forth between my DOS and ext2fs partitions. The 386SPART.PAR file is 20,922,368 bytes. To copy the file from DOS to the ext2fs took 52.05 seconds, with a transfer rate of 392.55kb/s. I then used three different methods of copying the file back to the DOS partition. 1. Using Linux Just using a straight Linux cp took 98.32 seconds (a transfer rate of 207.81kb/s) 2. Using the ext2tools Using the e2cp program took 232.11 seconds (a transfer rate of 88.03kb/s) 3. Using dft Using the get command in dft took 48.55 seconds (a transfer rate of 420.84kb/s) I was _really_ surprised at how slow Linux itself was to copy from the ext2fs to the DOS partition, especially considering the speed when copying the other way. The speed of the ext2tools is quite surprising also, since they are supposedly compiled with 386 enhancements (note that dft will run on an 8086). This is for those who say that file handling in Pascal is slow. Other Programs -------------- The ext2tools are available on sunsite (and its mirrors) in linux/system/FileSystems/ext2/ext2tool_1_1.zip or something similar. This is a suite of programs with the prefix e2, such as e2ls, e2cp, e2cd, etc. However, they are not really user friendly, and horrifically slow (see the speed tests in this file). There is another program in the same directory on sunsite as the ext2tools, called lread10.zip. I have no idea how well this program performs, since all I got when I ran it was Divide error fsdext2 is available for Windows 95. It acts a device driver and allows the user to mount an ext2fs as a drive letter. I don't have a URL for this, but have a look if you have 95, as it's quite good. Final Notes ----------- Thanks to Damion for words of encouragement, making this program feel wanted, and help with finding the all-too numerous bugs. Also, thanks must go to Dave for pointing out some stupid things I was doing. Thanks to Andy, etc. for testing. Andrew J Wales 1st November 1998