DiskOnChip Software Utilities For TrueFFS 6.3 User Manual Rev. 1.3
DiskOnChip Software Utilities For TrueFFS 6.3 User Manual Rev. 1.3
TrueFFS 6.3
User Manual, Rev. 1.3
December 2005
02-UM-0505-40
DiskOnChip Software Utilities for TrueFFS 6.3
TABLE OF CONTENTS
1. Introduction ........................................................................................................................... 4
1.1. DiskOnChip G3/P3, G3/P3 LP, G4 and H1 .................................................................... 4
1.2. Terms and Abbreviations ............................................................................................... 5
1.3. General Rules for all Utilities .......................................................................................... 6
2. DOCSHELL Utility ................................................................................................................. 7
2.1. Command Line Mode ..................................................................................................... 7
2.2. Menu Mode .................................................................................................................... 7
2.3. How to Extend DOCSHELL............................................................................................ 8
2.3.1. To Extend DOCSHELL .................................................................................................... 8
3. DFORMAT Utility ................................................................................................................. 10
3.1. DFORMAT Syntax........................................................................................................ 10
3.1.1. Operation Modes and Command Line Flags................................................................. 10
3.1.2. Common Syntax ............................................................................................................ 11
3.2. Using DFORMAT Flags................................................................................................ 12
3.2.1. Common Flags............................................................................................................... 12
3.2.2. Binary Partition Flags..................................................................................................... 12
3.2.3. Disk Partition Flags........................................................................................................ 14
3.2.4. Protection Flags ............................................................................................................. 14
3.2.5. Advanced Operation Flags ............................................................................................ 15
3.2.6. Removed Flags.............................................................................................................. 16
3.3. DFORMAT Usage Examples ....................................................................................... 17
4. DINFO Utility ........................................................................................................................ 18
4.1. DINFO Syntax .............................................................................................................. 18
4.2. Using DINFO Flags ...................................................................................................... 18
4.3. DINFO Usage Examples .............................................................................................. 20
5. DFS Utility ............................................................................................................................ 21
5.1. DFS syntax................................................................................................................... 21
5.2. Using DFS Flags .......................................................................................................... 21
5.3. DFS Usage Examples .................................................................................................. 22
6. DIMAGE Utility..................................................................................................................... 24
6.1. DIMAGE Syntax ........................................................................................................... 24
6.1.1. Serial DIMAGE Syntax .................................................................................................. 24
6.1.2. Parallel DIMAGE Syntax................................................................................................ 24
1. INTRODUCTION
This manual describes the following DiskOnChip utilities for Windows 2000/XP and DOS that
may be used with M-Systems DiskOnChip products:
• DFORMAT
• DINFO
• DIMAGE
• DFS
• SPLITIMAGE
Note: TrueFFS 6.3.X supports only SAFTL-formatted DiskOnChip devices. TrueFFS 6.3.X
utilities (DINFO, DFORMAT, DFS, and DIMAGE) support only SAFTL-formatted
DiskOnChip devices.
A description of the utility flags is provided, including specific examples and basic instructions
to assist in easy and quick installation of DiskOnChip over the target platform.
This manual is intended for system integrators who are familiar with the PC environment and the
operating system in use. It is also recommended to read the relevant DiskOnChip data sheets and
installation instructions for your specific operating system.
The latest versions of the DiskOnChip utilities can be downloaded from M-Systems’ website at
www.m-systems.com.
2. DOCSHELL UTILITY
This utility provides the shell for all other utilities described in this document.
The DOCSHELL utility has two operation modes – Menu mode and command line mode.
The number that appears to the left side of the command (utility) name should be typed followed
by the enter key. This will run the requested utility and prompt the user for relevant parameters.
After the specified command (utility) is completed, the menu is displayed again and the user may
choose another command to execute or exit the utility.
The Exit and the Help commands are not utilities. The Exit command will close DOCSHELL,
and the Help command will display relevant help content, as shown in Figure 2.
Note: menu mode accepts no more than 255 characters command lines.
3. DFORMAT UTILITY
Before the TrueFFS driver can access the DiskOnChip device, the device must be formatted
(similar to a floppy disk). Formatting the device initializes the flash media and creates the binary
and disk partitions.
DiskOnChip can be formatted more than once. However, all stored data on the device is erased
during the formatting process.
Note: When DiskOnChip is reformatted, the binary partitions are retained by default.
Appropriate versions of the DFORMAT utility are required for formatting. If the versions do not
match, the formatting procedure stops and DFORMAT returns an error message. The following
sections describe how to use the DFORMAT utility and provide a description of its flags.
DFORMAT functionality has changed compare to previous DFROMAT releases:
• There is no file system formatting done by DFORMAT. This functionality has been
moved to the DFS utility. Since this change was made, some corresponding flags have
been removed.
• Read operation is now supported by DFORMAT. Since this changes some flags and
enhances functionality, the /READ flag was added.
Note: When the binary partition number is not specified, the default partition number is 0.
Note: When the partition number is not specified, the default number is 0.
partitions.
Notes: 1. Note1: When the partition number is not specified, the default number is 0.
2. Note2: Password length is 8 bytes exactly.
4. DINFO UTILITY
The DINFO utility displays DiskOnChip information, such as physical size and partition number.
Available options include printing/displaying specific information, not just general information.
If no options are selected, DINFO displays general information.
5. DFS UTILITY
This utility supplies file system based services to work with DiskOnChip. The utility will allow
logical partitions format, read and update. MBR will also be updated by this utility
6. DIMAGE UTILITY
The DIMAGE utility is used to perform the following:
• Read the master DiskOnChip image to a file.
• Duplicate DiskOnChip, writing an image on up to 8 target DiskOnChip devices in parallel.
• Verify that the contents of the target devices match the master image file.
Warning: All target DiskOnChip devices must have the identical part number and capacity as the
source DiskOnChip. For example, if the source DiskOnChip is DiskOnChip G3 64MB, then the
target DiskOnChip must also be DiskOnChip G3 64MB.
The duplication process includes the following stages:
• Preparing the master DiskOnChip.
• Reading the contents of the master DiskOnChip to the image file.
• Burning the target DiskOnChip using the given image file.
Notes: 1. To mass-duplicate DiskOnChip efficiently, it is recommended to use one of the
programmer solutions recommended by M-Systems. The availability list of all
programmer solutions that support DiskOnChip is available on the M-Systems
website www.m-systems.com.
2. Some references in the following section contain information for duplicating a master
DiskOnChip to several target DiskOnChip devices in parallel. This information is
relevant mainly for programmer solutions.
7. SPLITIMAGE UTILITY
SPLITIMAGE can be used when the source DIMAGE file is taken from a master DiskOnChip
device with more than one floor. SPLITIMAGE extracts the master image file taken by the
DIMAGE, to separate image files each representing an image of one or more floors.
The SPLITIMAGE output files can be used later by the DiskOnChip programmers.
G3 512Mb 1 "G3_512MB_BGA_TSO.IMG"
2 cascaded G3 512Mb 2 "G3_1GB_BGA.IMG"
4 cascaded G3 512Mb 3 "G3_1GB_BGA_CASCADE_2.IMG"
P3 256Mb 4 "P3_256MB_BGA_TSO.IMG"
H1T 4Gb 5 "H1_4GB_BGA.IMG"
H1T 8Gb 6 "H1_8GB_BGA.IMG"
2 cascaded H1T 8Gb 8 "H1_8GB_BGA_CASCADE_2.IMG"
G3 LP 512Mb 9 "G3_512MB_BGA_TSO_LP.IMG"
P3 LP 256Mb 10 "P3_256MB_BGA_TSO_LP.IMG"
G4 1Gb 12 "G4_1Gb_BGA.IMG"
2 cascaded G4 1Gb 13 "G4_2Gb_BGA.IMG"
H1H 4Gb 15 "H1_4Gb_HYN_BGA.IMG"
H1H 2Gb 16 "H1_2Gb_HYN_BGA.IMG"
G4 1Gbit, 4 floors 17 "G4_4Gb_BGA.IMG"
G3 512Mb 1 "G3_512MB_BGA_TSO.IMG"
2 cascaded G3 512Mb 2 "G3_1GB_BGA.IMG"
Applications that run on Windows at the user level cannot access physical memory directly.
Instead, they can access virtual memory pointing to that physical memory location. M-Systems
supplies a dedicated driver called Mapmemory.dll, which allows the utility to map the
DiskOnChip memory range into virtual memory. The driver can be easily installed using a
dedicated Install Shield installation wizard.
This folder contains the files required to run the wizard that installs Mapmemory.dll
(virtual-to-physical memory driver). You must install the Mapmemory.dll before running the
utilities included in the Binary folder.
To install Mapmemory.dll:
1. Launch the installation wizard using the setup.exe program.
2. A Welcome screen is displayed. Click Next.
3. The wizard displays a list of the files that are going to be installed. When the subsequent
screen is displayed, click Next.
4. The driver files are installed in the specified location, and the wizard informs the user that
the installation process is complete.
5. When the appropriate screen is displayed, click Finish.
6. The wizard prompts you to restart your computer before using the M-Systems utility.
9.1.2.2 Binary
DINSHELL utility is a DLL file based on the TrueFFS SDK. The file is referred to as
Utility_dll.dll,. The Binary folder includes three Utility_dll.dll files: Dinfo_dll.dll,
Dformat_dll.dll and Dimage_dll.dll.
In addition, the folder contains a set of Utility.exe files (one for each DLL) that is used for
loading and running the DLLs.
To run a utility:
1. Install Mapmemory.dll using the installation wizard.
2. Open a command prompt window.
3. Execute the required utility from the Binary folder.
If you use the standard Windows 2000/XP OS with an M-Systems EVB, the utilities do not
require customization, and there is no need to access the Customization folder.
9.1.2.3 Customization
This folder contains the necessary tools for adapting the utilities to meet specific customer
requirements. It contains the following folders:
• Output\release: This folder consists of docsehll.dll file . All projects in the customization
folder will automatically copy its output to this folder.
• Src\Access_wrapper: This folder contains a Visual Studios 6 project that produces a second
DLL containing the user implementation for some or all of the DiskOnChip access routines.
This file may contain functions such as write-byte, read-byte and write-block functions (See
Table 17 for a complete list of user-defined access routines.) The file created is called
user_access.dll, and is automatically copied to the Binary release folder.
• Src\Os_wrapper: This folder contains a Visual Studio 6 project that produces a third DLL
containing the user implementation for system-dependent services, such as the print function.
(See Table 19 for a complete list of user-defined OS routines.) The file created is called
user_os.dll, and is automatically copied to the Binary release folder.
• Src\Docshell: This folder contains a sample application for the DOCSHELL utility. The
example is given as a Visual Studio 6 project that:
o Loads the docshell.dll file.
o Sets the names of the user_access dll and user_os dll files that will be used.
o Calls the docsehll.dll main entry point with the given arguments.
The .EXE file is automatically copied to the Output\release folder.
9.1.2.4 Functionality
The routines in this section should be implemented in the user Access Wrapper project, which
produces user_access.dll as output.
To insert your implementation, uncomment the relevant function and add your code. It is not
necessary to customize all of the routines in the access.dll. Routines that are not customized
simply use the default implementation.
If you have customized the block access routines, you must use the /FAST flag with all utilities.
Function Description
void EXAPI Write_Byte(FLByte val,volatile void* Writes a byte to the address
address); location.
void EXAPI Write_Word(FLWord val,volatile void* Writes a word to the address
address); location.
void EXAPI Write_Dword(FLDword val,volatile Writes a double word to the address
void* address); location.
FLByte EXAPI Read_Byte(volatile void* address); Reads a byte from the address
location.
FLWord EXAPI Read_Word(volatile void* address); Reads a word from the address
location.
FLDword EXAPI Read_Dword(volatile void* Reads a double word from the
address); address location.
void memcpy_from_io_8bit(EXBYTE EXFAR *dest, Copies a block of bytes from the
volatile EXBYTE EXFAR * src, EXWORD count) flash to a destination address.
void memcpy_to_io_8bit( volatile EXBYTE EXFAR Copies a block of bytes from a
*dest,EXBYTE EXFAR *src, EXWORD count) memory address to the flash
address.
void memset_to_io_8bit( volatile EXBYTE EXFAR * Sets a block of memory to a
dest,EXBYTE val, EXWORD count) specified value.
void memcpy_from_io_16bit(EXBYTE EXFAR *dest, Copies a block of words from the
volatile EXBYTE EXFAR * src, EXWORD count) flash to a destination address.
void memcpy_to_io_16bit( volatile EXBYTE EXFAR Copies a block of words from a
*dest,EXBYTE EXFAR *src, EXWORD count) memory address to the flash
address.
void memset_to_io_16bit( volatile EXBYTE EXFAR Sets a block of memory to a specific
* dest,EXBYTE val, EXWORD count) value.
void Get_Search_Range(EXDWORD*low_range,EXDWORD Gets the search range for
*high_range) DiskOnChip.
void *Map_Memory(unsigned long Maps a block of physical memory to
dwAddress,unsigned long dwLen) virtual memory.
Table 18: Parallel Access Functions that May Be Customized in user_access.dll (for
Programmers Only)
Function Description
void PARA_Write8BitRoutine (volatile FLByte Writes the same data (byte) to the
FAR1 *win,FLWord wOffset,FLByte bVal) same address in parallel to all
activated sockets.
void PARA_Write16BitRoutine (volatile FLByte Writes the same data (word) to the
FAR1 *win,FLWord wOffset,FLWord wVal) same address in parallel to all
activated sockets .
void PARA_Write8BitDifferentDataRoutine Writes different data (byte) to the
The routines in this section should be implemented in the user_os.dll project. To insert your
implementation, uncomment the relevant function and add your code. It is not necessary to
customize all of the routines in the file. Routines that are not customized simply use the default
implementation.
Table 19: Functions That May Be Customized in user_os.dll
Function Description
ExStatus EXAPI ExOsOpenCmdLineDevice( void** Opens a command line device.
data );
ExStatus EXAPI ExOsCloseCmdLineDevice( void* Closes a command line device.
data );
ExStatus EXAPI ExOsReadCmdLineDevice( Reads a command from a command line
void*data, EXWORD argc, void** retCommand ); device.
ExStatus EXAPI ExOsOpenMsgDevice( void** Opens a message device.
data );
ExStatus EXAPI ExOsCloseMsgDevice( void* Closes a message line device.
data );
ExStatus EXAPI ExOsWriteMsgDevice( void* Writes a string to a message device.
data, EXCHAR* pStr );
ExStatus EXAPI Opens an error message device.
ExOsOpenErrorMsgDevice( void** data );
ExStatus EXAPI Closes an error message line device.
ExOsCloseErrorMsgDevice( void* data );
Function Description
ExStatus EXAPI ExOsWriteErrorMsgDevice( Writes string to error message device
void* data, EXCHAR* pStr );
ExStatus EXAPI ExOsOpenPrgBarDevice( void** Opens a Progress Bar device.
data, EXCHAR* pPrgBarName, EXDWORD
dwPrgBarSize );
ExStatus EXAPI ExOsClosePrgBarDevice( void* Closes the Progress Bar line device.
data );
ExStatus EXAPI ExOsWritePrgBarDevice( void* Writes a string to the Progress Bar
data, EXDWORD dwDoneSoFar ); device.
ExStatus ExOsOpenFile( void** data, EXCHAR* Opens a file device.
name, EXWORD wMode );
ExStatus EXAPI ExOsCloseFile( void* data, Closes a file.
EXWORD wMode );
ExStatus EXAPI ExOsWriteToFile( void* data, Writes a buffer to a file.
EXDWORD size, void EXFAR* buff );
ExStatus EXAPI ExOsReadFromFile( void* data, Reads a buffer from a file.
EXDWORD size, void EXFAR* buff, EXDWORD*
byteRead );
ExStatus EXAPI Gets the length of a file.
ExOsGetLengthOfSerialFileDevice( void* data,
EXDWORD* retLen );
ExStatus EXAPI ExOsOpenUserInputDevice( Opens a user input device
void** data );
ExStatus EXAPI ExOsCloseUserInputDevice( Closes a user input device
void* data );
ExStatus EXAPI Prints user choices and waits for char
ExOsWaitForCharUserInputDevice( void*data, from the user input device.
ExWaitForCharChoices* waitForCharChoices );
void* EXAPI ExMemAlloc( EXDWORD size ); Allocates a memory block.
void EXAPI ExMemFree( void* memBlock ); Frees a memory block.
void* EXAPI ExMemSet( void* dest, EXWORD ch, Sets a buffer to a specified character.
EXDWORD size );
EXWORD EXAPI ExMemCmp( void* buf1, void* Compares characters between two
buf2, EXDWORD count ); buffers.
void* EXAPI ExMemCpy( void* dest, void* src, Copies a character between buffers.
EXDWORD count );
EXSWORD EXAPI ExRand( void ); Gets a random number.
void EXAPI ExSrand( EXWORD seed ); Sets the starting point for generating a
series of pseudorandom integers.
EXDWORD EXAPI ExTime( EXSDWORD* timer ); Gets the system time.
EXCHAR* EXAPI ExStrTime( EXCHAR* timestr ); Copies the system time to a buffer.
EXCHAR* EXAPI ExStrDate( EXCHAR* datestr ); Copies the date to a buffer, in the format
mm/dd/yy.
EXSDWORD EXAPI ExStrtol( const EXCHAR* nptr, Converts strings to a long-integer value.
EXCHAR** endptr, EXWORD radix );
EXDWORD EXAPI ExStrtoul( const EXCHAR* nptr, Converts strings to an unsigned long-
Function Description
EXCHAR** endptr, EXWORD radix ); integer value.
EXSWORD EXAPI ExAtoi( const EXCHAR* string Converts strings to an integer value.
);
EXCHAR* EXAPI ExItoa( EXSWORD value, EXCHAR* Converts an integer to a string.
string, EXSWORD radix );
void EXAPI ExClearScreen( void ); Clears the screen.
EXWORD EXAPI ExStrLen( const EXCHAR* Gets the length of a string.
string );
EXCHAR* EXAPI ExStrCat( EXCHAR* Appends a string.
strDestination, const EXCHAR* strSource );
EXWORD EXAPI ExCreateDirectory( const Creates a new directory.
EXCHAR* dirName );
EXWORD EXAPI ExGetDrive( void ); Gets the current disk drive.
EXWORD EXAPI ExChangeDrive( EXWORD drive ); Changes the current working drive.
EXWORD EXAPI ExGetDiskFree( EXWORD drive, Gets information regarding the number of
ExDiskInfoRecord* diskInfo ); available sectors, their size, number of
clusters, and sector per cluster.
EXCHAR EXAPI ExToupper( EXCHAR ch ); Converts lower case to upper case.
HOW TO CONTACT US
USA China
M-Systems, Inc. M-Systems China Ltd.
555 North Mathilda Avenue, Suite 220 Room 121-122
Sunnyvale, CA 94085 Bldg. 2, International Commerce & Exhibition Ctr.
Phone: +1-408-470-4440 Hong Hua Rd.
Fax: +1-408-470-4470 Futian Free Trade Zone
Shenzhen, China
Phone: +86-755-8348-5218
Fax: +86-755-8348-5418
Japan Europe
M-Systems Japan Inc. M-Systems Ltd.
Asahi Seimei Gotanda Bldg., 3F 7 Atir Yeda St.
5-25-16 Higashi-Gotanda Kfar Saba 44425, Israel
Shinagawa-ku Tokyo, 141-0022 Tel: +972-9-764-5000
Phone: +81-3-5423-8101 Fax: +972-3-548-8666
Fax: +81-3-5423-8102
Taiwan Internet
M-Systems Asia Ltd. http://www.m-systems.com/mobile
14 F, No. 6, Sec. 3
Minquan East Road General Information
Taipei, Taiwan, 104 [email protected]
Tel: +886-2-2515-2522
Fax: +886-2-2515-2295 Sales and Technical Information
[email protected]
This document is for information use only and is subject to change without prior notice. M-Systems Flash Disk Pioneers Ltd. assumes no
responsibility for any errors that may appear in this document. No part of this document may be reproduced, transmitted, transcribed, stored in a
retrievable manner or translated into any language or computer language, in any form or by any means, electronic, mechanical, magnetic,
optical, chemical, manual or otherwise, without prior written consent of M-Systems.
M-Systems products are not warranted to operate without failure. Accordingly, in any use of the Product in life support systems or other
applications where failure could cause injury or loss of life, the Product should only be incorporated in systems designed with appropriate and
sufficient redundancy or backup features.
Contact your local M-Systems sales office or distributor, or visit our website at hwww.m-systems.com to obtain the latest specifications before
placing your order.
© 2005 M-Systems Flash Disk Pioneers Ltd. All rights reserved.
M-Systems, DiskOnChip, DiskOnChip Millennium, DiskOnKey, DiskOnKey MyKey, FFD, Fly-By, iDiskOnChip, iDOC, mDiskOnChip,
mDOC, Mobile DiskOnChip, Smart DiskOnKey, SmartCaps, SuperMAP, TrueFFS, uDiskOnChip, uDOC, and Xkey are trademarks or
registered trademarks of M-Systems Flash Disk Pioneers, Ltd. Other product names or service marks mentioned herein may be trademarks or
registered trademarks of their respective owners and are hereby acknowledged. All specifications are subject to change without prior notice.