[Previous Chapter] [Next Chapter] [Front]

Implementing DR-Flash

This chapter describes the procedures for creating your flash disk. The procedures for customizing the OEM layer for your flash device, intializing your flash device, making it bootable, and accessing it are all described.

Overview of Procedure

Flash Device Support

The flash disk driver supports the Flash device that allows sectors to be written as well as read. This allows the flash disk to be created more easily and even modified on the target computer.

Sample Flash Devices

The DR-Flash SDK contains source files for five sample hardware devices. These source code files are called TARGETX.ASM where X is a number from 1-5.

Sample Source Files for Flash Devices
FilenameExplanation
TAREGT1.ASMThis 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.ASMThis is a sample file for a computer with an 8 MB flash disk in extended memory using the MX29F1610 devices.
TARGET3.ASMThis is a sample support file for hardware with a 4 MB flash disk in extended memory using the AM29F080 devices..
TARGET4.ASMThis is a sample support file for a memory mapped, 32 Kb window at b000 with specific write code for the AM29F016B 16Mbit devices.
TARGET5.ASMThis 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.

In such an embedded DR-DOS design, a minimum ROM window of 64 KB is required in the 8086 address space. If only the romdisk support is required, then the ROM window only needs to be 8 KB (DR-DOS not executing from ROM).

Before building the CDISK utility, you need to define the target hardware you are using so that the CDISK utility is created for your particular device. The sample target hardware files (TARGET?.ASM) are provided in this SDK for your reference. You can choose one of these to customize to your hardware device. Refer to Table 1-1 on page 1-10 for details on the sample source files provided.

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.

1. Edit MAKECD.BAT to include your modified TARGET.ASM file.

2. Enter MAKECD at the command prompt.

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.

The CDISK.EXE utility is created specifically for your hardware device. The next stage is to use the CDISK utility to create the flash disk for the first time and to format it.

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.

Note: During the format of the flash disk, the option ROM code is placed in the flash disk or in the file c:\option.bin depending on the hardware type.

Refer to the following table for the switches you can use with CDISK.

CDISK Switches
SwitchFunction
/CChecks the disk structure.
/DSave the current flash disk image to the file c:\cdisk.bin.
/FWrites a floppy disk image.
/HWrites a hard disk image.
/MMeasures and displays the time for writing sectors.
/OCreates the file c:\option.bin containing the option ROM code (int 13 code).
/RInvalidates any sectors not in the FAT to improve the write speed.
/TAllows you to view the debug code to trace read/write in resident option BIOS.

Update the ROM BIOS with Option ROM

If you run CDISK with the /F or /H switches to format your flash disk, the option ROM code is produced. If you do not use these switches, you need to use /O to create the necessary option ROM code - C:\OPTION.BIN.

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.

Making the Flash Disk Bootable

After running CDISK and creating the flash disk, reboot the system. The flash disk will appear either as a hard disk such as C: D: or E: or as a floppy disk such as A: or B:. This depends on what flags you have set in the hardware dependent file (TARGET?.ASM).

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.

Embedding the Software

Now that the flash disk is available as a regular disk drive, a system integrator can install the necessary software on to the flash disk and test it. For example, if you are installing the set-top box solution from Caldera, you would install DR-DOS and then DR-WebSpyder. You can increase the capacity of the flash disk using compression software such as Stacker.


[Previous Chapter] [Next Chapter] [Front]