[Peeweelinux] Kernel Panic

Correy Edmed [email protected]
Wed, 30 Apr 2003 07:02:31 +1000


Hey there

 > > - Boot Device on Target System: "/dev/hdc"
Was my biggest downfall in the help is says
************************************************
Boot Device: /dev/hda
How the target device will be known as on the final target system
It is unlikely you will need to change this parameter.
*************************************************
After changing this to /dev/hdc it obviously found where to boot from 
and stopped giving me the kernel panic and I can now
login which is great.

I don't have a Compact Flash to ide adapter so I have installed Redhat 
6.2 on a hard disk connected to the PCM-3350.
which means that my target system is hdc I am assuming ithat sda would 
be the default when using this adapter.

to change any of the files what I do since everything is running in 
ramdisk I mount the partitions.
mount -t ext2 /dev/hdc2 /mnt/cf2
mount -t ext2 /dev/hdc3 /mnt/cf3
And do all my changes this way that way when I boot up next time 
everything will have taken place.

Is there a command to flush everything in ramdisk to the CF card? 
Because all the changes are only
made to ramdisk at the time so when I reboot the ramdisk is of course 
rebooted and none of my
changes have taken place.

I like what you were doing with /opt and hdc3 I will give that a go.

I realy appreciate the effort you went to to write this all out for me.
Enjoy your day.

correy

Troy Engel wrote:

