加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

WINCE NAND FLASH eboot 创建多个分区

发布时间:2020-12-15 17:58:41 所属栏目:百科 来源:网络整理
导读:?方法一: 1.??????三星原厂两个分区的实现方式 1.1??WriteOSImageToBootMedia函数 ?// create extended partition in whatever is left ???// ???hPartEx = BP_OpenPartition( NEXT_FREE_LOC, ???????????????????????????????USE_REMAINING_SPACE, ???????
?方法一:

1.??????三星原厂两个分区的实现方式

1.1??WriteOSImageToBootMedia函数

?// create extended partition in whatever is left

???//

???hPartEx = BP_OpenPartition( NEXT_FREE_LOC,

???????????????????????????????USE_REMAINING_SPACE,

???????????????????????????????PART_DOS32,

???????????????????????????????TRUE,

???????????????????????????????PART_OPEN_ALWAYS);

?

???if (hPartEx == INVALID_HANDLE_VALUE )

???{

???????OALMSG(OAL_WARN,(TEXT("*** WARN: StoreImageToBootMedia: Failed to open/create Extended partition ***rn")));

}

上面的代码为除了nboot、TOC、eboot和nk之外的空间创建一个FAT32的分区。

?

1.2??Platform.reg注册表信息

?

IF BSP_NONANDFS !

; HIVE BOOT SECTION

?

[HKEY_LOCAL_MACHINESystemStorageManagerProfilesSMFLASH]

???"DefaultFileSystem"="BINFS"

???"PartitionDriver"="mspart.dll"

???"MountHidden"=dword:1

???"MountAsROM"=dword:1

???"Folder"="ResidentFlash"

???"Name"="Microsoft Flash Disk"

?

; Keep FATFS from trying to shadow Windows

[HKEY_LOCAL_MACHINESystemStorageManagerProfilesSMFLASHFATFS]

???"MountHidden"=dword:0

???"MountAsROM"=dword:0

?

[HKEY_LOCAL_MACHINEDriversBuiltInSMFLASH]

???"Prefix"="DSK"

???"Dll"="smflash.dll"

???"Index"=dword:1

???"Order"=dword:0

???"Profile"="SMFLASH"

???"IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"

?

[HKEY_LOCAL_MACHINESystemStorageManagerFATFS]

???"Flags"=dword:00000014??????? ;FATFS_TFAT_ALWAYS|FATFS_FORCE_TFAT

????

[HKEY_LOCAL_MACHINESystemStorageManagerAutoLoadSMFLASH]

???"DriverPath"="DriversBuiltInSMFLASH"

???"LoadFlags"=dword:1

???"BootPhase"=dword:0

?

; END HIVE BOOT SECTION

ENDIF ; BSP_NONANDFS

?

系统起来后可以看到ResidentFlash盘符,文件系统是FATFS。

1.3???

2.??????三个分区的实现

?

2.1??WriteOSImageToBootMedia函数

?

// create user partition size

hPartEx1 = BP_OpenPartition(NEXT_FREE_LOC,

SECTOR_TO_BLOCK_SIZE(FILE_TO_SECTOR_SIZE(SYS_PARTITION_SIZE))*PAGES_PER_BLOCK,// align to block

?PART_DOS32,

?TRUE,

?PART_OPEN_ALWAYS);

?

if (hPartEx1 == INVALID_HANDLE_VALUE )

{

?OALMSG(1,(TEXT("*** WARN: StoreImageToBootMedia: Failed to open/create Extended partition?1111 ***rn")));

}

?

hPartEx2 = BP_OpenPartition( NEXT_FREE_LOC,

USE_REMAINING_SPACE,

PART_DOS32X13,

TRUE,

PART_OPEN_ALWAYS);

?

if (hPartEx2 == INVALID_HANDLE_VALUE )

{

?OALMSG(1,(TEXT("*** WARN: StoreImageToBootMedia: Failed to open/create Extended partition 2222***rn")));

}

这里需要注意,创建的两个分区所采用的是不同的文件系统,分别是PART_DOS32和PART_DOS32X13。

?

2.2??Platform.reg

;---- NAND Flash Driver ---------------------------------------------------------

IF BSP_NONANDFS !

; HIVE BOOT SECTION

[HKEY_LOCAL_MACHINEDriversBuiltInNAND]

????????"Prefix"="DSK"

????????"Dll"="smflash.dll"

????????"Order"=dword:0

????????"Index"=dword:3

????????"Profile"="NAND"

????????"Ioctl"=dword:4

????????"IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"

????????"Flags"=dword:1000

?

;[HKEY_LOCAL_MACHINESystemStorageManagerAutoLoadNAND]

????????;"DriverPath"="DriversBuiltInNAND"

????????;"LoadFlags"=dword:1?????????????????????? ; load synchronously

????????;"BootPhase"=dword:0

????????;"MountAsBootable"=dword:1???????????????? ; for Hive-based registry

????????;"Flags"=dword:1000

?

[HKEY_LOCAL_MACHINESystemStorageManagerProfilesNAND]

????????"DefaultFileSystem"="BINFS"

????????"PartitionDriver"="mspart.dll"

????????"Name"="Microsoft Flash Disk"

????????"AutoPart"=dword:1

????????"AutoFormat"=dword:1

????????"AutoMount"=dword:1

????????"BootPhase"=dword:0

????????"Flags"=dword:1000

????????;"Folder"="HIVE1"

?

[HKEY_LOCAL_MACHINESystemStorageManagerProfilesNANDBINFS]

????????"MountHidden"=dword:1

????????"MountAsROM"=dword:1

?

[HKEY_LOCAL_MACHINESystemStorageManagerProfilesNANDFATFS]

????????;"FormatExfat"=dword:1

????????"FormatFAT"=dword:1

????????"Flags"=dword:14?????????????????????????????? ; deprecated in CE6.0 (0x4 : FATFS_DISABLE_AUTOSCAN,0x10 : FATFS_ENABLE_BACKUP_FAT)

????????"DisableAutoScan"=dword:1

????????"CheckForFormat"=dword:1

????????"EnableWriteBack"=dword:1

????????"AutoFormat"=dword:1

????????"MountAsRoot"=dword:1???????????????? ; for ROM-only file system

????????"MountAsBootable"=dword:1????????????????? ; for Hive-based registry

?

[HKEY_LOCAL_MACHINESystemStorageManagerProfilesNANDFATFS]

????????"Flags"=dword:00000024

????????

[HKEY_LOCAL_MACHINESystemStorageManagerAutoLoadNANDFiltersCacheFilt]

????????"Dll"="cachefilt.dll"

????????"LockIOBuffers"=dword:1

?

[HKEY_LOCAL_MACHINESystemStorageManagerProfilesNANDFATFSFiltersCacheFilt]

????????"Dll"="cachefilt.dll"

????????"LockIOBuffers"=dword:1

?

[HKEY_LOCAL_MACHINESystemStorageManagerProfilesNANDPART01]

??????????? "Name"="Microsoft Flash Disk"

??????????? "Folder"="NAND"

?

[HKEY_LOCAL_MACHINESystemStorageManagerProfilesNANDPART02]

??????????? "Name"="Microsoft Flash Disk"

??????????? "Folder"="Flash"

;END HIVE BOOT SECTION

ENDIF ; BSP_NONANDFS

?

方法二:
http://www.cnblogs.com/LoongEmbedded/archive/2011/01/11/1933303.html
方法三:
http://www.voidcn.com/article/p-cbtxxcwo-mq.html
?
另外使用ADS分区的,也有使用应用程序的,不过我没实现,始终没成功。望知道的人分享探讨下。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读