当前位置:   article > 正文

uboot代码解析3:内存管理、控制台、网络、启动函数_arm 安全启动

arm 安全启动

https://ke.qq.com/course/4032547?flowToken=1042705

目录

https://ke.qq.com/course/4032547?flowToken=1042705

内存管理

bdinfo命令

uboot的堆内存

网络

初始化:

修改MAC地址

logo

启动LINUX

数组static boot_os_fn *boot_os[]

do_bootm_linux

boot_prep_linux(下一章专项分析)

boot_jump_linux

 启动内核命令

和启动相关的boot命令族

安全启动

fat命令族

零碎知识

 arm-linux-gnueabihf-objcopy

开机倒数

自动补全

initr_jumptable

int console_init_r(void)

 zImage Image uImage

1.sudo apt install u-boot-tools

2.uboot编译后自动生成的

LzmaTools


内存管理

先看一个命令

bdinfo命令

  1. => bdinfo
  2. arch_number = 0x00000000
  3. boot_params = 0x80000100
  4. DRAM bank = 0x00000000
  5. -> start = 0x80000000
  6. -> size = 0x20000000
  7. eth0name = FEC0
  8. ethaddr = 6c:30:45:2f:91:d7
  9. current eth = FEC0
  10. ip_addr = 192.168.0.3
  11. baudrate = 115200 bps
  12. TLB addr = 0x9FFF0000
  13. relocaddr = 0x9FF74000
  14. reloc off = 0x18774000
  15. irq_sp = 0x9EF71ED0
  16. sp start = 0x9EF71EC0
  17. =>

这个命令就是打印结构体typedef struct bd_info的信息

由-> size  可知当前内存是512MB。

boot_params就是启动参数bootargs存放的地址

uboot的堆内存

看代码,这个函数位于common/board_r.c中, 就是uboot的堆内存初始化函数

  1. static int initr_malloc(void)
  2. {
  3. ulong malloc_start;
  4. #ifdef CONFIG_SYS_MALLOC_F_LEN
  5. debug("Pre-reloc malloc() used %#lx bytes (%ld KB)\n", gd->malloc_ptr,
  6. gd->malloc_ptr / 1024);
  7. #endif
  8. /* The malloc area is immediately below the monitor copy in DRAM */
  9. malloc_start = gd->relocaddr - TOTAL_MALLOC_LEN;
  10. mem_malloc_init((ulong)map_sysmem(malloc_start, TOTAL_MALLOC_LEN),
  11. TOTAL_MALLOC_LEN);
  12. return 0;
  13. }

打印几个值看看、

printf("malloc_start = 0x%08x len = 0x%08x\n",malloc_start,TOTAL_MALLOC_LEN);

 malloc_start + 0x01002000 = 0x9ff74000,正好等于bdinfo命令打印的relocaddr的值,这能说明啥呢?

1.0x9ff74000开始的0x01002000 长度的地址是不能动的。

2.堆内存的长度是16M,知道长度,为修改uboot使用堆内存时提供参考,防止分配失败。

common/dlmalloc.c

该文件中定义可具体的内存初始化和使用函数

  1. void mem_malloc_init(ulong start, ulong size)
  2. {
  3. mem_malloc_start = start;
  4. mem_malloc_end = start + size;
  5. mem_malloc_brk = start;
  6. debug("using memory %#lx-%#lx for malloc()\n", mem_malloc_start,
  7. mem_malloc_end);
  8. #ifdef CONFIG_SYS_MALLOC_CLEAR_ON_INIT
  9. memset((void *)mem_malloc_start, 0x0, size);
  10. #endif
  11. malloc_bin_reloc();
  12. }

理论上这里面应该有malloc和free系列函数的,但是没找到,这个有点复杂,它应该是实现了malloc的底层调用的函数,然后用这些函数替换了malloc这个库函数的实现,具体稍后再分析。

这个实际使用的时候,还是使用malloc和free。

