打印

嵌入式Linux 2.6 内核专题

Another way to do this:
1.Boot via NFS(don't mount /dev/mtdblock/3 and /dev/mtdblock/4)

2. Write the root fs to nand flash
#mkdir /mnt/roottemp
#./eraseall /dev/mtd/3
#mount -t yaffs /dev/mtdblock/3 /mnt/roottemp
...
Copying the root stuff(root_china) to /dev/mtdblock/3
# cp -a ./root_china/* /mnt/roottemp  (Your root fs is under ./root_china)

3. usr
You can do the same thing with /usr (yaffs), that is to say, just use cp instruction.

4. set the vivi param to boot from /dev/mtdblock/3

Any comments are welcome!

TOP

我把网络加进去后,zImage变大了300k还多

往板子上烧的时候提示太大

把网络搞定的兄弟给点建议吧

TOP

1. Reconfig the kernel and cancel the options you don't used;
2. Reconfig the partition map you used in nand driver and vivi to give more space for kernel.

TOP

按照上面的操作,到make就出错了
usr/initramfs_data.S: Assembler messages:
usr/initramfs_data.S:29: Error: Unknown pseudo-op:  `.incbin'
make[1]: *** [usr/initramfs_data.o] Error 1
make: *** [usr] Error 2

这个是什么问题呢?我没动usr/initramfs_data.S啊 ,谢谢
看了一下这个文件,就两句
.section .init.ramfs,"a"
.incbin "usr/initramfs_data.cpio.gz"

TOP

我的gcc是2.95.3的,不是这个问题吧?

TOP

[quote:c1d7992117="langzi2003"]我的gcc是2.95.3的,不是这个问题吧?[/quote]

升级到3.4吧

TOP

到ftp://ftp.handhelds.org/projects/toolchain/arm-linux-gcc-3.4.1.tar.bz2回来不会用,下载了另外一个bu-2.15_gcc-3.4.3-c-c++-java_nl-1.12.0_gi-6.1.tar.bz2,是arm-elf-的,可惜还是没有成功,
In file included from arch/arm/mach-s3c2410/devs.c:20:
include/linux/mtd/partitions.h:61: error: field `list' has incomplete type
make[1]: *** [arch/arm/mach-s3c2410/devs.o] Error 1
make: *** [arch/arm/mach-s3c2410] Error 2

/devs.c:20就是
/***********add here*************/
#include <linux/mtd/partitions.h>
#include <asm/arch/nand.h>
#include <linux/mtd/nand.h>
/***********end add*************/
而include/linux/mtd/partitions.h:61:就是
struct mtd_part_parser {
        struct list_head list;
        struct module *owner;
        const char *name;
        int (*parse_fn)(struct mtd_info *, struct mtd_partition **, unsigned long);
};
这个文件我没改啊
用这个编译器的时候用不了这些库?
请 指点一下,谢谢了

TOP

突然发现昨天我还没等解压完 就去看文件了,ftp://ftp.handhelds.org/projects/toolchain/arm-linux-gcc-3.4.1.tar.bz2的交叉编译我用上了。一样的错误,看了不是工具的错误了。

TOP

用 bzcat arm-linux-gcc-3.4.1.tar.bz2 | tar -x 安装
一个人当他来到你身边时你会笑,当他离开你时你会哭,那就是爱

TOP

下一步:音频/usb

TOP

b>add "&s3c_device_nand" to the __initdata in the arch/arm/mach-s3c2410/mach-smdk2410.c

对于这句,我有一些疑惑.我是加在这里的。
static struct platform_device *smdk2410_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_lcd,
        &s3c_device_wdt,
        &s3c_device_i2c,
        &s3c_device_iis,
        &s3c_device_nand,//add here by cefanty};

不知是否正确.

TOP

我的开发板,porting没有成功.估计是和SMDK2410的硬件有一些不同,
Press Return to start the OS  now, other key for vivi shell
Copy linux kernel from 0x00030000 to 0x30008000, size = 0x001c0000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock/3 init=/linuxrc console=ttyS
0 mac=00:0e:3a:bb:cc"
MACH_TYPE = 193
NOW, Booting Linux......
Uncompressing Linux......................................................... don
e, booting the kernel.


然后,没有下文了.死机了....................

TOP

哪位大侠,能把你们正常跑起来的linux2.6的内核打包,用QQ传给我,谢谢
QQ:57961495

TOP

console=ttyS0
应该改为:
console=ttySAC0

内核对串口的命名改变了。

TOP

谢谢回复,但是接下来的问题是这样的::::

SMDK2410的板子不用修改,编译就能运行,看见启动信息了。我照坐,就是不行!!!
Copy linux kernel from 0x00030000 to 0x30008000, size = 0x001c0000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock/3 init=/linuxrc console=ttySAC0 mac=00:0e:3a:aa:bb:cc"
MACH_TYPE = 193
NOW, Booting Linux......
Uncompressing Linux.............................................................
. done, booting the kernel.


在优龙的板子上跑2.6.11都没有问题。看他们的硬件和我们手头上的几乎是一样的
,在存储器配置和硬件地址分配上。SDRAM从0x30000000.
我追踪内核启动到arch\arm\kernel\head.S文件里.基本内容如下:

/*
* Kernel startup entry point.
* ---------------------------
*
* This is normally called from the decompressor code. The requirements
* are: MMU = off, D-cache = off, I-cache = dont care, r0 = 0,
* r1 = machine nr.
*
* This code is mostly position independent, so if you link the kernel at
* 0xc0008000, you call this at __pa(0xc0008000).
*
* See linux/arch/arm/tools/mach-types for the complete list of machine
* numbers for r1.
*
* We're trying to keep crap to a minimum; DO NOT add any machine specific
* crap here - that's what the boot loader (or in extreme, well justified
* circumstances, zImage) is for.
*/
__INIT
.type stext, %function
ENTRY(stext)
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode
@ and irqs disabled
bl __lookup_processor_type @ r5=procinfo r9=cpuid
movs r10, r5 @ invalid processor (r5=0)?
moveq r0, #'p' @ yes, error 'p'
beq __error
bl __lookup_machine_type @ r5=machinfo
movs r8, r5 @ invalid machine (r5=0)?
moveq r0, #'a' @ yes, error 'a'
beq __error
bl __create_page_tables
/*
moveq r0, #'1'
bl printch
*/
/*
* The following calls CPU specific code in a position independent
* manner. See arch/arm/mm/proc-*.S for details. r10 = base of
* xxx_proc_info structure selected by __lookup_machine_type
* above. On return, the CPU will be ready for the MMU to be
* turned on, and r0 will hold the CPU control register value.
*/
ldr r13, __switch_data @ address to jump to after
@ mmu has been enabled
adr lr, __enable_mmu @ return (PIC) address
add pc, r10, #PROCINFO_INITFUNC



.type __switch_data, %object
__switch_data:
.long __mmap_switched
.long __data_loc @ r4
.long __data_start @ r5
.long __bss_start @ r6
.long _end @ r7
.long processor_id @ r4
.long __machine_arch_type @ r5
.long cr_alignment @ r6
.long init_thread_union+8192 @ sp

/*
* The following fragment of code is executed with the MMU on, and uses
* absolute addresses; this is not position independent.
*
* r0 = cp#15 control register
* r1 = machine ID
* r9 = processor ID
*/
.type __mmap_switched, %function
__mmap_switched:
adr r3, __switch_data + 4



ldmia r3!, {r4, r5, r6, r7}
cmp r4, r5 @ Copy data segment if needed
1: cmpne r5, r6
ldrne fp, [r4], #4
strne fp, [r5], #4
bne 1b

mov fp, #0 @ Clear BSS (and zero fp)
1: cmp r6, r7
strcc fp, [r6],#4
bcc 1b

ldmia r3, {r4, r5, r6, sp}
str r9, [r4] @ Save processor ID
str r1, [r5] @ Save machine type
bic r4, r0, #CR_A @ Clear 'A' bit
stmia r6, {r0, r4} @ Save control register values

b start_kernel
假如以上的代码执行无误,应该开始跳到C的入口start_kernel了。
我在这个之前插入打印
moveq r0, #'1'
bl printch
在b start_kernel前发现能执行到这里.输出"1"这个字符了。然后我移除这两条语句.

然后就应该执行/init/main.c里的start_kernel函数了





于是我跳到main.c的start_kernel函数,
/*
* Activate the first processor.
*/
/* we can deal with the case the UARTs are being run
* in FIFO mode, so that we don't hold up our execution
* waiting for tx to happen...
*/
asmlinkage void __init start_kernel(void)
{
char * command_line;
extern struct kernel_param __start___param[], __stop___param[];
/*
* Interrupts are still disabled. Do necessary setups, then
* enable them
*/
printk("kdjsfhskf\n");
mdelay(1000);
lock_kernel();
page_address_init();
printk(linux_banner);
setup_arch(&command_line);
setup_per_cpu_areas();

/*
* Mark the boot cpu "online" so that it can call console drivers in
* printk() and can access its per-cpu storage.
*/
smp_prepare_boot_cpu();

/*
* Set up the scheduler prior starting any interrupts (such as the
* timer interrupt). Full topology setup happens at smp_init()
* time - but meanwhile we still have a functioning scheduler.
*/
sched_init();
/*
* Disable preemption - early bootup scheduling is extremely
* fragile until we cpu_idle() for the first time.
*/
preempt_disable();
build_all_zonelists();
page_alloc_init();
printk("Kernel command line: %s\n", saved_command_line);
parse_early_param();
parse_args("Booting kernel", command_line, __start___param,
__stop___param - __start___param,
&unknown_bootoption);
sort_main_extable();
trap_init();
.....................

粗体的使我添加的。但是串口没有打印我插入的打印文字.......
难道,在head.S里没有正确跳转到start_kernel还是 printk()函数没有作用?????
继续研究哟!!!

TOP