Installing TrueFFS for DiskOnChip in Windows CE (All Versions)

Similar documents
DOC-on-PCMCIA Evaluation Board

DiskOnChip PCI Evaluation Board

Guidelines for Integrating DiskOnChip in a Host System

DiskOnChip GANG Programmer Revision C

IDE Flash Disk

DiskOnChip 2000 MD2200, MD2201 Data Sheet

DiskOnChip GANG Programmer Rev. B2-1.23

idiskonchip (idoc) Flash Disk with IDE Interface

udiskonchip (udoc) Modular Flash Disk with USB 2.0 Interface

User Manual. DiskOnChip Software Utilities

Mobile DiskOnChip Plus 32/64MByte

DiskOnChip IDE Pro. Flash Disk with IDE Interface. Highlights. Operating Temperature. Environmental Conditions. IDE Modes.

DiskOnChip Millennium Plus 16/32/64MByte

AN2637 Application note

RoHS Compliant. Specification. April 23, Version 1.5. USB-Disk ModuleⅡ AP-UMxxxxXXXXG-XXXX. Apacer Technology Inc.

S1C17 Family EEPROM Emulation Library Manual

Statement of Volatility Xerox CiPress Production Inkjet System

Designing with the DiskOnChip Millennium in a PC Environment

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

Mobile DiskOnChip G3

How to use FlexMemory as D-Flash and EEPROM in KE1xF

AVR32401: AVR32 AP7 Linux Interfacing DataFlash. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

HPS SoC Boot Guide - Cyclone V SoC Development Kit

AN LPC1700 secondary USB bootloader. Document information. LPC1700, Secondary USB Bootloader, ISP, IAP

smxnand RTOS Innovators Flash Driver General Features

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

Active Serial Memory Interface

Kinetis Bootloader to Update Multiple Devices in a Field Bus Network

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

Using the Kinetis Family Enhanced EEPROM Functionality

High Performance Real-Time Operating Systems

USB Flash Drive. RoHS Compliant. AH321 Product Specifications. March 23, Version 2.5. Apacer Technology Inc.

Using the ColdFire+ Family Enhanced EEPROM Functionality Melissa Hunter Derrick Klotz

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

DYNAMIC ENGINEERING 150 DuBois St., Suite C Santa Cruz, CA Fax Est.

Porting WinCE 5.0 to your NXP BlueStreak MCU Board

Programming and Evaluation Tool for Serial EEPROMs

Module 8: Customizing the OS Design

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

Keil TM MDK-ARM Quick Start for. Holtek s HT32 Series Microcontrollers

APPLICATION NOTE. Atmel AT03304: SAM D20 I 2 C Slave Bootloader SAM D20. Description. Features

Spring 2017 :: CSE 506. Device Programming. Nima Honarmand

Flash File Systems Overview

Secure Microcontrollers for Smart Cards. AT90SC Summary

WinCE for LPC3250. BUMMS China Nov PDF created with pdffactory Pro trial version

CHAPTER 11: IMPLEMENTING FILE SYSTEMS (COMPACT) By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

File System: Interface and Implmentation

AN4491 Application note

AT89C5131 Starter Kit... Software User Guide

FLASH PROGRAMMER FP-8903 VER 2.00 USER S MANUAL

TotalShredder USB. User s Guide

S1C17 Family Application Library S1C17 Series Steps Calculation Library

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

Statement of Volatility XEROX 700 Digital Color Press

User's Guide. User Notice. Copyright

USB Flash Drive. RoHS Compliant. AH321 Specifications. February 17 th, Version 1.7. Apacer Technology Inc.

Typical File Extensions File Structure

nrf5x Command Line Tools v9.4.0

nrf5x Command Line Tools v9.2.0

User Guide. Storage Executive Command Line Interface. Introduction. Storage Executive Command Line Interface User Guide Introduction

Reference Manual VCM-DOC-1. Bootable DiskOnChip Module for the PC/104 Bus MVCMDOC1

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

CMT2110A/2210A One-Way RF Link Development Kits User s Guide

Atmel-Synario CPLD/PLD Design Software ATDS1100PC ATDS1120PC ATDS1130PC ATDS1140PC. Features. Description

& WizChan. Driver Documentation

USB-Disk Module 3. RoHS Compliant. Specification. January 13, Preliminary. Apacer Technology Inc.

