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

嵌入式系统系统升级内核双备份的实现方式

发布时间:2020-12-15 06:23:54 所属栏目:百科 来源:网络整理
导读:1.nand flash MTD分区 ? ? ? ? kernels/linux-2.6.31.1-cavm1/drivers/mtd/maps/xxxxx-flash.c? ? ? ? ??/* MTD partitions: From CNW5602 32MB ? ? ? ? ?* mtd0: 0x000C0000 00020000 "bootloader" ? ? ? ? ?* mtd1: 0x00040000 00020000 "factory_config"

1.nand flash MTD分区

? ? ? ? kernels/linux-2.6.31.1-cavm1/drivers/mtd/maps/xxxxx-flash.c?

? ? ? ??/* MTD partitions: From CNW5602 32MB ? ? ? ? ?* mtd0: 0x000C0000 00020000 "bootloader" ? ? ? ? ?* mtd1: 0x00040000 00020000 "factory_config" ? ? ? ? ?* mtd2: 0x00100000 00020000 "sysconfig" ? ? ? ? ?* mtd3: 0x00DE0000 00020000 "kernel_and_fs" ? ? ? ? ?* mtd4: 0x00020000 00020000 "bootloader_env" ? ? ? ? ?* mtd5: 0x00DE0000 00020000 "kernel_and_fs_backup" ? ? ? ? * mtd6: 0x001E0000 00020000 "syslog" ? ? ? ? * mtd7: 0x00020000 00020000 "transconfig" ? ? ? ? * mtd8: 0x00020000 00020000 "factoryconfig" */ static struct mtd_partition xxx_flash_partitions[] = { { .name = "bootloader",/* u-boot 6 sector (768KB),0x20000-0xC0000: Reserved Space */ .size = 0x000C0000,/* 0x00000000 .. 0x000BFFFF */ .offset = 0,.mask_flags = MTD_WRITEABLE,/* force read-only */ },{ .name = "factory_config",/* Static Configuration from factory,(256KB = 128KB used + 128KB reserved) */ .size = 0x00040000,/* 0x000C0000 .. 0x000FFFFF */ .offset = MTDPART_OFS_APPEND,{ .name = "sysconfig",/* sysconfig 8 sector (1024KB) */ .size = 0x00100000,/* 0x00100000 .. 0x001FFFFF */ .offset = MTDPART_OFS_APPEND,},{ .name = "kernel_and_fs",/* Linux Kernel and File System (bootpImage) (14208KB) */ .size = 0x00DE0000,/* 0x00200000 .. 0x00FDFFFF */ .offset = MTDPART_OFS_APPEND,{ .name = "bootloader_env",/* bottom 1 sector (128KB) for u-boot env variables */ .size = 0x00020000,/* 0x00FE0000 .. 0x00FFFFFF */ .offset = MTDPART_OFS_APPEND,{ .name = "kernel_and_fs_backup",/* 0x01000000 .. 0x01DDFFFF */ .offset = MTDPART_OFS_APPEND,{ .name = "syslog",/* syslog 15 sector (1920KB) */ .size = 0x001E0000,/* 0x01DE0000 .. 0x01FBFFFF */ .offset = MTDPART_OFS_APPEND,{ .name = "transconfig",/* transconfig 1 sector (128KB) */ .size = 0x00020000,/* 0x01FC0000 .. 0x01FDFFFF */ .offset = MTDPART_OFS_APPEND,{ .name = "factoryconfig",/* factoryconfig 1 sector (128KB) */ .size = MTDPART_SIZ_FULL,/* 0x01FE0000 .. 0x01FFFFFF */ /* MTDPART_SIZ_FULL= 0x00020000 */ .offset = MTDPART_OFS_APPEND,} }; 2.在应用层读写open("/dev/mtd3",O_RDWR);

(编辑:李大同)

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

    推荐文章
      热点阅读