环境变量初始化

  1. static int initr_env(void)
  2. {
  3. /* initialize environment */
  4. if (should_load_env())
  5. env_relocate();
  6. else
  7. set_default_env(NULL);
  8. #ifdef CONFIG_OF_CONTROL
  9. setenv_addr("fdtcontroladdr", gd->fdt_blob);
  10. #endif
  11. /* Initialize from environment */
  12. load_addr = getenv_ulong("loadaddr", 16, load_addr);
  13. #if defined(CONFIG_SYS_EXTBDINFO)
  14. #if defined(CONFIG_405GP) || defined(CONFIG_405EP)
  15. #if defined(CONFIG_I2CFAST)
  16. /*
  17. * set bi_iic_fast for linux taking environment variable
  18. * "i2cfast" into account
  19. */
  20. {
  21. char *s = getenv("i2cfast");
  22. if (s && ((*s == 'y') || (*s == 'Y'))) {
  23. gd->bd->bi_iic_fast[0] = 1;
  24. gd->bd->bi_iic_fast[1] = 1;
  25. }
  26. }
  27. #endif /* CONFIG_I2CFAST */
  28. #endif /* CONFIG_405GP, CONFIG_405EP */
  29. #endif /* CONFIG_SYS_EXTBDINFO */
  30. return 0;
  31. }

这里面,首先通过should_load_env判断是否已经设置了环境变量,如果设置了就执行,env_relocate环境变量重定位到内存,如果没有设置,就使用uboot编译时配置的默认值。

下面分别看下这两个函数

should_load_env

  1. /*
  2. * Tell if it's OK to load the environment early in boot.
  3. *
  4. * If CONFIG_OF_CONTROL is defined, we'll check with the FDT to see
  5. * if this is OK (defaulting to saying it's OK).
  6. *
  7. * NOTE: Loading the environment early can be a bad idea if security is
  8. * important, since no verification is done on the environment.
  9. *
  10. * @return 0 if environment should not be loaded, !=0 if it is ok to load
  11. */
  12. static int should_load_env(void)
  13. {
  14. #ifdef CONFIG_OF_CONTROL
  15. return fdtdec_get_config_int(gd->fdt_blob, "load-environment", 1);
  16. #elif defined CONFIG_DELAY_ENVIRONMENT
  17. return 0;
  18. #else
  19. return 1;
  20. #endif
  21. }

这里面调用的fdtdec_get_config_int

  1. int fdtdec_get_config_int(const void *blob, const char *prop_name,
  2. int default_val)
  3. {
  4. int config_node;
  5. debug("%s: %s\n", __func__, prop_name);
  6. config_node = fdt_path_offset(blob, "/config");
  7. if (config_node < 0)
  8. return default_val;
  9. return fdtdec_get_int(blob, config_node, prop_name, default_val);
  10. }

这个函数看起来是设备树啊,这是为什么呢,重新看一下,难道环境变量被存放到设备树文件里了吗?而且还是/config节点。真的吗?

测试一下,打印设备树:

使用fdt命令打印了设备树信息,没找到/config节点,可能到后面就明白了,向前分析

set_default_env

Env_common.c (common) 

void set_default_env(const char *s)

这个是设置默认环境变量,看看它保存到哪里了,没找到,继续向前看。

env_relocate_spec

这个是和硬件相关的,根据不同的启动设备会调用不同的版本,先放在这。

网络

初始化:

函数initr_net,先认个门就行了,需要研究的时候再研究。

  1. static int initr_net(void)
  2. {
  3.     puts("Net:   ");
  4.     eth_initialize();
  5. #if defined(CONFIG_RESET_PHY_R)
  6.     debug("Reset Ethernet PHY\n");
  7.     reset_phy();
  8. #endif
  9.     return 0;
  10. }

修改MAC地址

static int initr_ethaddr(void)

在这个函数里添加需要修改的值就行了。

Linux_logo.h (include),里面都是数组,这些数组应该就是图片是数据。

启动LINUX

数组static boot_os_fn *boot_os[]

