Non-Volatile Object Store And Hive Based Registry Design For Windows CE 刘由顺 软件架构师 北京华夏互动文化传播有限公司.

Slides:



Advertisements
Similar presentations
计算机系 信息处理实验室 Lecture 5 Startup and Shutdown
Advertisements

Configuration Files CGS2564. DOS Config.sys Device drivers Memory configuration Autoexec.bat Run programs, DOS commands, etc. Environment settings File.
EMB304 Building Trustworthy Windows CE Embedded Devices and Applications Ganapathy Raman Program Manager Windows CE Security Team Microsoft Corporation.
北京邮电大学. Sep Wireless and EMC Lab 主要内容 实验室研究方向 实验室研究方向 承担项目情况 承担项目情况 对外合作 对外合作 培养方向 培养方向 就业分配 就业分配 实验室文化 实验室文化.
石化的 IT 大挑战 洛阳石化工程公司. 石化公司简介 中国石化集团洛阳石油化工工程公司,是国内能源化 工领域集技术专利商与工程承包商于一体的高科技企 业。拥有中国综合设计甲级资质,为国家首批业务涵 盖 21 个行业的工程咨询企业之一,拥有工程总承包、 工程设计、工程监理、工程咨询和环境影响评价等甲.
Basic Input Output System
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 12: Managing and Implementing Backups and Disaster Recovery.
Week:#14 Windows Recovery
湖南省赛宝软件服务有限公司 信息报送及申报系统演示 湖南省赛宝软件服务有限公司 李纠.
Hands-On Microsoft Windows Server 2003 Administration Chapter 6 Managing Printers, Publishing, Auditing, and Desk Resources.
Application Repackaging - Naushad Ali T Doddamani.
 Contents 1.Introduction about operating system. 2. What is 32 bit and 64 bit operating system. 3. File systems. 4. Minimum requirement for Windows 7.
Source XP vs Windows 7 XPWin 7.
Operating System & Application Files BACS 371 Computer Forensics.
OS and Application Files BACS 371 Computer Forensics.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 12: Managing and Implementing Backups and Disaster Recovery.
70-293: MCSE Guide to Planning a Microsoft Windows Server 2003 Network, Enhanced Chapter 14: Problem Recovery.
How To Write A Windows CE SDIO Client Driver
COMP1321 Digital Infrastructure Richard Henson February 2012.
Windows 95 requirements l 80386DX or higher machine l at least 4 MB of RAM (8 MB recommended) l mouse l VGA or better monitor l hard drive with at least.
IT Essentials: PC Hardware and Software 1 Chapter 7 Windows NT/2000/XP Operating Systems.
Administering Windows 7 Lesson 11. Objectives Troubleshoot Windows 7 Use remote access technologies Troubleshoot installation and startup issues Understand.
Course ILT Monitoring and management Unit objectives Identify the stages of the Windows startup process Use Windows 2000 Professional and Windows XP utilities.
Basic Input Output System
Hands-On Microsoft Windows Server 2008
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner.
Module 13: Configuring Availability of Network Resources and Content.
EMB318 Improve Product Quality Using Windows CE Error Reporting (Watson) James Stulz Program Manager Windows CE Core Tools Microsoft Corporation.
EMB315 Non-Volatile Object Store And Hive Based Registry Design For Windows CE Rick Austin Principle Engineer Intermec Corporation.
Tutorial 11 Installing, Updating, and Configuring Software
Computers Are Your Future Eleventh Edition Chapter 4: System Software Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall1.
Windows CE 5.0 Memory Architecture Li-Ming Fan Escalation Engineer Microsoft GCR-GTSC.
EMB426 Windows CE Memory Architecture Steve Maillet CEO/Chief Software Architect EmbeddedFusion.
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Project Management November.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 12: Managing and Implementing Backups and Disaster Recovery.
EMB423 Creating A Trusted Environment For Windows CE 5.0 Nat Frampton President Real Time Development
Module 12: Managing Disaster Recovery. Overview Preparing for Disaster Recovery Backing Up Data Scheduling Backup Jobs Restoring Data Configuring Shadow.
Implementing Hyper-V®
CN1176 Computer Support Kemtis Kunanuraksapong MSIS with Distinction MCTS, MCDST, MCP, A+
5. Windows System Artifacts Part 1. Topics Deleted data Hibernation Files Registry.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 13 Understanding and Installing Windows 2000 and Windows NT.
Enabling Media Playback On Windows CE 5.0 Li-Ming Fan Escalation Engineer Microsoft GCR GTSC.
14 Step-by-Step Instructions for an Upgrade Installation n Prepare for the installation Verify that all devices and applications are Windows 2000 compatible.
Windows Vista Inside Out Chapter 24 – Recovering From an Computer Crash Last modified am.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 13 Understanding and Installing Windows 2000 and Windows NT.
1 Week #10Business Continuity Backing Up Data Configuring Shadow Copies Providing Server and Service Availability.
新一代移动物联系统 MC MOBILE CONTROL 开启办公物联网时代 Product Promotion.
Cody, Brian, and Jerry. Contains configuration options for a boot menu. The file is hidden and read-only to protect it from user configuration. Microsoft’s.
Managing Services and Registry Chapter 16 powered by dj.
Developing Windows CE 5.0 OAL Li-Ming Fan Escalation Engineer Microsoft GCR-GTSC.
Understanding Backup and Recovery Methods Lesson 8.
荆门市总工会会员信息采集系统 操作培训 融建信息技术有限公司 肖移海 QQ群号:
I T Essentials I Chapter 5 JEOPARDY Installing & UpgradingComputerBasicsErrorsServicePotpourri
© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 1 Third Edition Chapter 7 Under the Windows Desktop McGraw-Hill.
森林保护学本科系列课程 教学改革与实践 西北农林科技大学 一、基本情况 二、主要成果 三、创新点 四、成果的应用 项目研究背景 项目的总体设计 成果简介 解决的主要教学问题 解决教学问题的方法 改革前后的对比.
© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 1 Third Edition Chapter 7 Under the Windows Desktop McGraw-Hill.
CLI210 Introduction To Managed Development For Devices With Visual Studio 2005 Scott D. Smith Program Manager Visual Studio for Devices Microsoft Corporation.
Using Advanced Platform Builder Debugger Features Chenghui Lian Microsoft China Technology Center.
Hands-On Microsoft Windows Server 2008 Chapter 7 Configuring and Managing Data Storage.
A+ Guide to IT Technical Support, 9th Edition
Windows Forensic MD Saquib Nasir Khan (JONK) DEA- Data64
Lesson 9: SOFTWARE ICT Fundamentals 2nd Semester SY
Chapter Objectives In this chapter, you will learn:
Under the Windows Desktop
Hands-On Microsoft Windows Server nd Edition
CONFIGURING HARDWARE DEVICE & START UP PROCESS
Windows Under the Hood Chapter 13.
Windows Registry: Introduction
Modern PC operating systems
Presentation transcript:

