fuklfukl
驱动牛犊
驱动牛犊
  • 注册日期2007-09-05
  • 最后登录2010-08-26
  • 粉丝2
  • 关注0
  • 积分4分
  • 威望18点
  • 贡献值0点
  • 好评度13点
  • 原创分0分
  • 专家分0分
阅读:2558回复:1

关于EBOOT中,进行BINFS分区与FAT32分区的问题.

楼主#
更多 发布于:2008-05-19 17:12
之前一直没有用EBOOT去引导系统,最近想尝试下功能强大的EBOOT,粗略的看了一下EBOOT的一些代码,有些问题不是很清楚,特来请教下各位大大....

其中进行BINFS分区时,只知道调用这个函数可以进行分区.BP_OpenPartition( NEXT_FREE_LOC,
                              (dwBINFSPartSectors-1),
                              PART_BINFS,
                              TRUE,
                              PART_OPEN_ALWAYS);
BP_OpenPartition的第一个参数NEXT_FREE_LOC,具体指的是哪一个块呢?
还有第二个参数,也不知道是如何确定的?

分区的动作是要在OEMLaunch();里面DOWNLOAD IMAGE的时候进行,还是在调用OEMLaunch();之前就可以完成BINFS和FAT32的分区呢?

谢谢大家!
high
论坛版主
论坛版主
  • 注册日期2002-08-10
  • 最后登录2010-07-26
  • 粉丝4
  • 关注0
  • 积分60分
  • 威望655点
  • 贡献值0点
  • 好评度56点
  • 原创分0分
  • 专家分60分
沙发#
发布于:2008-05-20 02:31
*  Opens/creates a partition depending on the creation flags.  If it is opening
 *  and the partition has already been opened, then it returns a handle to the
 *  opened partition.  Otherwise, it loads the state information of that partition
 *  into memory and returns a handle.  
 *
 *  ENTRY
 *      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.
 *      dwPartType - Type of partition to create/open.
 *      fActive - TRUE indicates to create/open the active partition.  FALSE for
 *          inactive.
 *      dwCreationFlags - PART_CREATE_NEW to create only.  Fail if it already
 *          exists.  PART_OPEN_EXISTING to open only.  Fail if it doesn't exist.
 *          PART_OPEN_ALWAYS creates if it does not exist and opens if it
 *          does exist.
 *
 *  EXIT
 *      Handle to the partition on success.  INVALID_HANDLE_VALUE on error.
=====================================================
第一个表示开始的位置, NEXT_FREE_LOC=-1,表示下一个空闲位置.
第二个表示大小, #define USE_REMAINING_SPACE -1, 所以当等于-1表示将剩下的所有空间分一个区

bp_init初始化成功后就可以分区了.
游客

返回顶部