Subject: 2.2.13 problems

From: David Sean Friedman <[email-masked]>
Date: Fri, 12 Nov 1999 17:18:42 -0500 (EST)

I've been trying to get 2.2.13 to boot on an ebsa285 for the past few
days. I've been using 2.2.10-rmk2 without any problems, booting from a
ramdisk in the flash ROM.

It seems that the image is not properly uncompressed, resulting in ext2
errors. After a lot of debugging, I've noticed that the first call to
block_write() by gunzip() only writes 2k not all 32k. This appears to be
caused by stack corruption. A variable in block_write() is overwritten
with the address of nr_free_pages. 

Since the arm linux patch doesn't touch any of the code in
block_write(), I assumed the corruption was caused by an interrupt or an
exception. So I turned on the debug messages for exception handling and
I put cli/sti around the section where the corruption occurred. 

The board is being used in add-in mode, with only the patches from Mark
van Doesburg's for loading the arm kernel into the ebsa's RAM from the
host. The board still boots with an old 2.2.10-rmk2 kernel.

I am out of ideas on what else could cause this problem. If anyone has
any suggestions, please let me know.

Thanks,

David Friedman 

unsubscribe: body of `unsubscribe linux-arm-kernel' to [email-masked]

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Fri, 12 Nov 1999 23:18:07 +0000 (GMT)

> with the address of nr_free_pages. 

I've just asked Alan about this, and he says he hasn't received any bug
reports from the rest of the Linux masses, so I guess that this isn't a
generic kernel bug.  Can you give details of exactly how you built the
kernel (ie, which make commands from unpacking, patching, configuring),
and the versions of your ARM toolchain, and what host you are building
the kernel on?
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |  http://www.arm.linux.org.uk/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |

---

From: David Sean Friedman <[email-masked]>
Date: Fri, 12 Nov 1999 19:24:03 -0500 (EST)

Excerpts from arm-linux: 12-Nov-99 Re: 2.2.13 problems by Russell A. L.
Admin@arm. 
> and the versions of your ARM toolchain, and what host you are building
I got the kernel from kernel.org, and I applied the patch-2.2.13-rmk1
like this:

patch -p0 < patch-2.2.13-rmk1

Since I was building on x86, I changed the Makefile so that it would
compile for arm, instead of the host arch. 

Then I applied the fix for HOSTCFLAGS that I posted here a few days ago.

Next I applied a modified patch from Mark's co285 patch. This just adds
the symbols boot_command_line and boot_memory_end. It looks like this:

--- ../new_kernel/linux-2.2.10-orig/arch/arm/kernel/head-armv.S Wed Jul 
7 15:30
:09 1999
+++ linux/arch/arm/kernel/head-armv.S   Mon Jul 12 18:32:33 1999
@@ -10,6 +10,10 @@
 
                .globl  SYMBOL_NAME(swapper_pg_dir)
                .equ    SYMBOL_NAME(swapper_pg_dir),    TEXTADDR - 0x4000
+               .globl  SYMBOL_NAME(boot_command_line)
+               .equ    SYMBOL_NAME(boot_command_line), TEXTADDR - 0x5000
+               .globl  SYMBOL_NAME(boot_memory_end)
+               .equ    SYMBOL_NAME(boot_memory_end),   TEXTADDR - 0x4004
 
                .section ".text.init",#alloc,#execinstr
 ENTRY(stext)

I applied this in the same way as patch-2.2.13-rmk1.

Next I patched arch/arm/kernel/setup.c to set up the ramdisk. This
includes setting the ROOT_DEV and providing the correct arguments for
setup_ram() and setup_initrd(). BTW, check_initrd does not seem to
handle ramdisks loaded from ROM correctly, since the ROM is located at
an address beyond the end of memory.

Then I configured the kernel with only what I need to have it boot: 
Footbridge, not host mode, sa110
Binfmt-elf
Ramdisk, initrd
non-standard serial, console on 21285 serial
procfs, ext2fs
frame pointer, and verbose kernel and user messages

Then I compile it with gcc-2.95.2 and binutils 2.9.5.0.16. These were
built without any patches.

To boot the kernel, I use Mark's co285 modules on the host machine:
insmod arm_run.o
echo -n 'debug' > /dev/arm0_config
cat zImage > /dev/arm0

The kernel will start to boot and then panic after it receives an error
in ext2_check_descriptors.

Let me know if you need more detail.

Thanks,

David Friedman