Non-Volatile Object Store And Hive Based Registry Design For Windows CE 刘由顺 软件架构师 北京华夏互动文化传播有限公司

History RAM Registry –SYSGEN_FSREGRAM Most Common Implementation in PDAs Content Loss on boot Save And Restore Methods require difficult code –pReadRegistryFromOEM –pWriteRegistryToOEM RAM Object store –SYSGEN_FSRAMROM most common denominator for application development Object Store Volume is always mounted Object Store is the Root of the file system Content Loss on cold boot –Object Store and Executable Memory Tradeoff FSRAMPERCENT SetSystemMemoryDivision() RAM Object store limited to 256 MB

Persistence Benefits Simplifies Cold Boot System startup –Data and Configuration is permanent –Install applications once –Reduce Data Backup/Restore Requirement –Eliminate Redundant Data storage Requirement –Reduce Cold Boot Times –No Limit On Object Store Size

Persistence Benefits Better Power Management –Reduce/Remove Backup Battery needs –Increase Battery run time –Lower RAM requirements = Lower Power Easy to Implement –Largely Transparent to current Apps –Mainly Simple Registry Setup Required Lower Cost systems –Flash is cheaper than RAM for Data Store

Boot Phase Definitions 0 = Prior to init of locale (wince.nls) 1 = After locale init (wince.nls) but before registry is functional 2 = After registry is functional

File System Fundamentals Autoload file systems –HKLM\System\StorageManager\AutoLoad –Do not need block drivers –Don’t require Device.exe –Loaded by Storage Manager –Can Start in BootPhase 0 or 1 –Can Load Synchronously or Asynchronously [HKLM\System\StorageManager\Autoload\ ] “BootPhase” = dword:0 “LoadFlags” = dword:0 ;Async (default) ;Sync = 1

File System Fundamentals Block Driver Based File Systems –Loaded By Device.exe –IClass indicates its managed by storage manager {A4E7EDDA-E D6B-4195D48BB865} –Specifies partition and File system drivers –Must Start in Bootphase 1 HKLM\Drivers\Builtin\ “BootPhase” = dword:1

Hive Fundamentals Hives are registry files stored on persistent file systems –Boot Hive Changes made during boot are copied to system hive –Default Hive / System Hive System Data (HKLM, HKCR, HKU) –User Hive User Data (HKCU) Allows settings for different users at logon Only Deltas are stored

