User manual

158
-
CHAPI disk drive mapped to raw physical disk;
To load implemented CHAPI disk drives at run-time you should:
1) Load dll by calling :
hinst=::LoadLibrary(TEXT(“chapi_storage.dll”));
2) Find initiating function in loaded dll :
pf_init_disk_t init_disk = (pf_init_disk_t)::GetProcAddress(hinst[i], init_name);
init_name can be:
- “init_file_disk
- “init_phys_disk”
Type of initiating function defined as:
typedef bool (*pf_init_disk_t)(void * ctrl, chapi_disk_drive_iface ** p_disk_i, unsigned char
disk_number);
Where:
ctrl
-
pointer to CHAPI disk controller instance
**p_disk_i
place to put created CHAPI disk drive instance
transport_number
CHAPI disk drive instance number
Setup parameters pass to the CHAPI disk drive via setup(void * param, int arg) as a NULL
TERMINATED string.
For example:
to pass setup option to CHAPI disk drive mapped to disk image file we must call:
HDD[0]->setup(“somefile.mtd”, 0);
to pass setup option to CHAPI disk drive mapped to raw physical disk we must call:
HDD[0]->setup(“\\.\PhysicalDrive0”, 0);
Disk drive geometry (of disk is being emulated) pass to the CHAPI disk drive via
setup_geometry(CHAPI_DISK_DRIVE_GEOM geom) as the preset structure.