USB Bootloader GUI User s Guide

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

CS3600 SYSTEMS AND NETWORKS

AVR1315: Accessing the XMEGA EEPROM. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

S1C17 Family Application Note S1C17 Series Boot Loader Sample Software

APPLICATION NOTE. Atmel AVR116: Wear Leveling on DataFlash. 32-bit Atmel Microcontrollers. Features. Description. Wear leveling

DYNAMIC ENGINEERING. 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est.

Partial Lock Writer User s Guide

PM9263 Getting Started with Windows CE 6.0

MLC. Mini SATA III Flash Module. HERMES-JI Series. Product Specification APRO MLC MINI SATA III FLASH MODULE

Initial Bootloader. On power-up, when a computer is turned on, the following operations are performed:

USB Flash Drive. RoHS Compliant. AH322 Specifications. November 26, Version 1.9. Apacer Technology Inc.

Windows Device Driver and API Reference Manual

Kinetis Flash Tool User's Guide

DYNAMIC ENGINEERING 150 DuBois, Suite 3 Santa Cruz, CA (831) Fax (831) Est

Xerox WorkCentre Statement of Volatility Version 1.0

S A N D I S K F L A S H M E M O R Y C A R D S W E A R L E V E L I N G

Statement of Volatility WorkCentre 6505

Using the PowerQUICC II Auto-Load Feature

ZCRMZNICE01ZEMG Crimzon In-Circuit Emulator

Computers in Business: Concepts in Hardware and Software

AN-1471 APPLICATION NOTE

DYNAMIC ENGINEERING 150 DuBois St., Suite C Santa Cruz, CA (831) Fax (831) Est.

M2351 Trusted Boot. Application Note for 32-bit NuMicro Family

GNU17V3 Setup Guide. Rev.2.0

DiskOnChip -Based MCP

Statement of Volatility Xerox igen TM 150 Digital Press

Contents. Notice. System Requirements. User Notice. Copyright. Software installation. FAT32 Format Utility. One Button File Backup.

The Early System Start-Up Process. Group Presentation by: Tianyuan Liu, Caiwei He, Krishna Parasuram Srinivasan, Wenbin Xu

CTWP005: Write Abort Handling for Cactus Technologies Industrial-Grade Flash-Storage Products

AT09381: SAM D - Debugging Watchdog Timer Reset. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

Technical Note. Reset Configurations for MT25Q, MT25T, and N25Q Flash Memory Devices. Introduction

AN2061 APPLICATION NOTE

Simplex 4190 TrueSite Workstation (TSW) Software Upgrade Instructions

Transcription:

Installing TrueFFS for DiskOnChip in Windows CE (All Versions) Installation Guide December 2003 91-SR-005-07-7L Rev. 4.8

DOCUMENT CONTROL INFORMATION DCO No.: Title Name Date Issued by: DiskOnChip Product Manager Amir Fridman December 25, 2003 Approved by: VP Operations and Product Management Rami Koren December 25, 2003 2 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

TABLE OF CONTENTS 1. Introduction... 4 2. Using DiskOnChip with Windows CE... 5 2.1. Overview...5 2.2. DiskOnChip System Architecture... 5 3. Incorporating the TrueFFS Driver in the Windows CE Image... 7 3.1. Updating the Binary Image Builder (BIB) Files... 7 3.2. Updating the Registry... 7 3.3. Parameter Descriptions... 10 3.3.1. Required Entries... 10 3.3.2. Optional Entries... 10 3.4. Booting from DiskOnChip... 13 4. TrueFFS Extended Functionality... 14 4.1. DiskOnChip Extended Functionality via IOCTL Calls... 14 4.2. Sample Code Using IOCTL Calls to the TrueFFS Driver... 14 5. Accessing the DiskOnChip FAT Partition at Start-Up... 17 5.1. Loading and Running Applications from the DiskOnChip FAT Partition... 17 5.2. Example... 17 6. Storing Registry Entries... 18 7. Additional TrueFFS Functionality... 19 7.1. Formatting DiskOnChip Under Windows CE... 19 7.2. Remote Update the of Windows CE Image in the Binary Partition... 19 8. Additional Information and Tools... 21 How to Contact Us... 22 3 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

