All of lore.kernel.org
 help / color / mirror / Atom feed
* 2.6.31 kernel for mips compile failure - war.h:12:17: error: war.h: No such file or directory
@ 2009-10-16 23:23 myuboot
  2009-10-16 23:41 ` myuboot
  2009-10-16 23:50 ` David Daney
  0 siblings, 2 replies; 68+ messages in thread
From: myuboot @ 2009-10-16 23:23 UTC (permalink / raw)
  To: linux-kernel

I am trying to use buildroot 2009.08 to compile kernel 2.6.31 for mips,
but it fails to error -" war.h can't be found". I used the same
buildroot to build kernel version 2.6.29 with no problem. 

Please give me some suggestion on how to fix this issue. The file 
./arch/mips/include/asm/war.h is there with no problem. Thanks a lot.

cp
/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/usr/bin/mkimage
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/u-boot-tools
mkdir -p
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/root/boot
mv
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/localversion*
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/root/boot
mv: cannot stat
`/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/localversion*':
No such file or directory
make:
[/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/.depend_done]
Error 1 (ignored)
/usr/bin/make -j1 HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=mips
INSTALL_MOD_PATH=/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/root
CROSS_COMPILE=/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/usr/bin/mips-linux-uclibc-
LDFLAGS="-L/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/lib
-L/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/usr/lib
--sysroot=/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/"
LZMA="/home/root123/sources/buildroot-2009.08-k/toolchain_build_mips/bin/lzma"
PATH=/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/u-boot-tools:/home/root123/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/stuff/bitbake/bin
-C
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31
prepare
make[1]: Entering directory
`/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31'
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-mips
  CC      arch/mips/kernel/asm-offsets.s
In file included from
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/bitops.h:24,
                 from include/linux/bitops.h:17,
                 from include/linux/kernel.h:15,
                 from include/linux/sched.h:52,
                 from arch/mips/kernel/asm-offsets.c:13:
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:12:17:
error: war.h: No such file or directory
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:82:2:
error: #error Check setting of R4600_V1_INDEX_ICACHEOP_WAR for your
platform
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:112:2:
error: #error Check setting of R4600_V1_HIT_CACHEOP_WAR for your
platform
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:128:2:
error: #error Check setting of R4600_V2_HIT_CACHEOP_WAR for your
platform
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:141:2:
error: #error Check setting of R5432_CP0_INTERRUPT_WAR foryour platform
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:155:2:
error: #error Check setting of BCM1250_M3_WAR for your platform
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:162:2:
error: #error Check setting of SIBYTE_1956_WAR for your platform
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:178:2:
error: #error Check setting of MIPS4K_ICACHE_REFILL_WAR for your
platform

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: 2.6.31 kernel for mips compile failure - war.h:12:17: error: war.h: No such file or directory
  2009-10-16 23:23 2.6.31 kernel for mips compile failure - war.h:12:17: error: war.h: No such file or directory myuboot
@ 2009-10-16 23:41 ` myuboot
  2009-10-16 23:50 ` David Daney
  1 sibling, 0 replies; 68+ messages in thread
From: myuboot @ 2009-10-16 23:41 UTC (permalink / raw)
  To: linux-kernel

Sorry, I need to take the question back. I found war.h is a file I need
to created for my board. I forgot to copy it over. So no problem any
more.thanks.

On Fri, 16 Oct 2009 18:23 -0500, myuboot@fastmail.fm wrote:
> I am trying to use buildroot 2009.08 to compile kernel 2.6.31 for mips,
> but it fails to error -" war.h can't be found". I used the same
> buildroot to build kernel version 2.6.29 with no problem. 
> 
> Please give me some suggestion on how to fix this issue. The file 
> ./arch/mips/include/asm/war.h is there with no problem. Thanks a lot.
> 
> cp
> /home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/usr/bin/mkimage
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/u-boot-tools
> mkdir -p
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/root/boot
> mv
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/localversion*
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/root/boot
> mv: cannot stat
> `/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/localversion*':
> No such file or directory
> make:
> [/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/.depend_done]
> Error 1 (ignored)
> /usr/bin/make -j1 HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=mips
> INSTALL_MOD_PATH=/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/root
> CROSS_COMPILE=/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/usr/bin/mips-linux-uclibc-
> LDFLAGS="-L/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/lib
> -L/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/usr/lib
> --sysroot=/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/"
> LZMA="/home/root123/sources/buildroot-2009.08-k/toolchain_build_mips/bin/lzma"
> PATH=/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/u-boot-tools:/home/root123/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/stuff/bitbake/bin
> -C
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31
> prepare
> make[1]: Entering directory
> `/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31'
>   CHK     include/linux/version.h
>   CHK     include/linux/utsrelease.h
>   SYMLINK include/asm -> include/asm-mips
>   CC      arch/mips/kernel/asm-offsets.s
> In file included from
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/bitops.h:24,
>                  from include/linux/bitops.h:17,
>                  from include/linux/kernel.h:15,
>                  from include/linux/sched.h:52,
>                  from arch/mips/kernel/asm-offsets.c:13:
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:12:17:
> error: war.h: No such file or directory
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:82:2:
> error: #error Check setting of R4600_V1_INDEX_ICACHEOP_WAR for your
> platform
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:112:2:
> error: #error Check setting of R4600_V1_HIT_CACHEOP_WAR for your
> platform
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:128:2:
> error: #error Check setting of R4600_V2_HIT_CACHEOP_WAR for your
> platform
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:141:2:
> error: #error Check setting of R5432_CP0_INTERRUPT_WAR foryour platform
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:155:2:
> error: #error Check setting of BCM1250_M3_WAR for your platform
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:162:2:
> error: #error Check setting of SIBYTE_1956_WAR for your platform
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:178:2:
> error: #error Check setting of MIPS4K_ICACHE_REFILL_WAR for your
> platform

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: 2.6.31 kernel for mips compile failure - war.h:12:17: error: war.h: No such file or directory
  2009-10-16 23:23 2.6.31 kernel for mips compile failure - war.h:12:17: error: war.h: No such file or directory myuboot
  2009-10-16 23:41 ` myuboot
@ 2009-10-16 23:50 ` David Daney
  2009-10-19 23:49   ` myuboot
                     ` (3 more replies)
  1 sibling, 4 replies; 68+ messages in thread
From: David Daney @ 2009-10-16 23:50 UTC (permalink / raw)
  To: myuboot; +Cc: linux-kernel, linux-mips

mips-linux questions will get more attention if you send them to 
linux-mips@linux-mips.org.


myuboot@fastmail.fm wrote:
> I am trying to use buildroot 2009.08 to compile kernel 2.6.31 for mips,
> but it fails to error -" war.h can't be found". I used the same
> buildroot to build kernel version 2.6.29 with no problem. 
> 
> Please give me some suggestion on how to fix this issue. The file 
> ./arch/mips/include/asm/war.h is there with no problem. Thanks a lot.
> 
[...]
>   CC      arch/mips/kernel/asm-offsets.s
> In file included from
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/bitops.h:24,
>                  from include/linux/bitops.h:17,
>                  from include/linux/kernel.h:15,
>                  from include/linux/sched.h:52,
>                  from arch/mips/kernel/asm-offsets.c:13:

What does your .config look like?

Also try make V=1 so we can see the exact compiler command line that the 
build process is generating.

David Daney

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: 2.6.31 kernel for mips compile failure - war.h:12:17: error: war.h: No such file or directory
  2009-10-16 23:50 ` David Daney
@ 2009-10-19 23:49   ` myuboot
  2009-10-19 23:56   ` serial port 8250 messed up after coverting from little endian to big endian on kernel 2.6.31 myuboot
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 68+ messages in thread
From: myuboot @ 2009-10-19 23:49 UTC (permalink / raw)
  To: David Daney; +Cc: linux-kernel, linux-mips

Thanks. This issue is fixed now. In 2.6.31 the directory
include/asm-mips  is moved as arch/mips/include/asm/. I need to change
my Makefile accordingly.

On Fri, 16 Oct 2009 16:50 -0700, "David Daney"
<ddaney@caviumnetworks.com> wrote:
> mips-linux questions will get more attention if you send them to 
> linux-mips@linux-mips.org.
> 
> 
> myuboot@fastmail.fm wrote:
> > I am trying to use buildroot 2009.08 to compile kernel 2.6.31 for mips,
> > but it fails to error -" war.h can't be found". I used the same
> > buildroot to build kernel version 2.6.29 with no problem. 
> > 
> > Please give me some suggestion on how to fix this issue. The file 
> > ./arch/mips/include/asm/war.h is there with no problem. Thanks a lot.
> > 
> [...]
> >   CC      arch/mips/kernel/asm-offsets.s
> > In file included from
> > /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/bitops.h:24,
> >                  from include/linux/bitops.h:17,
> >                  from include/linux/kernel.h:15,
> >                  from include/linux/sched.h:52,
> >                  from arch/mips/kernel/asm-offsets.c:13:
> 
> What does your .config look like?
> 
> Also try make V=1 so we can see the exact compiler command line that the 
> build process is generating.
> 
> David Daney

^ permalink raw reply	[flat|nested] 68+ messages in thread

* serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-16 23:50 ` David Daney
  2009-10-19 23:49   ` myuboot
@ 2009-10-19 23:56   ` myuboot
  2009-10-20  6:17     ` Florian Fainelli
  2009-11-11  0:22   ` Kernel panic - not syncing: Attempted to kill init! myuboot
  2010-01-19 19:51   ` loadable kernel module link failure - endianness incompatible with that of the selected emulation myuboot
  3 siblings, 1 reply; 68+ messages in thread
From: myuboot @ 2009-10-19 23:56 UTC (permalink / raw)
  To: linux-kernel, linux-mips

I am trying to bringup a MIPS32 board using 2.6.31. It is working in
little endian mode. After changing the board's hardware from little
endian to bit endian, the serial port print messed up. It prints now
something like - "àààààààààààààààà" on the screen. When I trace the
execution, I can see the string the kernel is trying print is correct -
"Linux version 2.6.31 ..." and etc.

I guess it means the initialization of the serial port is not properly
done. But I am not sure where I should check for the problem. The serial
port device I am using is 8250. Please give me some advise.

Thanks. 

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-19 23:56   ` serial port 8250 messed up after coverting from little endian to big endian on kernel 2.6.31 myuboot
@ 2009-10-20  6:17     ` Florian Fainelli
  2009-10-20 15:52       ` myuboot
  2009-10-27 20:40       ` myuboot
  0 siblings, 2 replies; 68+ messages in thread
From: Florian Fainelli @ 2009-10-20  6:17 UTC (permalink / raw)
  To: myuboot; +Cc: linux-kernel, linux-mips

[-- Attachment #1: Type: Text/Plain, Size: 1116 bytes --]

Hi,

Le mardi 20 octobre 2009 01:56:04, myuboot@fastmail.fm a écrit :
> I am trying to bringup a MIPS32 board using 2.6.31. It is working in
> little endian mode. After changing the board's hardware from little
> endian to bit endian, the serial port print messed up. It prints now
> something like - "àààààààààààààààà" on the screen. When I trace the
> execution, I can see the string the kernel is trying print is correct -
> "Linux version 2.6.31 ..." and etc.
> 
> I guess it means the initialization of the serial port is not properly
> done. But I am not sure where I should check for the problem. The serial
> port device I am using is 8250. Please give me some advise.

If the same initialization routine used to work in little-endian, check how 
you actually write and read characters from the UART FIFO and especially if 
your hardware requires you to do word or byte access to these registers.

You can have a look at AR7, which has the same code working for Little and Big 
Endian modes in arch/mips/ar7/prom.c lines 272 to the end of the file. It also 
uses a 8250-compatible UART.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-20  6:17     ` Florian Fainelli
@ 2009-10-20 15:52       ` myuboot
  2009-10-27 20:40       ` myuboot
  1 sibling, 0 replies; 68+ messages in thread
From: myuboot @ 2009-10-20 15:52 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: linux-kernel, linux-mips

I happen to use the same code from ar7. So this part
serial_int/serial_out should be fine?

#define PORT(offset) (KSEG1ADDR(MY_MIPSBOARD_REGS_UART0 + (offset * 4)))
static inline unsigned int serial_in(int offset)
{
        return readl((void *)PORT(offset));
}

static inline void serial_out(int offset, int value)
{
        writel(value, (void *)PORT(offset));
}

Thanks. 



On Tue, 20 Oct 2009 08:17 +0200, "Florian Fainelli"
<florian@openwrt.org> wrote:
> Hi,
> 
> Le mardi 20 octobre 2009 01:56:04, myuboot@fastmail.fm a écrit :
> > I am trying to bringup a MIPS32 board using 2.6.31. It is working in
> > little endian mode. After changing the board's hardware from little
> > endian to bit endian, the serial port print messed up. It prints now
> > something like - "àààààààààààààààà" on the screen. When I trace the
> > execution, I can see the string the kernel is trying print is correct -
> > "Linux version 2.6.31 ..." and etc.
> > 
> > I guess it means the initialization of the serial port is not properly
> > done. But I am not sure where I should check for the problem. The serial
> > port device I am using is 8250. Please give me some advise.
> 
> If the same initialization routine used to work in little-endian, check
> how 
> you actually write and read characters from the UART FIFO and especially
> if 
> your hardware requires you to do word or byte access to these registers.
> 
> You can have a look at AR7, which has the same code working for Little
> and Big 
> Endian modes in arch/mips/ar7/prom.c lines 272 to the end of the file. It
> also 
> uses a 8250-compatible UART.

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-20  6:17     ` Florian Fainelli
  2009-10-20 15:52       ` myuboot
@ 2009-10-27 20:40       ` myuboot
  2009-10-28  8:35         ` Shmulik Ladkani
  1 sibling, 1 reply; 68+ messages in thread
From: myuboot @ 2009-10-27 20:40 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: linux-kernel, linux-mips

Thanks, Florian. I found the cause of the problem. My board is 32 bit
based, so each serial port register is 32bit even only 8 bit is used. So
when the board is switched endianess, I need to change the address
offset to access the same registers.
For example, original RHR register address is 0x8001000 with little
endian mode. With big endian, I need to access it as 0x8001003.

On Tue, 20 Oct 2009 08:17 +0200, "Florian Fainelli"
<florian@openwrt.org> wrote:
> Hi,
> 
> Le mardi 20 octobre 2009 01:56:04, myuboot@fastmail.fm a écrit :
> > I am trying to bringup a MIPS32 board using 2.6.31. It is working in
> > little endian mode. After changing the board's hardware from little
> > endian to bit endian, the serial port print messed up. It prints now
> > something like - "àààààààààààààààà" on the screen. When I trace the
> > execution, I can see the string the kernel is trying print is correct -
> > "Linux version 2.6.31 ..." and etc.
> > 
> > I guess it means the initialization of the serial port is not properly
> > done. But I am not sure where I should check for the problem. The serial
> > port device I am using is 8250. Please give me some advise.
> 
> If the same initialization routine used to work in little-endian, check
> how 
> you actually write and read characters from the UART FIFO and especially
> if 
> your hardware requires you to do word or byte access to these registers.
> 
> You can have a look at AR7, which has the same code working for Little
> and Big 
> Endian modes in arch/mips/ar7/prom.c lines 272 to the end of the file. It
> also 
> uses a 8250-compatible UART.

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-27 20:40       ` myuboot
@ 2009-10-28  8:35         ` Shmulik Ladkani
  2009-10-28 11:04           ` Sergei Shtylyov
  2009-12-04  1:52           ` PIR OFFSET for AR7 myuboot
  0 siblings, 2 replies; 68+ messages in thread
From: Shmulik Ladkani @ 2009-10-28  8:35 UTC (permalink / raw)
  To: myuboot; +Cc: Florian Fainelli, linux-kernel, linux-mips, shmulik

On Tue, 27 Oct 2009 15:40:13 -0500 myuboot@fastmail.fm wrote:
> Thanks, Florian. I found the cause of the problem. My board is 32 bit
> based, so each serial port register is 32bit even only 8 bit is used. So
> when the board is switched endianess, I need to change the address
> offset to access the same registers.
> For example, original RHR register address is 0x8001000 with little
> endian mode. With big endian, I need to access it as 0x8001003.

I assume your uart_port's iotype is defined as UPIO_MEM32.
UPIO_MEM32 makes 8250 access serial registers using readl/writel (which might
be a problem for big-endian), while UPIO_MEM makes 8250 access the registers
using readb/writeb.
Maybe you should try UPIO_MEM (assuming hardware allows byte access).

-- 
Shmulik Ladkani		Jungo Ltd.

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-28  8:35         ` Shmulik Ladkani
@ 2009-10-28 11:04           ` Sergei Shtylyov
  2009-10-28 19:36             ` myuboot
  2009-12-04  1:52           ` PIR OFFSET for AR7 myuboot
  1 sibling, 1 reply; 68+ messages in thread
From: Sergei Shtylyov @ 2009-10-28 11:04 UTC (permalink / raw)
  To: Shmulik Ladkani
  Cc: myuboot, Florian Fainelli, linux-kernel, linux-mips, shmulik

Hello.

Shmulik Ladkani wrote:

>> Thanks, Florian. I found the cause of the problem. My board is 32 bit
>> based, so each serial port register is 32bit even only 8 bit is used. So
>> when the board is switched endianess, I need to change the address
>> offset to access the same registers.
>> For example, original RHR register address is 0x8001000 with little
>> endian mode. With big endian, I need to access it as 0x8001003.
>>     
>
> I assume your uart_port's iotype is defined as UPIO_MEM32.
>   

   He wouldn't have to add 3 to the register addresses then.

> UPIO_MEM32 makes 8250 access serial registers using readl/writel (which might
> be a problem for big-endian), while UPIO_MEM makes 8250 access the registers
> using readb/writeb.
>   

   Both may be a problem for big endian.

> Maybe you should try UPIO_MEM (assuming hardware allows byte access).

   Contrarywise, I think he now has UPIO_MEM and needs to try UPIO_MEM32.

WBR, Sergei



^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-28 11:04           ` Sergei Shtylyov
@ 2009-10-28 19:36             ` myuboot
  2009-10-29  8:26               ` Shmulik Ladkani
  0 siblings, 1 reply; 68+ messages in thread
From: myuboot @ 2009-10-28 19:36 UTC (permalink / raw)
  To: Sergei Shtylyov, Shmulik Ladkani
  Cc: Florian Fainelli, linux-kernel, linux-mips, shmulik

Sergei, Shmulik,

Thanks a lot for your suggestions. I was using UPIO_MEM since I was not
aware of the difference between UPIO_MEM and UPIO_MEM32. 

I just tried UPIO_MEM32 without adding a offset of 3. But the result is
bad - after the kernel initializes the serial console, the console print
out messes up. The early printk is fine because the u-boot initialises
the serial port fine. 

How I tried UPIO_MEM32 is in platform.c changing the iotype to
UPIO_MEM32 in the uart_port structure and passing the structure to
early_serial_setup. What I did is  the same as in
arch/mips/ar7/platform.c.

In 8250.c I removed the offset I added to mem_serial_out and
mem_serial_in. 
Did I miss anything? Thanks again for your help.

On Wed, 28 Oct 2009 14:04 +0300, "Sergei Shtylyov"
<sshtylyov@ru.mvista.com> wrote:
> Hello.
> 
> Shmulik Ladkani wrote:
> 
> >> Thanks, Florian. I found the cause of the problem. My board is 32 bit
> >> based, so each serial port register is 32bit even only 8 bit is used. So
> >> when the board is switched endianess, I need to change the address
> >> offset to access the same registers.
> >> For example, original RHR register address is 0x8001000 with little
> >> endian mode. With big endian, I need to access it as 0x8001003.
> >>     
> >
> > I assume your uart_port's iotype is defined as UPIO_MEM32.
> >   
> 
>    He wouldn't have to add 3 to the register addresses then.
> 
> > UPIO_MEM32 makes 8250 access serial registers using readl/writel (which might
> > be a problem for big-endian), while UPIO_MEM makes 8250 access the registers
> > using readb/writeb.
> >   
> 
>    Both may be a problem for big endian.
> 
> > Maybe you should try UPIO_MEM (assuming hardware allows byte access).
> 
>    Contrarywise, I think he now has UPIO_MEM and needs to try UPIO_MEM32.
> 
> WBR, Sergei
> 
> 

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-28 19:36             ` myuboot
@ 2009-10-29  8:26               ` Shmulik Ladkani
  2009-11-02 23:54                 ` myuboot
  0 siblings, 1 reply; 68+ messages in thread
From: Shmulik Ladkani @ 2009-10-29  8:26 UTC (permalink / raw)
  To: myuboot
  Cc: Sergei Shtylyov, Florian Fainelli, linux-kernel, linux-mips, shmulik

On Wed, 28 Oct 2009 14:36:15 -0500 myuboot@fastmail.fm wrote:
> I just tried UPIO_MEM32 without adding a offset of 3. But the result is
> bad - after the kernel initializes the serial console, the console print
> out messes up. The early printk is fine because the u-boot initialises
> the serial port fine. 
> 
> Did I miss anything? Thanks again for your help.

