*************************************************************************
*                                                                      	*
*  DiskOnChip(R) TrueFFS(R) BIOS driver (DOS)				*
*                                                                      	*
*  Version 5.0.4, released on December 11, 2001				*
*  Based on TrueFFS version 5.0.1 from August 01, 2001			*
*                                                                      	*
*  Copyright M-Systems (c) 2001						*
*                                                                      	*
*  Installation guide & release notes					*
*                                                                      	*
*************************************************************************

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


Contents
-----------
1. Introduction
2. New features in version 5.0
3. Installing the DiskOnChip(R) product family in DOS environment
4. Extended functionality of DiskOnChip TrueFFS driver version 5.0
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 drive. Placing 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 (see also tool_man.txt enclosed 
with the this package).

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

- Mobile DiskOnChip (16MB)
- DiskOnChip Millennium Plus (32MB)
- DiskOnChip Millennium (8MB)
- DiskOnChip 2000 TSOP (16MB)
- DiskOnChip 2000 DIP/DIMM (16MB - 288MB)


2. New Features in version 5.0						
------------------------------
DiskOnChip latest TrueFFS BIOS driver version is 5.0.0.
It supports all DiskOnChip products and is backward compatible with TrueFFS 4.2.x.

Note: DiskOnChip Millennium Plus (MD2811-D32) and DiskOnChip 2000 TSOP (MD2211-D16) 
are only supported by TrueFFS 5.0.  

TrueFFS 5.0 includes the following new features:                    

2.1 Support for DiskOnChip Millennium Plus  (MD2811-D32)
2.2 Support for DiskOnChip 2000 TSOP (MD2211-D16)
2.3 Hardware protection (DiskOnChip Millennium Plus only):
    DiskOnChip Millennium Plus supports read and write protection at the 
    hardware level. Up to two of the volumes (partitions) exported by the 
    device can be protected by a unique 8 byte (64-bit) key. On power up,
    the device is protected until the correct key is inserted.
	   
    Once the password is provided, the device can be accessed freely until 
    one of the following occurs:
	(a) power down
	(b) key removed
	(c) protection mechanism reinitialized
   
2.4 DiskOnChip Millennium Plus also includes a hardware lock signal (#LOCK) 
    that overrides the password key. When set, the protected partitions cannot 
    be accessed, even if the correct key is used.
   
    For more info see the device Data Sheet and the TrueFFS 5.0 manual. 
 
2.5 Multiple Partitions (Volumes):
    DiskOnChip Millennium Plus and DiskOnChip 2000 TSOP can be divided into max. 
    4 separate volumes. The separation is made in the driver layer and is 
    not dependent on the host OS or file system.


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. 

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.

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

3.4 The DiskOnChip is now recognized as an additional drive (or drives, depending 
    on the DFORMAT option used in step 2).
   

4. Extended functionality of  TrueFFS driver version 5.0                                          
--------------------------------------------------------
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.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 relvant for all devices. 

4.1.1 DEFRAG_IOCTL (All DiskOnChip devices)
      Performers an "on-demand" space reclemation to speed up su-sequant write 
      operation.

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

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

4.1.5 DEEPOWER_MODE_IOCTL (DiskOnChip Millennium Plus only)
      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.

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

Note: The syntax of calling extended function for DiskOnChip 2000 DIP / DIMM  and 
       DiskOnChip Millennium (8MB) is diffrent from that of the new DiskOnChip 
       products including:

       - Mobile DiskOnChip
       - DiskOnChip Millennium Plus
       - DiskOnChip 2000 TSOP (16MB)


5. Example of calling extended functionality (via IOCTLs) for DiskOnChip 2000
   and DiskOnChip Millennium 8MB
-----------------------------------------------------------------------------
In the TrueFFS BIOS driver for DiskOnChip 2000, IOCTL command entry points are via 
IOCTL_WRITE. Each IOCTL has its unique string ID and structure. The status code 
is returned in register ax.

Programs use the following struct:

typedef struct	{
  char		id[8];		// "DEFRAG"
  int		not_used;
  long int	noOfSectors; 	// No of needed sectors.
} flDefragStruct;


Example of "DEFRAG"
--------------------

#include "dosioctl.h"

#define NO_OF_NEEDED_SECTORS 25000

int cdecl main(int argc,char *argv[])
{
  dlDefragStruct 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,"DEFRAG");	/* SEND IOCTL ID */
	request.noOfSectors  = NO_OF_NEEDED_SECTORS;

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


/* Call the Int13 Driver Command */
  	executeCommand(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 = _AX;

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

	return(EXIT_SUCCESS);
}


/* Command Execute by int 13 */
void executeCommand(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. Example of using extended functionality (via IOCTLs) for Millennium Plus
---------------------------------------------------------------------------

Note: Same interface applies for DiskOnChip 2000 TSOP and Mobile DiskOnChip.

In the TrueFFS BIOS driver all IOCTL command entry points are via IOCTL_WRITE.
Each IOCTL has its unique string ID.  

Programs use the following struct:

typedef struct	{
  char		id[16];		/* IOCTL String Id */
  void far* DiskInput;		/* pointer to Input structure */
  void far* DiskOutput;		/* pointer to OutPut structure */
} IOCTLstruct;


Example of "DEEP_POWER_DOWN_MODE" (DiskOnChip Millennium Plus only)
-------------------------------------------------------------------

#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);
}



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. 11F-2, No. 81, Sec.2, Chang Teh Rd. Taipei, Taiwan
		Phone: 886-2-2550-1741
		Fax: 886-2-2550-1745	
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
U.K. Office:	M-Systems UK Ltd.PO Box 20 Chalgrove SPDO OX44 7YP
		Phone: 44-1865-891-123
		Fax: 44-1865-891-391
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.