1. INTRODUCTION M-Systems DiskOnChip is a family of high-performance flash disks. Starting from ETK (Microsoft s Windows CE Embedded Tool Kit) version 2.1, Windows CE provides native support for DiskOnChip through the TrueFFS driver (as of version 4.2 of the platform builder, this support is located in the third-party section). However, it is recommended to download the newest version of the TrueFFS driver directly from the M-Systems website at www.m-sys.com. This installation manual explains how to install DiskOnChip as an additional disk or as a boot device under Windows CE 2.x-3.0 and Windows CE.NET. In this manual, the term DiskOnChip refers to all the devices listed below. Devices Supported by TrueFFS 6.x DiskOnChip G3 DiskOnChip P3 DiskOnChip 2000 G3 Devices Supported by TrueFFS 5.x DiskOnChip Millennium Plus Mobile DiskOnChip DiskOnChip 2000 TSOP DiskOnChip Millennium DiskOnChip 2000 DiskOnChip DIMM 2000 4 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

2. USING DISKONCHIP WITH WINDOWS CE 2.1. Overview DiskOnChip has three primary uses in a Windows -CE-based system: Additional storage device: Storage for user programs, drivers and data. When used in this capacity, programs stored on DiskOnChip are not fully loaded into RAM for execution, but rather are paged into RAM on demand. For system configurations with a shell, DiskOnChip is displayed as an icon just like all other folders in the system. OS boot device: Storage for the Windows CE image and registry information to enable booting Windows CE directly from DiskOnChip. Non-Volatile Memory (NVM) device: DiskOnChip models with XIP functionality can store the system boot code, thus eliminating the need for an additional boot device (EEPROM, ROM or NOR flash). This can reduce the BOM and simplify production. 2.2. DiskOnChip System Architecture DiskOnChip devices appear under Windows CE as ordinary disk drives. From the application perspective, files on DiskOnChip are accessed via standard Win32 File I/O APIs, such as CreateFile() and ReadFile(). The TrueFFS driver implements its own data organization scheme, known as a Virtual Block Device Flash Translation Layer, which manages the memory cells on DiskOnChip. It is unnecessary for Windows CE to implement a separate flash file system to support linear flash devices. Instead, the FAT file system included in Windows CE can also services files on the flash media via the TrueFFS driver. The FAT file system does not directly read or write to the DiskOnChip hardware; the TrueFFS driver performs all low-level hardware access, and presents DiskOnChip to the file system as a block-oriented device. 5 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

A conceptual view of the control flow for reading a file from DiskOnChip is shown in Figure 1. Applications TrueFFS/TL Layer ReadFile() Win CE Kernel Built-in Flash (DiskOnChip) Socket Layer FAT FileSystem Code VirtualCopy() DeviceIOContril() DiskOnChip Device Manager DSK_IOControl() Figure 1: Reading a File from DiskOnChip The application calls the ReadFile() function using a handle to a file stored on DiskOnChip. The FAT file system translates the read request into logical blocks and searches the buffer cache for the requested blocks. If the blocks are not found, the file system issues an IOControl() request to read bytes from DiskOnChip. The TrueFFS driver receives the IOControl() request and responds by accessing DiskOnChip through one of the socket layers. 6 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

3. INCORPORATING THE TRUEFFS DRIVER IN THE WINDOWS CE IMAGE This section describes the modifications required in the system configuration to include the TrueFFS driver, and the required registry entries in the OS image. 3.1. Updating the Binary Image Builder (BIB) Files The makeimg.exe file uses binary Image Builder (BIB) files to build the OS image. To include the TrueFFS driver in the image, the system integrator has to include the trueffs.dll file in one of the BIB files. You can modify one of the platform s BIB files (typically platform.bib as TrueFFS is part of the platform hardware configuration). The TrueFFS.dll is used by the kernel in an early stage of the boot process, especially when using the HIVE-based registry or the BinFS. It those cases trueffs.dll should be in the same XIP region as the kernel. You must verify that trueffs.dll is included in the ce.bib file after building the OS image. ce.bib lists all the BIB files included in the image. 3.2. Updating the Registry The Windows CE Device Manager uses several registry subkeys under the HKEY_LOCAL_MACHINE\Drivers key when loading the TrueFFS driver. Built-in devices like DiskOnChip rely on the registry settings being available at boot time. These keys must therefore be part of the default registry. This section describes the registry entries used by the Device Manager to install the TrueFFS driver. The following entries must be added to the appropriate registry file, typically platform.reg, which is located at %_WINCEROOT%\platform\<Platform name>\files, where <Platform name> stands for the relevant platform being used, such as ARM Integrator. The registry entry key name indicates the device and partition number to which the key refers: Registry entry for device 0 partition 0: HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TrueFFS Registry entry for device 0 partition 1: HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TrueFFS1 Registry entry for device 0 partition 2: HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TrueFFS2 Registry entry for device1 partition 0: HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TrueFFS10 Registry entry for device 1 partition 2: HKEY_LOCAL_MACHINE\Drivers\ BuiltIn\TrueFFS12 7 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

