*************************************************************************
*                                                                      	*
*  DiskOnChip(R) TrueFFS(R) BIOS driver (DOS)				*
*                                                                      	*
*  Version 5.1.2, released on Aug 1, 2002				*
*  Based on TrueFFS version 5.1.2 from Aug 1, 2002			*
*                                                                      	*
*  Copyright M-Systems (c) 2002						*
*                                                                      	*
*  Installation guide & release notes					*
*                                                                      	*
*************************************************************************

This document describes the usage of the DiskOnChip(R) BIOS driver. 


Contents
-----------
1. Introduction
2. New features in version 5.1.2
3. Installing the DiskOnChip product family in DOS environment
4. Extended functionality of DiskOnChip TrueFFS driver
5. Example of using extended functionality
6. Known limitations
7. Contact information


1. Introduction.
----------------
The DiskOnChip TrueFFS BIOS driver is designed for x86 platforms, and is 
automatically detected and loaded from the DiskOnChip during the BIOS 
expansion search. The driver is provided as an EXB file and should be 
placed on the DiskOnChip (in x86 systems) before it can be used as 
a bootable disk. Installing the BIOS driver on the DiskOnChip is done using the 
DFORMAT utility, which is part of the DiskOnChip software utilities. 

For detailed information on how to use DiskOnChip utilities for DOS, please 
refer to the DiskOnChip Utilities User Manual (enclosed). The latest version 
of the DiskOnChip software utilities may be downloaded from www.m-sys.com/download/

The DiskOnChip products supported by this version of the BIOS driver 
(DOC52.EXB) are:

- Mobile DiskOnChip Plus 
- DiskOnChip Millennium Plus 
- DiskOnChip Millennium 
- DiskOnChip 2000 DIP/DIMM  - including support in devices with 
    128MB Samsung Flash in capacities: (- New!)
       low profile: 258MB, 384MB
       high profile: 768MB, 1GB

2. New Features in version 5.1.2						
--------------------------------
1. Support for Samsung 128MB Flash.
2. Fixed a bug where interrupt 13, function 15H returned an error. This prevented
   booting from XP embedded and NT embedded.



3. Installing the DiskOnChip in DOS Environment
-----------------------------------------------
To install DiskOnChip in DOS, the DiskOnChip must be pre-formatted with the 
EXB file:

3.1 Mount DiskOnChip (or a DiskOnChip evaluation board) onto your hardware 
    platform or your development PC. You may use a DiskOnChip PCI or ISA 
    evaluation board.  

3.2 Use DFORMAT to format the media as requested.

     For detailed information on how to use DiskOnChip DFORMAT for DOS,
     please refer to the DiskOnChip Utilities User Manual enclosed.

     Example: DFORMAT /WIN:D000 /S:DOC52.EXB 

3.3 Reboot (the driver will load itself during the BIOS expansion search).

3.4 The DiskOnChip is now recognized as an additional drive. 
   

4. Extended functionality of  TrueFFS driver version 5.1.2                                          
----------------------------------------------------------
The basic function of TrueFFS is to enable regular file systems to access the
DiskOnChip as if it were a block device (disk). To do this, TrueFFS provides 
a standard block-device interface, with the capability of reading and writing 
logical sectors to and from the DiskOnChip. This capability, along with 
advanced Flash management features (transparent to the OS and file system) are 
enough to enable file-systems and operating systems to manage the DiskOnChip as 
a standard storage device.

In addition to the standard storage device functionality, the TrueFFS 5.1.0 
driver provides access to extended functionality, not part of standard 
file systems API.

The driver implements the interface of the extended functionality by exporting 
a list of extended functions (through IOCTLs). Every extended function is 
represented by a code defined as enumerated type defined in dosioctl.h.

Note: See implementation examples of using the DiskOnChip extended functionality 
through IOCTLs in the next section.


4.1 IOCTL list and functionality
================================
Note: Not all IOCTLs are relevant for all devices. 

4.1.1 DEFRAG_IOCTL (All DiskOnChip devices)
      Performers an "on-demand" space reclamation to speed up sub-sequent write 
      operation.

4.1.2 BDTL_HW_PROTECTION_IOCTL (Mobile DiskOnChip & DiskOnChip Millennium Plus)
      The functions described in this section implement hardware read and write
      protection to selected partitions.
 
4.1.3 CUSTOMER_ID_IOCTL (Mobile DiskOnChip & DiskOnChip Millennium Plus)
      Returns the hardware embedded customer ID.	