该数组中定义了不同的操作系统的启动函数,下图是uboot支持启动的操作系统列表

 下面代码是本uboot的启动引导入口

  1. static boot_os_fn *boot_os[] = {
  2. [IH_OS_U_BOOT] = do_bootm_standalone,
  3. #ifdef CONFIG_BOOTM_LINUX
  4. [IH_OS_LINUX] = do_bootm_linux,
  5. #endif
  6. #ifdef CONFIG_BOOTM_NETBSD
  7. [IH_OS_NETBSD] = do_bootm_netbsd,
  8. #endif
  9. #ifdef CONFIG_LYNXKDI
  10. [IH_OS_LYNXOS] = do_bootm_lynxkdi,
  11. #endif
  12. #ifdef CONFIG_BOOTM_RTEMS
  13. [IH_OS_RTEMS] = do_bootm_rtems,
  14. #endif
  15. #if defined(CONFIG_BOOTM_OSE)
  16. [IH_OS_OSE] = do_bootm_ose,
  17. #endif
  18. #if defined(CONFIG_BOOTM_PLAN9)
  19. [IH_OS_PLAN9] = do_bootm_plan9,
  20. #endif
  21. #if defined(CONFIG_BOOTM_VXWORKS) && \
  22. (defined(CONFIG_PPC) || defined(CONFIG_ARM))
  23. [IH_OS_VXWORKS] = do_bootm_vxworks,
  24. #endif
  25. #if defined(CONFIG_CMD_ELF)
  26. [IH_OS_QNX] = do_bootm_qnxelf,
  27. #endif
  28. #ifdef CONFIG_INTEGRITY
  29. [IH_OS_INTEGRITY] = do_bootm_integrity,
  30. #endif
  31. #ifdef CONFIG_BOOTM_OPENRTOS
  32. [IH_OS_OPENRTOS] = do_bootm_openrtos,
  33. #endif
  34. }

由上可知,do_bootm_linux是linux系统的启动入口

do_bootm_linux

该函数的定义如下所示:

  1. /* Main Entry point for arm bootm implementation
  2. *
  3. * Modeled after the powerpc implementation
  4. * DIFFERENCE: Instead of calling prep and go at the end
  5. * they are called if subcommand is equal 0.
  6. */
  7. int do_bootm_linux(int flag, int argc, char * const argv[],
  8. bootm_headers_t *images)
  9. {
  10. /* No need for those on ARM */
  11. if (flag & BOOTM_STATE_OS_BD_T || flag & BOOTM_STATE_OS_CMDLINE)
  12. return -1;
  13. if (flag & BOOTM_STATE_OS_PREP) {
  14. boot_prep_linux(images);
  15. return 0;
  16. }
  17. if (flag & (BOOTM_STATE_OS_GO | BOOTM_STATE_OS_FAKE_GO)) {
  18. boot_jump_linux(images, flag);
  19. return 0;
  20. }
  21. boot_prep_linux(images);
  22. boot_jump_linux(images, flag);
  23. return 0;
  24. }

在该函数开头添加打印信息,观测flag、argc、argv的值,打印如下

  1. arch/arm/lib/bootm.c,do_bootm_linux,line=358:flag = 256,argc=3
  2. arch/arm/lib/bootm.c,do_bootm_linux,line=360:argv[0] = 80800000
  3. arch/arm/lib/bootm.c,do_bootm_linux,line=360:argv[1] = -
  4. arch/arm/lib/bootm.c,do_bootm_linux,line=360:argv[2] = 86000000
  5. arch/arm/lib/bootm.c,boot_prep_linux,line=224:using: FDT
  6. Using Device Tree in place at 86000000, end 8600c3fb
  7. arch/arm/lib/bootm.c,do_bootm_linux,line=358:flag = 1024,argc=3
  8. arch/arm/lib/bootm.c,do_bootm_linux,line=360:argv[0] = 80800000
  9. arch/arm/lib/bootm.c,do_bootm_linux,line=360:argv[1] = -
  10. arch/arm/lib/bootm.c,do_bootm_linux,line=360:argv[2] = 86000000

从打印信息可到以下结果

1.do_bootm_linux被调用了两次

2.do_bootm_linux的argc和argv其实就是bootz的传递过来的参数

3.flag两次值不同,第一次是256即0x100,第二次是10240即0x400

然后再打印5个宏,他们绝对了该函数的if执行分支

  1. DEBUG_INFO("BOOTM_STATE_OS_BD_T=0x%08x",BOOTM_STATE_OS_BD_T);
  2. DEBUG_INFO("BOOTM_STATE_OS_CMDLINE=0x%08x",BOOTM_STATE_OS_CMDLINE);
  3. DEBUG_INFO("BOOTM_STATE_OS_PREP=0x%08x",BOOTM_STATE_OS_PREP);
  4. DEBUG_INFO("BOOTM_STATE_OS_GO=0x%08x",BOOTM_STATE_OS_GO);
  5. DEBUG_INFO("BOOTM_STATE_OS_FAKE_GO=0x%08x",BOOTM_STATE_OS_FAKE_GO);

