[Previous Chapter] [Front]

DR-Flash Functions and Data

This appendix lists the hardware specific functions and data that you need to provide in the hardware dependant code.

To create a FLASH driver for your hardware, you need to create a source file similar to the TARGETx.ASM files that is specific to your hardware. Within this file you will have to create functions and variables as described in the following lists.

Hardware Specific Functions and Data

Functions that you need to provide in the hardware dependant code are listed below with a brief description.

read_data_hw

Purpose To read data to the specified address, low level
Entry DX:AX is offset of data in romdisk on 4 byte boundary
ES:DI is source address
CX is number of bytes, always multiple of 4
Exit CF is clear if ok or set if error preserves all registers

write_data_hw

Purpose To write data to the specified address, low level
Entry DX:AX is offset of data in romdisk on 4 byte boundary
ES:DI is source address
CX is number of bytes, always multiple of 4
Exit CF is clear if ok or set if error preserves all registers

size_hw

Purpose sorts the rom info table, skipping blanks, and calculates total size
Entry ds and es set to data seg.
Exit ax is total sectors all registers except ax preserved.

cleanup_hw

Purpose Reset the window to romdisk address 0:0, for rom execution, ints back on
Entry none
Exit preserves all registers

eraseblock_hw

Purpose To erase the natural block size of the romdisk at the specified address
Entry DX:AX is offset of block in the romdisk
Exit CF is clear if ok or set if error preserves all registers

print_string_hw

Purpose hardware dependant print string, used before DOS is loaded!
Entry ds:dx points to '$' terminated string
Exit preserves all registers

init_hw

Purpose This code locates the 'DR' card and calculates the parameters.
Entry none
Exit ax is ZERO if OK else NZ all registers except ax preserved,
You will also need to provide the following variables.

max_eraseblock

WORD - the erase block size for the complete set of flash chips.

strs_in_eraseblock

WORD - Device erase block size in sectors.

flash_flags

WORD - Subset of the FG_ flags described in RDISK.EQU

fixed_blocks

WORD - Set this to 0, the description of this is beyond the scope of this readme.


[Previous Chapter] [Front]