Wince bootloader和内核定制

来源:互联网 发布:nodejs json 编辑:程序博客网 时间:2024/05/22 15:12

Wince bootloader和内核定制

l BootLoader Eboot

 
 
*   NBOOT
nboot是从NAND flash读image到内存并执行,也可以读eboot.nb0到内存中并执行,eboot是下载并烧写image到内存并执行。将nboot.nb0烧到第0块,将eboot.nb0烧到第2块。启动时nboot从flash读出eboot并执行之。
NBOOT->EBOOT->USB download NK.NB0 to memory-> jump to start address of nk.nb0 in Memory-> WINCE start.
    Memory layout on NAND flash:
ü  Block 0 has the NAND boot loader (NBOOT.BIN)
ü  Block 1 is the TOC block which specifies the layout on the NAND
ü  Block 2 is the start block for secondary bootloader
ü  Block n is the start of image. n is defined in the block 1 structure
TOC (Table Of Contents) : This block shows links to a subset of the available pages, filtered upon current visitor access privileges. This makes it easy to deliver custom access to different sections of your site.
   The layout on the first sector of TOC block is:
    typedef struct _TOC_SECTOR {
        DWORD               dwSignature;        //  4 bytes
        IMAGE_DESCRIPTOR    id[4];              //  480 bytes
        UCHAR               Pad[32];            //  32 bytes
        } TOC_SECTOR, *PTOC_SECTOR;
 
Nboot做了大部分的硬件初始化,然后将会在nand flash第一块内存(TOC)中查找images的位置!这个TOC定义在loader.h中,我在我的pb里面搜索了一下,路径如下
 
几个文件中的定义都是一样的,下面的代码是我从里面拷贝下来的!与上面的有所不同!可能是版本不同吧!
typedef struct _TOC {
    DWORD               dwSignature;
              BYTE                                              udid[8]; //
        // How to boot the images in this TOC This could be moved into the image descriptor if desired,                       . // but I prefer to conserve space.
    BOOT_CFG            BootCfg;
    IMAGE_DESCRIPTOR    id[MAX_TOC_DESCRIPTORS]; // Array of Image Descriptors.
//    UCHAR Pad[12];      // align on SECTOR_SIZE
    CHAININFO           chainInfo;
} TOC, *PTOC;           // 512 bytes
tocblock1 file,同样是使用SJF烧写到第一个(0为第一个)内存块的!
整个过程就很明显了:第一步,先烧写nboot.bin 到nand flash的第0个内存块!
                    第二步,烧写 tocblock1 file 到nand flash 的第一个内存块!
                    第三步,烧写 eboot.nb0 到nand flash 的第二块内存开始的地方!
 
*   EBOOT
  BinFS
在移植使用BOOTLOADER下载镜像的时候我法相,他会调用EBOOT中的一段代码去对nand进行一些操作,主要工作是格式化nand并简历文件系统!这个文件系统就是ROM image filesystem(BINFS)二进制文件系统!也称之为闪存文件系统。
EBOOT启动菜单中,我们会看到有两项是关于格式化FLASH的命令!一个是低格选项:
Low-level FORMAT Boot Media
他的代码解释如下:
// low-level format
// N.B: this erases images, BinFs, FATFS, user data, etc.
// However, we don't format Bootloaders & TOC bolcks; use JTAG for this.
另外一个是:Format Boot Media for BinFS
// format the boot media for BinFS
// N.B: this does not destroy our OEM reserved sections (TOC, bootloaders, etc)
// N.B: format offset by # of reserved blocks, decrease the ttl # blocks available by that amount.
   主要理解一下Format Boot Media for BinFS的过程!
在选择了这个选项之后,他首先会判断flash是否存在,然后调用WINCE的库函数BP_LowLevelFormat。这个函数的原型:
BOOL BP_LowLevelFormat(
  DWORD dwStartBlock,
  DWORD dwNumBlocks,
  DWORD dwFlags
);
 
文章还不是很完善,大家一起交流,如果问题,请提出来,大家一起塔讨论
 
阅读(3678) | 评论(3) | 转发(1) |
0

上一篇:建立根文件系统目录

下一篇:bootloader中USB下载的简单分析

相关热门文章
  • 10种启动故障解决方法(转)...
  • 关于自动弹出网页的解决方法...
  • Auto CAD 2007中文版 迅雷免费...
  • 出现“high definition audio...
  • 全国计算机一级考试试题...
  • 如何编写一个C程序实现将字符...
  • C程序能不能在main函数之前调...
  • 看一个程序调用了哪些动态库用...
  • 回复不了你啊,咋,威望值不够...
  • mysql的medium.cnf在哪里?...
给主人留下些什么吧!~~

chinaunix网友2010-03-18 11:12:24

我想知道Bootloader序列化菜单式怎么做出来的?博主有研究嘛?还有LOGO的问题,想做成.bin文件,放在FLASH的某一块,不晓得怎么做啊?博主能给点意见不?

回复 | 举报

chinaunix网友2008-12-16 21:44:07

而且这个CE设备没有串口只有USB口。有人知道怎样才能进入引导烧写模式吗?或者关于这个的资料?

回复 | 举报

chinaunix网友2008-12-15 20:51:45

怎样才能进入bootloader烧写ROM Image模式呢?我在PB中定制一个CE镜像,不过不知道怎样写入到CE设备的Flash ROM 当中,PB下载镜像到设备里面时出现“等待BootMe请求”的提示,我就不知道如何才能让设备进入Bootloader模式发出BootMe请求,而不是让里面原有的系统启动起来。你能不能帮我这个忙呢?我的CE设备配置是:ARM CPU,64MB RAM,64MB ROM,1GB SD Card.

回复 | 举报
原创粉丝点击