Hive Fundamentals The kernel starts Filesys.exe Filesys loads the Boot Hive from the ROM Image Filesys may start Device.exe to gain access to system hive –Device.exe starts block drivers based on the boot registry The boot file system is initialized based on registry keys Filesys loads and mounts system registry The Kernel initializes using the system registry The Kernel signals Filesys Filesys.exe starts applications (Launch Keys) –Device.exe is loaded if not already loaded –Filesys.exe signals BootPhase2 event –Device.exe then re-enumerates, starting drivers

Hive Fundamentals [HKLM\init\BootVars] "SystemHive"=" ” "Start DevMgr"=dword: ; 0 = don’t start ; 1 = Start “Default User”=“ ” “ProfileDir”= “Flags” = dword:3 ;Bit 0 = start storage manager ;Bit 1 = start device manager “RegistryFlags”=dword: ;1 = enables aggressive flushing ;0 = default behavior

Hive Implementation Select Catalog Components –Hive Based Registry support (SYSGEN_FSREGHIVE) –Storage Manager Components SYSGEN_STOREMGR FAT (SYSGEN_FATFS) ? TFAT (SYSGEN_TFAT) ? Partition Driver (SYSGEN_MSPART) ? Components required depends on boot device –See Examples

Hive Implementation Define Registry Hive Boot Sections –Define the drivers and other system components required to start the system and access the boot media. –Wrap all boot hive registry entries in the following comments ;Hive Boot Section ;End Hive Boot Section –Common.reg has default definitions

Hive Implementation Prevent device.exe from loading drivers twice [HKLM\Builtin\drivers\...] “Flags”=dword:1000 Analyze the File system components required to load the device used to store the hives Does it need partitioning or format? Beware of drivers that use IsAPIReady() Enable Additional Debug Zones [HKCU\Pegasus\Zones] "FileSys" = dword:20

Hive Implementation Indicate System Registry Location [HKLM\System\StorageManager\Profiles\ \ ] "MountFlags"=dword:2 or “MountAsBootable”=dword:1

Hive Implementation Implement Registry Flushing –Suspend/Resume/PowerDown Flushing is automatic if power aware (more later) –Do one or more of the following Enable Aggressive Flushing [HKLM\init\BootVars] “RegistryFlags"=dword:1 RegFlushKey() during power down Enable Lazy Flushing Environment Variable at build time –PRJ_ENABLE_REGFLUSH_THREAD

Persistent Object Store Select the Catalog Components –Select ROM-Only File System from Catalog (SYSGEN_FSROMONLY) –Select Storage Manager Components from Catalog SYSGEN_STOREMGR FAT (SYSGEN_FATFS) ? FAT (SYSGEN_TFAT) ? Partition Driver (SYSGEN_MSPART) ?

Persistent Object Store Mount Root File System [HKLM\System\StorageManager\Profiles\ ] “MountAsRoot” = dword:1

Persistent Object Store Update FSRAMPERCENT in Config.bib –Defaults to 0x if not set –Set FSRAMPERCENT to >= 32KB –Still need some RAM for Object Store Operations Recycle Bin Copy Operations Manage Stack and Memory Heap Compress and Expand Files –*pOEMCalcFSPages()

Exploring A Persistent System

iPSM Example ; This registry setting indicates the PSM contains the registry and sets PSM ; to load in the first boot phase with the boot registry. [HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\PSM] "Dll"="PSMFSD.dll" "Paging"=dword:1 "LoadFlags"=dword:1 "MountFlags"=dword:2 "Flags"=dword:1000 "MountAsRoot"=dword:1;makes psm the root of the file system "MountAsBootable"=dword:1 ;specifies the drive contains the system hive. "BootPhase"=dword:1 ;NLS support needed ; The following key loads the PSMLock dll to support power management issue with PSM [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PSMLock] "Prefix"="PSL" "Dll"="PSMLock.Dll" "IClass"=multi_sz:"{8DD679CE-8AB4-43c8-A14A-EA4963FAA715}"

iPSM Example ; This registry key specifies the name of the PSM folder. [HKEY_LOCAL_MACHINE\Drivers\Builtin\FlshDrv] "FolderName"="Flash File Store“ [HKEY_LOCAL_MACHINE\System\StorageManager] "Dll"="fsdmgr.dll“ ; This flag tells the device manager to load fsdmgr in the first boot phase ; with the boot registry, and not to load it a second time in the second ; boot phase with the system registry "Flags"=dword:1000 [HKEY_LOCAL_MACHINE\System\Platform] "RegPath" = "\\Flash File Store" [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\PSM] "MountAsRoot"=dword:1;makes PSM the root of the file system "MountAsBootable"=dword:1 ;specifies PSM contains the system hive. "BootPhase"=dword:1 ; NLS support is required