I guess you did fine with UPIO_MEM32.

Keeping the UPIO_MEM32 approach, I suggest also to fiddle Y/N with
CONFIG_SWAP_IO_SPACE (might be that you have it set to Y while you don't
really need it, or vice versa).
This is since 'readl' uses 'ioswabl' for (potential) byte-swapping of the read
value. Take a look at asm/io.h and mangle-port.h.

Most important, read your hardware documentation to determine correct access
to the memory mapped serial registers.

-- 
Shmulik Ladkani		Jungo Ltd.

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-29  8:26               ` Shmulik Ladkani
@ 2009-11-02 23:54                 ` myuboot
  0 siblings, 0 replies; 68+ messages in thread
From: myuboot @ 2009-11-02 23:54 UTC (permalink / raw)
  To: Shmulik Ladkani
  Cc: Sergei Shtylyov, Florian Fainelli, linux-kernel, linux-mips, shmulik

The CONFIG_SWAP_IO_SPACE was set to Y, but I don't even see it using
xconfig or menuconfig. So I set it manually to n into .config file and
then did a compile - I am using buildroot. But somehow the value always
comes back to y after I type in command "make". The kernel image still
messes up the console after the console is handovered from early printk
to really ttyS01.

Thanks. 

On Thu, 29 Oct 2009 10:26 +0200, "Shmulik Ladkani"
<jungoshmulik@gmail.com> wrote:
> On Wed, 28 Oct 2009 14:36:15 -0500 myuboot@fastmail.fm wrote:
> > I just tried UPIO_MEM32 without adding a offset of 3. But the result is
> > bad - after the kernel initializes the serial console, the console print
> > out messes up. The early printk is fine because the u-boot initialises
> > the serial port fine. 
> > 
> > Did I miss anything? Thanks again for your help.
> 
> I guess you did fine with UPIO_MEM32.
> 
> Keeping the UPIO_MEM32 approach, I suggest also to fiddle Y/N with
> CONFIG_SWAP_IO_SPACE (might be that you have it set to Y while you don't
> really need it, or vice versa).
> This is since 'readl' uses 'ioswabl' for (potential) byte-swapping of the
> read
> value. Take a look at asm/io.h and mangle-port.h.
> 
> Most important, read your hardware documentation to determine correct
> access
> to the memory mapped serial registers.
> 
> -- 
> Shmulik Ladkani         Jungo Ltd.

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Kernel panic - not syncing: Attempted to kill init!
  2009-10-16 23:50 ` David Daney
  2009-10-19 23:49   ` myuboot
  2009-10-19 23:56   ` serial port 8250 messed up after coverting from little endian to big endian on kernel 2.6.31 myuboot
@ 2009-11-11  0:22   ` myuboot
  2009-11-11  7:45     ` Gaye Abdoulaye Walsimou
  2010-01-19 19:51   ` loadable kernel module link failure - endianness incompatible with that of the selected emulation myuboot
  3 siblings, 1 reply; 68+ messages in thread
From: myuboot @ 2009-11-11  0:22 UTC (permalink / raw)
  To: linux-kernel, linux-mips

Hi, 

I got the following error trying to bring up the /sbin/init with Kernel
2.6.31 using cramfs filesystem on a MIPS 32 board:

[    1.160000] VFS: Mounted root (cramfs filesystem) readonly on device
31:2.
[    1.171000] Freeing unused kernel memory: 116k freed
[    1.223000] Kernel panic - not syncing: Attempted to kill init!
[    1.229000] Rebooting in 3 seconds..

Using BDI I know the kernel panic happens as soon as
run_init_process("/sbin/init") in init_post() is called. The filesystem
itself seems to be ok, because I can use 'ls' command under u-boot to
see /sbin/init is a symbolic link to busybox. Also the kernel seems to
like the filesystem and can mount the filesystem.  I have for checked
for similar questions for this error, so I tried replacing /sbin/init
with a hello world program, but the result is exactly the same. It seems
neither hello-world or /sbin/init got executed. 

At this point, I don't know how to debug this issue. Any suggestion on
how to debug this issue will be greatly appreciated.

Andrew

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2009-11-11  0:22   ` Kernel panic - not syncing: Attempted to kill init! myuboot
@ 2009-11-11  7:45     ` Gaye Abdoulaye Walsimou
  2009-11-11 15:48       ` myuboot
  2009-11-17  0:21       ` problem bring up initramfs and busybox myuboot
  0 siblings, 2 replies; 68+ messages in thread
From: Gaye Abdoulaye Walsimou @ 2009-11-11  7:45 UTC (permalink / raw)
  To: myuboot; +Cc: linux-kernel, linux-mips

myuboot@fastmail.fm wrote:
> Hi, 
>
> I got the following error trying to bring up the /sbin/init with Kernel
> 2.6.31 using cramfs filesystem on a MIPS 32 board:
>   

Just to be sure does:
$file vmlinux
$file busybox
give the same result?

Regards

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2009-11-11  7:45     ` Gaye Abdoulaye Walsimou
@ 2009-11-11 15:48       ` myuboot
  2009-11-17  0:21       ` problem bring up initramfs and busybox myuboot
  1 sibling, 0 replies; 68+ messages in thread
From: myuboot @ 2009-11-11 15:48 UTC (permalink / raw)
  To: Gaye Abdoulaye Walsimou; +Cc: linux-kernel, linux-mips


On Wed, 11 Nov 2009 08:45 +0100, "Gaye Abdoulaye Walsimou"
<walsimou@walsimou.com> wrote:
> myuboot@fastmail.fm wrote:
> > Hi, 
> >
> > I got the following error trying to bring up the /sbin/init with Kernel
> > 2.6.31 using cramfs filesystem on a MIPS 32 board:
> >   
> 
> Just to be sure does:
> $file vmlinux
> $file busybox
> give the same result?
> 
> Regards
The file result looks ok. The readelf result looks fine too.

file linux-2.6.31/vmlinux root/bin/busybox
linux-2.6.31/vmlinux: ELF 32-bit MSB executable, MIPS, MIPS32 version 1
(SYSV), statically linked, not stripped
root/bin/busybox:     setuid ELF 32-bit MSB executable, MIPS, MIPS32
version 1 (SYSV), dynamically linked (uses shared libs), stripped

Thanks, Andrew

^ permalink raw reply	[flat|nested] 68+ messages in thread

* problem bring up initramfs and busybox
  2009-11-11  7:45     ` Gaye Abdoulaye Walsimou
  2009-11-11 15:48       ` myuboot
@ 2009-11-17  0:21       ` myuboot
  2009-11-17  9:33         ` Ralf Baechle
  1 sibling, 1 reply; 68+ messages in thread
From: myuboot @ 2009-11-17  0:21 UTC (permalink / raw)
  To: linux-kernel, linux-mips

I have been struggling to bring up a MIPS 32 board with busybox with or
without initramfs.
The kernel stucks there without the shell coming up.

[    1.153000] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[    1.161000] ip_tables: (C) 2000-2006 Netfilter Core Team
[    1.167000] TCP cubic registered
[    1.170000] NET: Registered protocol family 17
[   25.971000] Freeing unused kernel memory: 1032k freed
[   39.969000] Algorithmics/MIPS FPU Emulator v1.5


What I tried here is to use initramfs with statically linked busybox.
The initramfs seems to be up, and runs the commands in the /init one by
one, and then it goes to a inifite loop in r4k_wait at
arch/mips/kernel/genex.S.

The following is the execution sequense when it runs /init. Can anyone
give me some idea what is wrong?

Thanks, Andrew


Breakpoint 2, do_execve (filename=0x9780a000 "/bin/sh", argv=0x4f73a4,
envp=0x4f73ac, regs=0x97997f30) at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/sbin/switch_root",
argv=0x4f7450, envp=0x4f7464, regs=0x97819f30) at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/usr/sbin/switch_root",
argv=0x4f7450, envp=0x4f7464, regs=0x97819f30) at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/bin/switch_root",
argv=0x4f7450, envp=0x4f7464, regs=0x97819f30) at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/usr/bin/switch_root",
argv=0x4f7450, envp=0x4f7464, regs=0x97819f30) at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.
^C
Program received signal SIGSTOP, Stopped (signal).
r4k_wait () at arch/mips/kernel/genex.S:147
147             jr      ra

-- And here is the content of /init script - 
#!/bin/busybox sh

# Mount the /proc and /sys filesystems.
mount -t proc none /proc
mount -t sysfs none /sys

mdev -s
/bin/sh

# Do your stuff here.
echo "This script mounts rootfs and boots it up, nothing more!"

# Mount the root filesystem.
mount -o ro /dev/mtdblock4 /mnt/root

# Clean up.
umount /proc
umount /sys

# Boot the real thing.
exec switch_root /mnt/root /sbin/init

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-17  0:21       ` problem bring up initramfs and busybox myuboot
@ 2009-11-17  9:33         ` Ralf Baechle
  2009-11-17 17:39           ` myuboot
  0 siblings, 1 reply; 68+ messages in thread
From: Ralf Baechle @ 2009-11-17  9:33 UTC (permalink / raw)
  To: myuboot; +Cc: linux-kernel, linux-mips

On Mon, Nov 16, 2009 at 06:21:21PM -0600, myuboot@fastmail.fm wrote:

> I have been struggling to bring up a MIPS 32 board with busybox with or
> without initramfs.
> The kernel stucks there without the shell coming up.
> 
> [    1.153000] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
> [    1.161000] ip_tables: (C) 2000-2006 Netfilter Core Team
> [    1.167000] TCP cubic registered
> [    1.170000] NET: Registered protocol family 17
> [   25.971000] Freeing unused kernel memory: 1032k freed
> [   39.969000] Algorithmics/MIPS FPU Emulator v1.5
> 
> 
> What I tried here is to use initramfs with statically linked busybox.
> The initramfs seems to be up, and runs the commands in the /init one by
> one, and then it goes to a inifite loop in r4k_wait at
> arch/mips/kernel/genex.S.

r4k_wait is called by the idle loop.  Which means the kernel has no process
to run so runs the idle loop.  This might be because there is no other
process left running or because all processes are waiting for I/O for
example.  So it's not uncommon that even busy systems ocasionally briefly
run the idle loop.  In other words, seeing the processor executing
r4k_wait does not necessarily mean something went wrong.  In this case -
also along with the other information you've provieded it's not obvious
what has gone wrong.

  Ralf

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-17  9:33         ` Ralf Baechle
@ 2009-11-17 17:39           ` myuboot
  2009-11-17 17:48             ` Florian Fainelli
  2009-11-17 21:02             ` Kevin D. Kissell
  0 siblings, 2 replies; 68+ messages in thread
From: myuboot @ 2009-11-17 17:39 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-kernel, linux-mips



On Tue, 17 Nov 2009 10:33 +0100, "Ralf Baechle" <ralf@linux-mips.org>
wrote:
> On Mon, Nov 16, 2009 at 06:21:21PM -0600, myuboot@fastmail.fm wrote:
> 
> > I have been struggling to bring up a MIPS 32 board with busybox with or
> > without initramfs.
> > The kernel stucks there without the shell coming up.
> > 
> > [    1.153000] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
> > [    1.161000] ip_tables: (C) 2000-2006 Netfilter Core Team
> > [    1.167000] TCP cubic registered
> > [    1.170000] NET: Registered protocol family 17
> > [   25.971000] Freeing unused kernel memory: 1032k freed
> > [   39.969000] Algorithmics/MIPS FPU Emulator v1.5
> > 
> > 
> > What I tried here is to use initramfs with statically linked busybox.
> > The initramfs seems to be up, and runs the commands in the /init one by
> > one, and then it goes to a inifite loop in r4k_wait at
> > arch/mips/kernel/genex.S.
> 
> r4k_wait is called by the idle loop.  Which means the kernel has no
> process
> to run so runs the idle loop.  This might be because there is no other
> process left running or because all processes are waiting for I/O for
> example.  So it's not uncommon that even busy systems ocasionally briefly
> run the idle loop.  In other words, seeing the processor executing
> r4k_wait does not necessarily mean something went wrong.  In this case -
> also along with the other information you've provieded it's not obvious
> what has gone wrong.
> 
>   Ralf

According to an email from Kevin, I added a symbolic link from
switch_root to busybox. The switch_root seems to be found now based on
the execution sequence, but I got the following error - "Kernel panic -
not syncing: Attempted to kill init!". This is the same error when I
tried to start the shell without initramfs. Something must be wrong, but
I can't quite figure out.

[    9.250000] Freeing unused kernel memory: 1032k freed
[   10.463000] Algorithmics/MIPS FPU Emulator v1.5
[   41.695000] Kernel panic - not syncing: Attempted to kill init!
[   41.701000] Rebooting in 3 seconds.

Thanks for your help. Andrew

(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/init", argv=0x943dd2bc,
envp=0x943dd230, regs=0x97819e30)
    at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/sbin/switch_root",
argv=0x4f7450, envp=0x4f7464, regs=0x97819f30)
    at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-17 17:39           ` myuboot
@ 2009-11-17 17:48             ` Florian Fainelli
  2009-11-17 21:09               ` myuboot
  2009-11-17 21:02             ` Kevin D. Kissell
  1 sibling, 1 reply; 68+ messages in thread
From: Florian Fainelli @ 2009-11-17 17:48 UTC (permalink / raw)
  To: myuboot; +Cc: Ralf Baechle, linux-kernel, linux-mips

Hi,

On Tuesday 17 November 2009 18:39:40 myuboot@fastmail.fm wrote:
> On Tue, 17 Nov 2009 10:33 +0100, "Ralf Baechle" <ralf@linux-mips.org>
> 
> wrote:
> > On Mon, Nov 16, 2009 at 06:21:21PM -0600, myuboot@fastmail.fm wrote:
> > > I have been struggling to bring up a MIPS 32 board with busybox with or
> > > without initramfs.
> > > The kernel stucks there without the shell coming up.
> > >
> > > [    1.153000] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
> > > [    1.161000] ip_tables: (C) 2000-2006 Netfilter Core Team
> > > [    1.167000] TCP cubic registered
> > > [    1.170000] NET: Registered protocol family 17
> > > [   25.971000] Freeing unused kernel memory: 1032k freed
> > > [   39.969000] Algorithmics/MIPS FPU Emulator v1.5
> > >
> > >
> > > What I tried here is to use initramfs with statically linked busybox.
> > > The initramfs seems to be up, and runs the commands in the /init one by
> > > one, and then it goes to a inifite loop in r4k_wait at
> > > arch/mips/kernel/genex.S.
> >
> > r4k_wait is called by the idle loop.  Which means the kernel has no
> > process
> > to run so runs the idle loop.  This might be because there is no other
> > process left running or because all processes are waiting for I/O for
> > example.  So it's not uncommon that even busy systems ocasionally briefly
> > run the idle loop.  In other words, seeing the processor executing
> > r4k_wait does not necessarily mean something went wrong.  In this case -
> > also along with the other information you've provieded it's not obvious
> > what has gone wrong.
> >
> >   Ralf
> 
> According to an email from Kevin, I added a symbolic link from
> switch_root to busybox. The switch_root seems to be found now based on
> the execution sequence, but I got the following error - "Kernel panic -
> not syncing: Attempted to kill init!". This is the same error when I
> tried to start the shell without initramfs. Something must be wrong, but
> I can't quite figure out.
> 
> [    9.250000] Freeing unused kernel memory: 1032k freed
> [   10.463000] Algorithmics/MIPS FPU Emulator v1.5
> [   41.695000] Kernel panic - not syncing: Attempted to kill init!
> [   41.701000] Rebooting in 3 seconds.
> 
> Thanks for your help. Andrew
> 
> (gdb) c
> Continuing.
> 
> Breakpoint 2, do_execve (filename=0x9780a000 "/init", argv=0x943dd2bc,
> envp=0x943dd230, regs=0x97819e30)
>     at fs/exec.c:1293
> 1293            retval = unshare_files(&displaced);
> (gdb) c
> Continuing.
> 
> Breakpoint 2, do_execve (filename=0x9780a000 "/sbin/switch_root",
> argv=0x4f7450, envp=0x4f7464, regs=0x97819f30)
>     at fs/exec.c:1293
> 1293            retval = unshare_files(&displaced);
> (gdb) c
> Continuing.

If you happen to use uClibc and gcc-4.4.0 or superior, make sure that you have 
that patch applied to uClibc: http://www.mail-
archive.com/uclibc@uclibc.org/msg04483.html
--
WBR, Florian

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-17 17:39           ` myuboot
  2009-11-17 17:48             ` Florian Fainelli
@ 2009-11-17 21:02             ` Kevin D. Kissell
  2009-11-17 21:54               ` Chris Dearman
  1 sibling, 1 reply; 68+ messages in thread
From: Kevin D. Kissell @ 2009-11-17 21:02 UTC (permalink / raw)
  To: myuboot; +Cc: linux-mips

[-- Attachment #1: Type: text/html, Size: 3514 bytes --]

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-17 17:48             ` Florian Fainelli
@ 2009-11-17 21:09               ` myuboot
  0 siblings, 0 replies; 68+ messages in thread
From: myuboot @ 2009-11-17 21:09 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: Ralf Baechle, linux-kernel, linux-mips



On Tue, 17 Nov 2009 18:48 +0100, "Florian Fainelli"
<florian@openwrt.org> wrote:
> Hi,
> 
> On Tuesday 17 November 2009 18:39:40 myuboot@fastmail.fm wrote:
> > On Tue, 17 Nov 2009 10:33 +0100, "Ralf Baechle" <ralf@linux-mips.org>
> > 
> > wrote:
> > > On Mon, Nov 16, 2009 at 06:21:21PM -0600, myuboot@fastmail.fm wrote:
> > > > I have been struggling to bring up a MIPS 32 board with busybox with or
> > > > without initramfs.
> > > > The kernel stucks there without the shell coming up.
> > > >
> > > > [    1.153000] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
> > > > [    1.161000] ip_tables: (C) 2000-2006 Netfilter Core Team
> > > > [    1.167000] TCP cubic registered
> > > > [    1.170000] NET: Registered protocol family 17
> > > > [   25.971000] Freeing unused kernel memory: 1032k freed
> > > > [   39.969000] Algorithmics/MIPS FPU Emulator v1.5
> > > >
> > > >
> > > > What I tried here is to use initramfs with statically linked busybox.
> > > > The initramfs seems to be up, and runs the commands in the /init one by
> > > > one, and then it goes to a inifite loop in r4k_wait at
> > > > arch/mips/kernel/genex.S.
> > >
> > > r4k_wait is called by the idle loop.  Which means the kernel has no
> > > process
> > > to run so runs the idle loop.  This might be because there is no other
> > > process left running or because all processes are waiting for I/O for
> > > example.  So it's not uncommon that even busy systems ocasionally briefly
> > > run the idle loop.  In other words, seeing the processor executing
> > > r4k_wait does not necessarily mean something went wrong.  In this case -
> > > also along with the other information you've provieded it's not obvious
> > > what has gone wrong.
> > >
> > >   Ralf
> > 
> > According to an email from Kevin, I added a symbolic link from
> > switch_root to busybox. The switch_root seems to be found now based on
> > the execution sequence, but I got the following error - "Kernel panic -
> > not syncing: Attempted to kill init!". This is the same error when I
> > tried to start the shell without initramfs. Something must be wrong, but
> > I can't quite figure out.
> > 
> > [    9.250000] Freeing unused kernel memory: 1032k freed
> > [   10.463000] Algorithmics/MIPS FPU Emulator v1.5
> > [   41.695000] Kernel panic - not syncing: Attempted to kill init!
> > [   41.701000] Rebooting in 3 seconds.
> > 
> > Thanks for your help. Andrew
> > 
> > (gdb) c
> > Continuing.
> > 
> > Breakpoint 2, do_execve (filename=0x9780a000 "/init", argv=0x943dd2bc,
> > envp=0x943dd230, regs=0x97819e30)
> >     at fs/exec.c:1293
> > 1293            retval = unshare_files(&displaced);
> > (gdb) c
> > Continuing.
> > 
> > Breakpoint 2, do_execve (filename=0x9780a000 "/sbin/switch_root",
> > argv=0x4f7450, envp=0x4f7464, regs=0x97819f30)
> >     at fs/exec.c:1293
> > 1293            retval = unshare_files(&displaced);
> > (gdb) c
> > Continuing.
> 
> If you happen to use uClibc and gcc-4.4.0 or superior, make sure that you
> have 
> that patch applied to uClibc: http://www.mail-
> archive.com/uclibc@uclibc.org/msg04483.html
> --
> WBR, Florian

Yes, I am using uClibc and gcc-4.4.1. So I went ahead and applied the
patch on
./toolchain_build_mips/uClibc-0.9.30.1/libc/sysdeps/linux/mips/bits/syscalls.h.
After that I touched ./toolchain_build_mips/uClibc-0.9.30.1/.configured
and rerun make. But the result is the same - "Kernel panic - not
syncing: Attempted to kill init!". Any of your suggestions will be
welcome. I have tried various things such as changes in init script or
using hello_world as the init, but the result is very similar. Thanks a
lot. Andrew

Breakpoint 1, init_post () at init/main.c:839
839             async_synchronize_full();
(gdb) enable 2
(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/init", argv=0x943dd2bc,
envp=0x943dd230, regs=0x97819e30)
    at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/sbin/busybox",
argv=0x4f7478, envp=0x4f748c, regs=0x97819f30)
    at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.