> Ok, let's start at the beginning and try to get you straight, with 
> some infos along the way.
>
> 1) what is "hdc" on your build machine can be anything on your 
> embedded board. I happen to use this exact board, the PCM-3350.  For 
> me, on my build machine the target is "sdb", but when booting on the 
> PCM-3350, the CF is "hdc". As far as I can tell, it will always be hdc 
> on the PCM-3350.
>
> In the PWL gui config, go into "Configure Target Hardware". Your 
> options may be slightly different, but as a general guidline use these:
>
> - Target: Uncompressed ramdisk, boot from ext2 partition -->
> - Target Device: "/dev/sdb"
> - Boot Device on Target System: "/dev/hdc"
>
> 2) Now the PWL gui should be able to build everything onto the flash 
> chip as normal. You've noticed that there's an extra "hdc3" laying 
> around -- in order to do it, you need to add a little trickery:
>
> - Make sure you have a kernel with desired options for the filesystem 
> (meaning, I upgraded to kernel 2.4.18 to be able to use ext3 on hdc3, 
> instead of ext2)
>
> - After PWL gui builds the chip, format hdc3 and populate it; I mount 
> hdc3 as /opt, so I have a script called "makeopt.sh" that does all 
> this. In general, you need to do at least:
>
>   echo "Creating filesystem..."
>   mke2fs -j -b 1024 -m0 /dev/sdb3
>   mount -t ext3 /dev/sdb3 /mnt/usbdev
>
>   [... INSERT CUSTOM POPULATION STUFF HERE ...]
>
>   echo "Syncing and unmounting..."
>   sync
>   umount /mnt/usbdev
>
> 3) Now your hdc3 is ready to be used, but PWL knows nothing about it. 
> But, there's a little hack you can do. PWL, on boot, will run a script 
> called "/etc/rc.modules" if it exists. Create a 
> <PWLDIR>/custom/rc.custom script (mode 0755) that has the following in 
> it:
>
>   # this all happens before filesystems are mounted
>
>   # this is so we can mount our ext3 /opt
>   mkdir /opt
>   echo "/dev/hdc3 /opt ext3 defaults 1 2" >> /etc/fstab
>
> Go back into the PWL gui, and use the features to make 
> custom/rc.modules copied to "/etc/rc.modules". Extract the filesystems 
> again (important!), then rebuild the flash chip. Rerun your 
> "makeopt.sh" script to redo hdc3 partition.
>
> Now stick that chip in the PCM-3350 and it should boot fine -- the 
> default BIOS assigns the CF/IDE adapter as hdc (there are already two 
> onboard IDE channels hda and hdb for adding real hardrives).
>
> Do NOT go screwing around with lilo.conf or anything else, if you 
> configure PWL correctly and use these guidelines, it all should "just 
> work" with little effort. This PCM-3350 has been super easy to work 
> with for me, nary a problem.
>
> hope this helps...
> -te
>
> Correy Edmed wrote:
>
>> Hi there
>>
>>  > > the uncompressed ext2 image (second partition) is copied to a 
>> ramdisk
>>  From what I understand that is what this line is doing
>>  > > Copying filesystem /dev/hda2 to /dev/ram2.....
>> However shouldn't that be /dev/hdc2 for my case.
>>
>> And what must I do to get the boot process past this fatal error.
>>
>>> tcsetpgrp: Inappropriate ioctl for device
>>> Invalid session number or type of track
>>> Kernel panic: VFS: Unable to mount root fs on 01:02
>>
>>
>>
>>> > as for a data partition the third partition is the way to go, just 
>>> format it
>>> > and add a line to mount it to fstab.
>>
>>
>>
>> Yes I have formatted partition 3 however I am still unable to get to 
>> the login screen.
>>
>> Thankyou for your help.
>>
>> Correy
>>
>>
>>
>>
>>
>>  > > as umounted afterwards. from your post it looks like you are not 
>> aware of this.
>>
>>  From what I underst
>>
>> Ricardo Trindade wrote:
>>
>>> the uncompressed ext2 image (second partition) is copied to a 
>>> ramdisk as
>>> umounted afterwards. from your post it looks like you are not aware 
>>> of this.
>>>
>>> as for a data partition the third partition is the way to go, just 
>>> format it
>>> and add a line to mount it to fstab.
>>>
>>> -----Mensagem original-----
>>> De: [email protected] 
>>> [mailto:[email protected]]Em
>>> nome de Correy Edmed
>>> Enviada: terca-feira, 29 de Abril de 2003 8:58
>>> Para: [email protected]; [email protected]; [email protected];
>>> Leif Steinhour; [email protected]
>>> Assunto: [Peeweelinux] Kernel Panic
>>>
>>>
>>> Hi Troy and Adi and Ricardo and Leif and PWL archive
>>>
>>> **********************************************************************
>>> Target System = PCM-3350 GX1 300MHz
>>> Developement PC = Redhat 6.2 with all the rpm's installed as specified
>>> in Reference
>>> **********************************************************************
>>>
>>> Troy has helped me so far with this problem but I noticed in the
>>> peewelinux archives that you all seem to know a bit in this area so any
>>> help you can give me would be much appreciated.
>>>
>>> Thankyou for your answer Troy (attached at bottom) I have another CF
>>> that is branded Sandisk Ultra 256M compact flash. That I tried instead
>>> of the Kodac 128M CF
>>>
>>> I have recompiled the kernel and made sure that all of the filesystems
>>> including ext2 fat16 and all the other ones are compiled in and not 
>>> only
>>> as modules.
>>>
>>> The things that I notice as fishy are
>>>
>>> when PWL configures it it creates 3 partitions
>>>
>>> Partition        Contents
>>> hdc1               boot.b    bzImage    initrd    map
>>> hdc2                bin    boot     dev    etc    lib    mnt    proc
>>> rc.init    root    sbin    tmp    usr    var
>>> hdc3                **Is there but I can't mount it and no 
>>> documentation
>>> about formating it during target install**
>>>
>>> I then have a look at /etc/lilo.conf and find the following which seems
>>> really wacky so I have included the lines that I changed in bold
>>> *********************************
>>> disk=/dev/sda    *disk=/dev/hdc*
>>>    bios=0x80
>>>    heads=4
>>>    sectors=32
>>>    cylinders=490
>>>
>>> boot=/dev/sda        *disk=/dev/hdc*
>>> map=/boot/map
>>> install=/boot/boot.b
>>> compact
>>> prompt
>>> timeout=20
>>> default=linux
>>>
>>> image=/boot/bzImage-ipx    *image=/boot/bzImage*
>>>    label=linux
>>>    read-only
>>>    root=/dev/hda1                *root=/dev/hdc2*
>>>    vga=0x317
>>> ***************************************
>>> However i don't even think it is accessing this file yet.
>>>
>>> After these changes (new kernel, updated lilo.conf file) I get the same
>>> errors as before (ioctl) plus more errors I am thinking because of all
>>> the extra file systems I built into the kernel that try and 
>>> recognise it
>>> but fail.
>>> I have tried using the kernels supplied with pwl such as bzImage-full
>>> and selecting modules but no go there either.
>>>
>>> Incase some more of the errors being produced would be helpful here 
>>> they
>>> are:
>>>
>>> *********************************************
>>> Partition check:
>>> hdc: hdc1 hdc2 hdc3
>>> RAMDISK: Compressed image found at block 0
>>> VFS: Mounted root (ext2 filesystem).
>>> Copying filesystem /dev/hda2 to /dev/ram2.....
>>> /dev/hda2Flushing buffers to disk....
>>> tcsetpgrp: Inappropriate ioctl for device
>>> Invalid session number or type of track
>>> Kernel panic: VFS: Unable to mount root fs on 01:02
>>> *********************************************
>>>
>>> I am able to get it to work when I use a Compressed ramdisk on ext2
>>> partition however that is not practical because it installs it all on
>>> hdc1 with no other partitions. I need it Uncompressed on ext2 partition
>>> so that I can write data to the hdc2 partition.
>>>
>>> Do you know what hdc3 is used for is it meant to be a swap or 
>>> something?
>>> I tried partitioning it,(mke2fs) so that I could mount it and 
>>> everything
>>> however to no avail at bootup.
>>>
>>> I have been reading the Bootdisk HOWTO and they have this error under
>>> their troubleshooting and say there is only a few problems here and to
>>> check the rdev -R on /dev/hdc1/bzImage. I followed through this
>>> possibility but it did nothing.
>>>
>>> Apparently you can look up what device 01:02 is in the format XX:YY in
>>> /usr/src/linux/Documentation/devices.txt however I didn't understand 
>>> this.
>>>
>>> Thankyou for any help you can give me,  I will document any successful
>>> help I am given in my writeup.
>>>
>>> Correy
>>>
>>>
>>> Troy Engel wrote:
>>>
>>>  
>>>
>>>> Hiya,
>>>>
>>>> Correy Edmed said:
>>>>
>>>>
>>>>  
>>>>
>>>>> tcsetpgrp: Inappropriate ioctl for device
>>>>> kernel panic: VFS: Unable to mount root fs on 01:02
>>>>>
>>>>>
>>>>>     
>>>>
>>>>
>>>> I saw this thread, but I'm not part of it I think? In any case, 
>>>> I'll try
>>>> to help...
>>>>
>>>>
>>>>
>>>>  
>>>>
>>>>> /dev/hda2Flushing buffers to disk....
>>>>> tcsetpgrp: Inappropriate ioctl for device
>>>>> Kernel panic: VFS: Unable to mount root fs on 01:02
>>>>>
>>>>>
>>>>>     
>>>>
>>>>
>>>> This smells like a CF error, or something in the subsystem like 
>>>> that. Do
>>>> you have any other flash chips to try and use, besides this one? 
>>>> Likewise,
>>>> do you have a different CF reader/writer to try?
>>>>
>>>> Under normal circumstances, this is the kind of error I would 
>>>> expect when
>>>> trying to mount a bad disk (or possibly a disk with a filesystem the
>>>> kernel doesn't have compiled in? like Sun or SGI disk, etc)
>>>>
>>>> Hope that helps some....
>>>> -te
>>>>
>>>>
>>>>
>>>>   
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Peeweelinux mailing list
>>> [email protected]
>>> http://mail.adis.on.ca/lists/listinfo/peeweelinux
>>>
>>> _______________________________________________
>>> Peeweelinux mailing list
>>> [email protected]
>>> http://mail.adis.on.ca/lists/listinfo/peeweelinux
>>>
>>>
>>>  
>>>
>>
>>
>> _______________________________________________
>> Peeweelinux mailing list
>> [email protected]
>> http://mail.adis.on.ca/lists/listinfo/peeweelinux
>
>