定制自己的嵌入式kernel

来源:互联网 发布:python 屏幕输入 编辑:程序博客网 时间:2024/05/29 09:00

 

make ARCH=arm CROSS_COMPILE=arm-linux-menuconfig

 

需要选中:

‘enable deprecated sysfs features tosupport old userspace tools

Initial RAM filesystem and RAM disk(initramfs/initrd) support ----linux to support Ramdisk

‘optimize for size

Disable heap randomization

选中支持dataflash

mem=64M console=ttyS0,115200initrd=0x21100000,3145728 root=dev/ram0 rw

初始化命令行。也可以不设定,会自动从u-boot继承。

上面的base address  and BSS address可以不设定,sam92ejs20008000启动

21100000ramdisk存放在SDRAM中存放的地址16384为容量,2.6.30以后内核默认就是16384(以前老版本为4096),设定不设定都没关系,会从继承的。

22200000uImageSDRAM中存放的地址。

 

支持NFS

IP: kernel level autoconfiguration

         IP:DHCP support

         IP:BOOTP support

         IP:RARP support

Loopback device support

Network block device support

Ram block device support

         Ramdisk size 16384

 

 

NFS file system支持选定:

文件系统设定,必须有一种文件系统选定,否则内核无法启动。

设置kernel支持USART不然u-boot支持到内核启动后,console收不到回显数据。

 

Kernel hacking 打印启动时间info

其余kernel选项根据需要来选取。

 

atmel at91sam926x系列的多串口UART支持

linux-2.6.27极以上版本:

如在linux源文件目录下/arch/arm/mach-at91/board-sam9263ek.c

修改:

 

static void __init ek_map_io(void)

{

/* Initialize processor: 16.367 MHz crystal */

at91sam9263_initialize(16367660);

 

/* DBGU on ttyS0. (Rx & Tx only) */

at91_register_uart(0, 0, 0);

 

/* USART0 on ttyS1. (Rx, Tx, RTS, CTS) */

at91_register_uart(AT91SAM9263_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS);

 

/* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */

at91_register_uart(AT91SAM9263_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS);

 

/* USART2 on ttyS3. (Rx, Tx) */

at91_register_uart(AT91SAM9263_ID_US2, 3, 0);

 

/* set serial console to ttyS0 (ie, DBGU) */

at91_set_serial_console(0);

}

 

 

linux-2.6.26以下版本:

 

static struct at91_uart_config __initdata ek_uart_config = {

.console_tty= 0,/* ttyS0 */

.nr_tty= 4,

.tty_map= { 3, 0, 1, 2, }/* ttyS0, ..., ttyS3 */

};