青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

milkyway的窩

最初想法的誕生地

 

Understanding Memory Sections in config.bib, boot.bib, and OEMAddressTable in Windows CE 5.0 and 6.0

Understanding Memory Sections in config.bib, boot.bib, and OEMAddressTable in Windows CE 5.0 and 6.0

 

Introduction

Windows CE uses .bib (binary image builder) files to track, among other things, the memory layout of bootloaders as well as OS images. If you’re writing a new BSP, you’ll definitely need a config.bib file for your OS, and you’ll likely need a boot.bib file for your bootloader.

 

Let’s take a few minutes to understand how .bib files relate to memory usage. It’s going to be muddy at the beginning, but I promise if you stick with me through the end you’ll be glad that you did. Well, maybe you won’t be glad but you’ll know more about .bib files. Let’s get to it!

 

OEMAddressTable

Before we look at the .bib files themselves, it’s important to understand the OEMAddressTable. This table defines the mappings between physical and virtual addresses. For MIPS and SH processors, this table is hard coded into the processor. For x86 and ARM, the mapping is defined in a variable called OEMAddressTable. Since .bib files operate largely on virtual addresses, we need to remember to reference the OEMAddressTable to address any confusion about what is happening at a particular physical address.

 

The table’s layout is quite simple. Each line creates a mapping of virtual addresses to physical addresses. The syntax is: Base virtual address, base physical address, size. Let’s take an example from the Mainstone BSP:

 

DCD     0x80000000, 0xA0000000,  64     ; MAINSTONEII: SDRAM (64MB).

DCD     0x88000000, 0x5C000000,   1     ; BULVERDE: Internal SRAM (64KB bank 0).

DCD     0x88100000, 0x58000000,   1     ; BULVERDE: Internal memory PM registers.

DCD     0x88200000, 0x4C000000,   1     ; BULVERDE: USB host controller.

 

So in the first line, we are mapping the 64MB of RAM at physical address 0xA0000000 to the virtual address 0x80000000. Since 64MB = 0x04000000 this means that the physical addresses 0xA000000-0xA4000000 are now mapped to virtual addresses 0x80000000-0x84000000. Likewise, we’ve mapped the USB host controller which resides at physical addresses 0x4C000000-0x4C100000 to virtual addresses 0x88200000-0x8300000.

 

Inside Windows CE, memory access is virtual by default. So when we access memory at 0x81005000, we’ll be accessing some physical memory in the Mainstone’s 64MB SDRAM bank. If we access memory at 0x88201000, we’ll be accessing the USB host controller, physically. If we access memory at 0x86001000, we’ll get a page fault because this virtual address has no corresponding physical address.

 

Now that we understand the OEMAddressTable, let’s talk about the .bib files.

 

Config.bib – this contains a lot of configuration info for a CE OS image. The MEMORY section is what we’ll focus on – it defines the memory blueprint for the CE image. Here are the important terms:

 

RAMIMAGE – This is the virtual address region that the kernel and any other components you select for your image will be placed in. This can be RAM or linearly addressable flash. Your config.bib file should have exactly one RAMIMAGE section. It needs to be virtually contiguous, and it needs to be large enough to hold whatever components you’ve selected.

 

RAM – This is the virtual address region of RAM that the kernel can allocate to applications and RAM-based file systems. It needs to be virtually contiguous. (If you need a non-contiguous section, you can allocate another, non-virtually-contiguous section at run-time by implementing the OEMGetExtensionDRAM function, but that’s outside our scope)

 

RESERVED – These are virtual address regions that are set aside – the kernel won’t allocate memory in these addresses and components won’t be placed in these addresses.

 

AUTOSIZE - In the CONFIG section, we have the AUTOSIZE=ON (or OFF) variable. If this variable is on, it will treat the RAMIMAGE and RAM regions as a single region, allocating just enough space to hold all of the components to the RAMIMAGE section and making the rest of the space available as RAM. This is a pretty convenient and easy way to make sure you’re getting maximal use out of your RAM. One thing autosize won’t do is interfere with reserved or unallocated regions.

 