The DocBase<xx> field in every registry entry indicates the WindowBases for the next DiskOnChip in the system. For example, when looking at the following registry entry: [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TrueFFS] refers to device 0 partition 0 [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TrueFFS1] refers to device 0 partition 1 [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TrueFFS2] refers to device 0 partition 2 The DocBase10 field in the first registry entry indicates that the WindowBase of device 1 is 0xD8000. The DocBase20 field in the first registry entry of device 1, [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TrueFFS1], indicates the WindowBase of device 2 is 0xc8000. Below is an example of registry entries customized for a CEPC platform with two DiskOnChip devices installed. The first device is further partitioned into three disk (BDTL) partitions. [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TrueFFS] Dll = TrueFFS.dll Prefix = DSK Order = dword:1 Ioctl = dword:4 FSD = FATFS.DLL WindowBase = dword:d0000 DocBase10 = dword:d8000 DeviceArrayIndex = dword:0 "IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}" ;CE.NET only [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TrueFFS1] Dll = TrueFFS.dll Prefix = DSK Order = dword:1 Ioctl = dword:4 FSD = FATFS.DLL WindowBase = dword:d0000 DeviceArrayIndex = dword:1 "IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}" ;CE.NET only [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TrueFFS2] Dll = TrueFFS.dll 8 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

Prefix = DSK Order = dword:1 Ioctl = dword:4 FSD = FATFS.DLL WindowBase = dword:d0000 DeviceArrayIndex = dword:2 "IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}" ;CE.NET only [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TrueFFS10] Dll = TrueFFS.dll Prefix = DSK Order = dword:1 Ioctl = dword:4 FSD = FATFS.DLL WindowBase = dword:d8000 DeviceArrayIndex = dword:3 "IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}" ;CE.NET only 9 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

3.3. Parameter Descriptions 3.3.1. Required Entries Every TrueFFS registry entry must contain the following keys: Dll : The name of the driver file (usually trueffs.dll). Prefix : The driver prefix. This is used when opening a device using CreateFile in order to operate extended driver functions. Order : For system use. See Windows CE help for details. IOCTL : For system use. See Windows CE help for details. FSD : The file system.dll file. TrueFFS typically uses the fatfs.dll file, but may use any file system for Windows CE that uses a 512-byte block device. WindowBase : The WindowBase parameter determines DiskOnChip s physical address in the system memory. The value should be within the 32-bit address range, and is determined during hardware design or system integration. Values shown here are for example only. DocBaseyy : The DiskOnChip WindowBase defined in the [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TruFFSyy] registry entry. This field is not required for the last device registry entry. DeviceArrayIndex : The order in which the system loads the devices. Iclass : GUID that defines the driver's exposed interface. The required value is A4E7EDDA- E575-4252-9D6B-4195D48BB865. This value is required only when using Windows CE.NET. 3.3.2. Optional Entries The following registry entries are optional: Folder (for Windows CE 3.0 or earlier): This parameter determines the folder name associated with the DiskOnChip partition. If this string is absent, the default name for Windows CE 3.0 and above is Storage Card, and for earlier versions of Windows CE the default name is DiskOnChip. If the Folder parameter is used to change the folder name (for example, to DiskOnChip), then the name defined in the Folder parameter is the actual name of the device. Profile (for Windows CE.NET): This parameter determines the profile name associated with the DiskOnChip partition. If this string is absent, the default name is TRUEFFS_DOC. The profile key is read by the Storage Manager in order to set the parameters of this partition. To set a dedicated name or folder name to a partition, change the profile setting of the Storage Manager with the profile name entered in this field. For more information about Storage Manager profiling, refer to the online platform builder documentation. AddressShift : This entry can only have the values 0, 1, or 2. This field determines the size of the DiskOnChip memory window. Some systems (such as StrongARM-based platforms) are unable to perform 8-bit transactions to the memory space. For example, connecting a 16-bit DiskOnChip to a platform that can perform only 32-bit memory transactions requires connecting DiskOnChip to the bus using single bit address shift (see the appropriate DiskOnChip data sheet). In this case, the memory window of DiskOnChip is doubled. 10 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