打印值如下:

  1. arch/arm/lib/bootm.c,do_bootm_linux,line=363:BOOTM_STATE_OS_BD_T=0x00000080
  2. arch/arm/lib/bootm.c,do_bootm_linux,line=364:BOOTM_STATE_OS_CMDLINE=0x00000040
  3. arch/arm/lib/bootm.c,do_bootm_linux,line=365:BOOTM_STATE_OS_PREP=0x00000100
  4. arch/arm/lib/bootm.c,do_bootm_linux,line=366:BOOTM_STATE_OS_GO=0x00000400
  5. arch/arm/lib/bootm.c,do_bootm_linux,line=367:BOOTM_STATE_OS_FAKE_GO=0x00000200

结合代码,两次值对比,第一次调用时,flag值是0x100进入下下面这个分支

  1. if (flag & BOOTM_STATE_OS_PREP) {
  2. boot_prep_linux(images);
  3. return 0;
  4. }

boot_prep_linux(下一章专项分析)

boot_prep_linux函数定义如下所示:从第一行代码可知,这个函数是用来处理传递的参数的,这里就是本次分多次编写文档分析的重点所在了。

  1. static void boot_prep_linux(bootm_headers_t *images)
  2. {
  3. char *commandline = getenv("bootargs");
  4. if (IMAGE_ENABLE_OF_LIBFDT && images->ft_len) {
  5. #ifdef CONFIG_OF_LIBFDT
  6. debug("using: FDT\n");
  7. if (image_setup_linux(images)) {
  8. printf("FDT creation failed! hanging...");
  9. hang();
  10. }
  11. #endif
  12. } else if (BOOTM_ENABLE_TAGS) {
  13. debug("using: ATAGS\n");
  14. setup_start_tag(gd->bd);
  15. if (BOOTM_ENABLE_SERIAL_TAG)
  16. setup_serial_tag(&params);
  17. if (BOOTM_ENABLE_CMDLINE_TAG)
  18. setup_commandline_tag(gd->bd, commandline);
  19. if (BOOTM_ENABLE_REVISION_TAG)
  20. setup_revision_tag(&params);
  21. if (BOOTM_ENABLE_MEMORY_TAGS)
  22. setup_memory_tags(gd->bd);
  23. if (BOOTM_ENABLE_INITRD_TAG) {
  24. /*
  25. * In boot_ramdisk_high(), it may relocate ramdisk to
  26. * a specified location. And set images->initrd_start &
  27. * images->initrd_end to relocated ramdisk's start/end
  28. * addresses. So use them instead of images->rd_start &
  29. * images->rd_end when possible.
  30. */
  31. if (images->initrd_start && images->initrd_end) {
  32. setup_initrd_tag(gd->bd, images->initrd_start,
  33. images->initrd_end);
  34. } else if (images->rd_start && images->rd_end) {
  35. setup_initrd_tag(gd->bd, images->rd_start,
  36. images->rd_end);
  37. }
  38. }
  39. setup_board_tags(&params);
  40. setup_end_tag(gd->bd);
  41. } else {
  42. printf("FDT and ATAGS support not compiled in - hanging\n");
  43. hang();
  44. }
  45. }

这个函数中有如下一段代码

  1. int image_setup_linux(bootm_headers_t *images)
  2. {
  3. /**/
  4. if (IMAGE_ENABLE_RAMDISK_HIGH) {
  5. rd_len = images->rd_end - images->rd_start;
  6. ret = boot_ramdisk_high(lmb, images->rd_start, rd_len,
  7. initrd_start, initrd_end);
  8. if (ret)
  9. return ret;
  10. }
  11. /**/
  12. }

首先,看下这个宏有没有定义,然后确定IMAGE_ENABLE_RAMDISK_HIGH的值,

其次,确认众多的TAG宏,是否被定义,开始写代码验证,列出几个需要验证的宏

  1. BOOTM_ENABLE_TAGS
  2. BOOTM_ENABLE_SERIAL_TAG
  3. BOOTM_ENABLE_CMDLINE_TAG
  4. BOOTM_ENABLE_REVISION_TAG
  5. BOOTM_ENABLE_MEMORY_TAGS
  6. BOOTM_ENABLE_INITRD_TAG

还有需要验证的结构体中从成员,这些值将在下一章,分出一章的内容来分析。

第二次调用时,flag值是0x400进入下面这个分支,

flag & (BOOTM_STATE_OS_GO | BOOTM_STATE_OS_FAKE_GO)的值就是

0x400 & (0x400 | 0x200) = 0x400,if结果为真

  1. if (flag & (BOOTM_STATE_OS_GO | BOOTM_STATE_OS_FAKE_GO)) {
  2. DEBUG_INFO("TWO");
  3. boot_jump_linux(images, flag);
  4. return 0;
  5. }

