Eboot 编译编译器决定中断向量及其实现单一性的原因

---------------by nasiry
转载请说明出处,并通知我

SYNCHRONIZE_DRAIN=1

TARGETNAME=EBOOT
TARGETTYPE=PROGRAM
WINCECPU=1RELEASETYPE=PLATFORM
WINCETARGETFILES=$(_RELEASEDIR)\$(TARGETNAME).nb0
EXEENTRY=StartUp
EXEBASE=0x80000000

INCLUDES=..\inc;$(_PUBLICROOT)\common\oak\drivers\block\msflashfmd\inc #INCLUDES=$(_TARGETPLATROOT)\eboot\inc;$(INCLUDES) INCLUDES=$(_TARGETPLATROOT)\Drivers\NandFlsh\FMD;$(INCLUDES) ADEFINES=-pd "ALLOCATE_TABLE SETS \"FALSE\""$(ADEFINES)

LDEFINES=-subsystem:native /DEBUG /DEBUGTYPE:CV /FIXED:NO
CDEFINES= $(CDEFINES) -DPPSH_PROTOCOL_NOTIMEOUT -DCOREDLL -DPLAT_ONBOARDEDBG=1 -DBOOT_LOADER=1 -DNOSYSCALL=1 TARGETLIBS=\ ....... Source文件仅仅提供了PROGRAM/LIBRARY/DYNLINK三个选项参数(见oak\MISC\makefile.def line 324),分别对应.exe,.lib,.dll文件。.exe和.dll文件都是符合windows程序要求的带头文件，而.lib仅仅是可重定位的函数集。这三者都不是我们通常用作loader的headless程序。所谓headless，不包含文件执行头，按照最后所在的地址信息进行链接，不可重定位为特点，这与通常的单片机程序是相似的。而上面所能指定的三种编译目标模式是用于winCE执行所用，其中包含了一个所谓类似PE头的信息部。这样产生的程序显然就不能满足运行的要求。下面是编译后产生的程序用实例来看看： 00000000h: 4D 5A 90 00 03 00 00 00 04 00 00 00 FF FF 00 00 ; MZ?.......... 00000010h: B8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 ; ?......@....... 00000020h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000030h: 00 00 00 00 00 00 00 00 00 00 00 00 D8 00 00 00 ; ............?.. 00000040h: 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 ; ..?.???L?Th 00000050h: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F ; is program canno 00000060h: 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 ; t be run in DOS 00000070h: 6D 6F 64 65 2E 0D 0D 0A 24 00 00 00 00 00 00 00 ; mode....$.......
00000080h: 6A 57 E0 F7 2E 36 8E A4 2E 36 8E A4 2E 36 8E A4 ; jW圜.6帳.6帳.6帳
00000090h: A1 13 BF A4 2C 36 8E A4 A1 13 BE A4 22 36 8E A4 ; ?郡,6帳?兢"6帳
000000a0h: 01 10 BE A4 29 36 8E A4 01 10 BF A4 2F 36 8E A4 ; ..兢)6帳..郡/6帳
000000b0h: 2E 36 8E A4 3F 36 8E A4 D6 3D D8 A4 2F 36 8E A4 ; .6帳?6帳?丐/6帳
000000c0h: 52 69 63 68 2E 36 8E A4 00 00 00 00 00 00 00 00 ; Rich.6帳........
000000d0h: 00 00 00 00 00 00 00 00 50 45 00 00 C2 01 04 00 ; ........PE..?..
000000e0h: B2 42 8F 41 00 00 00 00 00 00 00 00 E0 00 2E 01 ; 睟廇........?..
000000f0h: 0B 01 06 18 00 38 01 00 00 28 00 00 00 00 00 00 ; .....8...(......
00000100h: 00 10 00 00 00 10 00 00 00 50 01 00 00 00 00 80 ; .........P.....€
00000110h: 00 10 00 00 00 02 00 00 04 00 00 00 00 00 00 00 ; ................
00000120h: 04 00 14 00 00 00 00 00 00 90 01 00 00 04 00 00 ; .........?.....
00000130h: 28 2F 02 00 09 00 00 00 00 00 01 00 00 10 00 00 ; (/..............
00000140h: 00 00 10 00 00 10 00 00 00 00 00 00 10 00 00 00 ; ................
00000150h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000160h: 00 00 00 00 00 00 00 00 00 70 01 00 C8 05 00 00 ; .........p..?..
00000170h: 00 00 00 00 00 00 00 00 00 80 01 00 04 07 00 00 ; .........€......
00000180h: D0 14 00 00 1C 00 00 00 00 00 00 00 00 00 00 00 ; ?..............
00000190h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000001a0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000001b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000001c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000001d0h: 2E 74 65 78 74 00 00 00 9C 36 01 00 00 10 00 00 ; .text...?......
000001e0h: 00 38 01 00 00 04 00 00 00 00 00 00 00 00 00 00 ; .8..............
000001f0h: 00 00 00 00 20 00 00 60 2E 64 61 74 61 00 00 00 ; .... ...data...
00000200h: C8 18 00 00 00 50 01 00 00 02 00 00 00 3C 01 00 ; ?...P.......<..
00000210h: 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 C0 ; ............@..?
00000220h: 2E 70 64 61 74 61 00 00 C8 05 00 00 00 70 01 00 ; .pdata..?...p..
00000230h: 00 06 00 00 00 3E 01 00 00 00 00 00 00 00 00 00 ; .....>..........
00000240h: 00 00 00 00 40 00 00 40 2E 72 65 6C 6F 63 00 00 ; ....@..@.reloc..
00000250h: F0 07 00 00 00 80 01 00 00 08 00 00 00 44 01 00 ; ?...€.......D..
00000260h: 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 42 ; ............@..B
00000270h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000280h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000290h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000002a0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000002b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000002c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000002d0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000002e0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000002f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000300h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000310h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000320h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000330h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000340h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000350h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000360h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000370h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000380h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000390h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000003a0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000003b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000003c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000003d0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000003e0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000003f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000400h: 2A 00 00 EA FD FF FF EA FC FF FF EA FB FF FF EA ; *..挲挈犒?
00000410h: FA FF FF EA F9 FF FF EA F8 FF FF EA 74 00 9F E5 ; ?犍犋阾.熷
00000420h: 55 1C A0 E3 00 10 80 E5 6C 00 9F E5 20 10 A0 E3 ; U.犮..€錶.熷 .犮
00000430h: 00 10 80 E5 64 50 9F E5 00 60 95 E5 01 65 86 E3 ; ..€錮P熷.曞.e嗐
00000440h: 5C 30 9F E5 00 40 93 E5 06 48 84 E3 07 46 C4 E3 ; \0熷.@撳.H勩.F你
00000450h: 06 46 84 E3 4C 20 9F E5 4C 10 9F E5 10 00 A0 E3 ; .F勩L 熷L.熷..犮

romimage使用的是boot.bib的内容来对上面的程序进行处理的。我们来看看这部分的内容。

MEMORY
DRV_GLB  8c020000  00001000  RESERVED
BIN_FS   8c021000  00005000  RESERVED
RAM      8c026000  00006000  RAM
STACK    8c02c000  00004000  RESERVED
EBOOT    8c038000  00020000  RAMIMAGE
;    EBOOT    8c038000  00040000  RAMIMAGE

FLSCACHE 8D000000  01000000  RESERVED

CONFIG
COMPRESSION=OFF
PROFILE=OFF
KERNELFIXUPS=ON
SRE=ON
ROMSTART=8c038000
ROMWIDTH=32

ROMSIZE=16000

MODULES
nk.exe $(_TARGETPLATROOT)\target\$(_TGTCPU)\\$(WINCEDEBUG)\EBOOT.exe EBOOT

1.MEMORY部：

2.Config部

3.Modules部

00000000h: FE 03 00 EA 00 00 00 00 00 00 00 00 00 00 00 00 ; ?.?...........
00000010h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000020h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000030h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000040h: 45 43 45 43 88 C7 04 8C 00 00 00 00 00 00 00 00 ; ECEC埱.?.......
00000050h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000060h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
.................. zero .................................................
00000fc0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000fd0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000fe0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000ff0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00001000h: 2A 00 00 EA FD FF FF EA FC FF FF EA FB FF FF EA ; *..挲挈犒?
00001010h: FA FF FF EA F9 FF FF EA F8 FF FF EA 74 00 9F E5 ; ?犍犋阾.熷
00001020h: 55 1C A0 E3 00 10 80 E5 6C 00 9F E5 20 10 A0 E3 ; U.犮..€錶.熷 .犮
00001030h: 00 10 80 E5 64 50 9F E5 00 60 95 E5 01 65 86 E3 ; ..€錮P熷.曞.e嗐
00001040h: 5C 30 9F E5 00 40 93 E5 06 48 84 E3 07 46 C4 E3 ; \0熷.@撳.H勩.F你
00001050h: 06 46 84 E3 4C 20 9F E5 4C 10 9F E5 10 00 A0 E3 ; .F勩L 熷L.熷..犮
00001060h: 06 00 00 EA 00 00 00 00 00 00 00 00 00 00 00 00 ; ...?...........
00001070h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00001080h: 00 60 85 E5 01 00 50 E2 FD FF FF 1A 00 40 83 E5 ; .呭..P恺..@冨

posted @ 2004-11-08 18:18 nasiry 阅读(...) 评论(...) 编辑 收藏