DocAccessType : This entry determines the data bus width when accessing DiskOnChip. The value of this entry can be as follows (in hex format): dword:8 - DiskOnChip is accessed on a byte (8-bit) boundary. dword:10-16-bit access. DiskOnChip is accessed on a word (16-bit) boundary. dword:20-32-bit access. DiskOnChip is accessed on a long (32-bit) boundary. Use8Bit : When set, TrueFFS uses 8-bit (1-byte) access to DiskOnChip instead of 32-bit access. Useful for buses that only work in 16-bit mode. This entry should be set to 1 in platforms such as XScale and StrongARM. dword:0-32-bit access (default) dword:1-8-bit access CustomizeAccess : TrueFFS supports many bus types and configurations, including 8/16/32-bit access, address shifts and various types of processors and bus controllers. In addition, you may instruct TrueFFS to use your own custom access routines, in cases where the standard TrueFFS access routines are not usable. The Windows CE TrueFFS driver supports calling an external DLL file (which can be supplied by M-Systems or written by the customer) that contains customized access routines for a specific platform configuration and specific DiskOnChip models. VerifyWrite : When using this parameter, TrueFFS performs an immediate read operation from the flash after every write cycle. The value of this entry can be as follows: dword:0 - Sets TrueFFS to Optimized Verify Write mode. This is the default TrueFFS mode for devices supported by INFTL, such as DiskOnChip Millennium Plus and Mobile DiskOnChip. In this mode, a sector is assumed to remain valid after it has been verified as long as no sudden power-down event occurs; therefore, no additional read operations (verifications) are performed. When recovering from a power failure, TrueFFS gradually verifies the validity of additional sectors as data is written to the disk partition. All the sectors on the disk are eventually verified, at which point no further verification is done and peak performance is achieved (default). dword:1 - Sets TrueFFS to Read Before and After Write mode. In this mode, each write operation is preceded by a read operation verifying the flash area is indeed erased, and followed by a read operation verifying the data was written properly. Only after both conditions are met is the sector considered to be written properly. Selecting this option results in lower write performance, but insures absolute data protection against power failures or any other event (such as errors caused from noisy buses, faulty flash, or flash close to its end of life). dword:2 - Sets TrueFFS to Standard mode. In this mode, a sector is considered written successfully when the flash media reports that the write operation ended successfully. Additional verification (using a read operation) is not performed, so TrueFFS works at peak performance regardless of past power failure events. This is the default mode for devices supported by NFTL, as these devices do not require additional verification for most applications. 11 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

RamCheck : During the DiskOnChip mounting process, a RAM test is performed to verify that the memory address where DiskOnChip resides is correct, or whether it behaves like RAM (as flash media does not behave like RAM, this function can detect if DiskOnChip is located at the correct address). This test may cause problems in some systems. Set the value of RamCheck to 0 to turn off this test. dword:0 - RAM check disabled (default) dword:1 - RAM check enabled UseCache : Enabling this option improves performance, but requires additional RAM resources. The NAND Flash Translation Layer (NFTL, INFTL, or SAFTL) uses a small part of each flash unit and sector for control information that allows accessing the data stored on DiskOnChip as a virtual block device. Setting this option to 1 enables caching this information in order to improve performance. dword:0 dword:1 (default) CacheSize : Sets the cache size. For SAFTL, it is possible to set the cache size in order to control the memory consumption of the driver. The size is set as the number of cached erasable units. The minimum value is 0x40. If the specified number is higher than the actual number of units in the device, then memory consumption is limited to the amount required for all units. The default value for UseCache = 0 is 0x40, and UseCache = 1 indicates a full cache. dword:x RemoveFatFilter : The Windows CE TrueFFS driver contains a FAT filter that monitors file system write operations to the FAT area. The TrueFFS driver uses this information to improve performance by deleting sectors from the media when the corresponding file is deleted. Use this entry to disable FAT filter operation. dword:1 AutoDPDMode : This option enables Auto Deep Power-Down mode, which reduces the average power consumption of DiskOnChip. Auto mode puts DiskOnChip in Deep Power-Down mode automatically after each driver command, and takes DiskOnChip out of Deep Power-Down mode automatically when the driver is called again. Using this mode disables the option of booting from DiskOnChip via software reset, as the IPL cannot be accessed from Deep Power-Down mode. In order to boot from a DiskOnChip device in Deep Power-Down mode, a hardware reset or powering off is required. This registry entry has no effect on DiskOnChip devices that do not support Deep Power-Down mode. dword:1 AutoFormat : This option enables autoformatting DiskOnChip if the device cannot be mounted during the initialization process. AutoFormat formats the device with a single disk partition in FAT format. This allows the driver to mount, and the user can then format the device as required using the FL_IOCTL_FORMAT_PHYSICAL_DRIVE IOCTL function. dword:1 12 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