boot_jump_linux

看第一行的注释,Subcommand: GO,go是测试uboot代码时也是执行的go,在uboot中测试裸机代码也是执行的go,uboot启动linux内核时,可能也是go,也是把它当做一个普通的裸机程序对待而已,关键还在于内核自己争气,抓住了机会,一飞冲天。

  1. /* Subcommand: GO */
  2. static void boot_jump_linux(bootm_headers_t *images, int flag)
  3. {
  4. #ifdef CONFIG_ARM64
  5. void (*kernel_entry)(void *fdt_addr, void *res0, void *res1,
  6. void *res2);
  7. int fake = (flag & BOOTM_STATE_OS_FAKE_GO);
  8. kernel_entry = (void (*)(void *fdt_addr, void *res0, void *res1,
  9. void *res2))images->ep;
  10. debug("## Transferring control to Linux (at address %lx)...\n",
  11. (ulong) kernel_entry);
  12. bootstage_mark(BOOTSTAGE_ID_RUN_OS);
  13. announce_and_cleanup(fake);
  14. if (!fake) {
  15. do_nonsec_virt_switch();
  16. kernel_entry(images->ft_addr, NULL, NULL, NULL);
  17. }
  18. #else
  19. unsigned long machid = gd->bd->bi_arch_number;
  20. char *s;
  21. void (*kernel_entry)(int zero, int arch, uint params);
  22. unsigned long r2;
  23. int fake = (flag & BOOTM_STATE_OS_FAKE_GO);
  24. kernel_entry = (void (*)(int, int, uint))images->ep;
  25. s = getenv("machid");
  26. if (s) {
  27. if (strict_strtoul(s, 16, &machid) < 0) {
  28. debug("strict_strtoul failed!\n");
  29. return;
  30. }
  31. printf("Using machid 0x%lx from environment\n", machid);
  32. }
  33. debug("## Transferring control to Linux (at address %08lx)" \
  34. "...\n", (ulong) kernel_entry);
  35. bootstage_mark(BOOTSTAGE_ID_RUN_OS);
  36. announce_and_cleanup(fake);
  37. if (IMAGE_ENABLE_OF_LIBFDT && images->ft_len)
  38. r2 = (unsigned long)images->ft_addr;
  39. else
  40. r2 = gd->bd->bi_boot_params;
  41. if (!fake) {
  42. #ifdef CONFIG_ARMV7_NONSEC
  43. if (armv7_boot_nonsec()) {
  44. armv7_init_nonsec();
  45. secure_ram_addr(_do_nonsec_entry)(kernel_entry,
  46. 0, machid, r2);
  47. } else
  48. #endif
  49. kernel_entry(0, machid, r2);
  50. }
  51. #endif
  52. }

 启动内核命令

和启动相关的boot命令族

在命令行输入?或者help,就会看到当前uboot支持的命令,这里只关注boot相关的命令

他们对应d_xxx函数例如booz就对应do_bootz函数

  1. boot - boot default, i.e., run 'bootcmd'
  2. bootd - boot default, i.e., run 'bootcmd'
  3. bootelf - Boot from an ELF image in memory
  4. bootm - boot application image from memory
  5. bootp - boot image via network using BOOTP/TFTP protocol
  6. bootvx - Boot vxWorks from an ELF image
  7. bootz - boot Linux zImage image from memory

看看zImage存放在哪里了

fatls命令,这是的Fat文件系统

  1. => fatls mmc 1:1
  2. 6504344 zimage
  3. 39054 xxx.dtb
  4. 2 file(s), 0 dir(s)

安全启动

CONFIG_SECURE_BOOT

先知道有这个东西,后面大概率会用到

fat命令族

  1. => fat
  2. fatinfo fatload fatls fatsize fatwrite

fatinfo

  1. => fatinfo
  2. usage: fatinfo <interface> [<dev[:part]>]
  3. => fatinfo mmc 1:1
  4. Interface: MMC
  5. Device 1: Vendor: Man 000015 Snr af7f8d35 Rev: 0.6 Prod: 8GTF4R
  6. Type: Removable Hard Disk
  7. Capacity: 7456.0 MB = 7.2 GB (15269888 x 512)
  8. Filesystem: FAT32 "NO NAME "

零碎知识

 arm-linux-gnueabihf-objcopy

