SlideShare a Scribd company logo
1 of 67
Developing a Windows CE
OAL
Mr. Dhiraj Rane
Management
Tools
Communications
& Messaging
Device Update Agent
Software Update Services
Live Communications Server
Exchange Server
Internet Security and Acceleration Server
Speech Server
Image Update
Location Services
Multimedia
MapPoint
DirectX
Windows Media
Visual Studio 2005
Development Tools
MFC 8.0, ATL 8.0
Win32
Native
Managed
Server Side
Lightweight
Relational
SQL Server 2005 Express Edition
EDB
D
ata
P
rogramming
M
odel
Device Building
Tools
Hardware/Drivers
Windows XP DDK
Windows Embedded
Studio
Platform Builder
OEM/IHV Supplied
BSP
(ARM, SH4, MIPS)
OEM Hardware and
Standard Drivers
Standard PC
Hardware and Drivers
SQL Server 2005
SQL Server 2005 Mobile Edition
ASP.NET Mobile Controls ASP.NET
.NET Compact Framework .NET Framework
Microsoft Operations Manager
Systems Management Server
Agenda
Windows CE 5.0 BSPs and Kernels
Development Process
OAL
Architecture and Design
Boot Sequence and Required OAL Functions
Kernel and KITL
Optional OAL Functions
Building
Power Management
OAL Testing – Greg Prier
MEDC Call to Action
Questions?
Additional Information
Best Practices/Recommendations
Windows CE 5.0 BSPs
Windows CE 5.0 BSPs/CSPs
Family BSP/CSP Kernel
ARM
Intel Mainstone II ARMV4I
Samsung SMDK-2410 ARMV4I
CSP Only - Intel Xscale Lubbock ARMV4I
MIPS
AMD DBAu1000 MIPSII
AMD DBAu1100 MIPSII
AMD DBAu1500 MIPSII
NEC Solution Gear2 Vr4131 MIPSII (MIPS16)
NEC Solution Gear2 Vr5500 MIPSII & II_PF, MIPSIV & IV_FP
Broadcom VoIP Reference MIPSII
SH SH4 Aspen SH4
x86
x86 (CEPC) x86
x86 Emulator x86
Geode x86
Intel Assabet and Lubbock (use Mainstone II)
ARM Integrator (use Samsung SMDK2410)
SH3 Keywest (deprecated)
BSPs NO LONGER
SUPPORTED
Windows CE 5.0 Kernels
Kernels & OS builds in 4.2 = 9
ARMV4, ARMV4I, ARMV4T
MIPSIIB/16, MIPSII, MIPSII_FP, MIPSIV, MIPSIV_FP
SH3, SH4
x86
Kernels & OS builds in 5.0 = 7
ARMV4I, ARMV4
MIPSII, MIPSII_FP, MIPSIV, MIPSIV_FP
SH4, SH3
x86
Agenda
Windows CE 5.0 BSPs and Kernels
Development Process
OAL
Architecture and Design
Boot Sequence and Required OAL Functions
Kernel and KITL
Optional OAL Functions
Building
Power Management
OAL Testing – Greg Prier
MEDC Call to Action
Questions?
Additional Information
Best Practices/Recommendations
BSP Development Process
Test Hardware,
Rom Monitor
Develop
Boot Loader
Clone Reference
BSP
Power
Management
Develop OAL
(Minimal Kernel)
Add
Device Drivers
Package
(CEC/MSI)
Boot Loader Architecture
A typical development boot loader
blcommon
OEM code
eboot
…
NE2000
RTL8139
DP83815
bootpart
flash FMD
EDBG drivers
Bootloader Architecture
Blcommon – generic boot loader framework
OEM code – general board init and extensions
Eboot – Ethernet functions (UDP, DHCP, TFTP)
EDBG drivers – Ethernet drivers
3Com 3C90x, AMD AM79C97x, CS8900A, NS
DP83815, NE2000, RealTek RTL8139, SMSC9000 &
SMSC100
Bootpart – storage partition management
FMD – flash management driver
Samsung/Sandisk (NAND), Intel StrataFlash (NOR)
Agenda
Windows CE 5.0 BSPs and Kernels
Development Process
OAL
Architecture and Design
Boot Sequence and Required OAL Functions
Kernel and KITL
Optional OAL Functions
Building
Power Management
OAL Testing – Greg Prier
MEDC Call to Action
Questions?
Additional Information
Best Practices/Recommendations
Windows CE 5.0 BSPs
Reduce OS “bring-up” time on OEM hardware
Avoid changing the "public" OAL interface
Provide production features (power management, performance
optimizations, IOCTLs, etc.)
Maximize code re-use (and testing)
Provide a consistent OAL architecture that can be easily
extended/customized
Increase BSP coverage in-the-box
One BSP for each supported CPU
Integrate BSPs into the IDE Catalog
Integrate BSPs into the Platform Wizard
Enable third parties to create BSPs easily
Ship CSP drivers for many CPUs and SOCs
PB Tools - BSP Wizard and IDE tools
Enables faster, easier porting to OEM devices
PQOAL Design
Collection of OAL software libraries organized by CPU architecture (or
model) and by OAL “function”
Common Code Directory Structure
BSP configuration files are located in a single location
(platform<BSP>srcinc)
Chip/set Support Package (CSP) drivers share include files that define
hardware registers and layout
RTC
Cache
Library
Interrupt
Library
IOCTL
Library
Startup
Library
RTC
Library
KITL
Library
OS
Timer
Library
Timers Caches
Serial
port
Ethernet
port
USB
port
OAL
Kernel
Hardware
Directory Structure Example
platformcommonsrc
inc
ARM
common
cache
memory
ARM720T
ARM920T
Intel
Samsung
S3C2410
inc
interrupt
power
RTC
startup
timer
MIPS, SHx, x86
common
platform<BSP_name>
cesysgen
files
intltrns
0409
…
src
bootloader
kernel
OAL
kern
kernkitl
kernkitlprof
inc
common
debug
drivers
PCMCIA
Common code directory BSP code directory
BSP Configuration Files
BSP configuration files are located in a single
location (platform<BSP>srcinc)
Simplifies porting/customization work
Consistent file naming scheme
args.h – bootloader-OAL shared memory structure
bsp.h – master bsp include file
bsp_base_regs.h – board-level address definitions
bsp_cfg.h – general BSP configs (device name, clock
settings,…)
image_cfg.h – memory layout address definitions
ioctl_cfg.h – definitions used by BSP IOCTL routines
ioctl_tab.h – IOCTL function table
kitl_cfg.h – KITL transport name/device/driver table
oemaddrtab_cfg.inc – (ARM/x86) VA-PA mapping table
Shared Design
Chip/set Support Package (CSP) drivers will share include files
that define hardware registers and layout
publiccommonoakcsparmsamsungs3c2410xinc:
s3c2410x.h
s3c2410x.inc
s3c2410x_adc.h
s3c2410x_base_regs.h
s3c2410x_base_regs.inc
s3c2410x_clkpwr.h
s3c2410x_dma.h
s3c2410x_iicbus.h
s3c2410x_iisbus.h
s3c2410x_intr.h
s3c2410x_ioport.h
s3c2410x_lcd.h
s3c2410x_memctrl.h
s3c2410x_nand.h
s3c2410x_pwm.h
s3c2410x_rtc.h
s3c2410x_sdi.h
s3c2410x_spi.h
s3c2410x_uart.h
s3c2410x_usbd.h
s3c2410x_wdog.h
Creating A BSP
BSP wizard
IDE Tool to clone BSP or create a BSP definition
Can add/remove drivers to a BSP definition
Export wizard
IDE Tool to export feature components from the IDE Catalog to
other PB users
Creates a MS Windows Installer (MSI) file
CEC editor
IDE Tool to create and/or edit .CEC files
A .CEC file defines the properties of an object/component in the
IDE catalog
No more .bsp files
Two methods to create a BSP
Use the command line method
Use the BSP Wizard
Both methods rely on cloning a sample BSP
Creating An OAL
Create directory for OAL code in the BSP
platform<BSPname>kerneloal
Add <dirname> to “dirs” file to build OAL with BSP
Required OAL functions
Startup
Debug serial
OEMInit
System timer
Interrupt processing
Kernel input/output, KITL
Optional OAL functions (Platform Dependent)
Real-time clock and timer
Parallel port I/O code
Ethernet port debug
More information in PB docs
“How-to Create an OEM adaptation layer”
Agenda
Windows CE 5.0 BSPs and Kernels
Development Process
OAL
Architecture and Design
Boot Sequence and Required OAL Functions
Kernel and KITL
Optional OAL Functions
Building
Power Management
OAL Testing – Greg Prier
MEDC Call to Action
Questions?
Additional Information
Best Practices/Recommendations
CE 5.0 Boot Sequence
Boot loader startup sequence
Startup()
EbootMain()
BootloaderMain()
OEMDebugInit()
OEMPlatformInit()
OEMPreDownload()
Download Occurs
OEMLaunch()
Kernel startup sequence
Startup(
)
KernelStart()
ARMInit()
OEMInitDebugSerial()
OEMInit()
KernelInit()
HeapInit()
InitMemoryPool()
ProcInit()
SchedInit()
FirstSchedule()
SystemStartupFunc()
IOCTL_HAL_POSTINIT
Required OAL Functions
Startup
Debug Serial
OEMInit
System Timer
Interrupt Processing
Kernel Input/Output
Example: Custom Kernel IOCTL
KITL
StartUp
First function called when target device boots
Purpose is to initialize CPU to known state and
to call the kernel initialization function
(KernelInitialize for x86 and KernelStart on all
other platforms)
ARM
example
LEAF_ENTRY StartUp
. . .
; Initialize CPU to a known state
; Set up OEMAddressTable for KernelStart
. . .
bl KernelStart
. . .
; KernelStart should never return
Debug Serial
OEMInitDebugSerial()
Configures Speed, Parity, Stop bit length
OEMReadDebugByte()
Retrieves a byte from the debug monitor
port
OEMWriteDebugByte()
Outputs a byte to the debug monitor port
OEMWriteDebugString()
Writes a string to the debug monitor port
OEMInit
Required task is to set up hardware
and register interrupt for the
system tick
ISRs and HookInterrupt
Setting Up the Interrupt Map
Define a mapping of Interrupt IDs
Mapping can be dynamic at driver load time
Interrupt IDs’ are returned by the ISRs to
the kernel and are used to link an
incoming IRQ with a software IST
OEMInit: An Example
Void OEMInit() {
SetUpInterruptMap();
PCIInitBusInfo();
InitDebugEther();
OEMParallelPortInit()
InitPICs();
InitClock();
if (MainMemoryEndAddress == CEPC_EXTRA_RAM_START)
{
MainMemoryEndAddress += IsDRAM(MainMemoryEndAddress,
CEPC_EXTRA_RAM_SIZE);
}
pKDIoControl = OEMKDIoControl;
}
Interrupt Processing
OEMInterruptEnable()
Performs hardware operations necessary to allow
a device to generate the specified interrupt
Includes
Setting a hardware priority for the device
Setting a hardware interrupt enable port
Clearing any pending interrupt conditions from the device
OEMInterruptDisable()
Disables the specified hardware interrupt
OEMInterruptDone()
Unmasked and reenables of interrupt processing
Interrupt Processing
OEMGetInterrupt()
Used by the any device wanting and IRQ. Example
PCI bus
OEMRequestSysIntr()
Used in the OEMIoControl routine to implement
IOCTL_HAL_TRANSLATE_IRQ and
IOCTL_HAL_REQUEST_SYSINTR
OEMTranslateIrq()
Used by the main ISR to translate a non-shareable
IRQ into a SYSINTR
OEMTranslateSysIntr()
Translates a SYSINTR to its corresponding IRQ
System Timer
Make sure the system timer interrupt is
registered with the ISR
Program the system timer to generate
an interrupt every 1ms
Can also support variable tick
In the system timer ISR, update the
global system tick counter CurMSec
and CurTicks. If reschedule time is
expired then return SYSINTR_Resched
else SYSINTR_NOP
Agenda
Windows CE 5.0 BSPs and Kernels
Development Process
OAL
Architecture and Design
Boot Sequence and Required OAL Functions
Kernel and KITL
Optional OAL Functions
Building
Power Management
OAL Testing – Greg Prier
MEDC Call to Action
Questions?
Additional Information
Best Practices/Recommendations
Kernel Libraries
Library Description
kern.exe kernkitl.exe kernkitlprof.exe
basickernel
kernel w/ dbg
suppt
kernel w/
profiling suppt
Nk.lib Microprocessor-specific
Kernel code that MS supplies X X
Hal.lib OAL that you implement for
target HW X X X
NkProf.lib Profile version of the MS
Kernel code X
KITL.lib Kernel Independent
Transport Layer (KITL)
debugging services X X
SMC9000 Sample Ethernet debugging
driver. Must have for KITL
suppt X X X
FullLibc Microsoft C Run-Time Library X X X
Kernel Input/Output
OEMIoControl is called by the kernel when a device driver or
application program calls the KernelIoControl function
Extend the Ethernet Debugging Interface
BOOL OEMIoControl(. . .)
{
switch (dwIoControlCode) {
case IOCTL_HAL_SET_DEVICE_INFO :
case IOCTL_HAL_REBOOT:
. . .
default:
return FALSE;
}
return TRUE;
}
Example: Custom
Kernel IOCTL
#define IOCTL_MY_CONTROL1 
CTL_CODE(FILE_DEVICE_HAL, 2048,
METHOD_NEITHER, FILE_ANY_ACCESS)
BOOL OEMIoControl(. . .) {
switch (dwIoControlCode)
{
case IOCTL_MY_CONTROL1:
. . .
}
RetCode = KernelIoControl( IOCTL_MY_CONTROL1 ,
. . . );
KITL
Kernel Independent Transport Layer
Designed to provide an easy
way for you to support any
debug service
OEM Function to implement
is OEMKitlINit
Including the KITL support
in the operating
system image
Vmini not always necessary.
EDBG driver can talk directly
to desktop
Passive KITL also available
Agenda
Windows CE 5.0 BSPs and Kernels
Development Process
OAL
Architecture and Design
Boot Sequence and Required OAL Functions
Kernel and KITL
Optional OAL Functions
Building
Power Management
OAL Testing – Greg Prier
MEDC Call to Action
Questions?
Additional Information
Best Practices/Recommendations
Optional OAL Functions
Real-time Clock and Timer
OEMGetExtensionDRAM()
Real-time Clock And Timer
OEMGetRealTime()
Called by the kernel to get the time from the real-
time clock
OEMSetRealTime()
Sets the real time clock
OEMSetAlarmTime()
Sets the alarm time
OEMQueryPerformanceCounter()
Retrieves the current value of the high-resolution
performance counter, if one exists
OEMQueryPerformanceFrequency()
Retrieves the frequency of the high-resolution
performance counter, if one exists
OEMGetExtensionDRAM()
pNKEnumExtensionDRAM AND
OEMEnumExtensionDRAM
Example 2
Extended
4MB DRAM
available at
0x81800000
Example 1
No extension
DRAM
available
BOOL OEMGetExtensionDRAM(LPDWORD lpMemStart,
LPDWORD lpMemLen)
{
return FALSE; // no extension DRAM
}
BOOL OEMGetExtensionDRAM(LPDWORD lpMemStart,
LPDWORD lpMemLen)
{
*lpMemStart = 0x81800000;
*lpMemLen = 0x00400000; // 4MB
return TRUE;
}
Building OAL and Kernel
No longer necessary to SYSGEN OAL libraries
Shared OAL code is built just before the BSP directory
(platformcommon)
BSP kernel (kern.exe) sources file:
TARGETLIBS= 
$(_COMMONOAKROOT)lib$(_CPUDEPPATH)nk.lib 
$(_TARGETPLATROOT)lib$(_CPUDEPPATH)oal.lib 
$(_PLATCOMMONLIB)$(_CPUINDPATH)oal_startup_s3c2410x.lib 
$(_PLATCOMMONLIB)$(_CPUINDPATH)oal_abort_s3c2410x.lib 
$(_PLATCOMMONLIB)$(_CPUINDPATH)oal_cache_s3c2410x.lib 
$(_PLATCOMMONLIB)$(_CPUINDPATH)oal_memory_s3c2410x.lib 
$(_PLATCOMMONLIB)$(_CPUDEPPATH)oal_io_s3c2410x.lib 
$(_PLATCOMMONLIB)$(_CPUINDPATH)oal_intr_s3c2410x.lib 
$(_PLATCOMMONLIB)$(_CPUINDPATH)oal_timer_s3c2410x.lib 
$(_PLATCOMMONLIB)$(_CPUINDPATH)oal_rtc_s3c2410x.lib 
$(_PLATCOMMONLIB)$(_CPUINDPATH)oal_ioctl_s3c2410x.lib 
$(_PLATCOMMONLIB)$(_CPUDEPPATH)oal_other.lib 
$(_PLATCOMMONLIB)$(_CPUDEPPATH)oal_log.lib 
$(_COMMONOAKROOT)lib$(_CPUINDPATH)ddk_io.lib 
$(_COMMONOAKROOT)lib$(_CPUDEPPATH)kitl.lib 
$(_COMMONOAKROOT)lib$(_CPUINDPATH)fulllibc.lib 
$(_PLATCOMMONLIB)$(_CPUINDPATH)oal_ethdrv_cs8900a.lib
OAL Power
Management Functions
OAL Power Management Functions
OEMIdle – Puts the CPU in reduced power mode
OEMPowerOff – Puts the CPU in suspend mode
Device Drivers Power Management Functions
xxx_PowerDown, xxx_PowerUp for stream
interface drivers
Device-specific functions for other drivers
SetInterruptEvent
Agenda
Windows CE 5.0 BSPs and Kernels
Development Process
OAL
Architecture and Design
Boot Sequence and Required OAL Functions
Kernel and KITL
Optional OAL Functions
Building
Power Management
OAL Testing – Greg Prier
MEDC Call to Action
Questions?
Additional Information
Best Practices/Recommendations
OAL Tests
Available in CE 5.0
Timers/Clock support
Caches
IOCTLs
Future Tests
Interrupts
Memory Configuration
KITL and VMINI
Bootloader
Etc.
Test Harness
CETK tests
Can also be run from the standard shell
OAL Test Requirements
Booting Tinykern
KITL connection
OAL Timer Tests
Three clocks: GTC, RTC, and QPC
The Test currently checks
Resolution
Always increasing (except rollover)
Clock drift
Compares results against thresholds
Cache Testing
Currently verify correctness,
not performance
Read and write different patterns into
the cache, exercising
boundary conditions
Allow the tester to confirm the
cache parameters
IOCTL Testing
Confirm that an errant call won’t crash
the kernel
IOCTL_HAL_GET_DEVICEID
IOCTL_HAL_GET_UUID
More to come
More Information
PB docs
Source code
Lab
Testing the Windows CE 5.0 OAL
Thursday 11:15 – 12:30
Agenda
Windows CE 5.0 BSPs and Kernels
Development Process
OAL
Architecture and Design
Boot Sequence and Required OAL Functions
Kernel and KITL
Optional OAL Functions
Building
Power Management
OAL Testing – Greg Prier
MEDC Call to Action
Questions?
Additional Information
Best Practices/Recommendations
While at MEDC 2005…
Fill out an evaluation for this session
Randomly selected instant WIN prizes!
Use real technology in a lab
Instructor led Reef E/F & Breakers L
Self-paced Reef B/C
Visit the Microsoft Product Pavilion
in the Exhibit Hall Shorelines B
After The Conference…
Develop
Build
Install
Build
Join
Install
Enter
Join
Full-featured trial versions of Windows CE
and/or Windows XP Embedded
Cool stuff & tell us about it:
msdn.microsoft.com/embedded/community
Windows Embedded Partner Program:
www.mswep.com
Windows Mobile 5.0 Eval Kit including
Visual Studio 2005 Beta 2
Mobile2Market Contest and win up to $25000:
mobile2marketcontest.com
Microsoft Solutions Partner Program:
partner.microsoft.com
Tools & Resources
msdn.microsoft.com/
embedded
microsoft.public.
windowsxp.embedded
windowsce.platbuilder
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
Agenda
Windows CE 5.0 BSPs and Kernels
Development Process
OAL
Architecture and Design
Boot Sequence and Required OAL Functions
Kernel and KITL
Optional OAL Functions
Building
Power Management
OAL Testing – Greg Prier
MEDC Call to Action
Questions?
Additional Information
Best Practices/Recommendations
Questions?
OAL Best Practices
Enable KITL
Kernel Independent Transport Layer
Provides easy way to support any debug service
Include KITL support in the OS image
Enable Kernel Tracker (CELOG)
CELog is the Event Tracking engine that’s loaded into
the Kernel
PB ships a standard CELOG DLL
To enable event tracking, call LoadKernelLibrary with
celog.dll
Enable Ethernet sharing if single port(VMINI)
publiccommonoakdriversethdbgvbridge
publiccommonoakdriversethdbgvmini
OAL Best Practices
Implement PM Functions
OEMIdle: Puts CPU in reduced power mode
OEMPowerOff: Puts CPU in suspend mode
xxx_PowerDown, xxx_PowerUp for stream
interface drivers
Implement unique device ID for DRM use
Implement IOCTL_HAL_GET_UUID
ID based upon an OEM-defined device
hardware identifier
OAL Best Practices
Reuse the BSP code provided in CE 5.0
If the %_WINCEROOT%PlatformCommon
implementation does not meet your needs, only
copy the library that you need to replace
Reduce environment variable use
Create a different BSP directory for each variation
instead of creating just one BSP directory
Follow the layout and naming scheme for
directories and files so that code can be
located more easily
OAL Best Practices (Security)
Review your BSP code
Validate your inputs to make sure that you are only using
valid data
Make sure that the pointer being provided as data input is not NULL.
If you know what the data format should look like, make sure that you
validate the data and not use it if the format is wrong
Validate the arguments for the IOCTLs
Avoid implementing code in the IOCTL that could potentially open
your system to attacks; Always review your IOCTL code for
security concerns
Catch poorly written DMA drivers that use or overuse the
FlushDCache or OEMCacheRangeFlush functions
Overuse of these two functions in OEM calls or application calls can
slow down the system
Test your images before releasing them
Make sure that you remove code used only for development
purposes from your final code or product
Shared Interrupts
Issue/Concern – Providing a single mask for more than one interrupt may results in missed
interrupts.
Recommendation – Provide a mask for each interrupt as close to the interrupts as possible.
Issue/Concern – Mixing edge and level triggering on shared interrupts may result in missed
interrupts.
Recommendation – Don’t mix edge and level triggering on shared interrupts.
Int 1
Int 2
X
Int 1
Int 2 X
X
X = Interrupt Mask
Int 1
Int 2
X = Interrupt Mask
L
X
X
Int 1
Int 2
X
X
Int 1
Int 2
X
X
L
L
GIISR.dll
OAL ISR
Int #1
Int #n
Shared Interrupts wavedev.dll
UHCI.dll
UART.dll
X
X
X
Generic Installable ISR.
Common code keeps track
of all interrupt devices
associated with IRQ
Put highest
priority and most
often interrupts
at top
Drivers must
register
Address and
Mask to
GIISR.dll
Installable ISR Handler
Recommendation
Use GIISR.dll when sharing interrupts to keep ISR in OAL
simple, which will avoid confusion when
adding/deleting/changing interrupts
GIISR.dll allows drivers to be plugged in dynamically
** Current Macallan plans are to support up to 64
Total SYSINTR; TBD on the number of those to be
user SYSINTR
UART2.dll
UART3.dll
UART1.dll
X
X
X
ISR
SYSINTR
IST
Sharing
SYSINTR Design
Issue/Concern
Windows CE provides for 16 reserved and 24 user SYSINTR; As
SOC’s (for example) become more and more prevalent, the need for
more than 24 user SYSINTR is needed
Recommendation
Use IST sharing to minimize the number of SYSINTR needed by
the design
CPU Host Bridge
Device
PCI Bus
RAM
DMA
IOCTL_HAL_REBOOT
Recommendation
Implement IOCTL_HAL_REBOOT to be able to reset all board logic; Make sure
board level reset reinitializes to boot time state
This IOCTL supports a warm boot of the target device; A request to perform a
warm boot is made by calling the OEMIoControl function with
IOCTL_HAL_REBOOT
If a device calls for a reboot and it uses DMA, IOCTL_HAL_REBOOT takes care of
memory issues to make sure that RAM doesn’t continue to be updated through DMA
from the device
CPU
Host Bridge
Device
PCI Bus
RAM
Aperture Registers
PCI Host Bridge Aperture Registers
Issue/Concern
There is typically not enough space in the memory aperture
range in the host bridge
Recommendation
Use PCI cards with a suitable amount of memory for the for
the system selected
Example – Perm3 requires 128kb of PCI memory from the PCI
bus. Some PCI busses on have 128kb of memory; This
starves all other PCI devices
CPU
PCI/PCMCIA
Bridge
PCI Bus
RAM
LCD Host Bridge
802.11b
PCI Bus Mastering (DMA)
Issue/Concern
There are typically issues in the way that the PCI bus arbitrates
devices that are on the bus; Poor arbitration design can lead to
starving other devices, system resources, or hanging the device
Recommendation
Use proper bus arbitration to allow other devices to use system
resources when needed
Example – PCMCIA 802.11b card owning the bus too long can
lead to starving of the LCD because the 802.11b card is taking up
all CPU time
CPU
Host Bridge
Device
PCI Bus
RAM
DMA
DMA Routines in CEDDK
Recommendation
Utilize the CEDDK DMA Routines. CEDDK is an essential tool for creating
platform independent device drivers
Abstraction of Bus Architectures
Abstraction of I/O mechanisms
Abstraction of DMA buffer allocation
HalTranslateSystemAddress()
Translates a system wide address to a bus relative address
Default implementation is a 1:1 mapping on PCI only
Assumes PCI buses all have access to full RAM space via host bridge
HalAllocateCommonBuffer()
Allocates a buffer of contiguous physical memory for DMA usage
Does NOT allocate DMA channels
CEDDK does not provide any abstraction for DMA controllers at this point
HalFreeCommonBuffer()
Releases a buffer allocated with HalAllocateCommonBuffer()
Normally only used when the driver is unloading
CPU
PCI/PCMCIA
Bridge
PCI Bus
Host Bridge
Device
Byte Enable Lines
Device
CPU Byte Enable Lines
Issue/Concern
Variable width transfer bus needs to enable byte lines on
reads and writes; Current designs only provide for bytes
lanes on writes, which will cause problems with destructive
read operations
Recommendation
Enable byte lines on buses with variable width transfers for
reads and writes
Multiple Hardware Timers
Issue/Concern
System that provide a single timer for multiple
functions can lead to clock error issues
Recommendation
Provide a single timer that is used for the system
1ms TIC.
Provide additional timers for profilers and other
OS, Bus, Multimedia needs
Fixed interval timers should be avoided in mobile
battery-powered systems as there is no way for
the kernel to conserve power with OEMIdle
Peripheral Devices
Recommendations
USB Function controller should be able perform disconnect
signal and then connect signal either by reset or by program;
If these signals are not connected, Windows XP may not be
able to determine what state the device is in and ignore the
device during device initialization or suspend/resume; USB
cable may need to be physically disconnect and reconnected
to resolve
Ethernet MAC – Provide a default MAC address for all
peripheral devices and make sure that they all have unique
subnet addresses; MAC addresses located in flash can be
erased; We recommend locating the MAC address in a read
only location
Ethernet MAC – Provide DMA support in Ethernet Controllers
OEMAddressTable
Issue/Concern
Set up the OEMAddressTable efficiently
Recommendation
Don’t overlap Address
Make sure most commonly used components at top of list
Make sure design is consistent with config.bib
he data must be declared in a READONLY section and there must be at least one non-zero
entry for the structure to be valid
For x86 platforms, the first entry must identify RAM, and it must start at 0x80000000
For ARM platforms, 0x80000000 can be mapped to anything
The Size must be a multiple of 4MB for x86 platforms and a multiple of 1MB for ARM; The
last entry of the table must be zeroed. You can leave holes between ranges but you cannot
have overlapping ranges
The only valid virtual memory mapping range is from 0x80000000 to 0x9FFFFFFF; For every
entry created in the table, the kernel creates two virtual address ranges; One exists in the
virtual address range from 0x80000000 to 0x9FFFFFFF and is memory that has caching and
buffering enabled; The second exists in the virtual address range from 0xA0000000 to
0xBFFFFFFF and has caching and buffering disabled
Any memory that is not mapped at boot time cannot be directly accessed by an interrupt
service routine (ISR) without first calling CreateStaticMapping to map the address
OEMCacheRangeFlush
Recommendation
Implement OEMCacheRangeFlush correctly and efficiently
Use pre-configured OEMCacheRangeFlush style
OEMCacheRangeFlush replaces calls to FlushDCache, FlushICache,
and TLBClear in Windows CE .NET 4.2 and later.
If you are implementing this function you should perform TLB
flushes at the end of the function. For example, if
dwFlags==(CACHE_SYNC_DISCARD|CACHE_SYNC_FLUSH_TLB,
the cache discard operation is usually performed before the TLB
flush
Some of the CSP routines reference global variables containing
cache and TLB size information; Your platform must resolve these
variables. You can further optimize such CSP implementations by
hard-coding variables in a private implementation of
OEMCacheRangeFlush in your platform; If you want to modify or
override CSP implementations of caching code, you must put the
relevant source files in the KernelBuildexe directory and modify
each of the source files in its subdirectories to build the file

More Related Content

Similar to Developing a Windows CE OAL.ppt

Design of embedded systems tsp
Design of embedded systems tspDesign of embedded systems tsp
Design of embedded systems tspPradeep Kumar TS
 
Design of embedded systems
Design of embedded systemsDesign of embedded systems
Design of embedded systemsPradeep Kumar TS
 
Snug2007 Presentation
Snug2007 PresentationSnug2007 Presentation
Snug2007 Presentationclkalyan
 
AAME ARM Techcon2013 003v02 Software Development
AAME ARM Techcon2013 003v02  Software DevelopmentAAME ARM Techcon2013 003v02  Software Development
AAME ARM Techcon2013 003v02 Software DevelopmentAnh Dung NGUYEN
 
AMulti-coreSoftwareHardwareCo-DebugPlatform_Final
AMulti-coreSoftwareHardwareCo-DebugPlatform_FinalAMulti-coreSoftwareHardwareCo-DebugPlatform_Final
AMulti-coreSoftwareHardwareCo-DebugPlatform_FinalAlan Su
 
Introduction to Accelerators
Introduction to AcceleratorsIntroduction to Accelerators
Introduction to AcceleratorsDilum Bandara
 
System_on_Chip_SOC.ppt
System_on_Chip_SOC.pptSystem_on_Chip_SOC.ppt
System_on_Chip_SOC.pptzahixdd
 
Track B- Advanced ESL verification - Mentor
Track B- Advanced ESL verification - MentorTrack B- Advanced ESL verification - Mentor
Track B- Advanced ESL verification - Mentorchiportal
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011pundiramit
 
Hardware Probing in the Linux Kernel
Hardware Probing in the Linux KernelHardware Probing in the Linux Kernel
Hardware Probing in the Linux KernelKernel TLV
 
Performance and Power Profiling on Intel Android Devices
Performance and Power Profiling on Intel Android DevicesPerformance and Power Profiling on Intel Android Devices
Performance and Power Profiling on Intel Android DevicesIntel® Software
 
Raspberry Pi tutorial
Raspberry Pi tutorialRaspberry Pi tutorial
Raspberry Pi tutorial艾鍗科技
 
2015 10-30 面試心得分享
2015 10-30 面試心得分享2015 10-30 面試心得分享
2015 10-30 面試心得分享Hung Liu
 
LAS16-300: Mini Conference 2 Cortex-M Software - Device Configuration
LAS16-300: Mini Conference 2 Cortex-M Software - Device ConfigurationLAS16-300: Mini Conference 2 Cortex-M Software - Device Configuration
LAS16-300: Mini Conference 2 Cortex-M Software - Device ConfigurationLinaro
 
Driving The Platform 2
Driving The Platform 2Driving The Platform 2
Driving The Platform 2Aero Plane
 

Similar to Developing a Windows CE OAL.ppt (20)

Design of embedded systems tsp
Design of embedded systems tspDesign of embedded systems tsp
Design of embedded systems tsp
 
Design of embedded systems
Design of embedded systemsDesign of embedded systems
Design of embedded systems
 
Slimline Open Firmware
Slimline Open FirmwareSlimline Open Firmware
Slimline Open Firmware
 
Snug2007 Presentation
Snug2007 PresentationSnug2007 Presentation
Snug2007 Presentation
 
AAME ARM Techcon2013 003v02 Software Development
AAME ARM Techcon2013 003v02  Software DevelopmentAAME ARM Techcon2013 003v02  Software Development
AAME ARM Techcon2013 003v02 Software Development
 
AMulti-coreSoftwareHardwareCo-DebugPlatform_Final
AMulti-coreSoftwareHardwareCo-DebugPlatform_FinalAMulti-coreSoftwareHardwareCo-DebugPlatform_Final
AMulti-coreSoftwareHardwareCo-DebugPlatform_Final
 
Introduction to Accelerators
Introduction to AcceleratorsIntroduction to Accelerators
Introduction to Accelerators
 
C C N A Day2
C C N A  Day2C C N A  Day2
C C N A Day2
 
System_on_Chip_SOC.ppt
System_on_Chip_SOC.pptSystem_on_Chip_SOC.ppt
System_on_Chip_SOC.ppt
 
Track B- Advanced ESL verification - Mentor
Track B- Advanced ESL verification - MentorTrack B- Advanced ESL verification - Mentor
Track B- Advanced ESL verification - Mentor
 
Phillip 2015 08-28
Phillip 2015 08-28Phillip 2015 08-28
Phillip 2015 08-28
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
 
Hardware Probing in the Linux Kernel
Hardware Probing in the Linux KernelHardware Probing in the Linux Kernel
Hardware Probing in the Linux Kernel
 
Performance and Power Profiling on Intel Android Devices
Performance and Power Profiling on Intel Android DevicesPerformance and Power Profiling on Intel Android Devices
Performance and Power Profiling on Intel Android Devices
 
Raspberry Pi tutorial
Raspberry Pi tutorialRaspberry Pi tutorial
Raspberry Pi tutorial
 
2015 10-30 面試心得分享
2015 10-30 面試心得分享2015 10-30 面試心得分享
2015 10-30 面試心得分享
 
Evatronix track h
Evatronix   track hEvatronix   track h
Evatronix track h
 
LAS16-300: Mini Conference 2 Cortex-M Software - Device Configuration
LAS16-300: Mini Conference 2 Cortex-M Software - Device ConfigurationLAS16-300: Mini Conference 2 Cortex-M Software - Device Configuration
LAS16-300: Mini Conference 2 Cortex-M Software - Device Configuration
 
Agnostic Device Drivers
Agnostic Device DriversAgnostic Device Drivers
Agnostic Device Drivers
 
Driving The Platform 2
Driving The Platform 2Driving The Platform 2
Driving The Platform 2
 

Recently uploaded

IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 

Recently uploaded (20)

IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 

Developing a Windows CE OAL.ppt

  • 1. Developing a Windows CE OAL Mr. Dhiraj Rane
  • 2. Management Tools Communications & Messaging Device Update Agent Software Update Services Live Communications Server Exchange Server Internet Security and Acceleration Server Speech Server Image Update Location Services Multimedia MapPoint DirectX Windows Media Visual Studio 2005 Development Tools MFC 8.0, ATL 8.0 Win32 Native Managed Server Side Lightweight Relational SQL Server 2005 Express Edition EDB D ata P rogramming M odel Device Building Tools Hardware/Drivers Windows XP DDK Windows Embedded Studio Platform Builder OEM/IHV Supplied BSP (ARM, SH4, MIPS) OEM Hardware and Standard Drivers Standard PC Hardware and Drivers SQL Server 2005 SQL Server 2005 Mobile Edition ASP.NET Mobile Controls ASP.NET .NET Compact Framework .NET Framework Microsoft Operations Manager Systems Management Server
  • 3. Agenda Windows CE 5.0 BSPs and Kernels Development Process OAL Architecture and Design Boot Sequence and Required OAL Functions Kernel and KITL Optional OAL Functions Building Power Management OAL Testing – Greg Prier MEDC Call to Action Questions? Additional Information Best Practices/Recommendations
  • 4. Windows CE 5.0 BSPs Windows CE 5.0 BSPs/CSPs Family BSP/CSP Kernel ARM Intel Mainstone II ARMV4I Samsung SMDK-2410 ARMV4I CSP Only - Intel Xscale Lubbock ARMV4I MIPS AMD DBAu1000 MIPSII AMD DBAu1100 MIPSII AMD DBAu1500 MIPSII NEC Solution Gear2 Vr4131 MIPSII (MIPS16) NEC Solution Gear2 Vr5500 MIPSII & II_PF, MIPSIV & IV_FP Broadcom VoIP Reference MIPSII SH SH4 Aspen SH4 x86 x86 (CEPC) x86 x86 Emulator x86 Geode x86 Intel Assabet and Lubbock (use Mainstone II) ARM Integrator (use Samsung SMDK2410) SH3 Keywest (deprecated) BSPs NO LONGER SUPPORTED
  • 5. Windows CE 5.0 Kernels Kernels & OS builds in 4.2 = 9 ARMV4, ARMV4I, ARMV4T MIPSIIB/16, MIPSII, MIPSII_FP, MIPSIV, MIPSIV_FP SH3, SH4 x86 Kernels & OS builds in 5.0 = 7 ARMV4I, ARMV4 MIPSII, MIPSII_FP, MIPSIV, MIPSIV_FP SH4, SH3 x86
  • 6. Agenda Windows CE 5.0 BSPs and Kernels Development Process OAL Architecture and Design Boot Sequence and Required OAL Functions Kernel and KITL Optional OAL Functions Building Power Management OAL Testing – Greg Prier MEDC Call to Action Questions? Additional Information Best Practices/Recommendations
  • 7. BSP Development Process Test Hardware, Rom Monitor Develop Boot Loader Clone Reference BSP Power Management Develop OAL (Minimal Kernel) Add Device Drivers Package (CEC/MSI)
  • 8. Boot Loader Architecture A typical development boot loader blcommon OEM code eboot … NE2000 RTL8139 DP83815 bootpart flash FMD EDBG drivers
  • 9. Bootloader Architecture Blcommon – generic boot loader framework OEM code – general board init and extensions Eboot – Ethernet functions (UDP, DHCP, TFTP) EDBG drivers – Ethernet drivers 3Com 3C90x, AMD AM79C97x, CS8900A, NS DP83815, NE2000, RealTek RTL8139, SMSC9000 & SMSC100 Bootpart – storage partition management FMD – flash management driver Samsung/Sandisk (NAND), Intel StrataFlash (NOR)
  • 10. Agenda Windows CE 5.0 BSPs and Kernels Development Process OAL Architecture and Design Boot Sequence and Required OAL Functions Kernel and KITL Optional OAL Functions Building Power Management OAL Testing – Greg Prier MEDC Call to Action Questions? Additional Information Best Practices/Recommendations
  • 11. Windows CE 5.0 BSPs Reduce OS “bring-up” time on OEM hardware Avoid changing the "public" OAL interface Provide production features (power management, performance optimizations, IOCTLs, etc.) Maximize code re-use (and testing) Provide a consistent OAL architecture that can be easily extended/customized Increase BSP coverage in-the-box One BSP for each supported CPU Integrate BSPs into the IDE Catalog Integrate BSPs into the Platform Wizard Enable third parties to create BSPs easily Ship CSP drivers for many CPUs and SOCs PB Tools - BSP Wizard and IDE tools Enables faster, easier porting to OEM devices
  • 12. PQOAL Design Collection of OAL software libraries organized by CPU architecture (or model) and by OAL “function” Common Code Directory Structure BSP configuration files are located in a single location (platform<BSP>srcinc) Chip/set Support Package (CSP) drivers share include files that define hardware registers and layout RTC Cache Library Interrupt Library IOCTL Library Startup Library RTC Library KITL Library OS Timer Library Timers Caches Serial port Ethernet port USB port OAL Kernel Hardware
  • 13. Directory Structure Example platformcommonsrc inc ARM common cache memory ARM720T ARM920T Intel Samsung S3C2410 inc interrupt power RTC startup timer MIPS, SHx, x86 common platform<BSP_name> cesysgen files intltrns 0409 … src bootloader kernel OAL kern kernkitl kernkitlprof inc common debug drivers PCMCIA Common code directory BSP code directory
  • 14. BSP Configuration Files BSP configuration files are located in a single location (platform<BSP>srcinc) Simplifies porting/customization work Consistent file naming scheme args.h – bootloader-OAL shared memory structure bsp.h – master bsp include file bsp_base_regs.h – board-level address definitions bsp_cfg.h – general BSP configs (device name, clock settings,…) image_cfg.h – memory layout address definitions ioctl_cfg.h – definitions used by BSP IOCTL routines ioctl_tab.h – IOCTL function table kitl_cfg.h – KITL transport name/device/driver table oemaddrtab_cfg.inc – (ARM/x86) VA-PA mapping table
  • 15. Shared Design Chip/set Support Package (CSP) drivers will share include files that define hardware registers and layout publiccommonoakcsparmsamsungs3c2410xinc: s3c2410x.h s3c2410x.inc s3c2410x_adc.h s3c2410x_base_regs.h s3c2410x_base_regs.inc s3c2410x_clkpwr.h s3c2410x_dma.h s3c2410x_iicbus.h s3c2410x_iisbus.h s3c2410x_intr.h s3c2410x_ioport.h s3c2410x_lcd.h s3c2410x_memctrl.h s3c2410x_nand.h s3c2410x_pwm.h s3c2410x_rtc.h s3c2410x_sdi.h s3c2410x_spi.h s3c2410x_uart.h s3c2410x_usbd.h s3c2410x_wdog.h
  • 16. Creating A BSP BSP wizard IDE Tool to clone BSP or create a BSP definition Can add/remove drivers to a BSP definition Export wizard IDE Tool to export feature components from the IDE Catalog to other PB users Creates a MS Windows Installer (MSI) file CEC editor IDE Tool to create and/or edit .CEC files A .CEC file defines the properties of an object/component in the IDE catalog No more .bsp files Two methods to create a BSP Use the command line method Use the BSP Wizard Both methods rely on cloning a sample BSP
  • 17. Creating An OAL Create directory for OAL code in the BSP platform<BSPname>kerneloal Add <dirname> to “dirs” file to build OAL with BSP Required OAL functions Startup Debug serial OEMInit System timer Interrupt processing Kernel input/output, KITL Optional OAL functions (Platform Dependent) Real-time clock and timer Parallel port I/O code Ethernet port debug More information in PB docs “How-to Create an OEM adaptation layer”
  • 18. Agenda Windows CE 5.0 BSPs and Kernels Development Process OAL Architecture and Design Boot Sequence and Required OAL Functions Kernel and KITL Optional OAL Functions Building Power Management OAL Testing – Greg Prier MEDC Call to Action Questions? Additional Information Best Practices/Recommendations
  • 19. CE 5.0 Boot Sequence Boot loader startup sequence Startup() EbootMain() BootloaderMain() OEMDebugInit() OEMPlatformInit() OEMPreDownload() Download Occurs OEMLaunch() Kernel startup sequence Startup( ) KernelStart() ARMInit() OEMInitDebugSerial() OEMInit() KernelInit() HeapInit() InitMemoryPool() ProcInit() SchedInit() FirstSchedule() SystemStartupFunc() IOCTL_HAL_POSTINIT
  • 20. Required OAL Functions Startup Debug Serial OEMInit System Timer Interrupt Processing Kernel Input/Output Example: Custom Kernel IOCTL KITL
  • 21. StartUp First function called when target device boots Purpose is to initialize CPU to known state and to call the kernel initialization function (KernelInitialize for x86 and KernelStart on all other platforms) ARM example LEAF_ENTRY StartUp . . . ; Initialize CPU to a known state ; Set up OEMAddressTable for KernelStart . . . bl KernelStart . . . ; KernelStart should never return
  • 22. Debug Serial OEMInitDebugSerial() Configures Speed, Parity, Stop bit length OEMReadDebugByte() Retrieves a byte from the debug monitor port OEMWriteDebugByte() Outputs a byte to the debug monitor port OEMWriteDebugString() Writes a string to the debug monitor port
  • 23. OEMInit Required task is to set up hardware and register interrupt for the system tick ISRs and HookInterrupt Setting Up the Interrupt Map Define a mapping of Interrupt IDs Mapping can be dynamic at driver load time Interrupt IDs’ are returned by the ISRs to the kernel and are used to link an incoming IRQ with a software IST
  • 24. OEMInit: An Example Void OEMInit() { SetUpInterruptMap(); PCIInitBusInfo(); InitDebugEther(); OEMParallelPortInit() InitPICs(); InitClock(); if (MainMemoryEndAddress == CEPC_EXTRA_RAM_START) { MainMemoryEndAddress += IsDRAM(MainMemoryEndAddress, CEPC_EXTRA_RAM_SIZE); } pKDIoControl = OEMKDIoControl; }
  • 25. Interrupt Processing OEMInterruptEnable() Performs hardware operations necessary to allow a device to generate the specified interrupt Includes Setting a hardware priority for the device Setting a hardware interrupt enable port Clearing any pending interrupt conditions from the device OEMInterruptDisable() Disables the specified hardware interrupt OEMInterruptDone() Unmasked and reenables of interrupt processing
  • 26. Interrupt Processing OEMGetInterrupt() Used by the any device wanting and IRQ. Example PCI bus OEMRequestSysIntr() Used in the OEMIoControl routine to implement IOCTL_HAL_TRANSLATE_IRQ and IOCTL_HAL_REQUEST_SYSINTR OEMTranslateIrq() Used by the main ISR to translate a non-shareable IRQ into a SYSINTR OEMTranslateSysIntr() Translates a SYSINTR to its corresponding IRQ
  • 27. System Timer Make sure the system timer interrupt is registered with the ISR Program the system timer to generate an interrupt every 1ms Can also support variable tick In the system timer ISR, update the global system tick counter CurMSec and CurTicks. If reschedule time is expired then return SYSINTR_Resched else SYSINTR_NOP
  • 28. Agenda Windows CE 5.0 BSPs and Kernels Development Process OAL Architecture and Design Boot Sequence and Required OAL Functions Kernel and KITL Optional OAL Functions Building Power Management OAL Testing – Greg Prier MEDC Call to Action Questions? Additional Information Best Practices/Recommendations
  • 29. Kernel Libraries Library Description kern.exe kernkitl.exe kernkitlprof.exe basickernel kernel w/ dbg suppt kernel w/ profiling suppt Nk.lib Microprocessor-specific Kernel code that MS supplies X X Hal.lib OAL that you implement for target HW X X X NkProf.lib Profile version of the MS Kernel code X KITL.lib Kernel Independent Transport Layer (KITL) debugging services X X SMC9000 Sample Ethernet debugging driver. Must have for KITL suppt X X X FullLibc Microsoft C Run-Time Library X X X
  • 30. Kernel Input/Output OEMIoControl is called by the kernel when a device driver or application program calls the KernelIoControl function Extend the Ethernet Debugging Interface BOOL OEMIoControl(. . .) { switch (dwIoControlCode) { case IOCTL_HAL_SET_DEVICE_INFO : case IOCTL_HAL_REBOOT: . . . default: return FALSE; } return TRUE; }
  • 31. Example: Custom Kernel IOCTL #define IOCTL_MY_CONTROL1 CTL_CODE(FILE_DEVICE_HAL, 2048, METHOD_NEITHER, FILE_ANY_ACCESS) BOOL OEMIoControl(. . .) { switch (dwIoControlCode) { case IOCTL_MY_CONTROL1: . . . } RetCode = KernelIoControl( IOCTL_MY_CONTROL1 , . . . );
  • 32. KITL Kernel Independent Transport Layer Designed to provide an easy way for you to support any debug service OEM Function to implement is OEMKitlINit Including the KITL support in the operating system image Vmini not always necessary. EDBG driver can talk directly to desktop Passive KITL also available
  • 33. Agenda Windows CE 5.0 BSPs and Kernels Development Process OAL Architecture and Design Boot Sequence and Required OAL Functions Kernel and KITL Optional OAL Functions Building Power Management OAL Testing – Greg Prier MEDC Call to Action Questions? Additional Information Best Practices/Recommendations
  • 34. Optional OAL Functions Real-time Clock and Timer OEMGetExtensionDRAM()
  • 35. Real-time Clock And Timer OEMGetRealTime() Called by the kernel to get the time from the real- time clock OEMSetRealTime() Sets the real time clock OEMSetAlarmTime() Sets the alarm time OEMQueryPerformanceCounter() Retrieves the current value of the high-resolution performance counter, if one exists OEMQueryPerformanceFrequency() Retrieves the frequency of the high-resolution performance counter, if one exists
  • 36. OEMGetExtensionDRAM() pNKEnumExtensionDRAM AND OEMEnumExtensionDRAM Example 2 Extended 4MB DRAM available at 0x81800000 Example 1 No extension DRAM available BOOL OEMGetExtensionDRAM(LPDWORD lpMemStart, LPDWORD lpMemLen) { return FALSE; // no extension DRAM } BOOL OEMGetExtensionDRAM(LPDWORD lpMemStart, LPDWORD lpMemLen) { *lpMemStart = 0x81800000; *lpMemLen = 0x00400000; // 4MB return TRUE; }
  • 37. Building OAL and Kernel No longer necessary to SYSGEN OAL libraries Shared OAL code is built just before the BSP directory (platformcommon) BSP kernel (kern.exe) sources file: TARGETLIBS= $(_COMMONOAKROOT)lib$(_CPUDEPPATH)nk.lib $(_TARGETPLATROOT)lib$(_CPUDEPPATH)oal.lib $(_PLATCOMMONLIB)$(_CPUINDPATH)oal_startup_s3c2410x.lib $(_PLATCOMMONLIB)$(_CPUINDPATH)oal_abort_s3c2410x.lib $(_PLATCOMMONLIB)$(_CPUINDPATH)oal_cache_s3c2410x.lib $(_PLATCOMMONLIB)$(_CPUINDPATH)oal_memory_s3c2410x.lib $(_PLATCOMMONLIB)$(_CPUDEPPATH)oal_io_s3c2410x.lib $(_PLATCOMMONLIB)$(_CPUINDPATH)oal_intr_s3c2410x.lib $(_PLATCOMMONLIB)$(_CPUINDPATH)oal_timer_s3c2410x.lib $(_PLATCOMMONLIB)$(_CPUINDPATH)oal_rtc_s3c2410x.lib $(_PLATCOMMONLIB)$(_CPUINDPATH)oal_ioctl_s3c2410x.lib $(_PLATCOMMONLIB)$(_CPUDEPPATH)oal_other.lib $(_PLATCOMMONLIB)$(_CPUDEPPATH)oal_log.lib $(_COMMONOAKROOT)lib$(_CPUINDPATH)ddk_io.lib $(_COMMONOAKROOT)lib$(_CPUDEPPATH)kitl.lib $(_COMMONOAKROOT)lib$(_CPUINDPATH)fulllibc.lib $(_PLATCOMMONLIB)$(_CPUINDPATH)oal_ethdrv_cs8900a.lib
  • 38. OAL Power Management Functions OAL Power Management Functions OEMIdle – Puts the CPU in reduced power mode OEMPowerOff – Puts the CPU in suspend mode Device Drivers Power Management Functions xxx_PowerDown, xxx_PowerUp for stream interface drivers Device-specific functions for other drivers SetInterruptEvent
  • 39. Agenda Windows CE 5.0 BSPs and Kernels Development Process OAL Architecture and Design Boot Sequence and Required OAL Functions Kernel and KITL Optional OAL Functions Building Power Management OAL Testing – Greg Prier MEDC Call to Action Questions? Additional Information Best Practices/Recommendations
  • 40. OAL Tests Available in CE 5.0 Timers/Clock support Caches IOCTLs Future Tests Interrupts Memory Configuration KITL and VMINI Bootloader Etc.
  • 41. Test Harness CETK tests Can also be run from the standard shell OAL Test Requirements Booting Tinykern KITL connection
  • 42. OAL Timer Tests Three clocks: GTC, RTC, and QPC The Test currently checks Resolution Always increasing (except rollover) Clock drift Compares results against thresholds
  • 43. Cache Testing Currently verify correctness, not performance Read and write different patterns into the cache, exercising boundary conditions Allow the tester to confirm the cache parameters
  • 44. IOCTL Testing Confirm that an errant call won’t crash the kernel IOCTL_HAL_GET_DEVICEID IOCTL_HAL_GET_UUID More to come
  • 45. More Information PB docs Source code Lab Testing the Windows CE 5.0 OAL Thursday 11:15 – 12:30
  • 46. Agenda Windows CE 5.0 BSPs and Kernels Development Process OAL Architecture and Design Boot Sequence and Required OAL Functions Kernel and KITL Optional OAL Functions Building Power Management OAL Testing – Greg Prier MEDC Call to Action Questions? Additional Information Best Practices/Recommendations
  • 47. While at MEDC 2005… Fill out an evaluation for this session Randomly selected instant WIN prizes! Use real technology in a lab Instructor led Reef E/F & Breakers L Self-paced Reef B/C Visit the Microsoft Product Pavilion in the Exhibit Hall Shorelines B
  • 48. After The Conference… Develop Build Install Build Join Install Enter Join Full-featured trial versions of Windows CE and/or Windows XP Embedded Cool stuff & tell us about it: msdn.microsoft.com/embedded/community Windows Embedded Partner Program: www.mswep.com Windows Mobile 5.0 Eval Kit including Visual Studio 2005 Beta 2 Mobile2Market Contest and win up to $25000: mobile2marketcontest.com Microsoft Solutions Partner Program: partner.microsoft.com
  • 49. Tools & Resources msdn.microsoft.com/ embedded microsoft.public. windowsxp.embedded windowsce.platbuilder 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
  • 50. Agenda Windows CE 5.0 BSPs and Kernels Development Process OAL Architecture and Design Boot Sequence and Required OAL Functions Kernel and KITL Optional OAL Functions Building Power Management OAL Testing – Greg Prier MEDC Call to Action Questions? Additional Information Best Practices/Recommendations
  • 52. OAL Best Practices Enable KITL Kernel Independent Transport Layer Provides easy way to support any debug service Include KITL support in the OS image Enable Kernel Tracker (CELOG) CELog is the Event Tracking engine that’s loaded into the Kernel PB ships a standard CELOG DLL To enable event tracking, call LoadKernelLibrary with celog.dll Enable Ethernet sharing if single port(VMINI) publiccommonoakdriversethdbgvbridge publiccommonoakdriversethdbgvmini
  • 53. OAL Best Practices Implement PM Functions OEMIdle: Puts CPU in reduced power mode OEMPowerOff: Puts CPU in suspend mode xxx_PowerDown, xxx_PowerUp for stream interface drivers Implement unique device ID for DRM use Implement IOCTL_HAL_GET_UUID ID based upon an OEM-defined device hardware identifier
  • 54. OAL Best Practices Reuse the BSP code provided in CE 5.0 If the %_WINCEROOT%PlatformCommon implementation does not meet your needs, only copy the library that you need to replace Reduce environment variable use Create a different BSP directory for each variation instead of creating just one BSP directory Follow the layout and naming scheme for directories and files so that code can be located more easily
  • 55. OAL Best Practices (Security) Review your BSP code Validate your inputs to make sure that you are only using valid data Make sure that the pointer being provided as data input is not NULL. If you know what the data format should look like, make sure that you validate the data and not use it if the format is wrong Validate the arguments for the IOCTLs Avoid implementing code in the IOCTL that could potentially open your system to attacks; Always review your IOCTL code for security concerns Catch poorly written DMA drivers that use or overuse the FlushDCache or OEMCacheRangeFlush functions Overuse of these two functions in OEM calls or application calls can slow down the system Test your images before releasing them Make sure that you remove code used only for development purposes from your final code or product
  • 56. Shared Interrupts Issue/Concern – Providing a single mask for more than one interrupt may results in missed interrupts. Recommendation – Provide a mask for each interrupt as close to the interrupts as possible. Issue/Concern – Mixing edge and level triggering on shared interrupts may result in missed interrupts. Recommendation – Don’t mix edge and level triggering on shared interrupts. Int 1 Int 2 X Int 1 Int 2 X X X = Interrupt Mask Int 1 Int 2 X = Interrupt Mask L X X Int 1 Int 2 X X Int 1 Int 2 X X L L
  • 57. GIISR.dll OAL ISR Int #1 Int #n Shared Interrupts wavedev.dll UHCI.dll UART.dll X X X Generic Installable ISR. Common code keeps track of all interrupt devices associated with IRQ Put highest priority and most often interrupts at top Drivers must register Address and Mask to GIISR.dll Installable ISR Handler Recommendation Use GIISR.dll when sharing interrupts to keep ISR in OAL simple, which will avoid confusion when adding/deleting/changing interrupts GIISR.dll allows drivers to be plugged in dynamically
  • 58. ** Current Macallan plans are to support up to 64 Total SYSINTR; TBD on the number of those to be user SYSINTR UART2.dll UART3.dll UART1.dll X X X ISR SYSINTR IST Sharing SYSINTR Design Issue/Concern Windows CE provides for 16 reserved and 24 user SYSINTR; As SOC’s (for example) become more and more prevalent, the need for more than 24 user SYSINTR is needed Recommendation Use IST sharing to minimize the number of SYSINTR needed by the design
  • 59. CPU Host Bridge Device PCI Bus RAM DMA IOCTL_HAL_REBOOT Recommendation Implement IOCTL_HAL_REBOOT to be able to reset all board logic; Make sure board level reset reinitializes to boot time state This IOCTL supports a warm boot of the target device; A request to perform a warm boot is made by calling the OEMIoControl function with IOCTL_HAL_REBOOT If a device calls for a reboot and it uses DMA, IOCTL_HAL_REBOOT takes care of memory issues to make sure that RAM doesn’t continue to be updated through DMA from the device
  • 60. CPU Host Bridge Device PCI Bus RAM Aperture Registers PCI Host Bridge Aperture Registers Issue/Concern There is typically not enough space in the memory aperture range in the host bridge Recommendation Use PCI cards with a suitable amount of memory for the for the system selected Example – Perm3 requires 128kb of PCI memory from the PCI bus. Some PCI busses on have 128kb of memory; This starves all other PCI devices
  • 61. CPU PCI/PCMCIA Bridge PCI Bus RAM LCD Host Bridge 802.11b PCI Bus Mastering (DMA) Issue/Concern There are typically issues in the way that the PCI bus arbitrates devices that are on the bus; Poor arbitration design can lead to starving other devices, system resources, or hanging the device Recommendation Use proper bus arbitration to allow other devices to use system resources when needed Example – PCMCIA 802.11b card owning the bus too long can lead to starving of the LCD because the 802.11b card is taking up all CPU time
  • 62. CPU Host Bridge Device PCI Bus RAM DMA DMA Routines in CEDDK Recommendation Utilize the CEDDK DMA Routines. CEDDK is an essential tool for creating platform independent device drivers Abstraction of Bus Architectures Abstraction of I/O mechanisms Abstraction of DMA buffer allocation HalTranslateSystemAddress() Translates a system wide address to a bus relative address Default implementation is a 1:1 mapping on PCI only Assumes PCI buses all have access to full RAM space via host bridge HalAllocateCommonBuffer() Allocates a buffer of contiguous physical memory for DMA usage Does NOT allocate DMA channels CEDDK does not provide any abstraction for DMA controllers at this point HalFreeCommonBuffer() Releases a buffer allocated with HalAllocateCommonBuffer() Normally only used when the driver is unloading
  • 63. CPU PCI/PCMCIA Bridge PCI Bus Host Bridge Device Byte Enable Lines Device CPU Byte Enable Lines Issue/Concern Variable width transfer bus needs to enable byte lines on reads and writes; Current designs only provide for bytes lanes on writes, which will cause problems with destructive read operations Recommendation Enable byte lines on buses with variable width transfers for reads and writes
  • 64. Multiple Hardware Timers Issue/Concern System that provide a single timer for multiple functions can lead to clock error issues Recommendation Provide a single timer that is used for the system 1ms TIC. Provide additional timers for profilers and other OS, Bus, Multimedia needs Fixed interval timers should be avoided in mobile battery-powered systems as there is no way for the kernel to conserve power with OEMIdle
  • 65. Peripheral Devices Recommendations USB Function controller should be able perform disconnect signal and then connect signal either by reset or by program; If these signals are not connected, Windows XP may not be able to determine what state the device is in and ignore the device during device initialization or suspend/resume; USB cable may need to be physically disconnect and reconnected to resolve Ethernet MAC – Provide a default MAC address for all peripheral devices and make sure that they all have unique subnet addresses; MAC addresses located in flash can be erased; We recommend locating the MAC address in a read only location Ethernet MAC – Provide DMA support in Ethernet Controllers
  • 66. OEMAddressTable Issue/Concern Set up the OEMAddressTable efficiently Recommendation Don’t overlap Address Make sure most commonly used components at top of list Make sure design is consistent with config.bib he data must be declared in a READONLY section and there must be at least one non-zero entry for the structure to be valid For x86 platforms, the first entry must identify RAM, and it must start at 0x80000000 For ARM platforms, 0x80000000 can be mapped to anything The Size must be a multiple of 4MB for x86 platforms and a multiple of 1MB for ARM; The last entry of the table must be zeroed. You can leave holes between ranges but you cannot have overlapping ranges The only valid virtual memory mapping range is from 0x80000000 to 0x9FFFFFFF; For every entry created in the table, the kernel creates two virtual address ranges; One exists in the virtual address range from 0x80000000 to 0x9FFFFFFF and is memory that has caching and buffering enabled; The second exists in the virtual address range from 0xA0000000 to 0xBFFFFFFF and has caching and buffering disabled Any memory that is not mapped at boot time cannot be directly accessed by an interrupt service routine (ISR) without first calling CreateStaticMapping to map the address
  • 67. OEMCacheRangeFlush Recommendation Implement OEMCacheRangeFlush correctly and efficiently Use pre-configured OEMCacheRangeFlush style OEMCacheRangeFlush replaces calls to FlushDCache, FlushICache, and TLBClear in Windows CE .NET 4.2 and later. If you are implementing this function you should perform TLB flushes at the end of the function. For example, if dwFlags==(CACHE_SYNC_DISCARD|CACHE_SYNC_FLUSH_TLB, the cache discard operation is usually performed before the TLB flush Some of the CSP routines reference global variables containing cache and TLB size information; Your platform must resolve these variables. You can further optimize such CSP implementations by hard-coding variables in a private implementation of OEMCacheRangeFlush in your platform; If you want to modify or override CSP implementations of caching code, you must put the relevant source files in the KernelBuildexe directory and modify each of the source files in its subdirectories to build the file

Editor's Notes

  1. 2/10/2024 6:32 AM
  2. 2/10/2024 6:32 AM
  3. 2/10/2024 6:32 AM
  4. 2/10/2024 6:32 AM
  5. 2/10/2024 6:32 AM
  6. 2/10/2024 6:32 AM
  7. 2/10/2024 6:32 AM
  8. 2/10/2024 6:32 AM
  9. 2/10/2024 6:32 AM
  10. 2/10/2024 6:32 AM
  11. 2/10/2024 6:32 AM
  12. 2/10/2024 6:32 AM
  13. 2/10/2024 6:32 AM
  14. 2/10/2024 6:32 AM
  15. 2/10/2024 6:32 AM
  16. 2/10/2024 6:32 AM
  17. 2/10/2024 6:32 AM
  18. 2/10/2024 6:32 AM
  19. 2/10/2024 6:32 AM
  20. 2/10/2024 6:32 AM
  21. 2/10/2024 6:32 AM
  22. 2/10/2024 6:32 AM
  23. 2/10/2024 6:32 AM
  24. 2/10/2024 6:32 AM
  25. 2/10/2024 6:32 AM
  26. 2/10/2024 6:32 AM
  27. 2/10/2024 6:32 AM
  28. 2/10/2024 6:32 AM
  29. 2/10/2024 6:32 AM
  30. 2/10/2024 6:32 AM
  31. 2/10/2024 6:32 AM
  32. 2/10/2024 6:32 AM
  33. 2/10/2024 6:32 AM
  34. 2/10/2024 6:32 AM
  35. 2/10/2024 6:32 AM
  36. 2/10/2024 6:32 AM
  37. 2/10/2024 6:32 AM
  38. 2/10/2024 6:32 AM
  39. 2/10/2024 6:32 AM
  40. 2/10/2024 6:32 AM
  41. 2/10/2024 6:32 AM
  42. 2/10/2024 6:32 AM
  43. 2/10/2024 6:32 AM
  44. 2/10/2024 6:32 AM
  45. 2/10/2024 6:32 AM
  46. 2/10/2024 6:32 AM
  47. 2/10/2024 6:32 AM
  48. 2/10/2024 6:32 AM
  49. 2/10/2024 6:32 AM
  50. 2/10/2024 6:32 AM
  51. 2/10/2024 6:32 AM
  52. 2/10/2024 6:32 AM
  53. 2/10/2024 6:32 AM
  54. 2/10/2024 6:32 AM
  55. 2/10/2024 6:32 AM
  56. 2/10/2024 6:32 AM
  57. 2/10/2024 6:32 AM
  58. 2/10/2024 6:32 AM
  59. 2/10/2024 6:32 AM
  60. 2/10/2024 6:32 AM
  61. 2/10/2024 6:32 AM
  62. 2/10/2024 6:32 AM
  63. 2/10/2024 6:32 AM
  64. 2/10/2024 6:32 AM
  65. 2/10/2024 6:32 AM
  66. 2/10/2024 6:32 AM
  67. 2/10/2024 6:32 AM