3.4. Booting from DiskOnChip Booting Windows CE from DiskOnChip enables the system integrator to use a very small ROM in the system, storing the OS itself on DiskOnChip. Figure 2 illustrates the basic structure of a typical hardware system. CPU DiskOnChip (8-1024 MB) Contains the OS image and user files ROM or NOR flash (not needed when - using the DiskOnChip XIP boot block) RAM Other Devices Other Devices Figure 2: Basic Structure of a Typical Hardware Environment The system integrator generates a Windows CE image that contains the TrueFFS driver. This image is then placed on DiskOnChip, either as a standard file in the FAT file system or in a binary partition reserved especially for boot images. A boot loader is required to load this image into memory. The boot loader can be stored on DiskOnChip itself (in models with a Programmable Boot Block), or on EEPROM or NOR flash, and is invoked upon boot-up. The boot loader code consists of two parts: Code that performs basic system initialization tasks. Code that copies the Windows CE image (e.g. NK.BIN) from DiskOnChip to RAM and then jumps to the start address of the image. A minimal amount of ROM is required to implement this boot solution, usually in the range of 64-128KB. 13 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

4. TRUEFFS EXTENDED FUNCTIONALITY 4.1. DiskOnChip Extended Functionality via IOCTL Calls Version 6.1 of the TrueFFS driver for Windows CE enables the user to implement the following extended functionality of the TrueFFS and DiskOnChip hardware: Obtain information on DiskOnChip Hardware and software read/write protection Initiate garbage collection in the background Access the DiskOnChip binary partition Format DiskOnChip under Windows CE Read/write to/from the DiskOnChip OTP area Read the DiskOnChip device Unique ID (UID) Activate Deep Power-Down mode (low power consumption mode) These new features are accessible through standard Windows CE IOCTL calls to the TrueFFS driver, using the API provided in the ceioctl.h file. For more information on these IOCTL calls, refer to the DiskOnChip Driver Extended Functions Based on TrueFFS 6.x developer guide. Although this document specifies all IOCTL functionality, when using the Windows CE driver API, you should refer to the ceioctl.h file and not the developer guide. Sample programs using these IOCTL calls are located in the example directory of the TrueFFS driver for Windows CE. Section 4.2 illustrates a sample use of FL_IOCTL_GET_INFO. 4.2. Sample Code Using IOCTL Calls to the TrueFFS Driver // ***************************** // ** MAIN Get DiskOnChip info // ***************************** #include <windows.h> #include <winbase.h> #include ceioctl.h void TRACE(LPCTSTR szformat,...); int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hinstprev, LPWSTR pszcmdline,int ncmdshow) { 14 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

HANDLE hdev=null; // handle to the TrueFFS driver DWORD dwgarbage=0; // the amount of data returned BOOL bstatus=false; // return code from DeviceIoControl fldiskinfooutput diskinfooutput; floutputstatusrecord OutputStatusRecord; // Bind TrueFFS driver TRACE(TEXT("Binding TrueFFS driver\n")); hdev= CreateFile(TEXT("DSK1:"), GENERIC_READ GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if(hdev ==INVALID_HANDLE_VALUE) { TRACE(TEXT("Binding DiskOnChip driver failed.error %ld\n"),getlasterror()); hdev = NULL; return 1; } //Calling GetInfo extended function TRACE(TEXT("Calling GetInfo\n")); // get DiskOnChip information if(deviceiocontrol(hdev, FL_IOCTL_GET_INFO, NULL, 0, &diskinfooutput, sizeof(fldiskinfooutput), &dwgarbage, NULL)) 15 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