Eboot.bib (sometimes known as boot.bib) – this works identically to config.bib, except we’re building a bootloader image as opposed to one with a full kernel. All of the terminology is exactly the same. The only difference is, in the case where we’re not using an MMU in the bootloader (CEPC is an example of these), the addresses will be physical as opposed to virtual. Otherwise, the layout is identical.

 

Bringing it together

In almost all cases, the bootloader and OS use the same OEMAddressTable. Thus, they have the same virtual address space.

 

This is especially useful when it comes to RESERVED regions. Since nothing will be allocated or placed in these addresses, only components that refer directly to the address will have access. That means we can use these regions for special buffers (say, DMA) or passing arguments passed in from the bootloader to the OS. It also means that, if you want, you can leave the bootloader in RAM.

 

Keep in mind that while RESERVED means that we won’t allocate/place components in those virtual addresses, by default if an area isn’t specified in a .bib file then we won’t allocate/place in it. This means RESERVED is really more of a comment then anything. However, it is useful in our .bib files because it helps us identify the location of special buffers and arguments so that we know not to overwrite them in other modules.

 

An Example

Let’s take a look at a simplified example in the CEPC BSP:

Here’s our OEMAddressTable (platform\common\src\x86\common\startup\startup.asm):

_OEMAddressTable:

        dd 80000000h,     0,      04000000h

This means that we’re mapping physical addresses 0x00000000-0x04000000 to virtual addresses 0x80000000-0x84000000. That’s 64MB of RAM.

 

Here’s our boot.bib (platform\CEPC\src\bootloader\eboot\boot.bib):

MEMORY

;   Name     Start     Size      Type

;   ------- -------- -------- ----

    EBOOT    00130000 00020000 RAMIMAGE

    RAM      00150000 00070000 RAM

    ETHDMA   00200000 00020000 RESERVED

 

Remember the CEPC bootloader uses physical addresses. So in virtual address terms, our bootloader code is living at 0x80130000-0x80150000, with RAM available from 0x80150000-0x801C0000. We’re reserving a buffer for our Ethernet card from 0x80200000-0x80220000.

 

And a condensed version of config.bib (platform\CEPC\files\config.bib):

 

MEMORY

;   Name     Start     Size      Type

;   ------- -------- -------- ----

; 64 MB of RAM (note: AUTOSIZE will adjust boundary)

    NK       80220000 009E0000 RAMIMAGE

    RAM      80C00000 03400000 RAM

    DMA      80100000 00030000 RESERVED   ; Native DMA reserved.

    BOOTARGS 801FFF00 00000100 RESERVED   ; Boot arguments

    EDBG_DMA 80200000 00020000 RESERVED   ; EDBG DMA buffer

 

 

There are several interesting things going on here:

 

First, our OS image (NK) starts at 0x80220000, and RAM resides directly above it. That means we’re not allowing any components or allocation to write below 0x80220000, and thus our bootloader code is protected.

 

Second, note that we have also reserved some regions. The EDBG_DMA corresponds to the same addresses that the bootloader reserved. This way we can make a smooth transition from bootloader to kernel without worrying about the contents of this memory being tampered with. 

 

Another region has been reserved from 0x80100000-0x80130000. This is very close to the start of our bootloader. If we reserved even a byte more, we would not expect our bootloader to continue to be executable after we boot the OS. However, since the bootloader’s address space isn’t referenced by any region in config.bib, we know that it will remain untouched by the OS. This way we can jump back to the bootloader code during a warm reset, if desired.

 

We’re not required to keep our bootloader in memory, though. We could easily place the bootloader (in boot.bib) at the end of the RAM space (in config.bib). This way after the image was successfully downloaded we could allocate memory over the top of the bootloader and make full use of all of our system RAM. What you don’t want to do is intersect the bootloader with the RAMIMAGE part of config.bib – this means you’ll overwrite the code you’re running to download, during download!

 

