| Sample Source Files for Flash Devices | |
|---|---|
| Filename | Explanation |
| TAREGT1.ASM | This is a sample flash disk support file for a memory/IO mapped, 4/64k window, 512k-4MB devices. These can be Flash or EPROM with 28 or 32 pin, auto increment with specific write code for the SST29EE010/Amtel 128Kb devices. |
| TARGET2.ASM | This is a sample file for a computer with an 8 MB flash disk in extended memory using the MX29F1610 devices. |
| TARGET3.ASM | This is a sample support file for hardware with a 4 MB flash disk in extended memory using the AM29F080 devices.. |
| TARGET4.ASM | This is a sample support file for a memory mapped, 32 Kb window at b000 with specific write code for the AM29F016B 16Mbit devices. |
| TARGET5.ASM | This is a sample support file for a memory mapped, 16Kb window at dc000 with specific write code for the AM29F016B 16Mbit devices. |
Just from these examples, it can be seen that there are many different variations with devices from 64KB to 64MB in size needing 1 or more voltage supplies, 32 or 48 pin packages, small and large erase block sizes and so on.
Customizing the OEM Layer For Your Device
Since there is no standard for Flash disk hardware, the DR-Flash SDK provides many typical examples and information to assist you in the design of fast, economic and practical hardware. Using proprietary hardware is often the most economic solution for OEMs building the type of equipment likely to benefit from a flash disk. The sample device drivers show how the flash disk can accomodate virtually any type, size or make of ROM, EPROM or flash device. All the BIOS and DOS components that normally reside permanently are designed to operate from ROM in order to reduce the amount of RAM required.
Building the CDISK Utility
The batch file included in this SDK to build the CDISK.EXE utility is called MAKECD.BAT. You need to edit the batch file to make sure it is calling the correct file name for your TARGET?.ASM file. For example, if you have created a MYTARGET.ASM file, you will need to insert this filename into the batch file where appropriate.MAKECD [DEBUG][EMBEDDED]
Note: By default, it is not compiled to execute from ROM and has no debug support. The DEBUG and EMBEDDED parameters can be provided on the command line to change these default parameters depending on the flash disk design. Using the CDISK Flash System Utility
After building the CDISK utility, you need to add the flash disk support in the form of an option ROM extension to the ROMBIOS int 13. CDISK writes the necessary option ROM code and flash disk support code to the flash disk followed by a default DOS FAT format for either a floppy or hard disk. The default format ensures that the capacity of the flash disk is maximized based on the number of devices fitted. When the computer is rebooted, the flash disk will be recognised as an additional hard or floppy disk that can be immediately accessed.
| CDISK Switches | |
|---|---|
| Switch | Function |
| /C | Checks the disk structure. |
| /D | Save the current flash disk image to the file c:\cdisk.bin. |
| /F | Writes a floppy disk image. |
| /H | Writes a hard disk image. |
| /M | Measures and displays the time for writing sectors. |
| /O | Creates the file c:\option.bin containing the option ROM code (int 13 code). |
| /R | Invalidates any sectors not in the FAT to improve the write speed. |
| /T | Allows you to view the debug code to trace read/write in resident option BIOS. |
The ROM BIOS on the hardware device needs to have the option ROM code inserted so that the flash disk device can be detected. The option ROM code only requires 6Kb so will fit in the majority of ROM BIOS chips. Alternatively, you will need to find another place in upper memory to insert the option ROM code.
Once you have access to the flash disk, you can make it bootable by copying the DR-DOS system files on to it: IBMBIO.COM, IBMDOS.COM, COMMAND.COM.
You can reboot your system and the flash disk will boot. You will need to go into the BIOS setup to see how the system will boot.