📄 blcommon.cod
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 13.10.4237
TTL C:\WINCE500\PLATFORM\Ep93xx\Src\Bootloader\Common\.\blcommon.c
CODE32
00000 AREA |.drectve|, DRECTVE
DCB "-defaultlib:coredll.lib "
DCB "-defaultlib:corelibc.lib "
EXPORT |pTOC| [ DATA ]
EXPORT |NKSignon| [ DATA ]
00000 AREA |.data|, DATA
COMMON |g_pOEMVerifyMemory|, 0x4
00000 AREA |.rdata|, DATA, READONLY
|pTOC| DCD 0xffffffff
% 4
|NKSignon| DCB 0xa, "Microsoft Windows CE Ethernet Bootloader Common Lib"
DCB "rary Version %d.%d Built Jan 21 2008 11:41:45", 0xd, 0xa
DCB "Copyright (c) 2000-2001 Microsoft Corporation", 0xd, 0xa
DCB 0x0
% 4
|EdbgVendorIds| DCW 0x0
DCW 0x0
DCD 0x4033
DCB 0x1
DCB 0x0
DCB "AD", 0x0
% 3
DCW 0x1050
DCW 0x940
DCD 0x4005
DCB 0x1
DCB 0x0
DCB "LS", 0x0
% 3
DCW 0x1050
DCW 0x940
DCD 0x2078
DCB 0x1
DCB 0x0
DCB "LS", 0x0
% 3
DCW 0x10ec
DCW 0x8029
DCD 0xc0f0
DCB 0x1
DCB 0x0
DCB "KS", 0x0
% 3
DCW 0x10ec
DCW 0x8129
DCD 0x0
DCB 0x4
DCB 0x0
DCB "RT", 0x0
% 3
DCW 0x10ec
DCW 0x8139
DCD 0x900b
DCB 0x4
DCB 0x0
DCB "RT", 0x0
% 3
DCW 0x10ec
DCW 0x8139
DCD 0xd0c9
DCB 0x4
DCB 0x0
DCB "RT", 0x0
% 3
DCW 0x10ec
DCW 0x8139
DCD 0xe04c
DCB 0x4
DCB 0x0
DCB "RT", 0x0
% 3
DCW 0x1186
DCW 0x1300
DCD 0x50ba
DCB 0x4
DCB 0x0
DCB "DL", 0x0
% 3
DCW 0x100b
DCW 0x20
DCD 0xa0cc
DCB 0x5
DCB 0x0
DCB "NG", 0x0
% 3
DCW 0x10b7
DCW 0x9050
DCD 0x6008
DCB 0x6
DCB 0x0
DCB "3C", 0x0
% 3
DCW 0x10b7
DCW 0x9200
DCD 0x476
DCB 0x6
DCB 0x0
DCB "3C", 0x0
% 3
DCW 0x8086
DCW 0x1039
DCD 0x4033
DCB 0x7
DCB 0x1
DCB "IN", 0x0
% 3
DCW 0x8086
DCW 0x103a
DCD 0x4033
DCB 0x7
DCB 0x1
DCB "IN", 0x0
% 3
DCW 0x8086
DCW 0x1051
DCD 0x4033
DCB 0x7
DCB 0x1
DCB "IN", 0x0
% 3
DCW 0x8086
DCW 0x1229
DCD 0x4033
DCB 0x7
DCB 0x1
DCB "IN", 0x0
% 3
DCW 0x8086
DCW 0x2449
DCD 0x4033
DCB 0x7
DCB 0x1
DCB "IN", 0x0
% 3
EXPORT |BootloaderMain|
EXPORT |??_C@_0CL@NOFKHKJC@System?5ready?$CB?$AN?6Preparing?5for?5dow@| [ DATA ] ; `string'
EXPORT |??_C@_0BH@BICFFKHJ@Found?5pTOC?5signature?4?6?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_0BI@OCFAEGPK@ROMHDR?5at?5Address?5?$CFXh?$AN?6?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_0CO@LCHGIDCB@RomHdr?4ulRAMStart?$DN?$CFXh?5RomHdr?4phy@| [ DATA ] ; `string'
EXPORT |??_C@_0CM@NLKPPMBO@?$CB?5Did?5not?5Find?5Windows?5CE?5pTOC?5s@| [ DATA ] ; `string'
EXPORT |??_C@_0CE@IBJJNLHI@INFO?3?5Jumping?5to?5image?5at?50x?$CFX?4?4@| [ DATA ] ; `string'
IMPORT |OEMDebugInit|
IMPORT |OEMPlatformInit|
IMPORT |OEMPreDownload|
IMPORT |OEMLaunch|
IMPORT |OEMMapMemAddr|
IMPORT |EdbgOutputDebugString|
IMPORT |bEthLaunch|
IMPORT |memcpy|
00000 AREA |.bss|, NOINIT
|romhdr| % 0x54
; File c:\wince500\platform\ep93xx\src\bootloader\common\blcommon.c
00000 AREA |.text| { |BootloaderMain| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$BootloaderMain|, PDATA, SELECTION=5, ASSOC=|.text| { |BootloaderMain| } ; comdat associative
|$T38568| DCD |$L38567|
DCD 0x40007e02
00000 AREA |.rdata| { |??_C@_0CE@IBJJNLHI@INFO?3?5Jumping?5to?5image?5at?50x?$CFX?4?4@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CE@IBJJNLHI@INFO?3?5Jumping?5to?5image?5at?50x?$CFX?4?4@| DCB "IN"
DCB "FO: Jumping to image at 0x%X...", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0CM@NLKPPMBO@?$CB?5Did?5not?5Find?5Windows?5CE?5pTOC?5s@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CM@NLKPPMBO@?$CB?5Did?5not?5Find?5Windows?5CE?5pTOC?5s@| DCB "! D"
DCB "id not Find Windows CE pTOC signature.!", 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0CO@LCHGIDCB@RomHdr?4ulRAMStart?$DN?$CFXh?5RomHdr?4phy@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CO@LCHGIDCB@RomHdr?4ulRAMStart?$DN?$CFXh?5RomHdr?4phy@| DCB "RomH"
DCB "dr.ulRAMStart=%Xh RomHdr.physfirst=%Xh.", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0BI@OCFAEGPK@ROMHDR?5at?5Address?5?$CFXh?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BI@OCFAEGPK@ROMHDR?5at?5Address?5?$CFXh?$AN?6?$AA@| DCB "ROMHDR a"
DCB "t Address %Xh", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0BH@BICFFKHJ@Found?5pTOC?5signature?4?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BH@BICFFKHJ@Found?5pTOC?5signature?4?6?$AA@| DCB "Found pTOC sign"
DCB "ature.", 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0CL@NOFKHKJC@System?5ready?$CB?$AN?6Preparing?5for?5dow@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CL@NOFKHKJC@System?5ready?$CB?$AN?6Preparing?5for?5dow@| DCB "Sys"
DCB "tem ready!", 0xd, 0xa, "Preparing for download...", 0xd, 0xa
DCB 0x0 ; `string'
; Function compile flags: /Ods
00000 AREA |.text| { |BootloaderMain| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |BootloaderMain| PROC
; 92 : {
00000 |$L38567|
00000 e52de004 str lr, [sp, #-4]!
00004 e24dd03c sub sp, sp, #0x3C
00008 |$M38565|
; 93 : ROMHDR *pRomHdr = NULL; // pTOC for NK image. MUST COPY IT OR CLEANBOOT may erase it
00008 e3a03000 mov r3, #0
0000c e58d3008 str r3, [sp, #8]
; 94 : DWORD dwAction, dwpToc;
; 95 : DWORD dwImageStart = 0, dwImageLength = 0, dwLaunchAddr = 0;
00010 e3a03000 mov r3, #0
00014 e58d3000 str r3, [sp]
00018 e3a03000 mov r3, #0
0001c e58d3010 str r3, [sp, #0x10]
00020 e3a03000 mov r3, #0
00024 e58d300c str r3, [sp, #0xC]
; 96 :
; 97 : // relocate globals to RAM
; 98 : if (!KernelRelocate (pTOC)) {
00028 e59f31c4 ldr r3, [pc, #0x1C4]
0002c e5930000 ldr r0, [r3]
00030 eb000000 bl KernelRelocate
00034 e58d0018 str r0, [sp, #0x18]
00038 e59d3018 ldr r3, [sp, #0x18]
0003c e3530000 cmp r3, #0
00040 1a000000 bne |$L38409|
00044 |$L38411|
; 99 : // spin forever
; 100 : SPIN_FOREVER;
00044 eafffffe b |$L38411|
00048 |$L38409|
; 101 : }
; 102 :
; 103 : // (1) Init debug support. We can use OEMWriteDebugString afterward.
; 104 : if (!OEMDebugInit ()) {
00048 eb000000 bl OEMDebugInit
0004c e58d001c str r0, [sp, #0x1C]
00050 e59d301c ldr r3, [sp, #0x1C]
00054 e3530000 cmp r3, #0
00058 1a000000 bne |$L38413|
0005c |$L38415|
; 105 : // spin forever
; 106 : SPIN_FOREVER;
0005c eafffffe b |$L38415|
00060 |$L38413|
; 107 : }
; 108 :
; 109 : // output banner
; 110 : EdbgOutputDebugString (NKSignon, CURRENT_VERSION_MAJOR, CURRENT_VERSION_MINOR);
00060 e3a02000 mov r2, #0
00064 e3a01001 mov r1, #1
00068 e59f0180 ldr r0, [pc, #0x180]
0006c eb000000 bl EdbgOutputDebugString
; 111 :
; 112 : // (3) initialize platform (clock, drivers, transports, etc)
; 113 : if (!OEMPlatformInit ()) {
00070 eb000000 bl OEMPlatformInit
00074 e58d0020 str r0, [sp, #0x20]
00078 e59d3020 ldr r3, [sp, #0x20]
0007c e3530000 cmp r3, #0
00080 1a000000 bne |$L38417|
00084 |$L38419|
; 114 : // spin forever
; 115 : SPIN_FOREVER;
00084 eafffffe b |$L38419|
00088 |$L38417|
; 116 : }
; 117 :
; 118 : // system ready, preparing for download
; 119 : EdbgOutputDebugString ("System ready!\r\nPreparing for download...\r\n");
00088 e59f015c ldr r0, [pc, #0x15C]
0008c eb000000 bl EdbgOutputDebugString
; 120 :
; 121 : // (4) call OEM specific pre-download function
; 122 : switch (dwAction = OEMPreDownload ()) {
00090 eb000000 bl OEMPreDownload
00094 e58d0024 str r0, [sp, #0x24]
00098 e59d3024 ldr r3, [sp, #0x24]
0009c e58d3014 str r3, [sp, #0x14]
000a0 e59d3014 ldr r3, [sp, #0x14]
000a4 e58d3028 str r3, [sp, #0x28]
000a8 e59d3028 ldr r3, [sp, #0x28]
000ac e3530000 cmp r3, #0
000b0 0a000003 beq |$L38426|
000b4 e59d3028 ldr r3, [sp, #0x28]
000b8 e3530001 cmp r3, #1
000bc 0a00003c beq |$L38444|
000c0 ea000040 b |$L38445|
000c4 |$L38426|
; 123 : case BL_DOWNLOAD:
; 124 : // (5) download image
; 125 : if (!DownloadImage (&dwImageStart, &dwImageLength, &dwLaunchAddr)) {
000c4 e28d200c add r2, sp, #0xC
000c8 e28d1010 add r1, sp, #0x10
000cc e28d0000 add r0, sp, #0
000d0 eb000000 bl DownloadImage
000d4 e58d002c str r0, [sp, #0x2C]
000d8 e59d302c ldr r3, [sp, #0x2C]
000dc e3530000 cmp r3, #0
000e0 1a000000 bne |$L38427|
000e4 |$L38429|
; 126 : SPIN_FOREVER;
000e4 eafffffe b |$L38429|
000e8 |$L38427|
; 127 : }
; 128 : // Check for pTOC signature ("CECE") here, after image in place
; 129 : if (*(LPDWORD) OEMMapMemAddr (dwImageStart, dwImageStart + PTOC_SIG_OFFSET) == PTOC_SIG)
000e8 e59d3000 ldr r3, [sp]
000ec e2831040 add r1, r3, #0x40
000f0 e59d0000 ldr r0, [sp]
000f4 eb000000 bl OEMMapMemAddr
000f8 e58d0030 str r0, [sp, #0x30]
000fc e59d3030 ldr r3, [sp, #0x30]
00100 e5932000 ldr r2, [r3]
00104 e59f30dc ldr r3, [pc, #0xDC]
00108 e1520003 cmp r2, r3
0010c 1a000020 bne |$L38432|
; 130 : {
; 131 : EdbgOutputDebugString("Found pTOC signature.\n");
00110 e59f00cc ldr r0, [pc, #0xCC]
00114 eb000000 bl EdbgOutputDebugString
; 132 : dwpToc = *(LPDWORD) OEMMapMemAddr (dwImageStart, dwImageStart + PTOC_OFFSET);
00118 e59d3000 ldr r3, [sp]
0011c e2831044 add r1, r3, #0x44
00120 e59d0000 ldr r0, [sp]
00124 eb000000 bl OEMMapMemAddr
00128 e58d0034 str r0, [sp, #0x34]
0012c e59d3034 ldr r3, [sp, #0x34]
00130 e5933000 ldr r3, [r3]
00134 e58d3004 str r3, [sp, #4]
; 133 : //
; 134 : // need to map the content again since the pointer is going to be in a fixup address
; 135 : ///
; 136 : dwpToc = (DWORD) OEMMapMemAddr (dwImageStart, dwpToc);
00138 e59d1004 ldr r1, [sp, #4]
0013c e59d0000 ldr r0, [sp]
00140 eb000000 bl OEMMapMemAddr
00144 e58d0038 str r0, [sp, #0x38]
00148 e59d3038 ldr r3, [sp, #0x38]
0014c e58d3004 str r3, [sp, #4]
; 137 :
; 138 :
; 139 : //
; 140 : // NOTE: MUST COPY or a CLEAN_BOOT flag will erase it
; 141 : //
; 142 : memcpy (pRomHdr = &romhdr, (LPVOID) dwpToc, sizeof(ROMHDR));
00150 e59f3084 ldr r3, [pc, #0x84]
00154 e58d3008 str r3, [sp, #8]
00158 e3a02054 mov r2, #0x54
0015c e59d1004 ldr r1, [sp, #4]
00160 e59d0008 ldr r0, [sp, #8]
00164 eb000000 bl memcpy
; 143 :
; 144 : EdbgOutputDebugString("ROMHDR at Address %Xh\r\n", dwImageStart + PTOC_SIG_OFFSET + sizeof (DWORD)); // right after signature
00168 e59d3000 ldr r3, [sp]
0016c e2831044 add r1, r3, #0x44
00170 e59f0068 ldr r0, [pc, #0x68]
00174 eb000000 bl EdbgOutputDebugString
; 145 : EdbgOutputDebugString("RomHdr.ulRAMStart=%Xh RomHdr.physfirst=%Xh.\r\n", romhdr.ulRAMStart, romhdr.physfirst);
00178 e59f305c ldr r3, [pc, #0x5C]
0017c e5932008 ldr r2, [r3, #8]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -