Webinar - Booting x86 Systems Into Windows Embedded Compact 7
Webinar - Booting x86 Systems Into Windows Embedded Compact 7
• Author
– Programming Embedded Windows CE
• Fourth Edition
Agenda
• Storage Basics
• PC Boot Basics
Boot Sector
Master Boot Record
Desktop limitations on The Partition Table
• Windows expects 2 partitions
– Primary
– Extended
• BIOS loads first sector into RAM (in real mode) at 0:7C00
– Then jumps to address 0:7C00
• Bootsector searches disk for specific file and loads it into RAM
– Name of file and search method depends on format type
– Boot code then jumps to first byte of loaded sectors
• BIOSLOADER (BLDR)
– No need for DOS
– Works with FAT12/16/32 and ExFAT
• Code location
– WINCE700\platform\CEPC\src\bootloader\dos\loadcepc
Installing LoadCEPC
• Typically device is booted into DOS with system diskette
• Difficult to build
– Requires patch scripts that won’t run under Win64 systems
• XLDR component
– Switches to protected mode
– Finds WCELDR in root directory
– Scans file for 0xB000FF signature which is start of .bin file
– Reads packets of .bin file and places in RAM
– Jumps to start of new .bin image (BLDR)
WCELDR Sequence (2)
• BLDR
– Displays prompt for menu mode vs download
– If download, downloads from current download source (Ethernet/disk)
– If menu, displays menu and executes command
• Show Current Settings
• Set Boot Device
• Select KITL Device
• Network Settings
• Display Settings
• Debug Port Settings
• Save Settings
• Exit and Continue
Modifying WCELDR
• Modifications would generally be made to BLDR component
– XLDR really doesn’t know much except the directory structure
– XLDR.nb0
• Binary image of XLDR
– BLDRCfg.nb0
• Mostly empty file 512 byte file with BLDR.BIN
“BLDRCFG” as the header characters
• Used to save configuration changes
– BLDR.BIN
• Actual bootloader
• Automatically loads from configured
boot device or goes to menu BLDRCfg.nb0
Doug Boling
Boling Consulting Inc.
www.bolingconsulting.com
dboling @ bolingconsulting.com
©©
2011
2011Microsoft
Microsoft Corporation.
Corporation. AllAll rights
rights reserved.
reserved. ThisThis presentation
presentation is for informational
is for informational purposespurposes only.makes
only. Microsoft Microsoft makes noexpress
no warranties, warranties, express
or implied, or summary.
in this implied, in
this summary.
Building A Boot Sector
• Need access to an older assembler
– MASM 6 available from MSDN
– Take care to use the proper linker
• Understand GetBSect.scr
– A script for DEBUG.EXE (Won’t run on Win64 systems)
– Trims the length of image to code