[uClinux-dev] uCLinux 2.4.x switch_to init problem

Greg Ungerer gerg at snapgear.com
Thu Aug 11 01:25:45 EDT 2005


Hi Holger,

H. Holfelder wrote:
> I have posted a problem, but get no Answer therefor I try it again.
> 
> I have a new board with a MCF5206e processor, 2 MB Flash and 2 MB RAM on 
> it. I want to port uCLinux2.4.x on it, booting from FLASH. The kernel 
> starts, but when called switch_to function to start init the system 
> crashes. I think it is only a failure in the memory configuration or I 
> have forgot a define somewhere.
> Can anyone help me?
> 
> The boards RAM start at 0x70000000, the code in flash is placed at 
> 0x20040. The memory seem to be OK, but the mm and active_mm from 
> task_struct looks not to be initialized.
> 
> Here are the outputs i get during start, with some additional debug 
> information:

The key may well be in your crt0_rom.S code or rom.ld. You would need
to show us those. Are you copying the data segment properly?
  Are you clearing BSS properly?

Regards
Greg




> Linux version 2.4.27-uc1 (uclinux at pc-xxxxxxxx) (gcc version 2.95.3 
> 20010315 (release)(ColdFire patches - 20010318 from 
> http://fiddes.net/coldfire/)(uClinux XIP
> and shared lib patches from http://www.snapgear.com/)) #212 Mi Aug 10 
> 08:59:23 CEST 2005
> 
> uClinux/COLDFIRE(m5206e)
> COLDFIRE port done by Greg Ungerer, gerg at snapgear.com
> Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne
> KERNEL -> TEXT=0x020040-0x0868e0 DATA=0x70000400-0x7001b0b8 
> BSS=0x7001b0b8-0x7002d1a8
> KERNEL -> ROMFS=0x0a1598-0x0c0488 MEM=0x7002e000-0x701f0400 
> STACK=0x701f0400-0x701f0400
> called init_bootmem_node (0x70005ce0, 0x7002e, 0x70000, 0x701f0)
>   setup arch: bootmap_size=0x40
> On node 0 totalpages: 496
> zone(0): 0 pages.
> zone(1): 496 pages.
> zone(2): 0 pages.
> Kernel command line:
> Calibrating delay loop... 35.53 BogoMIPS
> Memory available: 1764k/1984k RAM, 0k/0k ROM (410k kernel code, 179k data)
> __get_free_pages: called alloc_pages(0x1F0, 0) = 0x700327FC, 
> pageadr=0x7002E000
> __get_free_pages: called alloc_pages(0x1F0, 0) = 0x70032AE8, 
> pageadr=0x7003F000
> kmem_create: Forcing size word alignment - vm_area_struct
> kmem_create: Forcing size word alignment - mm_struct
> -->call vfs_caches_init (496)
> kmem_create: Forcing size word alignment - filp
> --> call dcache_init
> __get_free_pages: called alloc_pages(0x20, 0) = 0x70032ABC, 
> pageadr=0x7003E000
> Dentry cache hash table entries: 512 (order: 0, 4096 bytes)
> --> call inode_init
> __get_free_pages: called alloc_pages(0x20, 0) = 0x70032A90, 
> pageadr=0x7003D000
> Inode cache hash table entries: 512 (order: 0, 4096 bytes)
> kmem_create: Forcing size word alignment - inode_cache
> --> call files_init
> --> call mnt_init
> __get_free_pages: called alloc_pages(0x20, 0) = 0x70032A64, 
> pageadr=0x7003C000
> Mount cache hash table entries: 512 (order: 0, 4096 bytes)
> --> call init_rootfs()
> --> call init_mount_tree()
>  --> do kern mount: filesystem List:
> nodev   rootfs
> 
> OK
> --> do_kern_mount type ok Type = 0x700078d0
> __get_free_pages: called alloc_pages(0x1F0, 0) = 0x70032A38, 
> pageadr=0x7003B000
> __get_free_pages: called alloc_pages(0x1F0, 0) = 0x70032A0C, 
> pageadr=0x7003A000
> __get_free_pages: called alloc_pages(0x1D0, 0) = 0x700329E0, 
> pageadr=0x70039000
> __get_free_pages: called alloc_pages(0x1D0, 0) = 0x700329B4, 
> pageadr=0x70038000
> __get_free_pages: called alloc_pages(0x1F0, 0) = 0x70037528, 
> pageadr=0x701EF000
> __get_free_pages: called alloc_pages(0x1F0, 0) = 0x700374FC, 
> pageadr=0x701EE000
> --> do_kern_mount super_block OK, sb = 0x70039000
> --> do_kern_mount mnt = 0x7003b110
> --> set_fs_pwd call write_lock, fs-Adresse = 0x70000614
> kmem_create: Forcing size word alignment - bdev_cache
>  --> do kern mount: filesystem List:
> nodev   rootfs
> nodev   bdev
> 
> OK
> --> do_kern_mount type ok Type = 0x70006510
> --> do_kern_mount super_block OK, sb = 0x70039400
> --> do_kern_mount mnt = 0x7003b150
> --> call cdev_cache_init
> kmem_create: Forcing size word alignment - cdev_cache
> --> call iobuf_cache_init
> kmem_create: Forcing size word alignment - kiobuf
> __get_free_pages: called alloc_pages(0x20, 0) = 0x700374D0, 
> pageadr=0x701ED000
> Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
> __get_free_pages: called alloc_pages(0x20, 0) = 0x700374A4, 
> pageadr=0x701EC000
> Page-cache hash table entries: 1024 (order: 0, 4096 bytes)
>  --> do kern mount: filesystem List:
> nodev   rootfs
> nodev   bdev
> nodev   proc
> 
> OK
> --> do_kern_mount type ok Type = 0x70006ba0
> --> do_kern_mount super_block OK, sb = 0x70039800
> --> do_kern_mount mnt = 0x7003b190
> __get_free_pages: called alloc_pages(0x1F0, 0) = 0x70037478, 
> pageadr=0x701EB000
> __get_free_pages: called alloc_pages(0x1F0, 0) = 0x7003744C, 
> pageadr=0x701EA000
> POSIX conformance testing by UNIFIX
> Invoking rest_init...
> Kernel_thread Adresse:7001657ah
> Kernel_thread nach getfs, fs = 0x1
> Kernel_thread nach setfs
> do_fork, dump regs:
> 
> CURRENT PROCESS:
> 
> COMM=swapper PID=0
> PC: 00021cb0
> SR: 00002010    SP: 70015f68
> d0: ffffffda    d1: 00010f00    d2: 70015f9c    d3: 00010f00
> d4: 00000d00    d5: 0000236d    a0: 00010f00    a1: 70005658
> 
> USP: 00000000   KSP: 00000000   TRAPFRAME: 70015f68
> 
> CODE:
> 00021c90: 00000001 48790007 510f4e92 588f2ebc
> 00021ca0: 00075134 4e922043 240f2208 70784e40
> 00021cb0: b48f6708 2f0c4e93 70014e40 48780001
> 00021cc0: 48790007 514e4e92 508f2ebc 00000001
> 
> KERNEL STACK:
> 70015f28: 000011ab 70015ff8 00021d3e 00010f00
> 70015f38: 70015f9c 70015f68 00000000 00023f00
> 70015f48: 70015f68 949def43 e7eff7dd 7001657a
> 70015f58: 00000000 7d6f5d8c 70015ff8 00023b4e
> 70015f68: 00010f00 70015f9c 00010f00 00000d00
> 70015f78: 0000236d 00010f00 70005658 00028852
> 70015f88: ffffffda 00000078 00000000 40802010
> 70015f98: 00021cb0 00075134 00000000 00000001
> 70015fa8: 00028852 40000006 00028852 00027676
> 70015fb8: 7001657a 00000000 00010e00 00000040
> 70015fc8: 00000000 700162fc 7001657a 00000000
> 70015fd8: 00010e00 00073fc0 40000005 70016524
> 
> USER STACK:
> 00000000: 20002000 00000050 ffffffff ffffffff
> 00000010: 00014000 53776974 63682043 412d3132
> 00000020: 39000000 76312e30 33002863 29203230
> 00000030: 30342054 65636f20 612e732e 001d0000
> 00000040: 001d0000 10000000 00000000 0000ce5a
> 00000050: 223c1000 00014e7b 1c0f220f 2e7c7000
> 00000060: 00004e7b f8012e41 223c2000 00274e7b
> 00000070: 1c04207c 100000ca 70383080 207c1000
> 
> __get_free_pages: called alloc_pages(0x1F0, 1) = 0x700373F4, 
> pageadr=0x701E8000
> do_fork reached fork_out, retval (PID)= 1
> Kernel_thread vor set_fs(fs), fs = 0x1
> Kernel_thread ENDE retval = 69376 , fs = 0x1
> Kernel_thread: ret = 69376
> rest_init unlocks kernel!
> rest_init unlock kernel done
> rest_init goes cpuidle...
> cpu_idle called
> init_idle done
> start idle
> idle has been started
> idle call schedule
> Welcome to G:\uClinux-dist\linux-2.4.x\kernel\sched.c!
> schedule:  current = 0x70014000
> schedule: found Prozess at: 701E8000h
> schedule call prepare to switch
> prev->active_mm:
> TEXT=2e303300-28632920 DATA=32303034-20546563 BSS=20546563-732e001d
> USER-STACK=00001000  KERNEL-STACK=70016000
> 
> next->active_mm:
> TEXT=00020040-000868e0 DATA=00000000-7001b0b8 BSS=7001b0b8-00000000
> USER-STACK=00000000  KERNEL-STACK=701ea000
> 
> schedule call switch_to ( 0x70014000, 0x701e8000, 0x70014000)
> 
> .... than the system stop.
> Has anyone an idea what is wrong?
> 
> Greetings to all, Holger
> 
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev at uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev at uclinux.org
> 

-- 
------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     gerg at snapgear.com
SnapGear -- a CyberGuard Company            PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com



More information about the uClinux-dev mailing list