kernel boot failier

Aleksandr Rybalko ray at
Fri Feb 15 11:41:31 UTC 2013

On Wed, 13 Feb 2013 06:15:07 -0500
Yasir hussan <kolyasir at> wrote:

> hi,
> i am have make some changes in my freebsd acutally have replaced mii bus
> with my own switch bus and have put some code of switch but after i
> successfully build kernel and world when i try to run it on machine it just
> hangs up at boot time after this
> ar7100> bootm
> change bootargs
> console=ttyS0,115200 root=31:03 rootfstype=jffs2 init=/sbin/init
> mtdparts=ar7100-nor0:256k(u-boot),64k(u-boot-env),1152k at 384k
> (uImage),6592k at 1536k(rootfs),64k at 320k(ART),64k at 8128M
> ## Booting image at 84000000 ...
>    Image Name:   FreeBSD-9.0-Paxym AR7161
>    Created:      2013-02-01   7:54:28 UTC
>    Image Type:   MIPS NetBSD Kernel Image (gzip compressed)
>    Data Size:    2301863 Bytes =  2.2 MB
>    Load Address: 80050120
>    Entry Point:  80050120
>    Verifying Checksum ... crc32_fw: 84000040 - 84231fe6 (len:00231fa7)
> calc...
> OK
>    Uncompressing Kernel Image ... OK
> ## Transferring control to NetBSD stage-2 loader (at address 80050120) ...
> One method is that i should revert all changes which will take time, Is
> there is other way to debug my code, and can identify correct problem
> thanks
> _______________________________________________
> freebsd-current at mailing list
> To unsubscribe, send any mail to "freebsd-current-unsubscribe at"

Hi Yasir,

at first check if kernel entrypoint is equal 
`readelf -a kernel` to get it from kernel and compare it to entrypoint
value passed to uboot's mkimage utility.

If you want to debug early startup, you need simple UART driver. Boot
goes in the following order:
1. mips/mips/locore.S
2. mips/atheros/ar71xx_machdep.c (from platform_start(...))

second one initialize UART and start printing messages to you, if
everything ok of course.

so to get to know if locore is ok, you need to put ASM block which will
put some chars into UART TX reg. Thanks god, MIPS have mapped devices
since boot (unlike ARM where you need to map devices before enable MMU).
Device segment mapped to 0xa0000000 as uncached and to 0x80000000 as
cached. So to use UART without cache you have to add UART physical
address to 0xa0000000 and you will get base address which you can use
to access UART controller.
0xa0000000 + 0x18020000 = 0xb8020000

>From possible problems what I know:
1. You may have different UART unit as console (don't remember if your
SoC have more than one UART)
2. platform_start try to parse command line passed by uboot to find mem
size. But it can have broken format, or may not have mem size variable.
So try to disable argv/envp parsing and set realmem manually.
3. UART can be disabled, then you have to set correct value to

Good luck!

Aleksandr Rybalko <ray at>

More information about the freebsd-current mailing list