DOC Example [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TrueFFS] "Index"=dword:1 "Index"=dword:1 "Dll"="TrueFFS.dll" "Dll"="TrueFFS.dll" "Prefix"="DSK" "Prefix"="DSK" "Order"=dword:1 "Order"=dword:1 "Ioctl"=dword:4 "Ioctl"=dword:4 "AutoFormat"=dword:1 ; test for format to boot "AutoFormat"=dword:1 ; test for format to boot "DocAccessType"=dword:10 "DocAccessType"=dword:10 "WindowBase"=dword:0c "WindowBase"=dword:0c "IClass"="{A4E7EDDA-E D6B-4195D48BB865}“ "IClass"="{A4E7EDDA-E D6B-4195D48BB865}“ "Flags"=dword:1000 ;avoid loading the driver twice "Flags"=dword:1000 ;avoid loading the driver twice "BootPhase"=dword:1 ;NLS support required "BootPhase"=dword:1 ;NLS support required

DOC Example [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\TRUEFFS_DOC] "Name"="DiskOnChip M-Systems" "Folder"="DiskOnChip" "AutoFormat"=dword:1 ;auto format if needed "AutoPart"=dword:1 ;auto partition if needed [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\TRUEFFS_DOC] "DefaultFileSystem"="FATFS" "AutoMount"=dword:1;mount any partition automatically "MountAsRoot"=dword:1;makes trueffs the root of the file system "MountAsBootable"=dword:1;specifies that Trueffs contains the system hive. "BootPhase"=dword:1;NLS required [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\TRUEFFS_DOC\FATFS] “MountAsBootable"=dword:1 ;FATFS is mounted as bootable "MountAsRoot"=dword:1 ;FATFS contains the system hive

Debug Example

Power Management Considerations Use SetSystemPowerState() –allow power manager to properly flush file system on suspend/resume cycles –Implement Graceful Shutdowns –Software enabled cold and warm boots –IClass {8DD679CE-8AB4-43c8-A14A-EA4963FAA715} indicates Power Managed Block Device Provide methods to protect against file system corruption –TFAT –Other software methods –Hardware methods –System recovery tools (ScanVolume())

Performance Considerations Performance will be slower than RAM based Object Store Consider the System Data Use NOR Flash Memory –Fast Read –Slower Write than NAND NAND Flash Memory –Slower Read than Nor –Faster Write than Nor RamDrive can be used to boost application performance Implement Proper File System Caching –HKLM\SYSTEM\StorageManager\FATFS “EnableCache” = dword:1 “CacheSize” = dword:? FATFS_VERIFY_WRITES Flag ? FATSF_WRITETHROUGH Flag ? Implement Proper System Data Caching Tune File System Drivers for Performance

Application Considerations Rogue Applications can prevent boot Implement Clean/Safe Boot –Format Media IOCTL_HAL_QUERY_FORMAT_PARTITON –Restore Default (ROM) Hive IOCTL_HAL_GET_HIVE_CLEAN_FLAG –Old Registry is deleted –New Registry is created –Reverts system to Factory Defaults –Provide tools for diagnosis of failure Read Media from Bootstrap –Diagnose Registry –Diagnose File System

Application Considerations Registry Save and Restore functions exist RegSaveKey(HKEY_LOCAL_MACHINE,…) RegReplaceKey(HKEY_LOCAL_MACHINE,…) RegSaveKey(HKEY_CURRENT_USER,…) SetCurrentUser(NULL,…) CopyFile(CurrentUser,….) Use Persisted Keys for determining when to backup registry [HKEY_LOCAL_MACHINE] "RegPersisted"=dword:1 [HKEY_CURRENT_USER] “RegPersisted”=dword:1

Questions?

Tools & Resources msdn.microsoft.com/ embedded microsoft.public. windowsxp.embedded windowsce.platbuilder windowsce.platbuilder windowsce.embedded.vc windowsce.embedded.vc blogs.msdn.com/ mikehall Windows CE 5.0 Eval Kit Windows XP Embedded Eval Kit msdn.microsoft.com/ mobility microsoft.public. pocketpc.developer smartphone.developer dotnet.framework.compactframework blogs.msdn.com/ windowsmobile vsdteam netcfteam Windows Mobile 5.0 Eval Kit Websites Newsgroups Blogs Tools Build Develop

请在课程结束后填写课程培训反馈表,参加抽奖。 请填写资料袋内的蓝色大会满意度反馈表,到大会接待台领取 《 Windows Mobile 手机应用开发》工具书。 您还可以: 参加 Windows Mobile 动手实验室; 参观微软及合作伙伴展区; 体验基于 Windows Mobile 平台开发的最新硬件产品及解决方案。 大会注意事项