Finally, notice we have a special reserved region called “boot arguments”.  If we at the CEPC’s bootloader we will see that it writes explicitly to the (physical) 0x001FFF00-0x002000000. You’ll also notice this isn’t used anywhere in the boot.bib layout. That means we can be assured it will be untouched (unless, of course, something else in the bootloader writes explicitly to that address range).

 

This is how we pass arguments from the bootloader to the OS – the OS can read directly from 0x801FFF00 and be assured that the kernel won’t tamper with it because it is RESERVED. Technically, we could have indicated that area as RESERVED in the bootloader as well.

 

Hopefully this has given you some insight into .bib memory layouts.

posted on 2007-04-19 11:03 milkyway 閱讀(1477) 評論(1)  編輯 收藏 引用

評論

# re: Understanding Memory Sections in config.bib, boot.bib, and OEMAddressTable in Windows CE 5.0 and 6.0 2007-04-19 11:04 相思酸中有甜

注意
1。以太網卡DMA在eboot.bib和config.bib的復用;
2。不要在config.bib中覆蓋eboot的IMAGE  回復  更多評論   

導航

統計

公告

隨筆皆原創,文章乃轉載. 歡迎留言!

常用鏈接

留言簿(37)

隨筆分類(104)

隨筆檔案(101)

文章分類(51)

文章檔案(53)

wince牛人

搜索

積分與排名

最新評論

閱讀排行榜

