DISK-EMU Floppy disk drive emulator Version 1.11 (c) 1.994 Carlos Fern ndez Sanz Emporium programming group 93:341/110@SubNet, 2:341/70@FidoNet, 100410.3445@compuserve.com English documentation ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Emporium BBS ³ ³ Official support and distribution BBS ³ ³ +34-1-378 01 27 ³ ³ 24h, 1.200-28.800 ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 1. Why do you need DiskEmu? =========================== a) Installations ---------------- If you install programs frequently in your computer, whatever they are (games, utilities, etc), you already know how boring it is. Each diskette needs at least two minutes, and some programs can take fifteen minutes per disk (there is no need to give examples, surely you already know some). Now just imagine that instead of having the disks phisically, you have a copy of them in the hard disk, and you can take one, install it, and without exit the installation program, you can change the disk and continue with the installation process. That is exactly what DiskEmu does: It allows you to read/write "photocopies" (images) of the disks in the hard drive, and use them whenever you want, changing disks on the fly, stopping any program to choose the new disk, and then continue without any problem. Besides that, DiskEmu allows you to erase the images at any moment, to make space to continue with the installation. Even in the case you had to read the disks before starting with the installation, it would save you time in the whole process, since the time necessary to make the copy in the hard drive is by far less than that employed in the installation. You can check it with any program. And if you have the disks' images in any backup media, like a tape, or even CD-ROM, the installations will be much faster. DiskEmu includes compression, and so you can use the own DiskEmu format method to make your backups. b) Emergency drive ------------------ From time to time, in systems with only one drive, it is necessary to have a second one to make copies, or tests. DiskEmu can emulate any kind of drive, that can be used. Besides, the virtual drive of DiskEmu is much faster than the real one (a thousand times faster). Even a third (of fourth) disk drive may be necessary. DiskEmu can behave as any number of drive. c) Disk to disk copies ---------------------- When there is a necessity of make a lot of copies of the same disk, it is very annoying to read the source many times. Of course, there are a lot of utilities that read the disk once and then make the copies. Most of them use the hard drive to store the disk. The hard drive, although being very fast, needs also some time. With DiskEmu, the process is instantaneous. You only have to copy the original diskette in the DiskEmu drive (using DISKCOPY, e.g.), and then start to make the copies. d) Shells to the operating system --------------------------------- Many times when into a program having the possibility to spawn a moment to the operating system would be very useful, do something (even execute another program), and come back to the first program, without losing anything. DiskEmu allows to make a shell to the operative system, from nearly any program. Once in the prompt you can do whatever you want, without any limitations, and then come back to the original program. DiskEmu has the ability to interrupt any program and correctly save its status. A special feature of DiskEmu is that it handles correctly any screen mode (both text and graphic). On the contrary of another programs, a shell to the operating system can be made whatever the mode of the program running. The screen will be restored correctly when coming back to the program. 2. Description of the program and its features ============================================== Shortly: DISK-EMU is a resident program that emulates a flopy disk drive in RAM memory. The emulation is performed at the BIOS level, making it compatible with all the programs that do not access the hardware directly (except some disk copiers, no program does this). DISK-EMU should not be considered as a RAM disk. Although the drive emulated is what is usually considered as a RAM disk, that is not the actual purpose of this program. Just to show why DISK-EMU is not a simple RAM disk, I will comment some of its features: -The emulation is at the BIOS level, not DOS level. So, every program that works with a floppy disk drive also works with the DISKEMU drive. -DISK-EMU allows you to change a disk on the fly. So, you can quickly install programs with various installation diskettes. -It is possible to make exact images of the emulated disk drive, which is much more quickly than copying file by file. The images are CRC checked, so it is possible to detect any possible error in the disks. -DISK-EMU compresses the images, so it can be used as an storage method for programs of various diskettes instead of the typical compression programs. -You can enter the DISK-EMU menu during the installations in any video mode, both text and graphic. DISK-EMU will correctly restore the screen when coming back. -You can enter a shell to DOS from the DISK-EMU menu. e.g. to delete some files in the middle of an installation (to gain a more space). -DISK-EMU disks can be write protected, just like normal disks. Besides, there is an special protection mode (pseudo), which protects the disk "cheating" the programs. This is very useful when programs need to write in the disk although you do not want so. -The emulated drives can be of any kind, from the usual ones of 360 kb, 720 kb, 1.2 Mb and 1.44, to those of 2.88 Mb, or any non-standard formats, e.g. 100 tracks with 20 sectors/track... 3. Hardware and software requirements to use DISKEMU. ===================================================== Not too much really, nowadays. At least (and enough) the following: -386SX or better. -10 kb of conventional memory, and the one necessary for the disks to be created. Typically 1.44 Mb. Memory can also be used for the resident swapping, but the hard disk can be used for that purpose. -Very likely a EGA or VGA for installations in graphic modes. I haven't had access to a CGA, so I can not assure if it works with it. -A XMS or EMS memory driver. Any of them can be used. 4. User support =============== The license of use of Disk-Emu, both the provisional for evaluation and the final for the registered users includes support from the author. The ways to contact with the author are detailed at the end of this text. 5. Distribution of DISK-EMU. ============================ DISK-EMU is distributed as shareware. This means that the evaluation copy is freely distributed. The user can test it for a time (usually, about three weeks) to decide whether he/she likes the program or not. if he/she likes it, he/she must register, which will give him/ her some privileges which are detailed below. If he/she does not like it, he/she just simply must stop using it. This way of distribution is of absolute confidence for the user, since he does exactly know what he is paying for, and very cheap for the programmer, which also gives a benefit to the user, who pays less. Concerning DISK-EMU, registering it gives the following benefits: -Of course, the right to use the program whenever you want, with no limitations. The registered version must not be distributed, being the user the responsible of guaranteeing this. The registered versions are protected by the law like any other program, and its distribution is a crime that can be severely punished. -Lifetime free upgrades. There are different ways to get the upgrades, the user will choose between them: -Sending a diskette with an envelope and the right stamp. -Through CompuServe. This is undoubtely the fastest way. -To users of FidoNet, SubNet, and software compatible networks, previously arranging a password to connect. The new version will be on hold from the moment it becomes available and it could be obtained with a simple call. -Through Emporium BBS. -An automatic upgrade to the next main revision. This upgrade will be automatically to all registered users as soon as it is finished, without delays. -Electronic mail support, you can choose between SubNet (this is the best way), FidoNet, Internet and CompuServe. Snail mail can also be used, although it is very slow. -The registered version has features that are not available in the shareware version. -The suggestions of registered users will always be in my mind. -The diskette with the registered version of DISK-EMU also has many other programs with utilities having something to do with DISK-EMU. Most of them are free. Some others are shareware too. The shareware version can be distributed in any media, including magazine diskettes, CD-ROMs, BBS, networks like Internet, catalogues of shareware vendors such a PsL, etc, as long as: 1. None of the files that go with the program is removed. Other files and advertisements can be added. 2. The requested price is the same of the one of any other program. To register, send 1.800 pesetas (from Spain) or 20 US dollars (from outside Spain). Accepted payment methods are: -Deposit in one of the following bank accounts: Name: Carlos Fern ndez Sanz Bank: Caja de Madrid Office: 1119 Account: 3001052409 Bank: Bankinter Office: 0013 Account: 010116507.7 The receipt of the deposit or a photocopy of it must be sent to the address detailed below. To make the delivery faster, the deposit can be notified by electronic mail. If you decide to do so add the quantity of the last two numbers of your phone number, just to identify your deposit quickly. If you use FidoNet send the message direct, do not route it. -Bank cheque. -Just send cash. Please send it in a registered letter. -Postal order. This way is very slow, since I have to go to the central post office, and so I do not go until I have some waiting. -Cash on delivery. Only if no other way can be used. The additional costs of the delivery are paid by the user. Only available if ordering from Spain. -CompuServe. GO SWREG and get ID #3035. -Credit card. See ORDER.DOC for details. Whatever the method you choose it is REQUIRED to send perfectly filled the form included in the file ORDER.DOC. The address is: Carlos Fern ndez Sanz C/Ferm¡n Caballero 60, 3-B Madrid 28034 Spain 6. Disclaimer. ============== There is no guarantee in the shareware version. The user is the only responsible of the use of the program, not being the author responsible of any harm or mistake the use of DISK-EMU can produce. I do guarantee that the registered version includes all what is described in this document and just the way it is described. 7. Parameters that can be used with DISK-EMU ============================================ By default, DISK-EMU creates a drive of the same size of the physical drive A:, using extended memory preferably (if there is no extended memory, expanded memory would be use), and it uses RAM memory as a container for the swapping methods. Its behaviour can be modified through the command line with the following parameters: Disk-Emu is very flexible in all its functions. The following parameters are used to change the default configuration. It does not matter their order in the command line. They may be preceded by / or -, but it is not required. The parameters with subparameters may have : to separate parameters from subparameters. Parameter 0 ----------- Disk-Emu will be installed, but it will not create any virtual disk. A disk can be created afterwards from the menu. Parameters 360, 720, 1220, 1440, 2880 ------------------------------------- By default DiskEmu creates a disk of the same kind of that of the physical drive A:. With these parameters the size of the drive can be determined. Parameter N ----------- By default the substituted drive is the 0 one, that it is nearly always A. With N can be changed the number of the drive to be emulated. One is usually B:, while 2 and 3 are usually drives that require drivers. The syntax is N:drive, in which drive is a number from 0 to 3. The possibility of using also the numbers 2 and 3 makes it possible to have a third drive in systems with only two. This parameter is only available in the registered version. Parameter T ----------- Although diskettes of standard capacities are generally used, Disk-Emu offers a wide range of possibilities to create drives of any kind. For example, to work with disks with 2M format, or of any other special formatting programs, it is very useful to specify another physical characteritics for the emulated drive. Changing the physical caractheristics, any capacity for the disks can be obtained: heads track sectors bytes bytes Capacity = ----- * ----- * ------- * ------ = ----- disk head track sector disk The syntax is T:tracks.(e.g.: DISK /T:100 will create a 100 tracks disk). IMPORTANT: DiskEmu formats automatically the standard disks of 360 kb, 720 kb, 1.2 Mb and 1.44 Mb. The disks of other capacities must be formatted with programs for it. I especially recommend FDFORMAT, which allows to format disks of any kind. Parameter H ----------- Syntax: H:heads It allows to change the number of heads of the disk. They are usually two (although the first IBM had drives with only one head). Its value can be between 1 and 4. Parameter S ----------- Syntax: S:sectors It allows to change the number of sectors per track. They can be 9, 15, 18 or 36 depending of the disk. Its value can be between 1 and 80. Parameter B ----------- Syntax: B: bytes per sector Usually 512 for all the disks, although it can be also 128, 256 or 1024 Parameter D ----------- Syntax: D:working directory From the DiskEmu menu (explained below), images can be loaded in memory. With the parameter D will be specified the directory to be shown when entering for the first time. In the following times the last directory to be shown will be the one entered last. Parameter K ----------- Syntax: K:code By default, the menu of DiskEmu will be activated when pressing simultaneously the keys Alt-Tab. It is possible that this combination could be in use by another program, or it can be uncomfortable for some reason. With the parameter K it can be changed by any other hot-key. The code to use for any given combination can be obtained through the DiskEmu menu. Parameter E ----------- Due to matters of speed (XMS memory is faster than EMS), DiskEmu tries to use XMS memory before EMS to store the virtual disk. With this parameter DiskEmu will try to use EMS first. This parameter does not avoid that XMS would be used. If there is no EMS, XMS memory will be used instead. So, its function is to change the preference order. Parameter M ----------- DiskEmu has in its menu an option to make a shell to the operative system. However, there are sometimes that can be foreseen that make a shell will not be necessary. The parameter M allows to reduce the amount of memory used by not having the possibility to make a shell. Parameter F ----------- DiskEmu uses a swap system that only needs 10 kb of memory in its resident part, in spite of the large size of the program mainly due to the menus. The menus are only necessary when they are used, and they do not usually remain in conventional memory. By default, the non-resident part of DiskEmu is in XMS/EMS memory because it is very fast. However, saving this memory can be needed because there are another aplications that need it. The parameter F obliges DiskEmu to use the hard drive as swap space. Parameter U ----------- Uninstalls DiskEmu. This can also be done from the menu, but it can be useful for .bat files. Parameter R ----------- Syntax: R:filename. Read a disk image. If DiskEmu is not installed, it will be installed at the same time the image is read. If it's already installed, it will not be installed again. The image will be read by the already installed copy. This option is only available in the registered version. Parameter W ----------- Syntax: W:filename Saves in the specified file an image of the disk that is currently in the virtual drive. The image is a file with a head that has the charactheristics of the drive, and a sector by sector dump of the disk. This option is only available in the registered version. Parameter WP ------------ Syntax: WP:filename The same as W, but the image is saved compressed, this can be used to make security copies of the disks, without a need for external programs. This option is only available in the registered version. Parameter ? ----------- Shows a help screen. Parameter G:[base] ------------------ This parameter is a little difficult to be explained, since it is quite technical. The only thing that is important to know is that it allows DiskEmu to interrupt programs that can not be noramlly usually, but with a slight lost in the compatibility, so it might be a good idea to use it only when it is necessary. For that interested in a more detailed explanation, here it goes: Usually, hardware interrupts of the PC (if you don't know what a hardware interrupt is, this explanation is not for you) start from vector 8. That is, for IRQ0 (timer), the routine in charge of handling the interruption is at the address pointed by vector 8, for IRQ9 (keyboard), the vector is 9, and so on. Most programs assume that this is always true (since this is the way IBM defined it in its first PC - ignoring Intel's specifications, but this is another story), so when they want the control over the keyboard they simply take the interrupt 9. When these programs have a complete control over the keyboard (that is, they don't give control to the previous service), they can not be interrupted. No resident program that was loaded before them can be activated, simply because it will not notice that it is being called from the keyboard. However, it is possible to redefine the base vector for the hardware interruptions. For example, Windows starts at 50h in such a way that the clock has vector 50h, keyboard 51h... So, it always has the first reading of the keyboard. After reading it, int 9 is called normally. The result of all this is that nearly any program can be interrupted. The parameter that G accepts is the vector number for IRQ0. It's 50h by default (to have compatibility with Windows and EMM386), although it can be any that is free an d which has another 7 ones free after it. 8. The DISK-EMU menu. --------------------- It is accessed through the key combination choosen with the parameter K, its default value is Alt-Tab. To exit the menu and return to the current program, press ESC. DISK-EMU will stop the running program, saving all the information required to let it continue after calling DISK-EMU. This includes the program itself (which is overwritten in memory with the non-resident part of DISK-EMU), the screen (both text and graphic mode), the DTA, and so on. What happens when activating the menu is not important at all for the user (although it is interesting for programmers). The menu is divided in three parts, which are "Image", "File" and "System". In the screen there is also an information panel with all the characteristics of the current virtual disk, if there one. In this panel is shown the following information: If there is no virtual disk, it simply has a warning. If there is a disk: Drive: Number of the physical drive substituted. This is better explained below. Tracks: Number of tracks. Heads: Number of heads. Sectors/Track: Number of sectors per track. Bytes/sector: Number of bytes per sector. Total sectors: Total number of sectors in the disk. Total bytes: Total number of bytes of the disk. The formula used is HEADS * TRACKS * SECTORS/TRACK * BYTES/SECTOR. The less experienced user would ask why this number is not the same that the DIR command of DOS returns when the disk is empty. This is because the first sectors of the disk are used by the DOS to manage the disk space. Protected: The disk can be protected against writting or not. There is also a third way of working (I have called it pseudo) that has the disk protected but cheats the programs that try to write in the disk, returning an "OK" as the result of a writting operation. Some programs try to write configuration files during installations (and also other things) in the disks, and they do not let the user decide whether he wants it or not. This pseudo mode is very useful if this happens. Active: The disk can be active or not. In the latter, the drive accesses are sent to the BIOS, and then the real drive is the one that works. The menu options are the following: "IMAGE" file. -Create | A submenu appears with options to choose the virtual disk| size of the disk. It can be a standard disk, or | it can have its own characteristics. To create a | virtual disk the current one must be erased, if | there is one. -Delete disk | Deletes from memory the virtual disk and it puts | the physical drive to work again. -(Un)protect | It toggles between the protection options, disk | already explained before. -(De)Activate| Activates or deactivates the disk. -Change drive| This option is only available in the registered | version. | By default, DISKEMU substitutes the physical | drive 0, which is the drive A: under DOS. | However, any other drive can be substituted (are | valid from 0 to 3). The physical drive 1 is the | drive B:. However, in the systems with only one | floppy drive, DOS assigns a 0 to A: and B: as | well, so in this systems it is not possible to | simply announce the drive change. To solve this | problem to possible solutions are available: | 1. Change the CMOS and set that there is another | drive, although it is not present. | 2. Load the DRIVER.SYS, that comes with MS-DOS. | For instance, DEVICE=DRIVER.SYS /D:1 /F:7 makes | DOS assign a drive letter to the physical drive | 1 (this can be the DISK-EMU drive) and set its | characteristics to those of a 1.44 Mb one. The | way DRIVER.SYS works is explained in the manual | of the operative system. | The letter can be E:, F:, etc., although DOS | still handles the drive as a floppy disk drive, | so all the commands for this drives still work | perfectly. | Systems with two drives can install the DISK-EMU | drive as the physical drive 2 (with /D:2 in | DRIVER.SYS), to have access for every drive at | the same time. "FILE" menu. -Read image | DISK-EMU will show a list with the image files | stored in the current working directory, and it | will let the user choose one to load it. Besides, | it will tell the operating system a disk change | has taken place, just to make everything work in | the same way as a disk had been changed in the | real drive. In the shareware version only the | first five images will be listed. -Read RAW | RAW images are just disk dumps. They don't have image | a header so they are useless for backup purposes. | Most disk utilities can read and write this type | of files so DiskEmu support its. | Please note that before a RAW image is loaded, | you must create a appropiate virtual disk. -Write image | This option writes an image, without compressing | it, but with CRC, in the working directory. | Besides the name, a description can be inserted, | this description appears with the option of read | image, to make the identification easier. -Write | Just the same that the previous one, but the without CRC | images does not have CRC. This option is used to | create images that are going to be used and | deleted inmediatedly, and which are not suitable | of storing, because they are not sure. However, | not being necessary to calculate the CRC they | are stored more quickly. -Write with | This option is only available in the registered compression | version. | Images are saved compressed, saving a lot of | space. -Write RAW | Writes a plain disk dump. Do not use this dumps image | for backup purposes. They aren't safe because | they don't have a CRC checking. Use them to | export data to other utilities. -Delete | Removes a user selected image from the hard disk, image | which is very useful if the space is needed to | continue with the installation of a program. "SYSTEM" menu. -Credits | It shows a screen with the names of the people | who have helped in the development of this | program. -Change | It allows the user to change the key combination hot-key | selected to invoke the menu. First of all the | main key is to be pressed (letters or numbers) | and after that the secondary key(s) (CTRL, ALT, | etc). DISK-EMU will return the associated code | of this combination, code that can be used with | the parameter K for future installations. -Shell to DOS| This option is only available in the registered | version. | It exits temporarily to DOS. After doing whatever | necessary in DOS (even another program can be | called) type EXIT to return to the menu. -Uninstall | Uninstalls DISK-EMU from memory, if it can be | done so. 9. Some aditional tips about DISK-EMU. ====================================== Although the way of working with DISK-EMU is already perfectly described, some other things must be discussed. Although DISK-EMU uses compression, it was not thought of as a way of storing files, but disks. For files, it is better to use any other wonderful utilities designed for it, like PKZIP or ARJ. DISK-EMU must not be loaded before any other program that receives real time messages (e.g., networks, communication programs, etc). When entering the menu, DISK-EMU stops all this programs, so data may be lost. Besides that, programs like DesqView must not be loaded before. The correct way (if you want to access the menu, if you do not want to do it is not necessary to do so) is by loadin DISK-EMU within a window. Detecting Disk-Emu: Int 2F Entry : AX = AFDEh (Ask For Disk-Emu) ES:DI = Pointer to a 14-byte table to store the info. Returns : If DiskEmu is installed AX = CFDEh (Carlos Fernandez' Disk-Emu) BX = Version number (BH=major, BL=minor) All other registers remain unchanged. Table: OffSet Length Description ------------------------- 00 1 Tracks 01 1 Sectors per track 02 2 Bytes per sector 04 1 Heads 05 1 Active (0=no, 1=yes) 06 1 Write-protected (1=yes) 07 1 Saved (1=yes) 08 1 Virtual disk loaded (1=yes) 09 2 EMS Handle 11 2 XMS Handle 13 1 Memory used (1=EMS, 0=XMS) 10. Contacting the author ========================= Through one of the following electronic addresses: SubNet : 93:341/110 FidoNet : 2:341/70 InterNet : 100410.3445@compuserve.com Compuserve: 100410,3445 And of course, also by snail mail. In this case, the letters with an envelope with the address and the right stamp will have preference. My address is: Carlos Fern ndez Sanz Ferm¡n Caballero 60, 3-B Madrid 28034 Spain 11. Credits =========== Besides me, Carlos Fern ndez Sanz, as the author of the program, some other people have colaborated in the developing of DISK-EMU: Betatesters: Rafael Imedio 93:341/101.2 2:341/31.0 Francisco J. Gonz lez 93:341/101.3 2:341/70.2 Paco Romero 93:341/901.0 2:341/53.0 Pedro de Paz 93:341/501.0 2:341/52.0 Nacho Rapallo 93:341/108.0 2:341/70.13 Antonio Cordero 93:341/108.0 2:341/70.13 Roger Manuel 93:341/108.0 2:341/70.13 Francisco J. Gonz lez has helped me a lot with the translation into English of the program and its documentation. Thanks, especially, to Ciriaco Garc¡a de Celis, who with his wonder- ful book "El universo digital del IBM PC, AT y PS/2", as well as our message exchange through Internet, has helped me a lot with some of the different parts of DiskEmu. Luis Crespo (the author of Visual Player) told me his experience on the distribution of his fine program. Greetings also go to Mstislav, Daf, Undo. They know why. I also want to greet all those who came to the computer meeting that some friends made in Madrid. And that ones who had to put up with me at the Assembly '94. Javier y Juan Carlos Ar‚valo, from Iguana. Arturo Ram¡rez-M (you are very good at DOOM), Jon Beltr n de Heredia (it was worthwhile to wait for your assembly book), Arcadi Magre, Francisco Carrascosa, Oscar Esteban, Aitor Garay, Patxi Olarte, Reddevil, Cesar Alba, David Tolosana, Enrique Coiras... And of course to all the members of Emporium: Packer, Guamm and Kompiler.