Having to split this into two posts to keep within the size limit.
Geraint.
Part 1 -------------------------------------------------
Silvio Fiorito
silvio.fiorito at gmail.com
Late last year (2004), I started investigating how to implement certain features of XP Embedded into XP Pro in order to make an installation that could run off of a Compact Flash card. This page gives details on what I found. Particularly on how to use the Enhanced Write Filter (EWF), MinLogon, and Hibernate Once, Resume Many features from XPe in order to create a more robust and faster OS for my CarPC.
The first step in preparing a CF install is to download the XPe SP2 trial from Microsoft’s MSDN site:
http://msdn.microsoft.com/embedded/windo...fault.aspx. The install will create a network share on your system called ‘Repositories’. This is where all the XPe components are stored.
MinLogon This is an optional component and is not necessary for running XP from a CF card, but it has been shown to improve boot time. Search the repositories for the latest version of minlogon.exe and transfer it to the PC.
1. First go to your Windows\System32 directory and rename the file winlogon.exe to winlogon.exe.bak.
2. Copy the minlogon.exe file to the Windows\System32 directory renaming it winlogon.exe.
3. If Windows File Protection comes up warning you about changing the file just cancel the dialog and continue. Make sure that the new MinLogon file isn’t replaced by Windows File Protection!
4. Next import the following registry entries by creating a text file called ‘minlogon.reg’. Edit the file and enter the following text:
Code:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"Config"=dword:00000017
5. Save the file and then merge it into the registry by double-clicking on it. Double-check the registry to make sure the entries were entered properly.
6. Reboot the system.
As long as you entered everything properly the system will boot into XP using the System account. The first time you boot up it’ll prepare the user settings for the System account so it’ll take a bit longer than usual. Once that is done, go ahead and reboot again to make sure everything is working properly. If you find that it doesn’t fit your needs then just restore the original WinLogon.
EWF Now that MinLogon is working properly you can go ahead and set up EWF. Before you do so, make sure you disable the Paging File by right-clicking on ‘My Computer’, clicking the ‘Advanced’ tab, clicking the ‘Performance’ button, clicking the ‘Change’ button in the ‘Virtual memory’ section, and selecting ‘No paging file’. You’ll also want to disable System Restore, again by right-clicking on ‘My Computer’, selecting the ‘System Restore’ tab, and checking ‘Turn off System Restore’. One bug I’ve found is that booting with EWF, XP always brings up the recovery options at boot up. We can disable this by deleting the ‘bootstat.dat’ file under the Windows directory. You’ll need to search the Repositories directory again for 3 files: ewf.sys, ewfntldr, and ewfmgr.exe. Make sure you get the latest versions.
1. Rename the ntldr file on your root drive to ntldr.bak.
2. Move the ewfntldr file to your root renaming it ntldr.
3. Move ewfmgr.exe to your Windows\System32 folder.
4. Move ewf.sys to your Windows\System32\drivers folder.
5. Create a text file called ‘ewf.reg’ and enter the following text:
Code:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction]
"Enable"="N"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OptimalLayout]
"EnableAutoLayout"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"NtfsDisableLastAccessUpdate"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters]
"EnablePrefetcher"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager]
BootExecute=""
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_EWF]
"NextInstance"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_EWF\0000]
"Service"="EWF"
"Legacy"=dword:00000001
"ConfigFlags"=dword:00000020
"Class"="LegacyDriver"
"ClassGUID"="{8ECC055D-047F-11D1-A537-0000F8753ED1}"
"DeviceDesc"="EWF"
"Capabilities"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_EWF\0000\Control]
"ActiveService"="EWF"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ewf]
"ErrorControl"=dword:00000001
"Group"="System Bus Extender"
"Start"=dword:00000000
"Type"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{71A27CDD-812A-11D0-BEC7-08002BE2092F}]
"UpperFilters"="Ewf"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ewf\Parameters\Protected\Volume0]
"Type"=dword:00000001
"ArcName"="multi(0)disk(0)rdisk(0)partition(1)"
6. Pay special attention to the last entry, ArcName. That points to the volume you want protected. This script will default to the first partition of the master drive on the primary IDE controller. As long as you have your CF card as the master drive on the primary IDE controller you’ll be fine.
7. The first few entries are optimizations for EWF enabled systems. We’ve disabled automatic defrag as well as prefetch for instance, to minimize disk writes. I also included a tweak to disable the NTFS last access file timestamp. In case you use NTFS on your system you don’t want the OS constantly updating timestamps for files you access, creating unnecessary disk writes.
8. Now, save the file. Before you merge it you need to alter the permissions on one registry key. In regedit, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root. Right-click on Root and click ‘Permissions’. Set ‘Everyone’ to have Full Control and then merge the file by double-clicking on it. Like you did for MinLogon, ensure that all values were entered properly and then reset the Root key permissions to the way they were before.
9. Reboot the system.