Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 03 May 2006 11:52 AM by  peter.barada@logicpd.com
M5484LITE Kernel Panic
 6 Replies
Sort:
You are not authorized to post a reply.
Author Messages
piku
New Member
New Member
Posts:


--
27 Apr 2006 11:34 AM
    Hey all,

    Just got the M5484lite and built the m5484gfe-lite-romfs image for it. When I load the kernel it goes through, decompresses the romfs image and attempts to boot and it claims it cannot find init and the kernel panics. I have no other coldfire hardware to ensure busybox or bash built correctly (using logic's toolchain that I also built myself). Any ideas?

    http://pikachu.dynup.net:8001/coldfire/

    There is my kernel image build, the romfs image by itself and bash and busybox tarred up. If anyone could verify that bash is indeed a valid binary, I would be MOST appreciative

    Thanks,
    Mark
    peter.barada@logicpd.com
    New Member
    New Member
    Posts:72


    --
    28 Apr 2006 02:32 PM
    How did you build the kernel?
    Here's the output when I try to boot your kernel:

    Linux version 2.4.26 (mduckworth@mduckworth.phillypark.net) (gcc version 3.4.3)
    #1 Thu Apr 27 01:12:09 EDT 2006
    starting up linux rev 0.2: startmem 0xc0248000, size 61MB
    initrd: c0348000 - c04acbf7
    Flex CS0: ff800000 007f0001 00101980
    Flex CS1: e0000000 07ff0001 00101980
    Flex CS4: 40000000 0fff0001 00106580
    Flex CS5: 50000000 0fff0001 00102980
    On node 0 totalpages: 8192
    zone(0): 1024 pages.
    zone(1): 7168 pages.
    zone(2): 0 pages.
    Kernel command line: root=/dev/hda2 rootfstype=ext2

    Note that you specify the root as /dev/hda2, rootfstype of ext2 which is not what is expected since the rootfs is a romfs. Did you specify "root=/dev/hda2 rootfstype=ext2" in the kernel configuration? There's no IDE harddisk in the system, so this will fail.

    The commandline should be "root=/dev/ram rootfstype=ramfs" which is setup for you automagically if you build the kernel/userland via:

    $ cd LinuxBSP-22012005
    $ make fresh
    $ make config-m5484gfe-lite-romfs
    $ make dep
    $ make

    And images/image-m5484gfe-lite.elf is the image(including a romfs root filesystem) that you want to load/boot.

    Even if I pass in the proper commandline when booting the kernel:

    losh> load elf /tftp/192.168.2.51:image-m5484gfe-lite.elf
    losh> exec "root=/dev/ram rootfstype=romfs"

    This fails with:

    VFS: Mounted root (romfs filesystem) readonly.
    Mounted devfs on /dev
    Kernel panic: No init found. Try passing init= option to kernel.

    Whihc indicates that the root filesystem you've built is missing some things(its only 1280KB in size(uncompressed)).

    Hopefully this explians why it has failed to boot.
    piku
    New Member
    New Member
    Posts:


    --
    01 May 2006 02:22 PM
    Ok good, this indicates a traceable problem. Can you tell me approximately what size the romfs image should be? I must have given you the wrong kernel as I was working on attempting to boot off of the CF card instead of romfs which was also unsuccessful since I just copied the bogus romfs. I didn't realize you could specify options on the command line there so I built them into the kernel. I didn't make many modifications at all except for that.

    The way I build was to build the logicpd cross gcc, install to /opt/logicpd, then compile the linuxBSP with make fresh && make config-m5484gfe-lite-romfs && make dep && make

    Which seems to work pretty well and goes through building both the kernel and the romfs image and items needed on it.

    You'd think though that the statically linked bash would load. It's there and all.

    Thanks,
    Mark
    peter.barada@logicpd.com
    New Member
    New Member
    Posts:72


    --
    01 May 2006 03:09 PM
    When you say you "want to boot off the CF card", do you mean that you want ot have a rootfs on the CF card and not in the internal flash(which I can see being necessary since the GFE only has 2MB of flash). If so, they you are trailblazing ahead of us, so no guarentees the following will work. Before you try to follow what Im writing, please amek sure that you understand the concepts so you'll have a much better chance of success.


    You'll need to do some interesting things for this to work. Here's the list (since I'm writing as I'm thinking it may not all come out in order, or quite right, so take it with a grain of salt).

    1) You'll want to build a romfs version of the kernel/rootfs that has includes 'fdisk' support so you can erase the partition on your CF card, and create an EXT2 filesystem. Do this by 'make config-xconfig', and under 'Busybox', and make sure that you also enable fdisk write support. Boot this version, and using fdisk, repartition your CF card to have a EXT2 fs on it. This will destroy the contents of the CF card, so backup anything you care about since it will disappear.

    2) You'll need to find mkfs.ext2 source and build it on your development host, and use it to create an ext2 image of the rootfilesystem, then copy that to /dev/hd/1 (the first partition on the CF card)on the GFE board (/dev/hd/0 is the partition table). I'll assume that you have the network up and running and can use it to access the image.

    2a) Do a sync, then 'mount -t ext2 /dev/hd/1 /mnt/fs' and verify that /mnt/fs contains what looks to be your root filesystem.

    2b) umount /mnt/fs (after making sure that you don't have an processes that have any files on the CF card open (like shells that you've 'cd' into /mnt/fs)).

    3) Reconfig the kernel (make linux-xconfig) and disable initrd (initial ramdisk, found in 'Block Devices' under "Initial RAM disk support). Turn ETX2 support (under 'Filesystems' / 'second extended fs support') to Y so it isn't a module(since you'd need EXT2 support to load the EXT2 driver, a recursive problem).

    4) Save the configuration, build the kernel. Then using a commandline of "root=/dev/hd/1 rootfstype=ext2", boot hte kernel. It *should* see the EXT2 fs on the CF card as your root filesystem...

    Hoepfully this will give you and idea of how to do this. Of course when you repartition your CF card you'll destroy any contents on it, so beware. If you have a linux host that has CF access, then you might be able to write the EXT2 to the CF card there, but I can't help you there(mine doesn't). Also google around for using CF cards in embedded linux, you'll find lots of info.
    piku
    New Member
    New Member
    Posts:


    --
    02 May 2006 10:43 PM
    Posted By peterb on 1 May 2006 3:9 PM
    When you say you "want to boot off the CF card", do you mean that you want ot have a rootfs on the CF card and not in the internal flash(which I can see being necessary since the GFE only has 2MB of flash). If so, they you are trailblazing ahead of us, so no guarentees the following will work. Before you try to follow what Im writing, please amek sure that you understand the concepts so you''ll have a much better chance of success.



    Well I'm confused why 1280KB is a bad size for the ROMFS image if there's only 2MB of flash on the GFE.
    Quote:


    You'll need to do some interesting things for this to work. Here's the list (since I'm writing as I'm thinking it may not all come out in order, or quite right, so take it with a grain of salt).

    I know linux *really* well. Much better than I let on here. I'm in charge of a binutils/gcc port for an entire m68k arch (Atari FreeMiNT) so I think I should be able to get by. I have a lot of experience with bootstrapping a system, a la gentoo, LFS, etc.
    Quote:


    1) You'll want to build a romfs version of the kernel/rootfs that has includes 'fdisk' support so you can erase the partition on your CF card, and create an EXT2 filesystem. Do this by 'make config-xconfig', and under 'Busybox', and make sure that you also enable fdisk write support. Boot this version, and using fdisk, repartition your CF card to have a EXT2 fs on it. This will destroy the contents of the CF card, so backup anything you care about since it will disappear.

    2) You'll need to find mkfs.ext2 source and build it on your development host, and use it to create an ext2 image of the rootfilesystem, then copy that to /dev/hd/1 (the first partition on the CF card)on the GFE board (/dev/hd/0 is the partition table). I'll assume that you have the network up and running and can use it to access the image.

    I can use another system to do this, no sense in trying to build it from the embedded system itself. Too painful My card is already partitioned and I copied the contents of the romfs rootfs to the card with my other system. The only reason I was trying to use hda2 was because the card is throwing IO errors because it's failing and I was trying to work around that
    Quote:


    2a) Do a sync, then 'mount -t ext2 /dev/hd/1 /mnt/fs' and verify that /mnt/fs contains what looks to be your root filesystem.

    2b) umount /mnt/fs (after making sure that you don't have an processes that have any files on the CF card open (like shells that you've 'cd' into /mnt/fs)).

    3) Reconfig the kernel (make linux-xconfig) and disable initrd (initial ramdisk, found in 'Block Devices' under "Initial RAM disk support). Turn ETX2 support (under 'Filesystems' / 'second extended fs support') to Y so it isn't a module(since you'd need EXT2 support to load the EXT2 driver, a recursive problem).

    4) Save the configuration, build the kernel. Then using a commandline of "root=/dev/hd/1 rootfstype=ext2", boot hte kernel. It *should* see the EXT2 fs on the CF card as your root filesystem...

    Hoepfully this will give you and idea of how to do this. Of course when you repartition your CF card you'll destroy any contents on it, so beware. If you have a linux host that has CF access, then you might be able to write the EXT2 to the CF card there, but I can't help you there(mine doesn't). Also google around for using CF cards in embedded linux, you'll find lots of info.

    Indeed I do have a linux host of sorts that has CF. My Sharp Zaurus SL-C3000. This device addresses the CF as /dev/hdXX so I wasn't prepared for /dev/hd/X. I'll give this a shot and see if this works any better but I have my doubts. What I really think is that something is wrong with my bash or busybox binaries, which I was hoping someone would test on another working system.

    I really only started the tweaking with the CF card and everything because the romfs image built into the kernel simply wasn't working as advertised. I already did enable ext2fs in the kernel and such in order to get things running and it didn't happen (perhaps due to my incorrect /dev/hdaX). I also tried adding nfsroot support to the kernel and booting off the NFS server running on my PC but it just kind of sat there and did nothing (for the more than 1 hour I left it sit). I verified from another host that there's no access problems or anything so I don't know there. Don't have a lot of experience with NFSroot. If anyone could post a linux-m5484gfe-lite-romfs image that works, I would be seriously appreciative, because that would make me able to figure out what's wrong with my own image/binaries/etc.

    Anyway, regarding the above I don't want to sound arrogant of course, I mean I'm asking for help which indicates a certain level of incompetence But what I am trying to convey is that I know how to build the image and as far as I can tell everything is going right, and the end result is that the image is bad, and since I don't have a proper working image binary to work from, I don't know how to take care of it. So... Hope I can get it worked out one way or another.

    Thanks for any help ,
    Mark
    piku
    New Member
    New Member
    Posts:


    --
    02 May 2006 11:49 PM
    Hey guys, The problem was either my incorrect use of the cross-compile-path file or the use of the host ar. I changed both at the same time and suddenly my image grew over a meg in size and it booted up fully.

    Yay! It always comes down to persistence.

    Thanks,
    Mark
    peter.barada@logicpd.com
    New Member
    New Member
    Posts:72


    --
    03 May 2006 11:52 AM
    Quote:
    Hey guys, The problem was either my incorrect use of the cross-compile-path file or the use of the host ar. I changed both at the same time and suddenly my image grew over a meg in size and it booted up fully.

    Yay! It always comes down to persistence.

    I'm glad it works for you now. Is that the ROMFS that booted, or the CF card?

    I've gotten NFSroot to work by changing the linux configuration to shut off initrd, enable NFS as a builtin(not a module), enable NFSroot, make sure the ethernet is builtinagain not a module), as well as setup the command line to do it. I've gotten it working with my FC4 host, and found that I had to shutdown iptables to allow the board to connect to the NFS server.

    I have a NFSroot config file you could try, drop me an email and I'll send it to you.
    You are not authorized to post a reply.