^C
Program received signal SIGSTOP, Stopped (signal).
r4k_wait () at arch/mips/kernel/genex.S:147
147             jr      ra
Current language:  auto; currently asm

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-17 21:02             ` Kevin D. Kissell
@ 2009-11-17 21:54               ` Chris Dearman
  2009-11-18  0:31                 ` myuboot
  0 siblings, 1 reply; 68+ messages in thread
From: Chris Dearman @ 2009-11-17 21:54 UTC (permalink / raw)
  To: myuboot; +Cc: linux-mips

Kevin D. Kissell wrote:
> This looks like another boot file system setup problem to me.  Are you 
> sure that there's an executable init image at /mnt/root/sbin/init?  I'm 
> pretty sure that the path that you provide to your new init has to be 
> relative to the new root.

That sounds right.

Andrew, my suggestion would be to change your initramfs /init script to 
invoke "/bin/busybox sh" as the last command instead of "exec 
switch_root". The "Kernel panic - not syncing: Attempted to kill init!" 
says that switch_root is exiting for some reason. It could be anything 
from missing files/devices on the /mnt/root file system to a bug in 
busy_box.
By booting into the shell you can run the command by hand (maybe with 
strace if you have it) to help identify where the problem is.

Chris

-- 
Chris Dearman               Desk: +1 408 530 5092  Cell: +1 408 398 5531
MIPS Technologies Inc            955 East Arques Ave, Sunnyvale CA 94085

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-17 21:54               ` Chris Dearman
@ 2009-11-18  0:31                 ` myuboot
  2009-11-18  0:39                   ` Florian Fainelli
  0 siblings, 1 reply; 68+ messages in thread
From: myuboot @ 2009-11-18  0:31 UTC (permalink / raw)
  To: Chris Dearman; +Cc: linux-mips


On Tue, 17 Nov 2009 13:54 -0800, "Chris Dearman" <chris@mips.com> wrote:
> Kevin D. Kissell wrote:
> > This looks like another boot file system setup problem to me.  Are you 
> > sure that there's an executable init image at /mnt/root/sbin/init?  I'm 
> > pretty sure that the path that you provide to your new init has to be 
> > relative to the new root.
> 
> That sounds right.
> 
> Andrew, my suggestion would be to change your initramfs /init script to 
> invoke "/bin/busybox sh" as the last command instead of "exec 
> switch_root". The "Kernel panic - not syncing: Attempted to kill init!" 
> says that switch_root is exiting for some reason. It could be anything 
> from missing files/devices on the /mnt/root file system to a bug in 
> busy_box.
> By booting into the shell you can run the command by hand (maybe with 
> strace if you have it) to help identify where the problem is.
> 
> Chris
> 
> -- 
> Chris Dearman               Desk: +1 408 530 5092  Cell: +1 408 398 5531
> MIPS Technologies Inc            955 East Arques Ave, Sunnyvale CA 94085

Chris,

Thanks for your response. Now I changed my init file to the following - 
#!/bin/busybox sh
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mdev -s
/bin/busybox sh

The Kernel panic is gone but the shell still does not come up. Somehow
there is no printout on the screen.  Below is the error info.
I have tried similar things previously. I also tried using a statically
linked hello world in the place of init script. But the result is
similar - no print out from either hello world or busybox.
[  1.169000] TCP cubic registered
[    1.173000] NET: Registered protocol family 17
[   15.811000] Freeing unused kernel memory: 1032k freed
[   33.978000] Algorithmics/MIPS FPU Emulator v1.5 

And here is the trace on BDI - 
gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/init", argv=0x943dd2bc,
envp=0x943dd230, regs=0x97819e30)
    at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/bin/busybox",
argv=0x4f73dc, envp=0x4f73ec, regs=0x97987f30)
    at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.
^C
Program received signal SIGSTOP, Stopped (signal).
r4k_wait () at arch/mips/kernel/genex.S:147
147             jr      ra
Current language:  auto; currently asm

Let me provide some history about what I am trying to do here in case it
is relevant to the issue. I have a MIPS32 board very similar to AR7.
Previously it has working toolchain/u-boot/kernel. I changed the board
from little endian to big endian mode and have been trying to upgrade
the toolchain/u-boot/kernel (gcc 4.4.1/u-boot2009.08/kernel 2.6.31). I
made some changes to the u-boot and kernel on console initialisation in
order to bring up the console. Up to the point, the kernel comes up
normally.