4.1.4 UNIQUE_ID_IOCTL (Mobile DiskOnChip & DiskOnChip Millennium Plus)
      Returns the hardware embedded unique device ID. No two devices have the 
      same device ID.

4.1.5 DEEPOWER_MODE_IOCTL (Mobile DiskOnChip & DiskOnChip Millennium Plus)
      Toggles the power consumption mode of the DiskOnChip.	

4.1.6 GET_INFO_IOCTL (All DiskOnChip devices)
      Returns general information on the specific BDTL partition, the 
      DiskOnChip socket address, software version, high- level and low- level 
      geometry and estimated lifetime of the media. A VolumeInfoRecord structure 
      is returned to a user buffer containing the information.

Notes: 
      - All the structures needed for using DiskOnChip extended functionality 
        (IOCTLs) are placed in the file called dosioctl.h. 
      

5. Example of using "DEEP_POWER_DOWN_MODE" 
------------------------------------------

#include "dosioctl.h"

int cdecl main(int argc,char *argv[])
{
  IOCTLstruct request;			
  char drive;				/* TFFS-DRIVE */
  char *argVal = NULL;
  long state  = 1;
  struct REGPACK reg;
  FLStatus status;

	
/* Initialize Struct to Send To Driver */

	strcpy(request.id,"DEEPOWER");	/* SEND IOCTL ID */

	/* Init Input and OutPut Buffer for IOCTL use */
	request.DiskInput  = (flPowerDownInput far*)malloc(sizeof(flPowerDownInput));
	request.DiskOutput = (flOutputStatusRecord far*)malloc(sizeof(flOutputStatusRecord));

	/* Send Params in Input Buffer */
	((flPowerDownInput far*)(request.DiskInput))->state = try1;


/* Call the Int13 Driver Command */
  	protectCommand(drive,(char *)&request,&reg);


/* Check Success of int13 command */
  	if( reg.r_flags & CF ) 
	{
		printf("Fail\n");
		return(EXIT_FAILURE);
	}

/* Get Return Data from OutPut Buffer */
	status = ((flOutputStatusRecord far*)(request.DiskOutput))->status;

	printf("Return Status: %d \n",status);

	return(EXIT_SUCCESS);
}


/* Command Execute by int 13 */
void protectCommand(char drive,char *command,struct REGPACK *sreg)
{ /* Send special command to INT 13, function: IOCTL_WRITE.*/
  sreg->r_ax = 0x1F00;                   /* IOCTL_WRITE */
  sreg->r_dx = drive - 'C' + 0x80;       /* Drive: 0x80 - C, 0x81 - D, etc */
  sreg->r_bx = FP_OFF(command);
  sreg->r_es = FP_SEG(command);
  intr(DISK, sreg);
}

6. Known limitations
--------------------
In TrueFFS 5.1.0, the IOCTL interface for all DiskOnChip devices is unified. 
Older versions of the BIOS driver had a different IOCTL interface for the 
following devices:

- DiskOnChip Millennium
- DiskOnChip 2000 DIP
- DiskOnChip DIMM 2000

For backward compatibility of applications using the former IOCTL interface 
use the DFORMAT flag /2K43 when installing the BIOS driver.

Example: DFORMAT /WIN:D000 /S:DOC52.EXB /2K43


7. Contact Information
----------------------

Internet: http://www.m-sys.com

E-mail:	info@m-sys.com

USA Office:	M-Systems Inc.8371 Central Ave, Suite A Newark CA  94560
		Phone: 1-510-494-2090
		Fax: 1-510-494-5545
Taiwan Office:  M-System Asia Ltd. Room B, 13th floor, No. 133 Sec. 3, Min Sheng East Road
                Taipei, Taiwan, R.O.C.
		Tel: +886-2-8770-6226
		Fax: +886-2-8770-6295 
Japan Office:	M-Systems Japan Inc. Arakyu Bldg., 5F 2-19-2 Nishi-Gotanda Shinagawa-ku, Tokyo 141-0031
		Phone: 81-3-5437-5739
		Fax: 81-3-5437-5759
Europe Office:	M-Systems Ltd. Central Park 2000 7 Atir Yeda St. Kfar Saba 44425, Israel
		Tel: 972-9-764-5000
		Fax: 972-3-548-8666

Please checkout our web site for the latest driver versions and updated 
information.     
 
 
TrueFFS is a registered trade mark of M-Systems Ltd. The TrueFFS software is 
protected by US Patent no. 5404485. All other trade marks, service marks, trade 
names are the property of their respective owners.