評論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美一区二区三区播放老司机| 国产精品乱人伦一区二区| 久久手机免费观看| 中文国产亚洲喷潮| 亚洲第一天堂av| 国产一区二区中文字幕免费看| 欧美jizz19性欧美| 亚洲国产专区校园欧美| 久久精品亚洲一区二区| 亚洲欧美久久久久一区二区三区| 亚洲黄色av| 亚洲风情亚aⅴ在线发布| 精品成人国产| 在线观看欧美日韩| 亚洲国产乱码最新视频| 亚洲黑丝在线| 日韩特黄影片| 中国成人黄色视屏| 夜夜夜久久久| 欧美国产三区| 蜜臀av在线播放一区二区三区| 欧美在线一区二区| 久久天堂成人| 男人的天堂成人在线| 免费成人av在线看| 欧美精品一区二区在线播放| 欧美激情成人在线视频| 欧美黄色免费| 欧美日韩国产综合视频在线观看| 欧美福利视频网站| 亚洲综合电影| 久久久久国产一区二区| 两个人的视频www国产精品| 欧美国产一区在线| 国产精品成人v| 在线免费一区三区| 在线视频亚洲| 久久精品国产久精国产爱| 麻豆精品视频| 99精品欧美一区二区蜜桃免费| 一区二区三区国产| 久久久99免费视频| 欧美日韩成人综合在线一区二区| 欧美视频在线观看视频极品| 国产在线观看91精品一区| 99re成人精品视频| 久久蜜臀精品av| 日韩视频国产视频| 久久国产精品色婷婷| 欧美日韩亚洲一区二区三区在线| 国产日韩欧美不卡在线| 亚洲国产成人精品女人久久久 | 狠狠色综合播放一区二区| 伊人成人开心激情综合网| 日韩亚洲欧美成人| 久久大逼视频| 日韩图片一区| 久久躁日日躁aaaaxxxx| 国产精品区一区二区三| 国产精品区二区三区日本 | 亚洲综合好骚| 欧美乱大交xxxxx| 经典三级久久| 久久99伊人| 在线亚洲欧美专区二区| 欧美大片在线看| 欧美日韩亚洲一区在线观看| 99re亚洲国产精品| 美女主播精品视频一二三四| 国产九区一区在线| 亚洲一区二区三区久久| 亚洲国产专区校园欧美| 久久综合激情| 好男人免费精品视频| 亚洲你懂的在线视频| 91久久午夜| 欧美国产日韩一区二区三区| 在线不卡中文字幕| 久久乐国产精品| 亚洲国产精品久久久久婷婷884 | 国产日韩视频一区二区三区| 亚洲男人第一av网站| 一区二区久久| 99国产精品99久久久久久| 西瓜成人精品人成网站| 狼狼综合久久久久综合网| 欧美一区二区精品在线| 国产欧美日韩综合一区在线观看| 亚洲自拍另类| 亚洲男女毛片无遮挡| 国产精品久久一级| 欧美一级大片在线免费观看| 亚洲欧美高清| 国产区亚洲区欧美区| 欧美呦呦网站| 久久成人18免费网站| 亚洲尤物视频网| 国产午夜精品理论片a级大结局 | 久久中文在线| 免费视频一区二区三区在线观看| 亚洲精华国产欧美| 亚洲日本在线观看| 国产精品成人一区二区三区夜夜夜| 亚洲网站在线| 午夜久久久久久久久久一区二区| 国产一区清纯| 亚洲国产日韩美| 欧美午夜精品一区| 香蕉av777xxx色综合一区| 日韩亚洲成人av在线| 国产精品亚洲激情| 六月婷婷久久| 欧美日韩综合视频网址| 欧美淫片网站| 欧美ed2k| 午夜久久影院| 蜜桃精品久久久久久久免费影院| 99国产精品自拍| 午夜欧美大尺度福利影院在线看| 伊人久久男人天堂| 正在播放日韩| 久久成人一区| 亚洲三级免费| 亚洲欧洲一区二区三区在线观看| 欧美日韩精品系列| 欧美一级久久久久久久大片| 亚洲婷婷综合久久一本伊一区| 欧美日韩国产高清视频| 久久综合给合久久狠狠狠97色69| 欧美日韩岛国| 欧美成人午夜激情在线| 国产精品久久久一区二区三区| 欧美不卡一卡二卡免费版| 国产精品久久久一区麻豆最新章节| 欧美国产视频日韩| 韩国av一区二区三区| 一区二区三区精品久久久| 亚洲国产精品v| 久久精品国产视频| aa国产精品| 在线天堂一区av电影| 亚洲日本欧美| 亚洲三级性片| 亚洲高清视频中文字幕| 西西人体一区二区| 午夜在线不卡| 国产精品高潮呻吟久久av无限| 亚洲第一在线| 亚洲福利免费| 久久国产精品一区二区三区四区 | 欧美呦呦网站| 久久国产精品99精品国产| 国产精品美女一区二区| 亚洲欧美在线免费| 美女黄毛**国产精品啪啪| 亚洲日本久久| 国产精品视频yy9299一区| 久久久99国产精品免费| 亚洲国产影院| 久久av一区二区三区| 亚洲大片免费看| 欧美视频在线播放| 久久精品欧美日韩| 亚洲激情视频在线播放| 亚洲欧美日韩直播| 亚洲成色777777女色窝| 欧美日韩精品二区第二页| 香蕉久久精品日日躁夜夜躁| 亚洲第一精品福利| 午夜精品国产更新| 亚洲欧洲另类| 国产美女一区| 欧美激情影院| 欧美专区在线观看| 99视频精品全国免费| 美女精品自拍一二三四| 亚洲女人小视频在线观看| 亚洲福利国产精品| 国产日韩欧美精品综合| 欧美日韩国产综合网| 久久婷婷亚洲| 午夜日韩电影| 一区二区三区三区在线| 欧美电影在线| 久久久亚洲国产天美传媒修理工 | 久久美女性网| 中文成人激情娱乐网| 日韩一级免费| 黑人巨大精品欧美一区二区 | 在线成人激情黄色| 国产精品蜜臀在线观看| 欧美激情一区二区三区在线视频 | 久久久久99| 欧美日韩伦理在线免费| 久久精品国产69国产精品亚洲| 亚洲精品免费看| 亚洲高清一区二| 亚洲第一伊人| 亚洲国产欧美国产综合一区| 欧美高清视频一区二区三区在线观看|