内核移植和文件系统制作(2):linux内核最小系统和initramfs文件系统

本文介绍了如何进行Linux内核最小系统移植,包括配置内核、修改分区、调整时钟参数等步骤。同时,详细讲解了如何制作initramfs文件系统,并将其编译入内核,最后讨论了u-boot参数的设置,以实现系统的成功启动。
摘要由CSDN通过智能技术生成

linux内核最小系统,使用内核版本:https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.8.1.tar.bz2

1,FL2440板子的基本硬件:晶振12MHZ

CPU

 型号为S3C2440,基于ARM920T,指令集ARMV4,时钟主频400MHz

SDRAM                             

 H57V2562GTR-75C  

 2片*32MB=64MB,挂载于nGCS6 (0x3000 0000)

NANDFLASH

型号:K9F2G08U0B  大小:256MB

Network Adapter  

 DM9000AEP   10/100M自适应,挂载于nGCS4 (0x2000 0000)

LED  

 5个LED(LED0~3)I/O口指示灯,LED5电源指示灯,LED9核心板3.3V指示灯

LED0~LED3分别接GPB6,GPB6,GPB8,GPB10

BEEP(蜂鸣器)       

 接在GPB0/TOUT0



2,首先说明make menuconfig,Kconfig,.config之间的关系:

1)make menuconfig首先读取顶层Kconfig文件,生成选择界面。

2)使能arch/$SRCARCH/Kconfig,最终生成.config(控制编译)

Kconfig文件:

#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "Linux/$ARCH $KERNELVERSION Kernel Configuration"


config SRCARCH
    string
    option env="SRCARCH"


source "arch/$SRCARCH/Kconfig"


相当于使能arch/arm/Kconfig,并且递归进入各个目录Kconfig,生成选项界面。

3)当make编译,就会读出生成的.config文件,根据其中的选项编译相应模块。

若选择<y>编译入内核中;<M>编译成驱动模块,需要的时候加载 ;否则不编译。


3,linux-3.8内核配置

1)修改顶层Makefile 

# CROSS_COMPILE specify the prefix used for all executables used
# during compilation. Only gcc and related bin-utils executables
# are prefixed with $(CROSS_COMPILE).
# CROSS_COMPILE can be set on the command line
# make CROSS_COMPILE=ia64-linux-
# Alternatively CROSS_COMPILE can be set in the environment.
# A third alternative is to store a setting in .config so that plain
# "make" in the configured kernel build directory always uses that.
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
export KBUILD_BUILDHOST := $(SU

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值