Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9418588
  • 博文数量: 1748
  • 博客积分: 12961
  • 博客等级: 上将
  • 技术积分: 20070
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-09 11:25
个人简介

偷得浮生半桶水(半日闲), 好记性不如抄下来(烂笔头). 信息爆炸的时代, 学习是一项持续的工作.

文章分类

全部博文(1748)

文章存档

2024年(24)

2023年(26)

2022年(112)

2021年(217)

2020年(157)

2019年(192)

2018年(81)

2017年(78)

2016年(70)

2015年(52)

2014年(40)

2013年(51)

2012年(85)

2011年(45)

2010年(231)

2009年(287)

分类: LINUX

2009-02-06 15:35:48

定义 arm-elf格式文件的布局

$(TOPDIR)/board/$(BOARDDIR)/u-boot.lds


OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")

/*OUTPUT_FORMAT("elf32-arm", "elf32-arm", "elf32-arm")*/

OUTPUT_ARCH(arm)

ENTRY(_start)

SECTIONS

{

. = 0x00000000;

. = ALIGN(4);

.text :

{

cpu/arm920t/start.o (.text) --> 可以看出整个程序的入口是start.S的源码

board/open24x0/boot_init.o (.text)

*(.text)

}

...

...

}



Config.mk

LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds

sinclude $(TOPDIR)/$(ARCH)_config.mk # include architecture dependend rules

sinclude $(TOPDIR)/cpu/$(CPU)/config.mk # include CPU specific rules

sinclude $(TOPDIR)/cpu/$(CPU)/$(SOC)/config.mk # include SoC specific rules

sinclude $(TOPDIR)/board/$(BOARDDIR)/config.mk



Makefile

include $(TOPDIR)/config.mk


  1. Makefile分析
    VERSION_FILE = $(obj)include/version_autogenerated.h

HOSTARCH=i386

HOSTOS=linux

MKCONFIG := $(SRCTREE)/mkconfig

include $(OBJTREE)/include/config.mk # make xxx_config后内容为配置的内容

export ARCH CPU BOARD VENDOR SOC


CROSS_COMPILE = arm-linux-

include $(TOPDIR)/config.mk


# U-Boot objects....order is important (i.e. start must be first)

OBJS = cpu/$(CPU)/start.o

LIBS = lib_generic/libgeneric.a

LIBS += board/$(BOARDDIR)/lib$(BOARD).a

LIBS += cpu/$(CPU)/lib$(CPU).a

ifdef SOC

LIBS += cpu/$(CPU)/$(SOC)/lib$(SOC).a

endif

LIBS += lib_$(ARCH)/lib$(ARCH).a

LIBS += fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a
fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a

LIBS += net/libnet.a

LIBS += disk/libdisk.a

LIBS += rtc/librtc.a

LIBS += dtt/libdtt.a

LIBS += drivers/libdrivers.a

LIBS += drivers/nand/libnand.a

LIBS += drivers/nand_legacy/libnand_legacy.a

LIBS += drivers/usb/libusb.a

LIBS += drivers/sk98lin/libsk98lin.a

LIBS += common/libcommon.a

LIBS += $(BOARDLIBS)

LIBS := $(addprefix $(obj),$(LIBS))


xxx_config: unconfig

@echo "#define CONFIG_CPU" >>include/config.h

@echo "#define CONFIG_BOARD" >>include/config.h

@$(MKCONFIG) $(@:_config=) ARCH CPU BOARD VENDOR SOC

@sed -i "s,^TEXT_BASE = .*,TEXT_BASE = (内存的高端地址-足够的运行空间),g" $(obj)board/VENDOR/BOARD/config.mk

@echo "... configured for VENDOR Logic BOARD board"


  1. 使用 make xxx_config的时候生成了

    1. include/asm include/asm-arm

    2. include/asm/arch include/asm-arm/arch- CPU

    3. include/config.h

    4. include/config.mk


再次使用Make的时候,Makefile中包含的各项配置文件已经有了

阅读(978) | 评论(0) | 转发(0) |
0

上一篇:交叉开发

下一篇:uboot分析

给主人留下些什么吧!~~