- C/C++ code
* dwStartSector - Logical sector to start the partition. NEXT_FREE_LOC if none * specified. Ignored if opening existing partition. * dwNumSectors - Number of logical sectors of the partition. USE_REMAINING_SPACE * to indicate to take up the rest of the space on the flash for that partition (should * only be used when creating extended partitions). This parameter is ignored * if opening existing partition....HANDLE BP_OpenPartition(DWORD dwStartSector, DWORD dwNumSectors, DWORD dwPartType, BOOL fActive, DWORD dwCreationFlags)
第一个参数说明是开始的Sector,第二个参数是Sector的数目
但是我看代码怎么好像是Page呢?
- C/C++ code
hPart = BP_OpenPartition( (NK_START_BLOCK+1)*PAGES_PER_BLOCK, // next block of MBR SECTOR_TO_BLOCK_SIZE(FILE_TO_SECTOR_SIZE(dwBINFSPartLength))*PAGES_PER_BLOCK, //align to block PART_BINFS, TRUE, PART_OPEN_ALWAYS);
(NK_START_BLOCK+1)*PAGES_PER_BLOCK ?? NK_START_BLOCK 在s3c6410中为6,PAGES_PER_BLOCK = 64
算出来应该是前面总共的Pages偏移量才对啊,第二个参数不是也是算Pages的数目吗?
另外还有一个问题,eboot里面这个分区为什么从(NK_START_BLOCK+1)开始,+1做什么。
第一sector放uboot,第二sector放TOC,第3-6(4个)放eboot,要跳开1个sector做什么?
------解决方案--------------------
Page跟Sector是一个意思吧Page->block,Sector->block
eboot里面这个分区为什么从(NK_START_BLOCK+1)开始,+1做什么
加1的意思是不是NK_START_BLOCK是MBR,我猜的,不敢确定
------解决方案--------------------
硬盘由很多盘片(platter)组成,每个盘片的每个面都有一个读写磁头。如果有N个盘片。就有2N个面,对应2N个磁头(Heads),从0、1、2 开始编号。每个盘片被划分成若干个同心圆磁道(逻辑上的,是不可见的。)每个盘片的划分规则通常是一样的。这样每个盘片的半径均为固定值R的同心圆再逻辑上形成了一个以电机主轴为轴的柱面(Cylinders),从外至里编号为0、1、2……每个盘片上的每个磁道又被划分为几十个扇区(Sector),通常的容量是512byte,并按照一定规则编号为1、2、3……形成Cylinders×Heads×Sector个扇区。这三个参数即是硬盘的物理参数。
上层对应的是页
底层是块
这方面以前好像有个帖子专门说了
------解决方案--------------------
------解决方案--------------------
HANDLE BP_OpenPartition(DWORD dwStartSector, DWORD dwNumSectors, DWORD dwPartType, BOOL fActive, DWORD dwCreationFlags)中:
这个函数是文件系统分区函数
StartSector:文件系统分区起始地址
dwNumSectors:这是长度了
注意这里是系统打印出来的时候 转成了逻辑地址
譬如:
CreatePartition: Start = 0x100, Num = 0xae00.
Log2Phys: Logical 0x100 -> Physical 0x500
这样有些厂家的BSP中EBOOT就可能存在问题(打印出来的信息与实际不符)
------解决方案--------------------