{ } else { TRACE(TEXT("ERROR code of %d while getting DiskOnChip information\n"),diskinfooutput.status); return 1; } TRACE(TEXT("\n The test completed successfully\r\n")); CloseHandle(hDev); hdev = NULL; return 0; } // FUNCTION NAME "TRACE" void TRACE(LPCTSTR szformat,...) { TCHAR szbuffer[512]; va_list pargs; va_start(pargs, szformat); wvsprintf(szbuffer, szformat, pargs); va_end(pargs); _tcscat(szbuffer, TEXT("")); OutputDebugString(szBuffer); } 16 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

5. ACCESSING THE DISKONCHIP FAT PARTITION AT START-UP 5.1. Loading and Running Applications from the DiskOnChip FAT Partition In Windows CE, applications can be integrated into NK.BIN or stored on the DiskOnChip FAT partition. Splitting the image by storing applications on the DiskOnChip FAT partition reduces the initial size of NK.BIN, and provides a flexible solution for upgrades. It also improves design regarding boot time and system performance, and frees up RAM space by loading only the most commonly used applications at start-up. This enables loading other applications to RAM, as required. A registry entry in NK.BIN is required so that applications that are stored in the DiskOnChip FAT partition may be loaded automatically upon boot-up. This entry should be added to the [HKEY_LOCAL_MACHINE\init] section of the Project.reg file. 5.2. Example The application user_application.exe is loaded automatically after the shell.exe, device.exe and gwes.exe applications are loaded on boot-up: [HKEY_LOCAL_MACHINE\init] "Launch10"= "shell.exe" "Launch20"= "device.exe" "Launch30"= "gwes.exe" "Depend30"= hex:14,00 "Launch40"= "user_application.exe" "Depend40"= hex:1e,00, 14,00 As DiskOnChip is not a default folder in Windows CE, a search path must be added to one of the registry (*.reg) files, similar to the PATH command in DOS: [HKEY_LOCAL_MACHINE\Loader] "SystemPath"= multi_sz:\\diskonchip\\ 17 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

6. STORING REGISTRY ENTRIES Non-volatile media such as DiskOnChip enable developers to save Windows CE registry entry changes, and to retain these modifications on subsequent boot-up of the target platform. This is facilitated by the Windows CE Persistent Registry Entries feature (introduced in Windows CE 2.11), which solves the problem of losing boot updates saved in volatile RAM registry entries. From Windows CE 4.1 and on, it is also possible to use the HIVE-based registry mechanism. Using this option enables including a minimal standard set of registry keys required for system startup, including the registry of the TrueFFS driver. The rest of the registry is stored as an FS file in the DiskOnChip block device folder. To learn more about using the HIVE-based registry mechanism, refer to the platform builder online help on HIVE-based registry. To learn more about implementing CE Persistent Registry storage with DiskOnChip, refer to application note AP-DOC-041, Windows CE Persistent Registry Storage using DiskOnChip. 18 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