Since the time I start porting, I have been wondering if any change
related to exception needs to be done due to the endianess change. But
recently I found an AR7 patch for big endian mode(
https://lists.openwrt.org/pipermail/openwrt-devel/2009-May/004262.html)
and I did not see any change related to exception there. I hope the
issue is not something related to exception that messes up the
execution. Sorry if the above is a stupid question. I am trying to learn
embedded system. Your suggestion will be appreciated.

Thanks, Andrew

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-18  0:31                 ` myuboot
@ 2009-11-18  0:39                   ` Florian Fainelli
  2009-11-18  0:58                     ` myuboot
  0 siblings, 1 reply; 68+ messages in thread
From: Florian Fainelli @ 2009-11-18  0:39 UTC (permalink / raw)
  To: myuboot; +Cc: Chris Dearman, linux-mips

Hi,

Le mercredi 18 novembre 2009 01:31:33, myuboot@fastmail.fm a écrit :
> On Tue, 17 Nov 2009 13:54 -0800, "Chris Dearman" <chris@mips.com> wrote:
> > Kevin D. Kissell wrote:
> > > This looks like another boot file system setup problem to me.  Are you
> > > sure that there's an executable init image at /mnt/root/sbin/init?  I'm
> > > pretty sure that the path that you provide to your new init has to be
> > > relative to the new root.
> >
> > That sounds right.
> >
> > Andrew, my suggestion would be to change your initramfs /init script to
> > invoke "/bin/busybox sh" as the last command instead of "exec
> > switch_root". The "Kernel panic - not syncing: Attempted to kill init!"
> > says that switch_root is exiting for some reason. It could be anything
> > from missing files/devices on the /mnt/root file system to a bug in
> > busy_box.
> > By booting into the shell you can run the command by hand (maybe with
> > strace if you have it) to help identify where the problem is.
> >
> > Chris
> 
> Chris,
> 
> Thanks for your response. Now I changed my init file to the following -
> #!/bin/busybox sh
> mount -t proc proc /proc
> mount -t sysfs sysfs /sys
> mdev -s
> /bin/busybox sh
> 
> The Kernel panic is gone but the shell still does not come up. Somehow
> there is no printout on the screen.  Below is the error info.
> I have tried similar things previously. I also tried using a statically
> linked hello world in the place of init script. But the result is
> similar - no print out from either hello world or busybox.
> [  1.169000] TCP cubic registered
> [    1.173000] NET: Registered protocol family 17
> [   15.811000] Freeing unused kernel memory: 1032k freed
> [   33.978000] Algorithmics/MIPS FPU Emulator v1.5
> 
> And here is the trace on BDI -
> gdb) c
> Continuing.
> 
> Breakpoint 2, do_execve (filename=0x9780a000 "/init", argv=0x943dd2bc,
> envp=0x943dd230, regs=0x97819e30)
>     at fs/exec.c:1293
> 1293            retval = unshare_files(&displaced);
> (gdb) c
> Continuing.
> 
> Breakpoint 2, do_execve (filename=0x9780a000 "/bin/busybox",
> argv=0x4f73dc, envp=0x4f73ec, regs=0x97987f30)
>     at fs/exec.c:1293
> 1293            retval = unshare_files(&displaced);
> (gdb) c
> Continuing.
> ^C
> Program received signal SIGSTOP, Stopped (signal).
> r4k_wait () at arch/mips/kernel/genex.S:147
> 147             jr      ra
> Current language:  auto; currently asm
> 
> Let me provide some history about what I am trying to do here in case it
> is relevant to the issue. I have a MIPS32 board very similar to AR7.
> Previously it has working toolchain/u-boot/kernel. I changed the board
> from little endian to big endian mode and have been trying to upgrade
> the toolchain/u-boot/kernel (gcc 4.4.1/u-boot2009.08/kernel 2.6.31). I
> made some changes to the u-boot and kernel on console initialisation in
> order to bring up the console. Up to the point, the kernel comes up
> normally.
> 
> Since the time I start porting, I have been wondering if any change
> related to exception needs to be done due to the endianess change. But
> recently I found an AR7 patch for big endian mode(
> https://lists.openwrt.org/pipermail/openwrt-devel/2009-May/004262.html)
> and I did not see any change related to exception there. I hope the
> issue is not something related to exception that messes up the
> execution. Sorry if the above is a stupid question. I am trying to learn
> embedded system. Your suggestion will be appreciated.

If your board is similar to AR7, then you might need the following patch which 
allows you to cope with the different physical offsets on AR7: 
http://www.linux-mips.org/archives/linux-mips/2009-06/msg00004.html
-- 
Best regards, Florian Fainelli
Email: florian@openwrt.org
Web: http://openwrt.org
IRC: [florian] on irc.freenode.net
-------------------------------

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-18  0:39                   ` Florian Fainelli
@ 2009-11-18  0:58                     ` myuboot
  2009-11-18  1:03                       ` David VomLehn
  0 siblings, 1 reply; 68+ messages in thread
From: myuboot @ 2009-11-18  0:58 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: Chris Dearman, linux-mips



On Wed, 18 Nov 2009 01:39 +0100, "Florian Fainelli"
<florian@openwrt.org> wrote:
> Hi,
> 
> Le mercredi 18 novembre 2009 01:31:33, myuboot@fastmail.fm a écrit :
> > On Tue, 17 Nov 2009 13:54 -0800, "Chris Dearman" <chris@mips.com> wrote:
> > > Kevin D. Kissell wrote:
> > > > This looks like another boot file system setup problem to me.  Are you
> > > > sure that there's an executable init image at /mnt/root/sbin/init?  I'm
> > > > pretty sure that the path that you provide to your new init has to be
> > > > relative to the new root.
> > >
> > > That sounds right.
> > >
> > > Andrew, my suggestion would be to change your initramfs /init script to
> > > invoke "/bin/busybox sh" as the last command instead of "exec
> > > switch_root". The "Kernel panic - not syncing: Attempted to kill init!"
> > > says that switch_root is exiting for some reason. It could be anything
> > > from missing files/devices on the /mnt/root file system to a bug in
> > > busy_box.
> > > By booting into the shell you can run the command by hand (maybe with
> > > strace if you have it) to help identify where the problem is.
> > >
> > > Chris
> > 
> > Chris,
> > 
> > Thanks for your response. Now I changed my init file to the following -
> > #!/bin/busybox sh
> > mount -t proc proc /proc
> > mount -t sysfs sysfs /sys
> > mdev -s
> > /bin/busybox sh
> > 
> > The Kernel panic is gone but the shell still does not come up. Somehow
> > there is no printout on the screen.  Below is the error info.
> > I have tried similar things previously. I also tried using a statically
> > linked hello world in the place of init script. But the result is
> > similar - no print out from either hello world or busybox.
> > [  1.169000] TCP cubic registered
> > [    1.173000] NET: Registered protocol family 17
> > [   15.811000] Freeing unused kernel memory: 1032k freed
> > [   33.978000] Algorithmics/MIPS FPU Emulator v1.5
> > 
> > And here is the trace on BDI -
> > gdb) c
> > Continuing.
> > 
> > Breakpoint 2, do_execve (filename=0x9780a000 "/init", argv=0x943dd2bc,
> > envp=0x943dd230, regs=0x97819e30)
> >     at fs/exec.c:1293
> > 1293            retval = unshare_files(&displaced);
> > (gdb) c
> > Continuing.
> > 
> > Breakpoint 2, do_execve (filename=0x9780a000 "/bin/busybox",
> > argv=0x4f73dc, envp=0x4f73ec, regs=0x97987f30)
> >     at fs/exec.c:1293
> > 1293            retval = unshare_files(&displaced);
> > (gdb) c
> > Continuing.
> > ^C
> > Program received signal SIGSTOP, Stopped (signal).
> > r4k_wait () at arch/mips/kernel/genex.S:147
> > 147             jr      ra
> > Current language:  auto; currently asm
> > 
> > Let me provide some history about what I am trying to do here in case it
> > is relevant to the issue. I have a MIPS32 board very similar to AR7.
> > Previously it has working toolchain/u-boot/kernel. I changed the board
> > from little endian to big endian mode and have been trying to upgrade
> > the toolchain/u-boot/kernel (gcc 4.4.1/u-boot2009.08/kernel 2.6.31). I
> > made some changes to the u-boot and kernel on console initialisation in
> > order to bring up the console. Up to the point, the kernel comes up
> > normally.
> > 
> > Since the time I start porting, I have been wondering if any change
> > related to exception needs to be done due to the endianess change. But
> > recently I found an AR7 patch for big endian mode(
> > https://lists.openwrt.org/pipermail/openwrt-devel/2009-May/004262.html)
> > and I did not see any change related to exception there. I hope the
> > issue is not something related to exception that messes up the
> > execution. Sorry if the above is a stupid question. I am trying to learn
> > embedded system. Your suggestion will be appreciated.
> 
> If your board is similar to AR7, then you might need the following patch
> which 
> allows you to cope with the different physical offsets on AR7: 
> http://www.linux-mips.org/archives/linux-mips/2009-06/msg00004.html
> -- 
> Best regards, Florian Fainelli
> Email: florian@openwrt.org
> Web: http://openwrt.org
> IRC: [florian] on irc.freenode.net
> -------------------------------
Actually I already got this patch for the board in little endian mode,
and it is still there for the big endian mode. And this is one of the
place I have been wondering if that needs to be changed for big endian. 

thanks. Andrew

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-18  0:58                     ` myuboot
@ 2009-11-18  1:03                       ` David VomLehn
  2009-11-18 16:11                         ` myuboot
                                           ` (2 more replies)
  0 siblings, 3 replies; 68+ messages in thread
From: David VomLehn @ 2009-11-18  1:03 UTC (permalink / raw)
  To: myuboot; +Cc: Florian Fainelli, Chris Dearman, linux-mips

On Tue, Nov 17, 2009 at 06:58:35PM -0600, myuboot@fastmail.fm wrote:
> 
> On Wed, 18 Nov 2009 01:39 +0100, "Florian Fainelli"
> <florian@openwrt.org> wrote:
> > -------------------------------
> Actually I already got this patch for the board in little endian mode,
> and it is still there for the big endian mode. And this is one of the
> place I have been wondering if that needs to be changed for big endian. 

It sounds like you've done a good job getting the bootloader and kernel
to work, so this may be a silly suggestion, but are you sure your root
filesystem and busybox are little-endian? It would be an easy mistake to
make...

> thanks. Andrew

David VL

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-18  1:03                       ` David VomLehn
@ 2009-11-18 16:11                         ` myuboot
  2009-11-18 16:29                         ` myuboot
  2009-11-26  0:24                         ` myuboot
  2 siblings, 0 replies; 68+ messages in thread
From: myuboot @ 2009-11-18 16:11 UTC (permalink / raw)
  To: David VomLehn; +Cc: Florian Fainelli, Chris Dearman, linux-mips



On Tue, 17 Nov 2009 20:03 -0500, "David VomLehn" <dvomlehn@cisco.com>
wrote:
> On Tue, Nov 17, 2009 at 06:58:35PM -0600, myuboot@fastmail.fm wrote:
> > 
> > On Wed, 18 Nov 2009 01:39 +0100, "Florian Fainelli"
> > <florian@openwrt.org> wrote:
> > > -------------------------------
> > Actually I already got this patch for the board in little endian mode,
> > and it is still there for the big endian mode. And this is one of the
> > place I have been wondering if that needs to be changed for big endian. 
> 
> It sounds like you've done a good job getting the bootloader and kernel
> to work, so this may be a silly suggestion, but are you sure your root
> filesystem and busybox are little-endian? It would be an easy mistake to
> make...
> 
> > thanks. Andrew
> 
> David VL

I am pretty sure the filesystem and busybox are big endian. I can see
the following print out when the filesystem is built for big endian
mode. 
"Swapping filesystem endian-ness"
Though I don't know if there is a command to check the endianess of a
filesystem directly.

And below is the header info of the busybox showing it is a big endian
object.
readelf -h busybox-1.14.3/busybox
ELF Header:
  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           MIPS R3000
  Version:                           0x1
  Entry point address:               0x4001b0
  Start of program headers:          52 (bytes into file)
  Start of section headers:          926564 (bytes into file)
  Flags:                             0x50001007, noreorder, pic, cpic,
  o32, mips32
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         3
  Size of section headers:           40 (bytes)
  Number of section headers:         19
  Section header string table index: 18
Thanks, Andrew

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-18  1:03                       ` David VomLehn
  2009-11-18 16:11                         ` myuboot
@ 2009-11-18 16:29                         ` myuboot
  2009-11-26  0:24                         ` myuboot
  2 siblings, 0 replies; 68+ messages in thread
From: myuboot @ 2009-11-18 16:29 UTC (permalink / raw)
  To: David VomLehn; +Cc: Florian Fainelli, Chris Dearman, linux-mips

At this point, I just want to be able to bring up the shell so that I
debug further, either with or without initramfs. For initramfs, do I
need to do anything for endianess? I am not aware of anything. 

Thanks, Andrew

On Tue, 17 Nov 2009 20:03 -0500, "David VomLehn" <dvomlehn@cisco.com>
wrote:
> On Tue, Nov 17, 2009 at 06:58:35PM -0600, myuboot@fastmail.fm wrote:
> > 
> > On Wed, 18 Nov 2009 01:39 +0100, "Florian Fainelli"
> > <florian@openwrt.org> wrote:
> > > -------------------------------
> > Actually I already got this patch for the board in little endian mode,
> > and it is still there for the big endian mode. And this is one of the
> > place I have been wondering if that needs to be changed for big endian. 
> 
> It sounds like you've done a good job getting the bootloader and kernel
> to work, so this may be a silly suggestion, but are you sure your root
> filesystem and busybox aAt re little-endian? It would be an easy mistake to
> make...
> 
> > thanks. Andrew
> 
> David VL

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-18  1:03                       ` David VomLehn
  2009-11-18 16:11                         ` myuboot
  2009-11-18 16:29                         ` myuboot
@ 2009-11-26  0:24                         ` myuboot
  2009-11-26  8:45                           ` Florian Fainelli
  2 siblings, 1 reply; 68+ messages in thread
From: myuboot @ 2009-11-26  0:24 UTC (permalink / raw)
  To: David VomLehn; +Cc: Florian Fainelli, Chris Dearman, linux-mips

On Tue, 17 Nov 2009 20:03 -0500, "David VomLehn" <dvomlehn@cisco.com>
wrote:
> On Tue, Nov 17, 2009 at 06:58:35PM -0600, myuboot@fastmail.fm wrote:
> > 
> > On Wed, 18 Nov 2009 01:39 +0100, "Florian Fainelli"
> > <florian@openwrt.org> wrote:
> > > -------------------------------
> > Actually I already got this patch for the board in little endian mode,
> > and it is still there for the big endian mode. And this is one of the
> > place I have been wondering if that needs to be changed for big endian. 
> 
> It sounds like you've done a good job getting the bootloader and kernel
> to work, so this may be a silly suggestion, but are you sure your root
> filesystem and busybox are little-endian? It would be an easy mistake to
> make...
> 
> > thanks. Andrew
> 
> David VL
I have some clue on this issue now. It seems there is some problem with
the serial console operating in interrupt mode. If the 8250 is in
polling mode(set the IRQ for the 8250 serial port to 0), the output on
the console is fine. But with 8250 in interrupt mode, 8250 serial driver
does not receive any interrupt in serial8250_interrupt(). The same board
works just fine when operating in little endian mode with interruption.
I probably need to change something in IRQ initialization for big
endian. I will post my solution when I can get it to work. In the
meantime, any suggestion will be welcome.

Best regards, Andrew

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-26  0:24                         ` myuboot
@ 2009-11-26  8:45                           ` Florian Fainelli
  2009-11-26 18:23                             ` myuboot
  2009-12-05  0:18                             ` myuboot
  0 siblings, 2 replies; 68+ messages in thread
From: Florian Fainelli @ 2009-11-26  8:45 UTC (permalink / raw)
  To: myuboot; +Cc: David VomLehn, Chris Dearman, linux-mips

Hi Andrew.

Le jeudi 26 novembre 2009 01:24:13, myuboot@fastmail.fm a écrit :
> On Tue, 17 Nov 2009 20:03 -0500, "David VomLehn" <dvomlehn@cisco.com>
> 
> wrote:
> > On Tue, Nov 17, 2009 at 06:58:35PM -0600, myuboot@fastmail.fm wrote:
> > > On Wed, 18 Nov 2009 01:39 +0100, "Florian Fainelli"
> > >
> > > <florian@openwrt.org> wrote:
> > > > -------------------------------
> > >
> > > Actually I already got this patch for the board in little endian mode,
> > > and it is still there for the big endian mode. And this is one of the
> > > place I have been wondering if that needs to be changed for big endian.
> >
> > It sounds like you've done a good job getting the bootloader and kernel
> > to work, so this may be a silly suggestion, but are you sure your root
> > filesystem and busybox are little-endian? It would be an easy mistake to
> > make...
> >
> > > thanks. Andrew
> >
> > David VL
> 
> I have some clue on this issue now. It seems there is some problem with
> the serial console operating in interrupt mode. If the 8250 is in
> polling mode(set the IRQ for the 8250 serial port to 0), the output on
> the console is fine. But with 8250 in interrupt mode, 8250 serial driver
> does not receive any interrupt in serial8250_interrupt(). The same board
> works just fine when operating in little endian mode with interruption.
> I probably need to change something in IRQ initialization for big
> endian. I will post my solution when I can get it to work. In the
> meantime, any suggestion will be welcome.

Do you need that patch to work in little-endian: 
https://dev.openwrt.org/browser/trunk/target/linux/ar7/patches-2.6.30/500-
serial_kludge.patch ? If so, you are likely to need it in big-endian too since 
it works around a silicon issue.
-- 
Best regards, Florian Fainelli
Email: florian@openwrt.org
Web: http://openwrt.org
IRC: [florian] on irc.freenode.net
-------------------------------

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-26  8:45                           ` Florian Fainelli
@ 2009-11-26 18:23                             ` myuboot
  2009-12-05  0:18                             ` myuboot
  1 sibling, 0 replies; 68+ messages in thread
From: myuboot @ 2009-11-26 18:23 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: David VomLehn, Chris Dearman, linux-mips



On Thu, 26 Nov 2009 09:45 +0100, "Florian Fainelli"
<florian@openwrt.org> wrote:
> Hi Andrew.
> 
> Le jeudi 26 novembre 2009 01:24:13, myuboot@fastmail.fm a écrit :
> > On Tue, 17 Nov 2009 20:03 -0500, "David VomLehn" <dvomlehn@cisco.com>
> > 
> > wrote:
> > > On Tue, Nov 17, 2009 at 06:58:35PM -0600, myuboot@fastmail.fm wrote:
> > > > On Wed, 18 Nov 2009 01:39 +0100, "Florian Fainelli"
> > > >
> > > > <florian@openwrt.org> wrote:
> > > > > -------------------------------
> > > >
> > > > Actually I already got this patch for the board in little endian mode,
> > > > and it is still there for the big endian mode. And this is one of the
> > > > place I have been wondering if that needs to be changed for big endian.
> > >
> > > It sounds like you've done a good job getting the bootloader and kernel
> > > to work, so this may be a silly suggestion, but are you sure your root
> > > filesystem and busybox are little-endian? It would be an easy mistake to
> > > make...
> > >
> > > > thanks. Andrew
> > >
> > > David VL
> > 
> > I have some clue on this issue now. It seems there is some problem with
> > the serial console operating in interrupt mode. If the 8250 is in
> > polling mode(set the IRQ for the 8250 serial port to 0), the output on
> > the console is fine. But with 8250 in interrupt mode, 8250 serial driver
> > does not receive any interrupt in serial8250_interrupt(). The same board
> > works just fine when operating in little endian mode with interruption.
> > I probably need to change something in IRQ initialization for big
> > endian. I will post my solution when I can get it to work. In the
> > meantime, any suggestion will be welcome.
> 
> Do you need that patch to work in little-endian: 
> https://dev.openwrt.org/browser/trunk/target/linux/ar7/patches-2.6.30/500-
> serial_kludge.patch ? If so, you are likely to need it in big-endian too
> since 
> it works around a silicon issue.
> -- 
> Best regards, Florian Fainelli
> Email: florian@openwrt.org
> Web: http://openwrt.org
> IRC: [florian] on irc.freenode.net
> -------------------------------
I did not need the patch for little endian. For the UART type, I used
PORT_16550 instead of AR7 and it worked just fine. Thanks for the
suggestion though.
Best regards, Andrew

^ permalink raw reply	[flat|nested] 68+ messages in thread

* PIR OFFSET for AR7
  2009-10-28  8:35         ` Shmulik Ladkani
  2009-10-28 11:04           ` Sergei Shtylyov
@ 2009-12-04  1:52           ` myuboot
  2009-12-04 16:03             ` Thomas Bogendoerfer
  1 sibling, 1 reply; 68+ messages in thread
From: myuboot @ 2009-12-04  1:52 UTC (permalink / raw)
  To: linux-kernel, linux-mips

Hi, What is the use of PIR register for AR7 board in file
arch/mips/ar7/irq.c? If I understand it right, PIR is used to define the
polarity of the interrupts. It seems to me that it needs to initialized?

Best regards, Andrew

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: PIR OFFSET for AR7
  2009-12-04  1:52           ` PIR OFFSET for AR7 myuboot
@ 2009-12-04 16:03             ` Thomas Bogendoerfer
  2009-12-04 17:30               ` myuboot
  0 siblings, 1 reply; 68+ messages in thread
From: Thomas Bogendoerfer @ 2009-12-04 16:03 UTC (permalink / raw)
  To: myuboot; +Cc: linux-kernel, linux-mips

On Thu, Dec 03, 2009 at 07:52:30PM -0600, myuboot@fastmail.fm wrote:
> Hi, What is the use of PIR register for AR7 board in file
> arch/mips/ar7/irq.c?

it gives back the channel and line of the pending interrupt with the
highest priority.

> If I understand it right, PIR is used to define the
> polarity of the interrupts. It seems to me that it needs to initialized?

no, it's a read only register. Why do you think it has something to do
with interrupt polarity ?

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: PIR OFFSET for AR7
  2009-12-04 16:03             ` Thomas Bogendoerfer
@ 2009-12-04 17:30               ` myuboot
  0 siblings, 0 replies; 68+ messages in thread
From: myuboot @ 2009-12-04 17:30 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: linux-kernel, linux-mips

Thomas,

Sorry, you are right. I mistook PM_OFFSET for PIR_OFFSET.

Thanks, Andrew
On Fri, 04 Dec 2009 17:03 +0100, "Thomas Bogendoerfer"
<tsbogend@alpha.franken.de> wrote:
> On Thu, Dec 03, 2009 at 07:52:30PM -0600, myuboot@fastmail.fm wrote:
> > Hi, What is the use of PIR register for AR7 board in file
> > arch/mips/ar7/irq.c?
> 
> it gives back the channel and line of the pending interrupt with the
> highest priority.
> 
> > If I understand it right, PIR is used to define the
> > polarity of the interrupts. It seems to me that it needs to initialized?
> 
> no, it's a read only register. Why do you think it has something to do
> with interrupt polarity ?
> 
> Thomas.
> 
> -- 
> Crap can work. Given enough thrust pigs will fly, but it's not necessary
> a
> good idea.                                                [ RFC1925, 2.3
> ]

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-26  8:45                           ` Florian Fainelli
  2009-11-26 18:23                             ` myuboot
@ 2009-12-05  0:18                             ` myuboot
  1 sibling, 0 replies; 68+ messages in thread
From: myuboot @ 2009-12-05  0:18 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: David VomLehn, Chris Dearman, linux-mips

[-- Attachment #1: Type: text/plain, Size: 2799 bytes --]

Finally, I figured out the problem. The main issue is in file irq.c, in
which the register starting at CHNL_OFFSET() is not set correctly in big
endian mode. With that problem, even though the serial port 8250 is
generating interrupt,  the interrupt controller blocks it.

In  big endian mode, the value written at line 
writel(i, REG(CHNL_OFFSET(i)));

should be 
writel(i << 24, REG(CHNL_OFFSET(i)));

I suspect this problem is applicable to AR7 running in big endian mode
since my board is almost the same to AR7. I am attaching a patch for
anyone's reference. Thanks to Florian, Kevin, Chris and Ralf for your
advise.

Best regards, Andrew



On Thu, 26 Nov 2009 09:45 +0100, "Florian Fainelli"
<florian@openwrt.org> wrote:
> Hi Andrew.
> 
> Le jeudi 26 novembre 2009 01:24:13, myuboot@fastmail.fm a écrit :
> > On Tue, 17 Nov 2009 20:03 -0500, "David VomLehn" <dvomlehn@cisco.com>
> > 
> > wrote:
> > > On Tue, Nov 17, 2009 at 06:58:35PM -0600, myuboot@fastmail.fm wrote:
> > > > On Wed, 18 Nov 2009 01:39 +0100, "Florian Fainelli"
> > > >
> > > > <florian@openwrt.org> wrote:
> > > > > -------------------------------
> > > >
> > > > Actually I already got this patch for the board in little endian mode,
> > > > and it is still there for the big endian mode. And this is one of the
> > > > place I have been wondering if that needs to be changed for big endian.
> > >
> > > It sounds like you've done a good job getting the bootloader and kernel
> > > to work, so this may be a silly suggestion, but are you sure your root
> > > filesystem and busybox are little-endian? It would be an easy mistake to
> > > make...
> > >
> > > > thanks. Andrew
> > >
> > > David VL
> > 
> > I have some clue on this issue now. It seems there is some problem with
> > the serial console operating in interrupt mode. If the 8250 is in
> > polling mode(set the IRQ for the 8250 serial port to 0), the output on
> > the console is fine. But with 8250 in interrupt mode, 8250 serial driver
> > does not receive any interrupt in serial8250_interrupt(). The same board
> > works just fine when operating in little endian mode with interruption.
> > I probably need to change something in IRQ initialization for big
> > endian. I will post my solution when I can get it to work. In the
> > meantime, any suggestion will be welcome.
> 
> Do you need that patch to work in little-endian: 
> https://dev.openwrt.org/browser/trunk/target/linux/ar7/patches-2.6.30/500-
> serial_kludge.patch ? If so, you are likely to need it in big-endian too
> since 
> it works around a silicon issue.
> -- 
> Best regards, Florian Fainelli
> Email: florian@openwrt.org
> Web: http://openwrt.org
> IRC: [florian] on irc.freenode.net
> -------------------------------

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: irq.patch --]
[-- Type: text/x-patch; name="irq.patch", Size: 2982 bytes --]

--- irq.c	2009-09-21 19:24:30.000000000 -0500
+++ irq.c	2009-12-04 17:52:59.000000000 -0600
@@ -45,7 +45,8 @@
 
 #define REG(addr) ((u32 *)(KSEG1ADDR(AR7_REGS_IRQ) + addr))
 
-#define CHNL_OFFSET(chnl) (CHNLS_OFFSET + (chnl * 4))
+#define CHNL_OFFSET(chnl) (CHNLS_OFFSET + (chnl * 4))  /* priority for interrupt chnl */
+#define LITTLE_TO_BIG_ENDIAN(i)  (24-(i)/8*8 + ((i)%8))  /* convert the bit number from little to big endin within 32 bit*/
 
 static void ar7_unmask_irq(unsigned int irq_nr);
 static void ar7_mask_irq(unsigned int irq_nr);
@@ -78,35 +79,35 @@
 
 static void ar7_unmask_irq(unsigned int irq)
 {
-	writel(1 << ((irq - ar7_irq_base) % 32),
+	writel(1<< LITTLE_TO_BIG_ENDIAN(irq - ar7_irq_base), 
 	       REG(ESR_OFFSET(irq - ar7_irq_base)));
 }
 
 static void ar7_mask_irq(unsigned int irq)
 {
-	writel(1 << ((irq - ar7_irq_base) % 32),
+	writel(1<< LITTLE_TO_BIG_ENDIAN(irq - ar7_irq_base),
 	       REG(ECR_OFFSET(irq - ar7_irq_base)));
 }
 
 static void ar7_ack_irq(unsigned int irq)
 {
-	writel(1 << ((irq - ar7_irq_base) % 32),
+	writel(1<<LITTLE_TO_BIG_ENDIAN(irq - ar7_irq_base),
 	       REG(CR_OFFSET(irq - ar7_irq_base)));
 }
 
 static void ar7_unmask_sec_irq(unsigned int irq)
 {
-	writel(1 << (irq - ar7_irq_base - 40), REG(SEC_ESR_OFFSET));
+	writel(1 << LITTLE_TO_BIG_ENDIAN(irq - ar7_irq_base - 40), REG(SEC_ESR_OFFSET));
 }
 
 static void ar7_mask_sec_irq(unsigned int irq)
 {
-	writel(1 << (irq - ar7_irq_base - 40), REG(SEC_ECR_OFFSET));
+	writel(1 << LITTLE_TO_BIG_ENDIAN(irq - ar7_irq_base - 40), REG(SEC_ECR_OFFSET));
 }
 
 static void ar7_ack_sec_irq(unsigned int irq)
 {
-	writel(1 << (irq - ar7_irq_base - 40), REG(SEC_CR_OFFSET));
+	writel(1 << LITTLE_TO_BIG_ENDIAN(irq - ar7_irq_base - 40), REG(SEC_CR_OFFSET));
 }
 
 void __init arch_init_irq(void)
@@ -123,16 +124,16 @@
 	 * Disable interrupts and clear pending
 	 */
 	writel(0xffffffff, REG(ECR_OFFSET(0)));
-	writel(0xff, REG(ECR_OFFSET(32)));
+	writel(0xff000000, REG(ECR_OFFSET(32)));
 	writel(0xffffffff, REG(SEC_ECR_OFFSET));
 	writel(0xffffffff, REG(CR_OFFSET(0)));
-	writel(0xff, REG(CR_OFFSET(32)));
+	writel(0xff000000, REG(CR_OFFSET(32)));
 	writel(0xffffffff, REG(SEC_CR_OFFSET));
 
 	ar7_irq_base = base;
 
 	for (i = 0; i < 40; i++) {
-		writel(i, REG(CHNL_OFFSET(i)));
+		writel(i<<24, REG(CHNL_OFFSET(i)));
 		/* Primary IRQ's */
 		set_irq_chip_and_handler(base + i, &ar7_irq_type,
 					 handle_edge_irq);
@@ -156,18 +157,18 @@
 	int i, irq;
 
 	/* Primary IRQ's */
-	irq = readl(REG(PIR_OFFSET)) & 0x3f;
+	irq = (readl(REG(PIR_OFFSET)) & 0x3f000000)>>24;
 	if (irq) {
 		do_IRQ(ar7_irq_base + irq);
 		return;
 	}
 
 	/* Secondary IRQ's are cascaded through primary '0' */
-	writel(1, REG(CR_OFFSET(irq)));
+	writel(0x01000000, REG(CR_OFFSET(irq)));
 	status = readl(REG(SEC_SR_OFFSET));
 	for (i = 0; i < 32; i++) {
 		if (status & 1) {
-			do_IRQ(ar7_irq_base + i + 40);
+			do_IRQ(ar7_irq_base + LITTLE_TO_BIG_ENDIAN(i) + 40);
 			return;
 		}
 		status >>= 1;

^ permalink raw reply	[flat|nested] 68+ messages in thread

* loadable kernel module link failure -  endianness incompatible with that of the selected emulation
  2009-10-16 23:50 ` David Daney
                     ` (2 preceding siblings ...)
  2009-11-11  0:22   ` Kernel panic - not syncing: Attempted to kill init! myuboot
@ 2010-01-19 19:51   ` myuboot
  2010-01-19 23:47     ` David Daney
  3 siblings, 1 reply; 68+ messages in thread
From: myuboot @ 2010-01-19 19:51 UTC (permalink / raw)
  To: linux-kernel, linux-mips

I got a link error when compiling 2 loadable kernel modules -
"endianness incompatible with that of the selected emulation". 

But both kernel and the kernel modules of error are in big endian. I
don't know what I should check or fix. Any suggestions? I checked the
endianess of the kernel by checking the elf header of vmlinux file, is
that the right way to do it?

Below are the error info and the readelf output, showing both the kernel
and a kernel module are in big endian.
Thanks for your help. Andrew

1) error log 
make -C /home/root123/sources/kernel/linux
CROSS_COMPILE=""/home/root123/sources/gcc3.4.3-be"/bin/mips-linux-"
M=/home/root123/sources/sdk/platform/src/linux/mxp/src modules    

  LD [M]  /home/root123/sources/sdk/platform/src/linux/mxp/src/mxpmod.o
/home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld:
/home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o:
compiled for a big endian system and target is little endian
/home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld:
/home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o:
endianness incompatible with that of the selected emulation
/home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld: failed to merge
target specific data of file
/home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o
make[13]: ***
[/home/root123/sources/sdk/platform/src/linux/mxp/src/mxpmod.o] Error 1

2) kernel is in big endian
readelf -h vmlinux
ELF Header:
  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           MIPS R3000
  Version:                           0x1
  Entry point address:               0x941aa000
  Start of program headers:          52 (bytes into file)
  Start of section headers:          1720624 (bytes into file)
  Flags:                             0x50001001, noreorder, o32, mips32
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         1
  Size of section headers:           40 (bytes)
  Number of section headers:         27
  Section header string table index: 24


3) kernel module is big endian.
readelf -h mmxpcore.o
ELF Header:
  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              REL (Relocatable file)
  Machine:                           MIPS R3000
  Version:                           0x1
  Entry point address:               0x0
  Start of program headers:          0 (bytes into file)
  Start of section headers:          81024 (bytes into file)
  Flags:                             0x10001001, noreorder, o32, mips2
  Size of this header:               52 (bytes)
  Size of program headers:           0 (bytes)
  Number of program headers:         0
  Size of section headers:           40 (bytes)
  Number of section headers:         34
  Section header string table index: 31


^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: loadable kernel module link failure -  endianness incompatible with that of the selected emulation
  2010-01-19 19:51   ` loadable kernel module link failure - endianness incompatible with that of the selected emulation myuboot
@ 2010-01-19 23:47     ` David Daney
  2010-01-20 16:10       ` myuboot
  0 siblings, 1 reply; 68+ messages in thread
From: David Daney @ 2010-01-19 23:47 UTC (permalink / raw)
  To: myuboot; +Cc: linux-kernel, linux-mips

myuboot@fastmail.fm wrote:
> I got a link error when compiling 2 loadable kernel modules -
> "endianness incompatible with that of the selected emulation". 
> 
> But both kernel and the kernel modules of error are in big endian. I
> don't know what I should check or fix. Any suggestions? I checked the
> endianess of the kernel by checking the elf header of vmlinux file, is
> that the right way to do it?
> 
> Below are the error info and the readelf output, showing both the kernel
> and a kernel module are in big endian.
> Thanks for your help. Andrew
> 
> 1) error log 
> make -C /home/root123/sources/kernel/linux
> CROSS_COMPILE=""/home/root123/sources/gcc3.4.3-be"/bin/mips-linux-"
> M=/home/root123/sources/sdk/platform/src/linux/mxp/src modules    
> 
>   LD [M]  /home/root123/sources/sdk/platform/src/linux/mxp/src/mxpmod.o
> /home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld:
> /home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o:
> compiled for a big endian system and target is little endian
> /home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld:
> /home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o:
> endianness incompatible with that of the selected emulation
> /home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld: failed to merge
> target specific data of file
> /home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o
> make[13]: ***
> [/home/root123/sources/sdk/platform/src/linux/mxp/src/mxpmod.o] Error 1
> 

Looks like a toolchain bug/configuration-problem.  Hard to tell though 
as you didn't pass 'V=1' on the make invocation line.

David Daney

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: loadable kernel module link failure -  endianness incompatible with that of the selected emulation
  2010-01-19 23:47     ` David Daney
@ 2010-01-20 16:10       ` myuboot
  0 siblings, 0 replies; 68+ messages in thread
From: myuboot @ 2010-01-20 16:10 UTC (permalink / raw)
  To: David Daney; +Cc: linux-kernel, linux-mips



On Tue, 19 Jan 2010 15:47 -0800, "David Daney"
<ddaney@caviumnetworks.com> wrote:
> myuboot@fastmail.fm wrote:
> > I got a link error when compiling 2 loadable kernel modules -
> > "endianness incompatible with that of the selected emulation". 
> > 
> > But both kernel and the kernel modules of error are in big endian. I
> > don't know what I should check or fix. Any suggestions? I checked the
> > endianess of the kernel by checking the elf header of vmlinux file, is
> > that the right way to do it?
> > 
> > Below are the error info and the readelf output, showing both the kernel
> > and a kernel module are in big endian.
> > Thanks for your help. Andrew
> > 
> > 1) error log 
> > make -C /home/root123/sources/kernel/linux
> > CROSS_COMPILE=""/home/root123/sources/gcc3.4.3-be"/bin/mips-linux-"
> > M=/home/root123/sources/sdk/platform/src/linux/mxp/src modules    
> > 
> >   LD [M]  /home/root123/sources/sdk/platform/src/linux/mxp/src/mxpmod.o
> > /home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld:
> > /home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o:
> > compiled for a big endian system and target is little endian
> > /home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld:
> > /home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o:
> > endianness incompatible with that of the selected emulation
> > /home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld: failed to merge
> > target specific data of file
> > /home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o
> > make[13]: ***
> > [/home/root123/sources/sdk/platform/src/linux/mxp/src/mxpmod.o] Error 1
> > 
> 
> Looks like a toolchain bug/configuration-problem.  Hard to tell though 
> as you didn't pass 'V=1' on the make invocation line.
> 
> David Daney
With the V=1 option suggested, I found the culprit is this "-m
elf32ltsmip". It is working now.

Thanks. Andrew

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Kernel panic - not syncing: Attempted to kill init!
  2012-11-26  7:51     ` Baruch Siach
@ 2012-11-26  7:53       ` Woody Wu
  0 siblings, 0 replies; 68+ messages in thread
From: Woody Wu @ 2012-11-26  7:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 26, 2012 at 09:51:16AM +0200, Baruch Siach wrote:
> Hi Woody,
> 
> On Mon, Nov 26, 2012 at 03:40:42PM +0800, Woody Wu wrote:
> > Firstly thank you so much for the suggestion.  But you know, this old
> > file system is working for a old 2.6 kernel, which was not built by me.
> > Hence I can see, this file system is okay for at least that version of
> > kernel.
> 
> Make sure that you have support for ARM OABI if you need it for your older 
> filesystem (very likely). See http://wiki.debian.org/ArmEabiPort for some 
> background.
> 
> baruch
> 

Thanks! I've already discovered, that's the exact reason.  Now it works!


> > For the situation, I want to try something from two directions:
> > 1. Is there possible something missed from the kernel side? Any
> > suggestion?
> > 2. Because it resulted in a kernel panic message, I have no good way to
> > trace it.  Can I run something else (init=) from the root file system to
> > gather more information about the file system?  So, how can I play with
> > the "init=" parameter to help for the case?
> > 
> > Thanks in advance.
> > 
> > -woody
> > 
> > On Thu, Nov 22, 2012 at 05:50:05PM +0800, Jello huang wrote:
> > > pls check u root file system.if the root file system is no filesystem or not
> > > * correct .the kernel shall*
> > > *throw the kernel panic*
> > > 
> > > 
> > > On 22 November 2012 17:19, Woody Wu <narkewoody@gmail.com> wrote:
> > > 
> > > > Hi,
> > > >
> > > > "Kernel panic - not syncing: Attempted to kill init!
> > > > exitcode=0x0000000b"
> > > >
> > > > I got above message when I am porting 3.4.19 to a s3c2410 board.  I
> > > > traced the execution path is: kernel_init() -> init_post() ->
> > > > run_init_process("/sbin/init") -> kernel_execve().
> > > >
> > > > And, in the last function kernel_execve, the call of do_execve sucessed.
> > > > Then I see a piece of assembly code follows which I cannot understand.
> > > >
> > > > That means, the root file system, which is mtdblock3 in my case, is
> > > > mounted and /sbin/init was started to execute, then I got the panic
> > > > message.
> > > >
> > > > Is that possible that this is caused by the root file system instead of
> > > > the kernel? The root file system is a very old one that can run with an
> > > > old kernel 2.6.14.
> > > >
> > > >
> > > > Do you have any clue?  Thanks in advance!
> > > >
> > > > --
> > > > woody
> > > > I can't go back to yesterday - because I was a different person then.
> 
> -- 
>      http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
> =}------------------------------------------------ooO--U--Ooo------------{=
>    - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

-- 
woody
I can't go back to yesterday - because I was a different person then.

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Kernel panic - not syncing: Attempted to kill init!
  2012-11-26  7:40   ` Woody Wu
@ 2012-11-26  7:51     ` Baruch Siach
  2012-11-26  7:53       ` Woody Wu
  0 siblings, 1 reply; 68+ messages in thread
From: Baruch Siach @ 2012-11-26  7:51 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Woody,

On Mon, Nov 26, 2012 at 03:40:42PM +0800, Woody Wu wrote:
> Firstly thank you so much for the suggestion.  But you know, this old
> file system is working for a old 2.6 kernel, which was not built by me.
> Hence I can see, this file system is okay for at least that version of
> kernel.

Make sure that you have support for ARM OABI if you need it for your older 
filesystem (very likely). See http://wiki.debian.org/ArmEabiPort for some 
background.

baruch

> For the situation, I want to try something from two directions:
> 1. Is there possible something missed from the kernel side? Any
> suggestion?
> 2. Because it resulted in a kernel panic message, I have no good way to
> trace it.  Can I run something else (init=) from the root file system to
> gather more information about the file system?  So, how can I play with
> the "init=" parameter to help for the case?
> 
> Thanks in advance.
> 
> -woody
> 
> On Thu, Nov 22, 2012 at 05:50:05PM +0800, Jello huang wrote:
> > pls check u root file system.if the root file system is no filesystem or not
> > * correct .the kernel shall*
> > *throw the kernel panic*
> > 
> > 
> > On 22 November 2012 17:19, Woody Wu <narkewoody@gmail.com> wrote:
> > 
> > > Hi,
> > >
> > > "Kernel panic - not syncing: Attempted to kill init!
> > > exitcode=0x0000000b"
> > >
> > > I got above message when I am porting 3.4.19 to a s3c2410 board.  I
> > > traced the execution path is: kernel_init() -> init_post() ->
> > > run_init_process("/sbin/init") -> kernel_execve().
> > >
> > > And, in the last function kernel_execve, the call of do_execve sucessed.
> > > Then I see a piece of assembly code follows which I cannot understand.
> > >
> > > That means, the root file system, which is mtdblock3 in my case, is
> > > mounted and /sbin/init was started to execute, then I got the panic
> > > message.
> > >
> > > Is that possible that this is caused by the root file system instead of
> > > the kernel? The root file system is a very old one that can run with an
> > > old kernel 2.6.14.
> > >
> > >
> > > Do you have any clue?  Thanks in advance!
> > >
> > > --
> > > woody
> > > I can't go back to yesterday - because I was a different person then.

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Kernel panic - not syncing: Attempted to kill init!
  2012-11-22  9:50 ` Jello huang
@ 2012-11-26  7:40   ` Woody Wu
  2012-11-26  7:51     ` Baruch Siach
  0 siblings, 1 reply; 68+ messages in thread
From: Woody Wu @ 2012-11-26  7:40 UTC (permalink / raw)
  To: linux-arm-kernel


Hi, Jello

It's a little strange that your reply not appear on the list (at least
at this moment).

Firstly thank you so much for the suggestion.  But you know, this old
file system is working for a old 2.6 kernel, which was not built by me.
Hence I can see, this file system is okay for at least that version of
kernel.

For the situation, I want to try something from two directions:
1. Is there possible something missed from the kernel side? Any
suggestion?
2. Because it resulted in a kernel panic message, I have no good way to
trace it.  Can I run something else (init=) from the root file system to
gather more information about the file system?  So, how can I play with
the "init=" parameter to help for the case?

Thanks in advance.

-woody

On Thu, Nov 22, 2012 at 05:50:05PM +0800, Jello huang wrote:
> pls check u root file system.if the root file system is no filesystem or not
> * correct .the kernel shall*
> *throw the kernel panic*
> 
> 
> On 22 November 2012 17:19, Woody Wu <narkewoody@gmail.com> wrote:
> 
> > Hi,
> >
> > "Kernel panic - not syncing: Attempted to kill init!
> > exitcode=0x0000000b"
> >
> > I got above message when I am porting 3.4.19 to a s3c2410 board.  I
> > traced the execution path is: kernel_init() -> init_post() ->
> > run_init_process("/sbin/init") -> kernel_execve().
> >
> > And, in the last function kernel_execve, the call of do_execve sucessed.
> > Then I see a piece of assembly code follows which I cannot understand.
> >
> > That means, the root file system, which is mtdblock3 in my case, is
> > mounted and /sbin/init was started to execute, then I got the panic
> > message.
> >
> > Is that possible that this is caused by the root file system instead of
> > the kernel? The root file system is a very old one that can run with an
> > old kernel 2.6.14.
> >
> >
> > Do you have any clue?  Thanks in advance!
> >
> > --
> > woody
> > I can't go back to yesterday - because I was a different person then.
> >
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> >
> 
> 
> 
> -- 
> Thanks
> Jello Huang

-- 
woody
I can't go back to yesterday - because I was a different person then.

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Kernel panic - not syncing: Attempted to kill init!
  2012-11-22  9:19 Kernel panic - not syncing: Attempted to kill init! Woody Wu
@ 2012-11-22  9:50 ` Jello huang
  2012-11-26  7:40   ` Woody Wu
  0 siblings, 1 reply; 68+ messages in thread
From: Jello huang @ 2012-11-22  9:50 UTC (permalink / raw)
  To: linux-arm-kernel

pls check u root file system.if the root file system is no filesystem or not
* correct .the kernel shall*
*throw the kernel panic*


On 22 November 2012 17:19, Woody Wu <narkewoody@gmail.com> wrote:

> Hi,
>
> "Kernel panic - not syncing: Attempted to kill init!
> exitcode=0x0000000b"
>
> I got above message when I am porting 3.4.19 to a s3c2410 board.  I
> traced the execution path is: kernel_init() -> init_post() ->
> run_init_process("/sbin/init") -> kernel_execve().
>
> And, in the last function kernel_execve, the call of do_execve sucessed.
> Then I see a piece of assembly code follows which I cannot understand.
>
> That means, the root file system, which is mtdblock3 in my case, is
> mounted and /sbin/init was started to execute, then I got the panic
> message.
>
> Is that possible that this is caused by the root file system instead of
> the kernel? The root file system is a very old one that can run with an
> old kernel 2.6.14.
>
>
> Do you have any clue?  Thanks in advance!
>
> --
> woody
> I can't go back to yesterday - because I was a different person then.
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>



-- 
Thanks
Jello Huang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121122/8a7a7802/attachment.html>

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Kernel panic - not syncing: Attempted to kill init!
@ 2012-11-22  9:19 Woody Wu
  2012-11-22  9:50 ` Jello huang
  0 siblings, 1 reply; 68+ messages in thread
From: Woody Wu @ 2012-11-22  9:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hi, 

"Kernel panic - not syncing: Attempted to kill init!
exitcode=0x0000000b"

I got above message when I am porting 3.4.19 to a s3c2410 board.  I
traced the execution path is: kernel_init() -> init_post() ->
run_init_process("/sbin/init") -> kernel_execve().

And, in the last function kernel_execve, the call of do_execve sucessed.
Then I see a piece of assembly code follows which I cannot understand.

That means, the root file system, which is mtdblock3 in my case, is
mounted and /sbin/init was started to execute, then I got the panic
message.

Is that possible that this is caused by the root file system instead of
the kernel? The root file system is a very old one that can run with an
old kernel 2.6.14.


Do you have any clue?  Thanks in advance!

-- 
woody
I can't go back to yesterday - because I was a different person then.

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Kernel panic - not syncing: Attempted to kill init!
  2011-07-13  4:02 ` Vladimir Murzin
@ 2011-07-13  4:16   ` 史星星(研六 福州)
  0 siblings, 0 replies; 68+ messages in thread
From: 史星星(研六 福州) @ 2011-07-13  4:16 UTC (permalink / raw)
  To: kernelnewbies

boot option: 
root=/dev/mtdblock1 rootfstype=ext3 rw console=ttyS0,115200 mtdparts=phys_mapped_flash:1024k(bootloader)ro,256k(product_info),256k(system_para),128k(exception_info),128k(bootloader_env),-(reserve);gen_nand.0:128M(root),-(usr)
boot logs:
Using octmgmt0 device
TFTP from server 10.10.10.5; our IP address is 10.10.10.7
Filename 'vmlinux.64'.
Load address: 0x20000000
Loading: T #################################
done
Bytes transferred = 4720693 (480835 hex), 413 Kbytes/sec
argv[2]: root=/dev/mtdblock1
argv[3]: rootfstype=ext3
argv[4]: rw
argv[5]: console=ttyS0,115200
argv[6]: mtdparts=phys_mapped_flash:1024k(bootloader)ro,256k(product_info),256k(system_para),128k(exception_info),128k(bootloader_env),-(reserve);gen_nand.0:128M(root),-(usr)
ELF file is 64 bit
Allocating memory for ELF segment: addr: 0xffffffff81100000 (adjusted to: 0x1100000), size 0x3bdd80
Allocated memory for ELF segment: addr: 0xffffffff81100000, size 0x3bdd80
Processing PHDR 0
  Loading 390a80 bytes at ffffffff81100000
  Clearing 2d300 bytes at ffffffff81490a80
## Loading Linux kernel with entry point: 0xffffffff81105e90 ...
Bootloader: Done loading app on coremask: 0x1
Linux version 2.6.32.13-dirty (root at ubuntu) (gcc version 4.3.3 (Cavium Networks Version: 2_0_0 build 95) ) #5 SMP PREEMPT Tue Jul 12 08:57:24 CST 2011
CVMSEG size: 2 cache lines (256 bytes)
bootconsole [early0] enabled
CPU revision is: 000d0409 (Cavium Octeon)
Checking for the multiply/shift bug... no.
Checking for the daddiu bug... no.
Determined physical RAM map:
 memory: 000000000002c000 @ 0000000001465000 (usable)
 memory: 0000000006c00000 @ 0000000001500000 (usable)
 memory: 0000000007c00000 @ 0000000008200000 (usable)
 memory: 0000000011800000 @ 0000000020000000 (usable)
Wasting 292376 bytes for tracking 5221 unused pages
Zone PFN ranges:
  Normal   0x00001465 -> 0x00031800
Movable zone start PFN for each node
early_node_map[4] active PFN ranges
    0: 0x00001465 -> 0x00001491
    0: 0x00001500 -> 0x00008100
    0: 0x00008200 -> 0x0000fe00
    0: 0x00020000 -> 0x00031800
PERCPU: Embedded 10 pages/cpu @a800000001f91000 s10880 r8192 d21888 u65536
pcpu-alloc: s10880 r8192 d21888 u65536 alloc=16*4096
pcpu-alloc: [0] 0 
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 128415
Kernel command line:  bootoctlinux 0x20000000 root=/dev/mtdblock1 rootfstype=ext3 rw console=ttyS0,115200 mtdparts=phys_mapped_flash:1024k(bootloader)ro,256k(product_info),256k(system_para),128k(exception_info),128k(bootloader_env),-(reserve);gen_nand.0:128M(root),-(usr)
PID hash table entries: 2048 (order: 2, 16384 bytes)
Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
Inode-cache hash table entries: 32768 (order: 6, 262144 bytes)
Primary instruction cache 32kB, virtually tagged, 4 way, 64 sets, linesize 128 bytes.
Primary data cache 16kB, 64-way, 2 sets, linesize 128 bytes.
Memory: 512256k/524464k available (2615k kernel code, 11800k reserved, 856k data, 176k init, 0k highmem)
Hierarchical RCU implementation.
NR_IRQS:152
console [ttyS0] enabled, bootconsole disabled
console [ttyS0] enabled, bootconsole disabled
Calibrating delay using timer specific routine.. 1501.67 BogoMIPS (lpj=3003356)
Security Framework initialized
Mount-cache hash table entries: 256
Checking for the daddi bug... no.
Brought up 1 CPUs
NET: Registered protocol family 16
nand_init(): registering device resources
bio: create slab <bio-0> at 0
Switching to clocksource OCTEON_CVMCOUNT
NET: Registered protocol family 2
IP route cache hash table entries: 4096 (order: 3, 32768 bytes)
TCP established hash table entries: 16384 (order: 6, 262144 bytes)
TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
TCP reno registered
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
msgmni has been set to 1001
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x1180000000800 (irq = 58) is a OCTEON
loop: module loaded
nand id: 0xaddc
NAND device: Manufacturer ID: 0xad, Chip ID: 0xdc (Hynix NAND 512MiB 3,3V 8-bit)
Scanning device for bad blocks
2 cmdlinepart partitions found on MTD device gen_nand.0
nr_parts:2
Creating 2 MTD partitions on "gen_nand.0":
0x000000000000-0x000008000000 : "root"
0x000008000000-0x000020000000 : "usr"
TCP cubic registered
NET: Registered protocol family 17
Bootbus flash: Setting flash for 2MB flash at 0x1fa00000
phys_mapped_flash: Found 1 x16 devices at 0x0 in 8-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
6 cmdlinepart partitions found on MTD device phys_mapped_flash
Creating 6 MTD partitions on "phys_mapped_flash":
0x000000000000-0x000000100000 : "bootloader"
0x000000100000-0x000000140000 : "product_info"
0x000000140000-0x000000180000 : "system_para"
0x000000180000-0x0000001a0000 : "exception_info"
0x0000001a0000-0x0000001c0000 : "bootloader_env"
0x0000001c0000-0x000000200000 : "reserve"
EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
kjournald starting.  Commit interval 5 seconds
EXT3 FS on mtdblock1, internal journal
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) on device 31:1.
Freeing unused kernel memory: 176k freed


> Hi,
>
> ???????? I got a problem when trying to boot linux 2.6.32.13 on my Octeon
> CN5650 board.
>
> Booting logs below:
>
> ...omit?.
>
> EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
>
> kjournald starting.? Commit interval 5 seconds
>
> EXT3 FS on mtdblock1, internal journal
>
> EXT3-fs: recovery complete.
>
> EXT3-fs: mounted filesystem with ordered data mode.
>
> VFS: Mounted root (ext3 filesystem) on device 31:1.
>
> Freeing unused kernel memory: 176k freed
>
> Kernel panic - not syncing: Attempted to kill init!???? ? kernel panic here
>
>
>
> What I do:
>
> 1?The busybox init is OK in another version kernel .I replace init with
> ?Hello world? prog or dead loop prog, kernel panic still.
>
> 2?
>
> run_init_process(?/sbin/init?) ? kernel_execve ? sys_execve
>
> so I add some debug msgs in sys_execve.
>
>
>
> asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs)
>
> {
>
> ???????? int error;
>
> ???????? char * filename;
>
>
>
> ?? ?printk("enter sys_execve\n");
>
> ???????? filename = getname((char __user *) (long)regs.regs[4]);
>
> ???????? error = PTR_ERR(filename);
>
> ???????? if (IS_ERR(filename))
>
> ?????????????????? goto out;
>
> ???????? error = do_execve(filename, (char __user *__user *)
> (long)regs.regs[5],
>
> ???????? ????????????????? (char __user *__user *) (long)regs.regs[6],
> &regs);
>
> ??? putname(filename);
>
> ??? printk("out sys_execve\n");
>
> out:
>
> ???????? return error;
>
> }
>
>
>
> Boot logs:
>
> VFS: Mounted root (ext3 filesystem) on device 31:1.
>
> Freeing unused kernel memory: 176k freed
>
> enter sys_execve
>
> out sys_execve
>
> Kernel panic - not syncing: Attempted to kill init!???? ? kernel panic here
>
>
>
> My question:
>
> 1.the kernel panic happened when return to userspace prog?
>
> 2.how to solve this problem?
>
>
>
> Thank you!
>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
Hi!

What about "init=" boot option?... and CONFIG_CMDLINE as well?

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Kernel panic - not syncing: Attempted to kill init!
  2011-07-13  2:57 史星星(研六 福州)
@ 2011-07-13  4:02 ` Vladimir Murzin
  2011-07-13  4:16   ` 史星星(研六 福州)
  0 siblings, 1 reply; 68+ messages in thread
From: Vladimir Murzin @ 2011-07-13  4:02 UTC (permalink / raw)
  To: kernelnewbies

2011/7/13 ???(?? ??) <shixingxing@ruijie.com.cn>:
> Hi,
>
> ???????? I got a problem when trying to boot linux 2.6.32.13 on my Octeon
> CN5650 board.
>
> Booting logs below:
>
> ...omit?.
>
> EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
>
> kjournald starting.? Commit interval 5 seconds
>
> EXT3 FS on mtdblock1, internal journal
>
> EXT3-fs: recovery complete.
>
> EXT3-fs: mounted filesystem with ordered data mode.
>
> VFS: Mounted root (ext3 filesystem) on device 31:1.
>
> Freeing unused kernel memory: 176k freed
>
> Kernel panic - not syncing: Attempted to kill init!???? ? kernel panic here
>
>
>
> What I do:
>
> 1?The busybox init is OK in another version kernel .I replace init with
> ?Hello world? prog or dead loop prog, kernel panic still.
>
> 2?
>
> run_init_process(?/sbin/init?) ? kernel_execve ? sys_execve
>
> so I add some debug msgs in sys_execve.
>
>
>
> asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs)
>
> {
>
> ???????? int error;
>
> ???????? char * filename;
>
>
>
> ?? ?printk("enter sys_execve\n");
>
> ???????? filename = getname((char __user *) (long)regs.regs[4]);
>
> ???????? error = PTR_ERR(filename);
>
> ???????? if (IS_ERR(filename))
>
> ?????????????????? goto out;
>
> ???????? error = do_execve(filename, (char __user *__user *)
> (long)regs.regs[5],
>
> ???????? ????????????????? (char __user *__user *) (long)regs.regs[6],
> &regs);
>
> ??? putname(filename);
>
> ??? printk("out sys_execve\n");
>
> out:
>
> ???????? return error;
>
> }
>
>
>
> Boot logs:
>
> VFS: Mounted root (ext3 filesystem) on device 31:1.
>
> Freeing unused kernel memory: 176k freed
>
> enter sys_execve
>
> out sys_execve
>
> Kernel panic - not syncing: Attempted to kill init!???? ? kernel panic here
>
>
>
> My question:
>
> 1.the kernel panic happened when return to userspace prog?
>
> 2.how to solve this problem?
>
>
>
> Thank you!
>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
Hi!

What about "init=" boot option?... and CONFIG_CMDLINE as well?

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Kernel panic - not syncing: Attempted to kill init!
@ 2011-07-13  2:57 史星星(研六 福州)
  2011-07-13  4:02 ` Vladimir Murzin
  0 siblings, 1 reply; 68+ messages in thread
From: 史星星(研六 福州) @ 2011-07-13  2:57 UTC (permalink / raw)
  To: kernelnewbies

Hi,
         I got a problem when trying to boot linux 2.6.32.13 on my Octeon CN5650 board.
Booting logs below:
...omit?.
EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
kjournald starting.  Commit interval 5 seconds
EXT3 FS on mtdblock1, internal journal
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) on device 31:1.
Freeing unused kernel memory: 176k freed
Kernel panic - not syncing: Attempted to kill init!     <-- kernel panic here

What I do:
1?The busybox init is OK in another version kernel .I replace init with ?Hello world? prog or dead loop prog, kernel panic still.
2?
run_init_process(?/sbin/init?) --> kernel_execve --> sys_execve
so I add some debug msgs in sys_execve.

asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs)
{
         int error;
         char * filename;

    printk("enter sys_execve\n");
         filename = getname((char __user *) (long)regs.regs[4]);
         error = PTR_ERR(filename);
         if (IS_ERR(filename))
                   goto out;
         error = do_execve(filename, (char __user *__user *) (long)regs.regs[5],
                           (char __user *__user *) (long)regs.regs[6], &regs);
    putname(filename);
    printk("out sys_execve\n");
out:
         return error;
}

Boot logs:
VFS: Mounted root (ext3 filesystem) on device 31:1.
Freeing unused kernel memory: 176k freed
enter sys_execve
out sys_execve
Kernel panic - not syncing: Attempted to kill init!     <-- kernel panic here

My question:
1.the kernel panic happened when return to userspace prog?
2.how to solve this problem?

Thank you!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110713/134a2b2b/attachment-0001.html 

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel Panic - not syncing: Attempted to kill init!
  2008-04-10  8:50 ` Sebastian Siewior
@ 2008-04-10 16:53   ` Sreen Tallam
  0 siblings, 0 replies; 68+ messages in thread
From: Sreen Tallam @ 2008-04-10 16:53 UTC (permalink / raw)
  To: Sebastian Siewior; +Cc: linuxppc-embedded

Hi Sebastian,

Thank you for looking into this issue.
But I am not using udev. And my /dev is empty, there is no devices in there.

Any more hints on this. I would appreciate your follow up.

Thanks,
Sreen

On Thu, Apr 10, 2008 at 1:50 AM, Sebastian Siewior
<linuxppc-embedded@ml.breakpoint.cc> wrote:
> * Sreen Tallam | 2008-04-09 19:07:01 [-0700]:
>
>
>  >VFS: Mounted root (jffs2 filesystem) readonly.
>  >Freeing unused kernel memory: 156k init
>  >Warning: unable to open an initial console.
>  >init/main.c -- 819
>  >init/main.c -- 821
>  >init/main.c -- 844
>  >init/main.c -- 704 -- /sbin/tallam_init<0>Kernel panic - not syncing:
>  >Attempted to kill init!
>  >Call Trace:
>  >[C3FE7E60] [C0006D98]  (unreliable)
>  >[C3FE7EA0] [C001F150]
>  >[C3FE7EF0] [C0023630]
>  >[C3FE7F30] [C0023734]
>  >[C3FE7F40] [C000DBC0]
>  > <0>Rebooting in 180 seconds..
>  >
>
>  This looks like you are missing /dev/console and probably /dev/null. You
>  need atleast those two nodes in your rootfs if you are using udev. You
>  will need a static /dev if you don't use udev/mdev.
>
>  >Thanks,
>  >Sreen
>  Sebastian
>

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel Panic - not syncing: Attempted to kill init!
  2008-04-10  2:07 Kernel Panic " Sreen Tallam
@ 2008-04-10  8:50 ` Sebastian Siewior
  2008-04-10 16:53   ` Sreen Tallam
  0 siblings, 1 reply; 68+ messages in thread
From: Sebastian Siewior @ 2008-04-10  8:50 UTC (permalink / raw)
  To: Sreen Tallam; +Cc: linuxppc-embedded

* Sreen Tallam | 2008-04-09 19:07:01 [-0700]:

>VFS: Mounted root (jffs2 filesystem) readonly.
>Freeing unused kernel memory: 156k init
>Warning: unable to open an initial console.
>init/main.c -- 819
>init/main.c -- 821
>init/main.c -- 844
>init/main.c -- 704 -- /sbin/tallam_init<0>Kernel panic - not syncing:
>Attempted to kill init!
>Call Trace:
>[C3FE7E60] [C0006D98]  (unreliable)
>[C3FE7EA0] [C001F150]
>[C3FE7EF0] [C0023630]
>[C3FE7F30] [C0023734]
>[C3FE7F40] [C000DBC0]
> <0>Rebooting in 180 seconds..
>

This looks like you are missing /dev/console and probably /dev/null. You
need atleast those two nodes in your rootfs if you are using udev. You
will need a static /dev if you don't use udev/mdev.

>Thanks,
>Sreen
Sebastian

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Kernel Panic - not syncing: Attempted to kill init!
@ 2008-04-10  2:07 Sreen Tallam
  2008-04-10  8:50 ` Sebastian Siewior
  0 siblings, 1 reply; 68+ messages in thread
From: Sreen Tallam @ 2008-04-10  2:07 UTC (permalink / raw)
  To: linuxppc-embedded

Hi All,

Has anyone seen this error?
I am running a 2.6.18 kernel on a PPC 405GP using a AMCC Walnut board.

I added some printf's within the kernel to debug more information, and
it pointed to

init/main.c
under init() routine
in run_init_process(execute_command);
where execute_command = /sbin/tallam_init


=> tftp 0x800000 /tftpboot/tallam/kernel_5_2
ENET Speed is 100 Mbps - FULL duplex connection
Filename '/tftpboot/tallam/kernel_5_2'.
Load address: 0x800000
Loading: #################################################################
         #################################################################
         #################################################################
         #######################################
done
Bytes transferred = 1196495 (1241cf hex)
=> bootm 0x800000
## Booting image at 00800000 ...
   Image Name:   Linux-2.6.18_pro500
   Created:      2008-04-09  23:13:11 UTC
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    1196431 Bytes =  1.1 MB
   Load Address: 00400000
   Entry Point:  0040053c
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
## Current stack ends at 0x03FAD548 => set upper limit to 0x00800000
## cmdline at 0x007FFC00 ... 0x007FFD14
gd address  = 0x03FADF18
bd address  = 0x03FADF48
memstart    = 0x00000000
memsize     = 0x04000000
flashstart  = 0xFF000000
flashsize   = 0x01000000
flashoffset = 0x00000000
sramstart   = 0x00000000
sramsize    = 0x00000000
bootflags   = 0x0000A000
procfreq    =    100 MHz
plb_busfreq =    100 MHz
pci_busfreq =     50 MHz
ethaddr     = 00:xx:xx:04:4F:70
IP addr     = 172.xx.xxx.177
baudrate    =   9600 bps
No initrd
## Transferring control to Linux (at address 0040053c) ...
Memory <- <0x0 0x4000000> (64MB)
CPU clock-frequency <- 0x5f5e0ff (100MHz)
CPU timebase-frequency <- 0x5f5e0ff (100MHz)
/plb: clock-frequency <- 5f5e0ff (100MHz)
/plb/opb: clock-frequency <- 2faf07f (50MHz)
/plb/ebc: clock-frequency <- 2faf07f (50MHz)
/plb/opb/serial@ef600300: clock-frequency <- a98ac7 (11MHz)
/plb/opb/serial@ef600400: clock-frequency <- a98ac7 (11MHz)
ENET0: local-mac-address <- 00:xx:xx:04:4f:70

zImage starting: loaded at 0x00400000 (sp: 0x03fad3e8)
Allocating 0x299958 bytes for kernel ...
gunzipping (0x00000000 <- 0x0040d000:0x006a871c)...done 0x2740c0 bytes

Linux/PowerPC load:
mtdparts=phys_mapped_flash:64k@0k(envb),960k@64k(spare-log
s),6m@1m(jffs2b),768k@7m(kernelb),256k@7936k(u-bootb),64k@8m(envp),960k@8256k(
    logs),6m@9m(jffs2p),768k@15m(kernelp),256k@16128k(u-bootp)
console=ttyS1,9600      rootfstype=jffs2 root=/dev/mtdblock7 ro
init=/sbin/tallam_init
Finalizing device tree... flat tree at 0x6b5420
id mach(): done
MMU:enter
MMU:hw init
MMU:mapin
MMU:setio
MMU:exit
Linux version 2.6.18_pro500 (gcc version 4.2.     0 ) #1 PREEMPT Wed
Apr 9 16:02:34      PDT 2008
Found legacy serial port 0 for /plb/opb/serial@ef600300
  mem=ef600300, taddr=ef600300, irq=0, clk=11111111, speed=9600
Found legacy serial port 1 for /plb/opb/serial@e600400
  mem=ef600400, taddr=ef600400, irq=0, clk=11111111, spHz
time_init: processor frequency   = 99.999999 MHz
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 62228k/65536k available (2372k kernel code, 3248k reserved,
92k data,      146k bss, 156k init)
Calibrating delay loop... 198.65 BogoMIPS (lpj=397312)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
/plb/opb/gpio@ef600700: device found
PCI: Probing PCI hardware
NET: Registered protocol family 2
IP route cache hash table entries: 512 (order: -1, 2048 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 2048 bind 1024)
TCP reno registered
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
/plb/opb/gpio@ef600700 character device (0) ready
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
serial8250.0: ttyS0 at MMIO map 0xef600300 mem 0xc5000300 (irq = 16)
is a 1655     0A
serial8250.0: ttyS1 at MMIO map 0xef600400 mem 0xc5002400 (irq = 17)
is a 1655     0A
console handover: boot [udbg0] -> real [ttyS1]
ef600300.serial: ttyS0 at MMIO map 0xef600300 mem 0xc5062300 (irq =
16) is a 1     6550A
ef600400.serial: ttyS1 at MMIO map 0xef600400 mem 0xc5064400 (irq =
17) is a 1     6550A
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
loop: loaded (max 8 devices)
PPC 4xx OCP EMAC driver, version 3.54
MAL v1 /plb/mcmal, 1 TX channels, 1 RX channels
eth0: EMAC-0 /plb/opb/ethernet@ef600800, MAC 00:a0:xx:xx:4f:70
eth0: found Generic MII PHY (0x01)
i2c /dev entries driver
IBM IIC driver v2.1
ff000000.flash: Found 1 x16 devices at 0x0 in 16-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
ff000000.flash: CFI does not contain boot bank location. Assuming top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
RedBoot partition parsing not available
Creating 10 MTD partitions on "ff000000.flash":
0x00000000-0x00010000 : "envb"
0x00010000-0x00100000 : "spare-logs"
0x00100000-0x00700000 : "jffs2b"
0x00700000-0x007c0000 : "kernelb"
0x007c0000-0x00800000 : "u-bootb"
0x00800000-0x00810000 : "envp"
0x00810000-0x00900000 : "logs"
0x00900000-0x00f00000 : "jffs2p"
0x00f00000-0x00fc0000 : "kernelp"
0x00fc0000-0x01000000 : "u-bootp"
ip_conntrack version 2.4 (512 buckets, 4096 max) - 172 bytes per conntrack
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Time: timebase clocksource has been installed.
eth0: link is up, 100 FDX
IP-Config: Incomplete network configuration information.
VFS: Mounted root (jffs2 filesystem) readonly.
Freeing unused kernel memory: 156k init
Warning: unable to open an initial console.
init/main.c -- 819
init/main.c -- 821
init/main.c -- 844
init/main.c -- 704 -- /sbin/tallam_init<0>Kernel panic - not syncing:
Attempted to kill init!
Call Trace:
[C3FE7E60] [C0006D98]  (unreliable)
[C3FE7EA0] [C001F150]
[C3FE7EF0] [C0023630]
[C3FE7F30] [C0023734]
[C3FE7F40] [C000DBC0]
 <0>Rebooting in 180 seconds..

Any help will be appreciated.

Thanks,
Sreen

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2004-12-22  3:13 Kernel panic " Ian Pratt
@ 2004-12-22 15:39 ` David F Barrera
  0 siblings, 0 replies; 68+ messages in thread
From: David F Barrera @ 2004-12-22 15:39 UTC (permalink / raw)
  To: xen-devel

Ian,

It was a setup problem after all. Mea culpa.

One thing I had to do was to change the /etc/fstab on the xenU partition 
(hdc1 in my machine):
/dev/sda1               /                       ext2    defaults        
1 1   <----------- I had the original /dev/hdc1 here

to match the xen config file:
disk = [ 'phy:hdc1,0801,w' ]   < ---- This suggestion you gave to use 
'0801' and 'sda1' works for some reason. 
                                                        Using  'hdc1' 
here and on the root = /dev/ line does NOT work, as you were aware.
root = "/dev/sda1 ro"

I need to have an initrd in order to have a console.  It will not work 
without it:
# Kernel image file.
kernel = "/boot/vmlinuz-2.6.9-xenU"
# Optional ramdisk.
ramdisk = "/boot/initrd-2.6.9-xenU.img"


Thanks for all your suggestions!

David F Barrera

Ian Pratt wrote:

>>OK. I copied all the contents from (hdc3) /dev to (hdc1) 
>>/dev, and that let's me boot xenU on hdc1.  The problem, 
>>however, is that this is not they way RHEL 4 works--I need to 
>>figure out how the xen0 is able to boot off essentially the 
>>same setup.
>>    
>>
>
>Have you tried using the xen0 kernel in the other domain? It's possible
>there's some difference in the .config that is causing this.
>  
>
I tried this just for kicks, and, of course, it worked.

>Ian
>
>
>-------------------------------------------------------
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from real users.
>Discover which products truly live up to the hype. Start reading now. 
>http://productguide.itmanagersjournal.com/
>_______________________________________________
>Xen-devel mailing list
>Xen-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/xen-devel
>
>  
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* RE: Kernel panic - not syncing: Attempted to kill init!
@ 2004-12-22  3:13 Ian Pratt
  2004-12-22 15:39 ` David F Barrera
  0 siblings, 1 reply; 68+ messages in thread
From: Ian Pratt @ 2004-12-22  3:13 UTC (permalink / raw)
  To: David F Barrera, xen-devel

> OK. I copied all the contents from (hdc3) /dev to (hdc1) 
> /dev, and that let's me boot xenU on hdc1.  The problem, 
> however, is that this is not they way RHEL 4 works--I need to 
> figure out how the xen0 is able to boot off essentially the 
> same setup.

Have you tried using the xen0 kernel in the other domain? It's possible
there's some difference in the .config that is causing this.

Ian


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* RE: Kernel panic - not syncing: Attempted to kill init!
@ 2004-12-22  2:30 Ian Pratt
  0 siblings, 0 replies; 68+ messages in thread
From: Ian Pratt @ 2004-12-22  2:30 UTC (permalink / raw)
  To: David F Barrera, Ian Pratt; +Cc: xen-devel

> I believe it.  But RHEL 4 has some differences from RHEL 3, 
> among them the fact that in RHEL 4 the devices in /dev are 
> created dynamically.  
> Thus, if I mount hdc1 and look at /dev, it is empty.  However, /dev in
> hdc3 (xen0) has 671 entries. I have a SuSE 9.0 system where 
> the drive that I export (equivalent to hdc1, in this case) 
> has many devicen on /dev, meaning they are static;  RHEL 3 is similar.

Just to prove this theory, boot native Linux (or dom0), and 'cp -a' the
/dev directory over to the other domain's file system. If you haven't
got a /dev/console bad things can happen.

Ian 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
@ 2004-12-21 21:25 David F Barrera
  0 siblings, 0 replies; 68+ messages in thread
From: David F Barrera @ 2004-12-21 21:25 UTC (permalink / raw)
  To: xen-devel

Ian,

OK. I copied all the contents from (hdc3) /dev to (hdc1) /dev, and that 
let's me boot xenU on hdc1.  The problem, however, is that this is not 
they way RHEL 4 works--I need to figure out how the xen0 is able to boot 
off essentially the same setup.

[root@dyn95394184 xen]# xm list
Name              Id  Mem(MB)  CPU  State  Time(s)  Console
Domain-0           0      495        0      r----    126.0
test1                   1        64        0      -b---       2.0    9601
[root@dyn95394184 xen]#




-------- Original Message --------
Subject: 	Re: [Xen-devel] Kernel panic - not syncing: Attempted to kill 
init!
Date: 	Tue, 21 Dec 2004 12:53:15 -0600
From: 	David F Barrera <dfbp@us.ibm.com>
To: 	xen-devel@lists.sourceforge.net
References: 	<E1CgWrK-0003vv-00@mta1.cl.cam.ac.uk> 
<41C844BA.7020801@us.ibm.com>



Ian,

As I indicated earlier, I created an image file, and I am able to boot 
xenU now:

Red Hat Enterprise Linux Desktop release 3.90 (Nahant)
Kernel 2.6.9-xenU on an i686

(none) login:

I still can't log in, but I will continue to add files to the image to 
make it work.  In the image, I copied the contents of  (hdc3) /dev to 
the  image/dev.  I still don't understand why I can get xenU to boot 
using the system partition (hdc1). I'll keep digging.

David F Barrera

>
>
> Ian Pratt wrote:
>
>>>>> I had tried that (and hda1) before, but sda1 I get an error, too:
>>>>> [root@dyn95394184 xen]# xm create -c test1 vmid=1
>>>>> Using config file "test1".
>>>>> Error: Error creating domain: vbd: Device not found: sda1
>>>>>       
>>>>
>>>> try  disk = [ 'phy:hdc1,0801,w' ]
>>>>
>>>> 0801 == sda1
>>>>     
>>>
>>> No difference.  Same Kernel panic
>>>   
>>
>>
>> Something odd is going on here -- I believe other people have had
>> RHEL3 working.
>>  
>>
> I believe it.  But RHEL 4 has some differences from RHEL 3, among them 
> the fact that in RHEL 4 the devices in /dev are created dynamically.  
> Thus, if I mount hdc1 and look at /dev, it is empty.  However, /dev in 
> hdc3 (xen0) has 671 entries. I have a SuSE 9.0 system where the drive 
> that I export (equivalent to hdc1, in this case) has many devicen on 
> /dev, meaning they are static;  RHEL 3 is similar.
>
>> Can you mount hdc1 in dom 0 OK?
>
> Yes:
>
> [root@dyn95394184 ~]# mount /dev/hdc1 /data1
> [root@dyn95394184 ~]# df
> Filesystem           1K-blocks      Used Available Use% Mounted on
> /dev/hdc3              6372520   2732376   3316436  46% /
> none                    251384         0    251384   0% /dev/shm
> /dev/hdc1              7055144   2422572   4274180  37% /data1
> [root@dyn95394184 ~]#
>
>> Is there an sbin/init
>
> [root@dyn95394184 ~]# ls /data1/sbin/init
> /data1/sbin/init
> [root@dyn95394184 ~]#
>
>> ? Is there
>> a dev directory?  
>>
> Yes, but it is empty:
> [root@dyn95394184 dev]# pwd
> /data1/dev
> [root@dyn95394184 dev]# ls
> [root@dyn95394184 dev]#
>
>> It might be worth enabling the debugging printks in
>> drivers/xen/blkfront/block.h and drivers/xen/blockback/common.h
>> and rebuilding xen0 / xenU.
>>
>>  
>>
> I created an image file to experiment, and it seems to go a little 
> further.  The problem has got to be related to the /dev issue.
>
> disk = [ 'file:/boot/initrd.x86.image,0801,w' ]
> # Set if you want dhcp to allocate the IP address.
> # dhcp="dhcp"
> # Set root device.
> root = "/dev/sda1 ro"
>
>
> Red Hat nash version 4.1.18 starting
> Mounted /proc filesystem
> Mounting sysfs
> Creating /dev
> Starting udev
> Creating root device
> Mounting root filesystem
> Switching to new root
> init started:  BusyBox v1.00-pre10 (2004.06.10-04:09+0000) multi-call 
> binary
> Linux localhost.localdomain 2.6.9-xenU #1 Fri Dec 17 15:50:10 CST 2004 
> i686 unknown
>
>
>> Ian
>>
>>
>>
>>
>>  
>>
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xen-devel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2004-12-21 15:43                   ` David F Barrera
@ 2004-12-21 18:53                     ` David F Barrera
  0 siblings, 0 replies; 68+ messages in thread
From: David F Barrera @ 2004-12-21 18:53 UTC (permalink / raw)
  To: xen-devel


Ian,

As I indicated earlier, I created an image file, and I am able to boot 
xenU now:

Red Hat Enterprise Linux Desktop release 3.90 (Nahant)
Kernel 2.6.9-xenU on an i686

(none) login:

I still can't log in, but I will continue to add files to the image to 
make it work.  In the image, I copied the contents of  (hdc3) /dev to 
the  image/dev.  I still don't understand why I can get xenU to boot 
using the system partition (hdc1). I'll keep digging.

David F Barrera

>
>
> Ian Pratt wrote:
>
>>>>> I had tried that (and hda1) before, but sda1 I get an error, too:
>>>>> [root@dyn95394184 xen]# xm create -c test1 vmid=1
>>>>> Using config file "test1".
>>>>> Error: Error creating domain: vbd: Device not found: sda1
>>>>>       
>>>>
>>>> try  disk = [ 'phy:hdc1,0801,w' ]
>>>>
>>>> 0801 == sda1
>>>>     
>>>
>>> No difference.  Same Kernel panic
>>>   
>>
>>
>> Something odd is going on here -- I believe other people have had
>> RHEL3 working.
>>  
>>
> I believe it.  But RHEL 4 has some differences from RHEL 3, among them 
> the fact that in RHEL 4 the devices in /dev are created dynamically.  
> Thus, if I mount hdc1 and look at /dev, it is empty.  However, /dev in 
> hdc3 (xen0) has 671 entries. I have a SuSE 9.0 system where the drive 
> that I export (equivalent to hdc1, in this case) has many devicen on 
> /dev, meaning they are static;  RHEL 3 is similar.
>
>> Can you mount hdc1 in dom 0 OK?
>
> Yes:
>
> [root@dyn95394184 ~]# mount /dev/hdc1 /data1
> [root@dyn95394184 ~]# df
> Filesystem           1K-blocks      Used Available Use% Mounted on
> /dev/hdc3              6372520   2732376   3316436  46% /
> none                    251384         0    251384   0% /dev/shm
> /dev/hdc1              7055144   2422572   4274180  37% /data1
> [root@dyn95394184 ~]#
>
>> Is there an sbin/init
>
> [root@dyn95394184 ~]# ls /data1/sbin/init
> /data1/sbin/init
> [root@dyn95394184 ~]#
>
>> ? Is there
>> a dev directory?  
>>
> Yes, but it is empty:
> [root@dyn95394184 dev]# pwd
> /data1/dev
> [root@dyn95394184 dev]# ls
> [root@dyn95394184 dev]#
>
>> It might be worth enabling the debugging printks in
>> drivers/xen/blkfront/block.h and drivers/xen/blockback/common.h
>> and rebuilding xen0 / xenU.
>>
>>  
>>
> I created an image file to experiment, and it seems to go a little 
> further.  The problem has got to be related to the /dev issue.
>
> disk = [ 'file:/boot/initrd.x86.image,0801,w' ]
> # Set if you want dhcp to allocate the IP address.
> # dhcp="dhcp"
> # Set root device.
> root = "/dev/sda1 ro"
>
>
> Red Hat nash version 4.1.18 starting
> Mounted /proc filesystem
> Mounting sysfs
> Creating /dev
> Starting udev
> Creating root device
> Mounting root filesystem
> Switching to new root
> init started:  BusyBox v1.00-pre10 (2004.06.10-04:09+0000) multi-call 
> binary
> Linux localhost.localdomain 2.6.9-xenU #1 Fri Dec 17 15:50:10 CST 2004 
> i686 unknown
>
>
>> Ian
>>
>>
>>
>>
>>  
>>
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2004-12-20 23:22                 ` Ian Pratt
@ 2004-12-21 15:43                   ` David F Barrera
  2004-12-21 18:53                     ` David F Barrera
  0 siblings, 1 reply; 68+ messages in thread
From: David F Barrera @ 2004-12-21 15:43 UTC (permalink / raw)
  To: Ian Pratt; +Cc: xen-devel



Ian Pratt wrote:

>>>>I had tried that (and hda1) before, but sda1 I get an error, too:
>>>>[root@dyn95394184 xen]# xm create -c test1 vmid=1
>>>>Using config file "test1".
>>>>Error: Error creating domain: vbd: Device not found: sda1
>>>>        
>>>>
>>>try  disk = [ 'phy:hdc1,0801,w' ]
>>>
>>>0801 == sda1
>>>      
>>>
>>No difference.  Same Kernel panic
>>    
>>
>
>Something odd is going on here -- I believe other people have had
>RHEL3 working.
>  
>
I believe it.  But RHEL 4 has some differences from RHEL 3, among them 
the fact that in RHEL 4 the devices in /dev are created dynamically.  
Thus, if I mount hdc1 and look at /dev, it is empty.  However, /dev in 
hdc3 (xen0) has 671 entries. I have a SuSE 9.0 system where the drive 
that I export (equivalent to hdc1, in this case) has many devicen on 
/dev, meaning they are static;  RHEL 3 is similar.

>Can you mount hdc1 in dom 0 OK? 
>
Yes:

[root@dyn95394184 ~]# mount /dev/hdc1 /data1
[root@dyn95394184 ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hdc3              6372520   2732376   3316436  46% /
none                    251384         0    251384   0% /dev/shm
/dev/hdc1              7055144   2422572   4274180  37% /data1
[root@dyn95394184 ~]#

>Is there an sbin/init 
>
[root@dyn95394184 ~]# ls /data1/sbin/init
/data1/sbin/init
[root@dyn95394184 ~]#

>? Is there
>a dev directory? 
>  
>
Yes, but it is empty:
[root@dyn95394184 dev]# pwd
/data1/dev
[root@dyn95394184 dev]# ls
[root@dyn95394184 dev]#

>It might be worth enabling the debugging printks in
>drivers/xen/blkfront/block.h and drivers/xen/blockback/common.h
>and rebuilding xen0 / xenU.
>
>  
>
I created an image file to experiment, and it seems to go a little 
further.  The problem has got to be related to the /dev issue.

disk = [ 'file:/boot/initrd.x86.image,0801,w' ]
# Set if you want dhcp to allocate the IP address.
# dhcp="dhcp"
# Set root device.
root = "/dev/sda1 ro"


Red Hat nash version 4.1.18 starting
Mounted /proc filesystem
Mounting sysfs
Creating /dev
Starting udev
Creating root device
Mounting root filesystem
Switching to new root
init started:  BusyBox v1.00-pre10 (2004.06.10-04:09+0000) multi-call binary
Linux localhost.localdomain 2.6.9-xenU #1 Fri Dec 17 15:50:10 CST 2004 
i686 unknown
 

>Ian
>
>
>
>
>  
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2004-12-20 19:45               ` David F Barrera
@ 2004-12-20 23:22                 ` Ian Pratt
  2004-12-21 15:43                   ` David F Barrera
  0 siblings, 1 reply; 68+ messages in thread
From: Ian Pratt @ 2004-12-20 23:22 UTC (permalink / raw)
  To: David F Barrera; +Cc: xen-devel, Ian.Pratt

> >>I had tried that (and hda1) before, but sda1 I get an error, too:
> >>[root@dyn95394184 xen]# xm create -c test1 vmid=1
> >>Using config file "test1".
> >>Error: Error creating domain: vbd: Device not found: sda1
> >
> >try  disk = [ 'phy:hdc1,0801,w' ]
> >
> >0801 == sda1
>
> No difference.  Same Kernel panic

Something odd is going on here -- I believe other people have had
RHEL3 working.

Can you mount hdc1 in dom 0 OK? Is there an sbin/init ? Is there
a dev directory?

It might be worth enabling the debugging printks in
drivers/xen/blkfront/block.h and drivers/xen/blockback/common.h
and rebuilding xen0 / xenU.


Ian





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2004-12-20 19:02             ` Ian Pratt
@ 2004-12-20 19:45               ` David F Barrera
  2004-12-20 23:22                 ` Ian Pratt
  0 siblings, 1 reply; 68+ messages in thread
From: David F Barrera @ 2004-12-20 19:45 UTC (permalink / raw)
  To: xen-devel



Ian Pratt wrote:

>># Kernel image file.
>>kernel = "/boot/vmlinuz-2.6.9-xenU"
>># Optional ramdisk.
>>ramdisk = "/boot/initrd-2.6.9-xenU.img"
>># The domain build function. Default is 'linux'.
>>builder='linux'
>># Initial memory allocation (in megabytes) for the new domain.
>>memory = 64
>># A name for your domain. All domains must have different names.
>>name = "test1"
>># disk = [ 'phy:hda1,hda1,r' ]
>>disk = [ 'phy:hdc1,hdc1,w' ]
>># Set if you want dhcp to allocate the IP address.
>>dhcp="dhcp"
>># Set root device.
>>root = "/dev/hdc1 ro/"
>>    
>>
>
>
>The '/' on the end of 'ro' looks odd to me.
>  
>
Thx. Removing it did not make any difference.

>  
>
>>xen_blk: Initialising virtual block device driver
>>Using anticipatory io scheduler
>>xen_net: Initialising virtual ethernet driver.
>>NET: Registered protocol family 2
>>IP: routing cache hash table of 512 buckets, 4Kbytes
>>TCP: Hash tables configured (established 4096 bind 8192)
>>NET: Registered protocol family 1
>>NET: Registered protocol family 17
>>IP-Config: Incomplete network configuration information.
>>Freeing unused kernel memory: 92k freed
>>Red Hat nash version 4.1.18 starting
>>    
>>
>
>I can't see any partitions being found at any point, so you're
>doomed from here on in.
>  
>
Agree.

>  
>
>>I had tried that (and hda1) before, but sda1 I get an error, too:
>>[root@dyn95394184 xen]# xm create -c test1 vmid=1
>>Using config file "test1".
>>Error: Error creating domain: vbd: Device not found: sda1
>>    
>>
>
>
>try  disk = [ 'phy:hdc1,0801,w' ]
>
>0801 == sda1
>  
>
No difference.  Same Kernel panic

>
>
>
>Ian
>
>  
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2004-12-20 16:08           ` David F Barrera
@ 2004-12-20 19:02             ` Ian Pratt
  2004-12-20 19:45               ` David F Barrera
  0 siblings, 1 reply; 68+ messages in thread
From: Ian Pratt @ 2004-12-20 19:02 UTC (permalink / raw)
  To: David F Barrera; +Cc: xen-devel, Ian.Pratt


> # Kernel image file.
> kernel = "/boot/vmlinuz-2.6.9-xenU"
> # Optional ramdisk.
> ramdisk = "/boot/initrd-2.6.9-xenU.img"
> # The domain build function. Default is 'linux'.
> builder='linux'
> # Initial memory allocation (in megabytes) for the new domain.
> memory = 64
> # A name for your domain. All domains must have different names.
> name = "test1"
> # disk = [ 'phy:hda1,hda1,r' ]
> disk = [ 'phy:hdc1,hdc1,w' ]
> # Set if you want dhcp to allocate the IP address.
> dhcp="dhcp"
> # Set root device.
> root = "/dev/hdc1 ro/"


The '/' on the end of 'ro' looks odd to me.

> xen_blk: Initialising virtual block device driver
> Using anticipatory io scheduler
> xen_net: Initialising virtual ethernet driver.
> NET: Registered protocol family 2
> IP: routing cache hash table of 512 buckets, 4Kbytes
> TCP: Hash tables configured (established 4096 bind 8192)
> NET: Registered protocol family 1
> NET: Registered protocol family 17
> IP-Config: Incomplete network configuration information.
> Freeing unused kernel memory: 92k freed
> Red Hat nash version 4.1.18 starting

I can't see any partitions being found at any point, so you're
doomed from here on in.

> I had tried that (and hda1) before, but sda1 I get an error, too:
> [root@dyn95394184 xen]# xm create -c test1 vmid=1
> Using config file "test1".
> Error: Error creating domain: vbd: Device not found: sda1


try  disk = [ 'phy:hdc1,0801,w' ]

0801 == sda1




Ian


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2004-12-18 18:18         ` Ian Pratt
  2004-12-20 16:08           ` David F Barrera
@ 2004-12-20 17:53           ` David F Barrera
  1 sibling, 0 replies; 68+ messages in thread
From: David F Barrera @ 2004-12-20 17:53 UTC (permalink / raw)
  To: Ian Pratt; +Cc: xen-devel

Ian,

One thing about RHEL 4 is that the devices in /dev seem to be created 
dynamically, at boot time.  When I mount the 'hdc1' partition and go to 
the /dev directory, there is nothing in it, as on a SuSE 9.0 or earlier 
Red Hat installs.  That is why I need an initrd, I suppose, to make or 
create those devices.

David

Ian Pratt wrote:

>>Derrick,
>>
>>I rebuilt the xenU kernel, with the devfs support disabled, and it makes 
>>no difference. It behaves in the same manner as the pre-built kernel 
>>that's included with the binary pack.  I am at a loss. I've been able to 
>>boot a kernel under xen on a SuSE Linux 9.0 machine, so I've had a 
>>little experience with this:-) 
>>    
>>
>
>David, earlier in the boot messages do you see the hdc1 partition
>being found when the partition check happens?
>
>You'll need to export the partition 'rw' eventually, but that's
>not your current problem.
>
>You might like to try exporting it as 'sda1' or something to see
>if that helps. Not sure why it would, but I've heard folklore
>along these lines. 
>
>Adding some more debugging to the linuxrc nash script might shed
>some light on the problem. 
>
>Also, what happens if you skip the initrd and try booting
>directly off the disk. I doubt there's anything in the initrd you
>need.
>
>Ian
>
> 
>  
>
>>Freeing unused kernel memory: 92k freed
>>Red Hat nash version 4.1.18 starting
>>Mounted /proc filesystem
>>Mounting sysfs
>>Creating /dev
>>Starting udev
>>Creating root device
>>Mounting root filesystem
>>mount: error 6 mounting ext3
>>mount: error 2 mounting none
>>Switching to new root
>>switchroot: mount failed: 22
>>umount /initrd/dev failed: 2
>>Kernel panic - not syncing: Attempted to kill init!
>> <0>Rebooting in 1 seconds..
>>
>>
>>David Barrera
>>
>>
>>Derrik Pates wrote:
>>
>>    
>>
>>>David F Barrera wrote:
>>>
>>>      
>>>
>>>>The distro I am using is  RHEL 4 Beta 2 (Red Hat Enterprise Linux 
>>>>Desktop release 3.90 (Nahant)
>>>>        
>>>>
>>>      
>>>
>>>>/dev/hdc1               /                       ext2    
>>>>defaults        1 1
>>>>        
>>>>
>>>      
>>>
>>>>LABEL=SWAP-hdc2         swap                    swap    
>>>>defaults        0 0
>>>>/dev/hda                /media/cdrom            auto    
>>>>pamconsole,fscontext=system_u:object_r:removable_t,ro,exec,noauto,managed 
>>>>0 0
>>>>        
>>>>
>>>      
>>>
>>>># disk = [ 'phy:hda1,hda1,r' ]
>>>>disk = [ 'phy:hdc1,hdc1,r' ]
>>>>        
>>>>
>>>Well, the configuration of the virtual disk looks correct; the swap 
>>>might disagree with it, but that shouldn't appear until later in the 
>>>boot process. Perhaps it's an interaction with devfs? Do you have 
>>>devfs enabled in your xenU (unprivileged domain) kernel? This gave me 
>>>fits when I first began using Xen, mostly because it seems that the 
>>>xenU prebuilt kernel that's included with the binary pack has devfs 
>>>support enabled, and this breaks things. The only other possibility I 
>>>can think of is that you need to change the block-device import to 
>>>read-write.
>>>
>>>      
>>>
>>-------------------------------------------------------
>>SF email is sponsored by - The IT Product Guide
>>Read honest & candid reviews on hundreds of IT Products from real users.
>>Discover which products truly live up to the hype. Start reading now. 
>>http://productguide.itmanagersjournal.com/
>>_______________________________________________
>>Xen-devel mailing list
>>Xen-devel@lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/xen-devel
>>    
>>
>
>
>
>-------------------------------------------------------
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from real users.
>Discover which products truly live up to the hype. Start reading now. 
>http://productguide.itmanagersjournal.com/
>_______________________________________________
>Xen-devel mailing list
>Xen-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/xen-devel
>
>  
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2004-12-18 18:18         ` Ian Pratt
@ 2004-12-20 16:08           ` David F Barrera
  2004-12-20 19:02             ` Ian Pratt
  2004-12-20 17:53           ` David F Barrera
  1 sibling, 1 reply; 68+ messages in thread
From: David F Barrera @ 2004-12-20 16:08 UTC (permalink / raw)
  To: xen-devel

Ian,

Thanks for the reply and the suggestions. Some details about my setup:
/dev/hdc3  is where xen0 is running
/dev/hdc1 --  another partition that actually has a copy of RHEL 4  Beta 
2 installed (working OS)
/etc/fstab:
# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/hdc3               /                       ext2    defaults        1 1
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs   defaults        0 0
none                    /proc                   proc    defaults        0 0
none                    /sys                    sysfs   defaults        0 0
/dev/hdc2               swap                    swap    defaults        0 0
/dev/hda                /media/cdrom            auto    
pamconsole,ro,exec,noauto,managed 0 0
~

The config file that I am using:

# Kernel image file.
kernel = "/boot/vmlinuz-2.6.9-xenU"
# Optional ramdisk.
ramdisk = "/boot/initrd-2.6.9-xenU.img"
# The domain build function. Default is 'linux'.
builder='linux'
# Initial memory allocation (in megabytes) for the new domain.
memory = 64
# A name for your domain. All domains must have different names.
name = "test1"
# disk = [ 'phy:hda1,hda1,r' ]
disk = [ 'phy:hdc1,hdc1,w' ]
# Set if you want dhcp to allocate the IP address.
dhcp="dhcp"
# Set root device.
root = "/dev/hdc1 ro/"
# Sets runlevel 4.
extra = "4"
#============================================================================
~


Ian Pratt wrote:

>>Derrick,
>>
>>I rebuilt the xenU kernel, with the devfs support disabled, and it makes 
>>no difference. It behaves in the same manner as the pre-built kernel 
>>that's included with the binary pack.  I am at a loss. I've been able to 
>>boot a kernel under xen on a SuSE Linux 9.0 machine, so I've had a 
>>little experience with this:-) 
>>    
>>
>
>David, earlier in the boot messages do you see the hdc1 partition
>being found when the partition check happens?
>  
>
This is the entire log:

Linux version 2.6.9-xenU (root@dyn95394184.austin.ibm.com) (gcc version 
3.4.2 20041017 (Red Hat 3.4.2-6.fc3)) #1 Fri Dec 17 15:50:10 CST 2004
BIOS-provided physical RAM map:
 Xen: 0000000000000000 - 0000000004000000 (usable)
64MB LOWMEM available.
DMI not present.
Built 1 zonelists
Kernel command line:  ip=:1.2.3.4::::eth0:dhcp root=/dev/hdc1 ro/ 4
Initializing CPU#0
PID hash table entries: 512 (order: 9, 8192 bytes)
Xen reported: 866.697 MHz processor.
Using tsc for high-res timesource
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 61900k/65536k available (1569k kernel code, 3596k reserved, 429k 
data, 92k init, 0k highmem)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: L1 I cache: 16K, L1 D cache: 16K
CPU: L2 cache: 256K
CPU: Intel Pentium III (Coppermine) stepping 06
Enabling unmasked SIMD FPU exception support... done.
Checking 'hlt' instruction... disabled
checking if image is initramfs... it is
Freeing initrd memory: 600k freed
NET: Registered protocol family 16
Initializing Cryptographic API
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
Xen virtual console successfully installed as tty
Event-channel device installed.
Starting Xen Balloon driver
xen_blk: Initialising virtual block device driver
Using anticipatory io scheduler
xen_net: Initialising virtual ethernet driver.
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 8192)
NET: Registered protocol family 1
NET: Registered protocol family 17
IP-Config: Incomplete network configuration information.
Freeing unused kernel memory: 92k freed
Red Hat nash version 4.1.18 starting
Mounted /proc filesystem
Mounting sysfs
Creating /dev
Starting udev
Creating root device
Mounting root filesystem
mount: error 6 mounting ext2
mount: error 2 mounting none
Switching to new root
switchroot: mount failed: 22
umount /initrd/dev failed: 2
Kernel panic - not syncing: Attempted to kill init!
 <0>Rebooting in 1 seconds..