u-boot编译后生成u-boot、u-boot.bin、u-boot.imx三个文件

  1. $ file u-boot
  2. u-boot: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /usr/lib/ld.so.1, not stripped
  3. $ file u-boot.bin
  4. u-boot.bin: data
  5. $ file u-boot.imx
  6. u-boot.imx: data

arm-linux-gnueabihf-objcopy将u-boot文件转换为u-boot.bin文件,然后u-boot.bin可以直接在内存中运行,前面测试时候就是这么做的。

u-boot.imx是下载到flash中存储的,直接在内核中不能运行,它里面包含一些芯片启动时需要加载的参数。就是u-boot.bin再添加一个额外的信息。这个地方每个芯片都不一样。

开机倒数

Autoboot.c (common) 从文件名就知道,它是和自动启动相关的。

const char *bootdelay_process(void)

要修改开启倒数的行为,就修改这里

自动补全

Command.c (common)  

int cmd_auto_complete(const char *const prompt, char *buf, int *np, int *colp)

initr_jumptable

这个功能,从代码上看,应该是早期uboot想做一个驱动框架,但是因为驱动本身的多样性和编写驱动的人员的分散性。导致这个计划失败了,我猜可能是这样吧。

  1. static int initr_jumptable(void)
  2. {
  3.     jumptable_init();
  4.     return 0;
  5. }
  1. void jumptable_init(void)
  2. {
  3. gd->jt = malloc(sizeof(struct jt_funcs));
  4. #include <_exports.h>
  5. }

关键是给gd->jt赋值。这个变量里面有很多函数指针,估计是为了实现初始化的时候,给这些变量赋值成对应设备的操作函数,想法很好,没有实现。

int console_init_r(void)

  1. stdinname = getenv("stdin");
  2. stdoutname = getenv("stdout");
  3. stderrname = getenv("stderr");

配置标准错误、标准输入、标准输出,其实都是对应的串口

这个主要是和软件相关的,如果需要修改调试串口,还是从环境变量那里开始分析好一点。

 zImage Image uImage

zImage 是Image的压缩版,并且其前段包含一段未压缩自解压代码。

uboot中mkimage工作,可以将zImage生成uImage,就是在zImage加上64字节的uImage信息。

u-boot启动时,需要uImage,或者zImage,

(这个uboot新版版可能没有了

LINUX_ZIMAGE_MAGIC:这个宏提供zImage启动的支持)

mkimage工具

有两种方法安装这个工具

1.sudo apt install u-boot-tools

  1. $ mkimage
  2. 程序“mkimage”尚未安装。 您可以使用以下命令安装:
  3. sudo apt install u-boot-tools

这个感觉不太靠谱,没试

2.uboot编译后自动生成的

  1. $ find -name mkimage
  2. ./tools/mkimage
  3. lkmao@ubuntu:~/i

把它复制到内核目录下

然后

export PATH=$PATH:./

make uimage,

我在自己的内核试了试,就是这样的,先放在这里,以前看过这个,后来忘记了,所以,这就是不记笔记的坏处。

make: *** No rule to make target 'uimage'。 停止。

LzmaTools

The do_bootm() function uses the lzmaBuffToBuffDecopress() function to expand the compressed image.

  1. The lib_lzma functionality was written by Igor Pavlov. The original source cames from the LZMA SDK web page:
  2. URL: http://www.7-zip.org/sdk.html Author: Igor Pavlov
  3. The import is made using the import_lzmasdk.sh script that:
  4. * untars the lzmaXYY.tar.bz2 file (from the download web page)
  5. * copies the files LzmaDec.h, Types.h, LzmaDec.c, history.txt, and lzma.txt from source archive into the lib_lzma directory (pwd).
  6. Example:
  7. . import_lzmasdk.sh ~/lzma465.tar.bz2
  8. Notice: The files from lzma sdk are _not modified_ by this script!
  9. The files LzmaTools.{c,h} are provided to export the lzmaBuffToBuffDecompress() function that wraps the complex LzmaDecode() function from the LZMA SDK. The do_bootm() function uses the lzmaBuffToBuffDecopress() function to expand the compressed image.
  10. The directory U-BOOT/include/lzma contains stubs files that permit to use the library directly from U-BOOT code without touching the original LZMA SDK's files.
  11. Luigi 'Comio' Mantellini <luigi.mantellini@idf-hit.com>

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/609992
推荐阅读
相关标签
  

闽ICP备14008679号