7. ADDITIONAL TRUEFFS FUNCTIONALITY 7.1. Formatting DiskOnChip Under Windows CE The TrueFFS driver scans the system bus for installed DiskOnChip devices. If it locates a device that is physically unformatted, such as a new device, TrueFFS automatically formats it. This format operation also implements part of the CE formatter function, and places two copies of the FAT tables on DiskOnChip. If the installed DiskOnChip is formatted physically but not logically, meaning that no FAT files are found, Windows CE displays a formatting process confirmation during the boot process. If confirmed, Windows CE logically formats DiskOnChip. The boot sequence then continues smoothly, and no rebooting is required. The TrueFFS driver call FL_IOCTL_FORMAT_PHYSICAL_DRIVE IOCTL may be used to format the DiskOnChip manually, and to create disk partitions, protection, etc. Sample code for operating this IOCTL call (and others) is included in the examples directory of the TrueFFS CE driver for Windows CE. DiskOnChip can also be formatted using the TrueFFS SDK package, which is available from M-Systems. The TrueFFS SDK is supplied in source code, and requires a license agreement. If DiskOnChip can be physically removed from the development platform (using ZIF sockets), it is recommended to format the device on a PC platform running DOS. This requires a DiskOnChip EVB with a ZIF socket, and the ready-made DFORMAT utility for DOS. Use the TrueFFS SDK or the BDK source code provided by M-Systems to write the Windows CE image and data to the DiskOnChip binary partition, through files or buffers. The TrueFFS driver under Windows CE enables writing files to the FAT partition. Important: You must reboot your system in order to remount DiskOnChip. 7.2. Remote Update the of Windows CE Image in the Binary Partition The TrueFFS driver can be used to perform remote updates of data that reside on the DiskOnChip binary partition. The BDK code in the boot ROM enables the developer to update the DiskOnChip boot image from a remote server quickly and safely. For example, the end user can update the Windows CE image file NK.BIN, and drivers and applications that reside on the DiskOnChip binary partition via a dial-up or network port. A remote update can be performed in the following ways: Updating the binary partition with an application that uses the BDK write API, while the OS is running. Updating the binary partition upon boot-up, before the OS is launched Note: Win CE is 32WIN-API-driven, and slight changes may have to be made to the BDK functions to allocate memory and compile it. It is recommended to implement the VirtualAlloc() and VirtualCopy() Windows CE APIs in order to allocate the bdkwin pointer. 19 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

When updating the OS image itself, it is recommended to implement the remote update using the second option, before the OS is launched. As the update mechanism is included in the boot ROM or in the DiskOnChip binary partition itself (when DiskOnChip is used as the sole non-volatile memory device in the system), it is possible to restart if a power failure should occur during the update process. Figure 3 illustrates a boot ROM update scheme, using the BDK init and write API functions: Updating the OS image workflow System Init Code Do you want to update your OS image? Initiate a dial-up or network port for dowloading, and allocate a RAM buffer Download the new OS image from the rem ote server to the RAM buffer (typically 512 bytes) YES W rite the new OS image to the binary partition using the BDK init and write API functions NO End/Verify the updating process Copy the OS image from DiskOnChip to RAM Jump to the start address of the OS image in RAM Figure 3 Updating the OS Image Using BDK Functions 20 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

8. ADDITIONAL INFORMATION AND TOOLS Additional information about DiskOnChip, including data sheets and application notes, can be found at www.m-sys.com. More information about booting up a Windows CE system using DiskOnChip can be obtained from Bsquare at www.bsquare.com. Additional tools and documents are listed in the following table: Document/Tool Description Developer Guide DiskOnChip Boot Software Development Kit (BDK) Developer Guide DiskOnChip Driver Extended Functions Based on TrueFFS 6.x Application Note, AP-DOC-41 Windows CE Persistent Registry Storage Using DiskOnChip User Manual DiskOnChip Software Utilities Reference Guide Installing and Using DiskOnChip in Pocket PC 2003 21 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8

HOW TO CONTACT US USA M-Systems Inc. 8371 Central Ave, Suite A Newark CA 94560 Phone: +1-510-494-2090 Fax: +1-510-494-5545 Japan M-Systems Japan Inc. Asahi Seimei Gotanda Bldg., 3F 5-25-16 Higashi-Gotanda Shinagawa-ku Tokyo, 141-0022 Phone: +81-3-5423-8101 Fax: +81-3-5423-8102 Taiwan M-Systems Asia Ltd. Room B, 13 F, No. 133 Sec. 3 Min Sheng East Road Taipei, Taiwan R.O.C. Tel: +886-2-8770-6226 Fax: +886-2-8770-6295 China M-Systems China Ltd. Room 121-122 Bldg. 2, International Commerce & Exhibition Ctr. Hong Hua Rd. Futian Free Trade Zone Shenzhen, China Phone: +86-755-8348-5218 Fax: +86-755-8348-5418 Europe M-Systems Ltd. 7 Atir Yeda St. Kfar Saba 44425, Israel Tel: +972-9-764-5000 Fax: +972-3-548-8666 Internet http://www.m-sys.com General Information info@m-sys.com Sales and Technical Information techsupport@m-sys.com 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 www.m-sys.com to obtain the latest specifications before placing your order. 2003 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, SuperMAP, TrueFFS, udiskonchip and udoc 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. 22 Installing TrueFFS for DiskOnChip in Windows CE (All Versions) 91-SR-005-07-7L Rev. 4.8