>You'll need to export the partition 'rw' eventually, but that's
>not your current problem.
>  
>
Right. Already tried it.

>You might like to try exporting it as 'sda1' or something to see
>if that helps. Not sure why it would, but I've heard folklore
>along these lines. 
>  
>
I had tried that (and hda1) before, but sda1 I get an error, too:
[root@dyn95394184 xen]# xm create -c test1 vmid=1
Using config file "test1".
Error: Error creating domain: vbd: Device not found: sda1

>Adding some more debugging to the linuxrc nash script might shed
>some light on the problem. 
>  
>
I need to find out how to do this first...

>Also, what happens if you skip the initrd and try booting
>directly off the disk. I doubt there's anything in the initrd you
>need.
>  
>
I had tried it, also.  I get a VFS error if I don't use an initrd

VFS: Cannot open root device "hdc1" or unknown-block(2,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on 
unknown-block(2,0)
 <0>Rebooting in 1 seconds..


>Ian
>
> 
>  
>
>>Freeing unused kernel memory: 92k freed
>>Red Hat nash version 4.1.18 starting
>>Mounted /proc filesystem
>>Mounting sysfs
>>Creating /dev
>>Starting udev
>>Creating root device
>>Mounting root filesystem
>>mount: error 6 mounting ext3
>>mount: error 2 mounting none
>>Switching to new root
>>switchroot: mount failed: 22
>>umount /initrd/dev failed: 2
>>Kernel panic - not syncing: Attempted to kill init!
>> <0>Rebooting in 1 seconds..
>>
>>
>>David Barrera
>>
>>
>>Derrik Pates wrote:
>>
>>    
>>
>>>David F Barrera wrote:
>>>
>>>      
>>>
>>>>The distro I am using is  RHEL 4 Beta 2 (Red Hat Enterprise Linux 
>>>>Desktop release 3.90 (Nahant)
>>>>        
>>>>
>>>      
>>>
>>>>/dev/hdc1               /                       ext2    
>>>>defaults        1 1
>>>>        
>>>>
>>>      
>>>
>>>>LABEL=SWAP-hdc2         swap                    swap    
>>>>defaults        0 0
>>>>/dev/hda                /media/cdrom            auto    
>>>>pamconsole,fscontext=system_u:object_r:removable_t,ro,exec,noauto,managed 
>>>>0 0
>>>>        
>>>>
>>>      
>>>
>>>># disk = [ 'phy:hda1,hda1,r' ]
>>>>disk = [ 'phy:hdc1,hdc1,r' ]
>>>>        
>>>>
>>>Well, the configuration of the virtual disk looks correct; the swap 
>>>might disagree with it, but that shouldn't appear until later in the 
>>>boot process. Perhaps it's an interaction with devfs? Do you have 
>>>devfs enabled in your xenU (unprivileged domain) kernel? This gave me 
>>>fits when I first began using Xen, mostly because it seems that the 
>>>xenU prebuilt kernel that's included with the binary pack has devfs 
>>>support enabled, and this breaks things. The only other possibility I 
>>>can think of is that you need to change the block-device import to 
>>>read-write.
>>>
>>>      
>>>
>>-------------------------------------------------------
>>SF email is sponsored by - The IT Product Guide
>>Read honest & candid reviews on hundreds of IT Products from real users.
>>Discover which products truly live up to the hype. Start reading now. 
>>http://productguide.itmanagersjournal.com/
>>_______________________________________________
>>Xen-devel mailing list
>>Xen-devel@lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/xen-devel
>>    
>>
>
>
>
>-------------------------------------------------------
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from real users.
>Discover which products truly live up to the hype. Start reading now. 
>http://productguide.itmanagersjournal.com/
>_______________________________________________
>Xen-devel mailing list
>Xen-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/xen-devel
>
>  
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2004-12-17 20:39       ` David F Barrera
@ 2004-12-18 18:18         ` Ian Pratt
  2004-12-20 16:08           ` David F Barrera
  2004-12-20 17:53           ` David F Barrera
  0 siblings, 2 replies; 68+ messages in thread
From: Ian Pratt @ 2004-12-18 18:18 UTC (permalink / raw)
  To: David F Barrera; +Cc: xen-devel, Ian.Pratt

> Derrick,
> 
> I rebuilt the xenU kernel, with the devfs support disabled, and it makes 
> no difference. It behaves in the same manner as the pre-built kernel 
> that's included with the binary pack.  I am at a loss. I've been able to 
> boot a kernel under xen on a SuSE Linux 9.0 machine, so I've had a 
> little experience with this:-) 

David, earlier in the boot messages do you see the hdc1 partition
being found when the partition check happens?

You'll need to export the partition 'rw' eventually, but that's
not your current problem.

You might like to try exporting it as 'sda1' or something to see
if that helps. Not sure why it would, but I've heard folklore
along these lines. 

Adding some more debugging to the linuxrc nash script might shed
some light on the problem. 

Also, what happens if you skip the initrd and try booting
directly off the disk. I doubt there's anything in the initrd you
need.

Ian

 
> Freeing unused kernel memory: 92k freed
> Red Hat nash version 4.1.18 starting
> Mounted /proc filesystem
> Mounting sysfs
> Creating /dev
> Starting udev
> Creating root device
> Mounting root filesystem
> mount: error 6 mounting ext3
> mount: error 2 mounting none
> Switching to new root
> switchroot: mount failed: 22
> umount /initrd/dev failed: 2
> Kernel panic - not syncing: Attempted to kill init!
>  <0>Rebooting in 1 seconds..
> 
> 
> David Barrera
> 
> 
> Derrik Pates wrote:
> 
> > David F Barrera wrote:
> >
> >> The distro I am using is  RHEL 4 Beta 2 (Red Hat Enterprise Linux 
> >> Desktop release 3.90 (Nahant)
> >
> >
> >> /dev/hdc1               /                       ext2    
> >> defaults        1 1
> >
> >
> >> LABEL=SWAP-hdc2         swap                    swap    
> >> defaults        0 0
> >> /dev/hda                /media/cdrom            auto    
> >> pamconsole,fscontext=system_u:object_r:removable_t,ro,exec,noauto,managed 
> >> 0 0
> >
> >
> >> # disk = [ 'phy:hda1,hda1,r' ]
> >> disk = [ 'phy:hdc1,hdc1,r' ]
> >
> >
> > Well, the configuration of the virtual disk looks correct; the swap 
> > might disagree with it, but that shouldn't appear until later in the 
> > boot process. Perhaps it's an interaction with devfs? Do you have 
> > devfs enabled in your xenU (unprivileged domain) kernel? This gave me 
> > fits when I first began using Xen, mostly because it seems that the 
> > xenU prebuilt kernel that's included with the binary pack has devfs 
> > support enabled, and this breaks things. The only other possibility I 
> > can think of is that you need to change the block-device import to 
> > read-write.
> >
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now. 
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/xen-devel



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2004-12-16 18:04     ` Derrik Pates
  2004-12-16 19:29       ` David F Barrera
@ 2004-12-17 20:39       ` David F Barrera
  2004-12-18 18:18         ` Ian Pratt
  1 sibling, 1 reply; 68+ messages in thread
From: David F Barrera @ 2004-12-17 20:39 UTC (permalink / raw)
  To: xen-devel

Derrick,

I rebuilt the xenU kernel, with the devfs support disabled, and it makes 
no difference. It behaves in the same manner as the pre-built kernel 
that's included with the binary pack.  I am at a loss. I've been able to 
boot a kernel under xen on a SuSE Linux 9.0 machine, so I've had a 
little experience with this:-) 

Freeing unused kernel memory: 92k freed
Red Hat nash version 4.1.18 starting
Mounted /proc filesystem
Mounting sysfs
Creating /dev
Starting udev
Creating root device
Mounting root filesystem
mount: error 6 mounting ext3
mount: error 2 mounting none
Switching to new root
switchroot: mount failed: 22
umount /initrd/dev failed: 2
Kernel panic - not syncing: Attempted to kill init!
 <0>Rebooting in 1 seconds..


David Barrera


Derrik Pates wrote:

> David F Barrera wrote:
>
>> The distro I am using is  RHEL 4 Beta 2 (Red Hat Enterprise Linux 
>> Desktop release 3.90 (Nahant)
>
>
>> /dev/hdc1               /                       ext2    
>> defaults        1 1
>
>
>> LABEL=SWAP-hdc2         swap                    swap    
>> defaults        0 0
>> /dev/hda                /media/cdrom            auto    
>> pamconsole,fscontext=system_u:object_r:removable_t,ro,exec,noauto,managed 
>> 0 0
>
>
>> # disk = [ 'phy:hda1,hda1,r' ]
>> disk = [ 'phy:hdc1,hdc1,r' ]
>
>
> Well, the configuration of the virtual disk looks correct; the swap 
> might disagree with it, but that shouldn't appear until later in the 
> boot process. Perhaps it's an interaction with devfs? Do you have 
> devfs enabled in your xenU (unprivileged domain) kernel? This gave me 
> fits when I first began using Xen, mostly because it seems that the 
> xenU prebuilt kernel that's included with the binary pack has devfs 
> support enabled, and this breaks things. The only other possibility I 
> can think of is that you need to change the block-device import to 
> read-write.
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2004-12-16 18:04     ` Derrik Pates
@ 2004-12-16 19:29       ` David F Barrera
  2004-12-17 20:39       ` David F Barrera
  1 sibling, 0 replies; 68+ messages in thread
From: David F Barrera @ 2004-12-16 19:29 UTC (permalink / raw)
  To: xen-devel

Derrik ,

Thanks for the feedback.

Derrik Pates wrote:

> David F Barrera wrote:
>
>> The distro I am using is  RHEL 4 Beta 2 (Red Hat Enterprise Linux 
>> Desktop release 3.90 (Nahant)
>
>
>> /dev/hdc1               /                       ext2    
>> defaults        1 1
>
>
>> LABEL=SWAP-hdc2         swap                    swap    
>> defaults        0 0
>> /dev/hda                /media/cdrom            auto    
>> pamconsole,fscontext=system_u:object_r:removable_t,ro,exec,noauto,managed 
>> 0 0
>
>
>> # disk = [ 'phy:hda1,hda1,r' ]
>> disk = [ 'phy:hdc1,hdc1,r' ]
>
>
> Well, the configuration of the virtual disk looks correct; the swap 
> might disagree with it, but that shouldn't appear until later in the 
> boot process. Perhaps it's an interaction with devfs? Do you have 
> devfs enabled in your xenU (unprivileged domain) kernel? This gave me 
> fits when I first began using Xen, mostly because it seems that the 
> xenU prebuilt kernel that's included with the binary pack has devfs 
> support enabled, and this breaks things. 

I will try rebuilding the xenU kernel.

> The only other possibility I can think of is that you need to change 
> the block-device import to read-write.

I've already tried changing the block-device import to read-write. No 
difference.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2004-12-16 14:41   ` David F Barrera
@ 2004-12-16 18:04     ` Derrik Pates
  2004-12-16 19:29       ` David F Barrera
  2004-12-17 20:39       ` David F Barrera
  0 siblings, 2 replies; 68+ messages in thread
From: Derrik Pates @ 2004-12-16 18:04 UTC (permalink / raw)
  To: David F Barrera; +Cc: xen-devel

David F Barrera wrote:
> The distro I am using is  RHEL 4 Beta 2 (Red Hat Enterprise Linux 
> Desktop release 3.90 (Nahant)

> /dev/hdc1               /                       ext2    defaults        1 1

> LABEL=SWAP-hdc2         swap                    swap    defaults        0 0
> /dev/hda                /media/cdrom            auto    
> pamconsole,fscontext=system_u:object_r:removable_t,ro,exec,noauto,managed 
> 0 0

> # disk = [ 'phy:hda1,hda1,r' ]
> disk = [ 'phy:hdc1,hdc1,r' ]

Well, the configuration of the virtual disk looks correct; the swap 
might disagree with it, but that shouldn't appear until later in the 
boot process. Perhaps it's an interaction with devfs? Do you have devfs 
enabled in your xenU (unprivileged domain) kernel? This gave me fits 
when I first began using Xen, mostly because it seems that the xenU 
prebuilt kernel that's included with the binary pack has devfs support 
enabled, and this breaks things. The only other possibility I can think 
of is that you need to change the block-device import to read-write.

-- 
Derrik Pates
dpates@dsdk12.net


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2004-12-16  0:07 ` Derrik Pates
@ 2004-12-16 14:41   ` David F Barrera
  2004-12-16 18:04     ` Derrik Pates
  0 siblings, 1 reply; 68+ messages in thread
From: David F Barrera @ 2004-12-16 14:41 UTC (permalink / raw)
  To: xen-devel

Derrik,

Thanks for your response.  Of course I should have given more details! 
(my bad).

The distro I am using is  RHEL 4 Beta 2 (Red Hat Enterprise Linux 
Desktop release 3.90 (Nahant)

 >>What does the fstab for the domain's root FS look like?

/dev/hdc1               /                       ext2    defaults        1 1
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs   defaults        0 0
none                    /proc                   proc    defaults        0 0
none                    /sys                    sysfs   defaults        0 0
LABEL=SWAP-hdc2         swap                    swap    defaults        0 0
/dev/hda                /media/cdrom            auto    
pamconsole,fscontext=system_u:object_r:removable_t,ro,exec,noauto,managed 
0 0
/dev/fd0                /media/floppy           auto    
pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0


 >>Also, what does your domain definition file look like?

#----------------------------------------------------------------------------START 
OF DEFINITION FILE
# Kernel image file.
kernel = "/boot/vmlinuz-2.6.9-xenU"

# Optional ramdisk.
ramdisk = "/boot/initrd-fc3.img"

# The domain build function. Default is 'linux'.
builder='linux'

# Initial memory allocation (in megabytes) for the new domain.
memory = 64

# A name for your domain. All domains must have different names.
name = "test1"

# disk = [ 'phy:hda1,hda1,r' ]
disk = [ 'phy:hdc1,hdc1,r' ]

# Set if you want dhcp to allocate the IP address.
dhcp="dhcp"
# Set root device.

root = "/dev/hdc1 ro"

# Sets runlevel 4.
extra = "4"
#---------------------------------------------------------------------------- 
END OF DEFINITION FILE  


Derrik Pates wrote:

> David F Barrera wrote:
>
>> I am trying to create an additional domain and have created a 
>> configuration file based on the examples.  When I try to boot the 
>> domain, it eventually hits a Kernel panic, as follows:
>>
>> Red Hat nash version 4.1.18 starting
>> Mounted /proc filesystem
>> Mounting sysfs
>> Creating /dev
>> Starting udev
>> Creating root device
>> Mounting root filesystem
>> mount: error 6 mounting ext3
>> mount: error 2 mounting none
>> Switching to new root
>> switchroot: mount failed: 22
>> umount /initrd/dev failed: 2
>> Kernel panic - not syncing: Attempted to kill init!
>> <0>Rebooting in 1 seconds..
>> -----------------------------------
>
>
> Which RH flavor is this? I've so far had Fedora Core 2 and 3, as well 
> as CentOS, running happily inside a Xen domain. What does the fstab 
> for the domain's root FS look like? Also, what does your domain 
> definition file look like?
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2004-12-15 20:40 David F Barrera
@ 2004-12-16  0:07 ` Derrik Pates
  2004-12-16 14:41   ` David F Barrera
  0 siblings, 1 reply; 68+ messages in thread
From: Derrik Pates @ 2004-12-16  0:07 UTC (permalink / raw)
  To: David F Barrera; +Cc: xen-devel

David F Barrera wrote:
> I am trying to create an additional domain and have created a 
> configuration file based on the examples.  When I try to boot the 
> domain, it eventually hits a Kernel panic, as follows:
> 
> Red Hat nash version 4.1.18 starting
> Mounted /proc filesystem
> Mounting sysfs
> Creating /dev
> Starting udev
> Creating root device
> Mounting root filesystem
> mount: error 6 mounting ext3
> mount: error 2 mounting none
> Switching to new root
> switchroot: mount failed: 22
> umount /initrd/dev failed: 2
> Kernel panic - not syncing: Attempted to kill init!
> <0>Rebooting in 1 seconds..
> -----------------------------------

Which RH flavor is this? I've so far had Fedora Core 2 and 3, as well as 
CentOS, running happily inside a Xen domain. What does the fstab for the 
domain's root FS look like? Also, what does your domain definition file 
look like?

-- 
Derrik Pates
dpates@dsdk12.net


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Kernel panic - not syncing: Attempted to kill init!
@ 2004-12-15 20:40 David F Barrera
  2004-12-16  0:07 ` Derrik Pates
  0 siblings, 1 reply; 68+ messages in thread
From: David F Barrera @ 2004-12-15 20:40 UTC (permalink / raw)
  To: xen-devel

I am trying to create an additional domain and have created a 
configuration file based on the examples.  When I try to boot the 
domain, it eventually hits a Kernel panic, as follows:

Red Hat nash version 4.1.18 starting
Mounted /proc filesystem
Mounting sysfs
Creating /dev
Starting udev
Creating root device
Mounting root filesystem
mount: error 6 mounting ext3
mount: error 2 mounting none
Switching to new root
switchroot: mount failed: 22
umount /initrd/dev failed: 2
Kernel panic - not syncing: Attempted to kill init!
 <0>Rebooting in 1 seconds..
-----------------------------------

I have tried using an initrd file, but it makes no difference. Any ideas 
or suggestions will be greatly appreciated!





David Barrera


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

^ permalink raw reply	[flat|nested] 68+ messages in thread

end of thread, other threads:[~2012-11-26  7:53 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-16 23:23 2.6.31 kernel for mips compile failure - war.h:12:17: error: war.h: No such file or directory myuboot
2009-10-16 23:41 ` myuboot
2009-10-16 23:50 ` David Daney
2009-10-19 23:49   ` myuboot
2009-10-19 23:56   ` serial port 8250 messed up after coverting from little endian to big endian on kernel 2.6.31 myuboot
2009-10-20  6:17     ` Florian Fainelli
2009-10-20 15:52       ` myuboot
2009-10-27 20:40       ` myuboot
2009-10-28  8:35         ` Shmulik Ladkani
2009-10-28 11:04           ` Sergei Shtylyov
2009-10-28 19:36             ` myuboot
2009-10-29  8:26               ` Shmulik Ladkani
2009-11-02 23:54                 ` myuboot
2009-12-04  1:52           ` PIR OFFSET for AR7 myuboot
2009-12-04 16:03             ` Thomas Bogendoerfer
2009-12-04 17:30               ` myuboot
2009-11-11  0:22   ` Kernel panic - not syncing: Attempted to kill init! myuboot
2009-11-11  7:45     ` Gaye Abdoulaye Walsimou
2009-11-11 15:48       ` myuboot
2009-11-17  0:21       ` problem bring up initramfs and busybox myuboot
2009-11-17  9:33         ` Ralf Baechle
2009-11-17 17:39           ` myuboot
2009-11-17 17:48             ` Florian Fainelli
2009-11-17 21:09               ` myuboot
2009-11-17 21:02             ` Kevin D. Kissell
2009-11-17 21:54               ` Chris Dearman
2009-11-18  0:31                 ` myuboot
2009-11-18  0:39                   ` Florian Fainelli
2009-11-18  0:58                     ` myuboot
2009-11-18  1:03                       ` David VomLehn
2009-11-18 16:11                         ` myuboot
2009-11-18 16:29                         ` myuboot
2009-11-26  0:24                         ` myuboot
2009-11-26  8:45                           ` Florian Fainelli
2009-11-26 18:23                             ` myuboot
2009-12-05  0:18                             ` myuboot
2010-01-19 19:51   ` loadable kernel module link failure - endianness incompatible with that of the selected emulation myuboot
2010-01-19 23:47     ` David Daney
2010-01-20 16:10       ` myuboot
  -- strict thread matches above, loose matches on Subject: below --
2012-11-22  9:19 Kernel panic - not syncing: Attempted to kill init! Woody Wu
2012-11-22  9:50 ` Jello huang
2012-11-26  7:40   ` Woody Wu
2012-11-26  7:51     ` Baruch Siach
2012-11-26  7:53       ` Woody Wu
2011-07-13  2:57 史星星(研六 福州)
2011-07-13  4:02 ` Vladimir Murzin
2011-07-13  4:16   ` 史星星(研六 福州)
2008-04-10  2:07 Kernel Panic " Sreen Tallam
2008-04-10  8:50 ` Sebastian Siewior
2008-04-10 16:53   ` Sreen Tallam
2004-12-22  3:13 Kernel panic " Ian Pratt
2004-12-22 15:39 ` David F Barrera
2004-12-22  2:30 Ian Pratt
2004-12-21 21:25 David F Barrera
2004-12-15 20:40 David F Barrera
2004-12-16  0:07 ` Derrik Pates
2004-12-16 14:41   ` David F Barrera
2004-12-16 18:04     ` Derrik Pates
2004-12-16 19:29       ` David F Barrera
2004-12-17 20:39       ` David F Barrera
2004-12-18 18:18         ` Ian Pratt
2004-12-20 16:08           ` David F Barrera
2004-12-20 19:02             ` Ian Pratt
2004-12-20 19:45               ` David F Barrera
2004-12-20 23:22                 ` Ian Pratt
2004-12-21 15:43                   ` David F Barrera
2004-12-21 18:53                     ` David F Barrera
2004-12-20 17:53           ` David F Barrera

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.