Skip to contentSkip to conversation

: for poor sools with old I2 & 64 bits kernel

PATCH In review Juan Quintela 4 participants 13 messages Dec 19, 2002 – Dec 23, 2002 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : for poor sools with old I2 & 64 bits kernel

Hi
this small patch made possible to compile a 64bit kernel for people that have old proms that only accept ecoff. As usual stolen from the 32 bits version.

The easiest way is creating the file in arch/mips/boot, otherwise we need to copy elf2ecoff.c to mips64.

Later, Juan.

Index: arch/mips64/Makefile
===================================================================
RCS file: /home/cvs/linux/arch/mips64/Makefile,v
retrieving revision 1.22.2.20

mips64/Makefile +3 -0
diff -u -r1.22.2.20 Makefile
@@ -255,6 +255,9 @@
 	$(OBJCOPY) -O $(64bit-bfd) --remove-section=.reginfo --change-addresses=0xa800000080000000 $< $@
 endif
 
+vmlinux.ecoff: vmlinux
+	$(MAKE) -C arch/mips/boot $@
+
 zImage: vmlinux
 	@$(MAKEBOOT) zImage
 
Signature · 2 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
#1 lore raw
Quoted 8 lines · Juan Quintela

Hi
this small patch made possible to compile a 64bit kernel for people that have old proms that only accept ecoff. As usual stolen from the 32 bits version.

The easiest way is creating the file in arch/mips/boot, otherwise we need to copy elf2ecoff.c to mips64.

Sorry, but I plainly doubt you have tested this.

I tried such a method today, and elf2ecoff failed to work on ELF64 files. Maybe a recent enough objcopy is the better choice for this purpose.

Thiemo

#2 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"thiemo" == Thiemo Seufer <[email protected]> writes:

Quoted 8 lines · thiemo> Juan Quintela wrote:
Quoted 8 lines

Hi
this small patch made possible to compile a 64bit kernel for people that have old proms that only accept ecoff. As usual stolen from the 32 bits version.

The easiest way is creating the file in arch/mips/boot, otherwise we need to copy elf2ecoff.c to mips64.

thiemo> Sorry, but I plainly doubt you have tested this.

thiemo> I tried such a method today, and elf2ecoff failed to work on ELF64 files. thiemo> Maybe a recent enough objcopy is the better choice for this purpose.

I tested it and it works :)

Notice that I am using egcs for MIPS64 as I am not able to compile the kernel with gcc-3.2 :(

Later, Juan.

Signature · 2 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
#3 lore raw
Quoted 12 lines · Juan Quintela
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"thiemo" == Thiemo Seufer <[email protected]> writes:

Quoted 8 lines · thiemo> Juan Quintela wrote:
Quoted 8 lines

Hi
this small patch made possible to compile a 64bit kernel for people that have old proms that only accept ecoff. As usual stolen from the 32 bits version.

The easiest way is creating the file in arch/mips/boot, otherwise we need to copy elf2ecoff.c to mips64.

Quoted 6 lines

thiemo> Sorry, but I plainly doubt you have tested this.

thiemo> I tried such a method today, and elf2ecoff failed to work on ELF64 files. thiemo> Maybe a recent enough objcopy is the better choice for this purpose.

I tested it and it works :)

How is this possible, given that elf2ecoff uses Elf32_* variables to process the ELF file? elf2ecoff might be bad enough at error checking to produce some binary garbage.

Quoted 2 lines

Notice that I am using egcs for MIPS64 as I am not able to compile the kernel with gcc-3.2 :(

I don't think this is compiler dependent. :-)

Thiemo

#4 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"thiemo" == Thiemo Seufer <[email protected]> writes:

Quoted 2 lines · thiemo> Juan Quintela wrote:
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"thiemo" == Thiemo Seufer <[email protected]> writes:

Quoted 9 lines · thiemo> Juan Quintela wrote:
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines

Hi
this small patch made possible to compile a 64bit kernel for people that have old proms that only accept ecoff. As usual stolen from the 32 bits version.

The easiest way is creating the file in arch/mips/boot, otherwise we need to copy elf2ecoff.c to mips64.

thiemo> Sorry, but I plainly doubt you have tested this.

Quoted 1 line
Quoted 1 line

thiemo> I tried such a method today, and elf2ecoff failed to work on ELF64 files. thiemo> Maybe a recent enough objcopy is the better choice for this purpose.

Quoted 2 lines
Quoted 2 lines

I tested it and it works :)

thiemo> How is this possible, given that elf2ecoff uses Elf32_* variables to thiemo> process the ELF file? elf2ecoff might be bad enough at error checking thiemo> to produce some binary garbage.

Quoted 2 lines
Quoted 2 lines

Notice that I am using egcs for MIPS64 as I am not able to compile the kernel with gcc-3.2 :(

thiemo> I don't think this is compiler dependent. :-)

from arch/mips64/Makefile:

#
# Some machines like the Indy need 32-bit ELF binaries for booting purposes. # Other need ECOFF, so we build a 32-bit ELF binary for them which we then

# convert to ECOFF using elf2ecoff.
#
ifdef CONFIG_BOOT_ELF32
GCCFLAGS += -Wa,-32 $(shell if $(CC) -Wa,-mgp64 -c -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "-Wa,-mgp64"; fi)
LINKFLAGS += -T arch/mips64/ld.script.elf32
endif
Signature · 2 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
#5 lore raw

Juan Quintela wrote:
[snip]

Quoted 11 lines
Quoted 2 lines
Quoted 2 lines

Notice that I am using egcs for MIPS64 as I am not able to compile the kernel with gcc-3.2 :(

thiemo> I don't think this is compiler dependent. :-)

from arch/mips64/Makefile:

#
# Some machines like the Indy need 32-bit ELF binaries for booting purposes. # Other need ECOFF, so we build a 32-bit ELF binary for them which we then

# convert to ECOFF using elf2ecoff.

Argh, this hack again! Sorry for the confusion, I'm just used to think 64bit == ELF64.

Thiemo

#6 lore raw
In reply to Juan Quintela
Quoted 6 lines · Juan Quintela

this small patch made possible to compile a 64bit kernel for people that have old proms that only accept ecoff. As usual stolen from the 32 bits version.

The easiest way is creating the file in arch/mips/boot, otherwise we need to copy elf2ecoff.c to mips64.

Applied slightly modified. I removed two other unused targets.

Ralf

#7 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"ralf" == Ralf Baechle <[email protected]> writes:

Quoted 6 lines · Juan Quintela
Quoted 6 lines

this small patch made possible to compile a 64bit kernel for people that have old proms that only accept ecoff. As usual stolen from the 32 bits version.

The easiest way is creating the file in arch/mips/boot, otherwise we need to copy elf2ecoff.c to mips64.

ralf> Applied slightly modified. I removed two other unused targets.

Please, add that back, and things will indeed compile :)

Later, Juan.

Index: arch/mips64/Makefile
===================================================================
RCS file: /home/cvs/linux/arch/mips64/Makefile,v
retrieving revision 1.22.2.21

mips64/Makefile +1 -1
diff -u -r1.22.2.21 Makefile
@@ -235,7 +235,7 @@
 CORE_FILES := arch/mips64/kernel/kernel.o arch/mips64/mm/mm.o $(CORE_FILES)
 LIBS := arch/mips64/lib/lib.a $(LIBS)
 
-MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
+MAKEBOOT = $(MAKE) -C arch/mips/boot
 
 ifdef CONFIG_CPU_LITTLE_ENDIAN
 64bit-bfd = elf64-tradlittlemips
Signature · 2 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
#8 lore raw
Quoted 3 lines · Juan Quintela

ralf> Applied slightly modified. I removed two other unused targets.

Please, add that back, and things will indeed compile :)

Ralf did that right -- it's annoying to have the COFF image for mips64
built in the mips tree. Unlike the intermediate object files, this target is visible to a non-developer. But a few bits are missing, indeed. How about the following patch? It's a trivial modification of what I use for about half a year now.

Signature · 24 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +

patch-mips-2.4.20-pre6-20021220-mips64-ecoff-0
diff -up --recursive --new-file linux-mips-2.4.20-pre6-20021220.macro/arch/mips64/boot/Makefile linux-mips-2.4.20-pre6-20021220/arch/mips64/boot/Makefile
--- linux-mips-2.4.20-pre6-20021220.macro/arch/mips64/boot/Makefile	2002-06-26 03:04:47.000000000 +0000
+++ linux-mips-2.4.20-pre6-20021220/arch/mips64/boot/Makefile	2002-12-21 14:23:32.000000000 +0000
@@ -22,11 +22,11 @@ all: vmlinux.ecoff addinitrd
 vmlinux.ecoff:	$(CONFIGURE) elf2ecoff $(TOPDIR)/vmlinux
 	./elf2ecoff $(TOPDIR)/vmlinux vmlinux.ecoff $(E2EFLAGS)
 
-elf2ecoff: elf2ecoff.c
-	$(HOSTCC) -o $@ $^
+elf2ecoff: $(TOPDIR)/arch/mips/boot/elf2ecoff.c
+	$(HOSTCC) -I$(TOPDIR)/arch/mips/boot -I- -o $@ $^
 
-addinitrd: addinitrd.c
-	$(HOSTCC) -o $@ $^
+addinitrd: $(TOPDIR)/arch/mips/boot/addinitrd.c
+	$(HOSTCC) -I$(TOPDIR)/arch/mips/boot -I- -o $@ $^
 
 # Don't build dependencies, this may die if $(CC) isn't gcc
 dep:
#9 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"maciej" == Maciej W Rozycki <[email protected]> writes:

maciej> On 20 Dec 2002, Juan Quintela wrote:
ralf> Applied slightly modified. I removed two other unused targets.

Quoted 2 lines
Quoted 2 lines

Please, add that back, and things will indeed compile :)

maciej> Ralf did that right -- it's annoying to have the COFF image for mips64 maciej> built in the mips tree. Unlike the intermediate object files, this target maciej> is visible to a non-developer. But a few bits are missing, indeed. How maciej> about the following patch? It's a trivial modification of what I use for maciej> about half a year now.

BTW, are you using mips64 in a r4k? If so, do you need any additional patches?

I am having some memory corruption :(

maciej> --
maciej> + Maciej W. Rozycki, Technical University of Gdansk, Poland +
maciej> +--------------------------------------------------------------+
maciej> + e-mail: [email protected], PGP key available +

maciej> patch-mips-2.4.20-pre6-20021220-mips64-ecoff-0
maciej> diff -up --recursive --new-file linux-mips-2.4.20-pre6-20021220.macro/arch/mips64/boot/Makefile linux-mips-2.4.20-pre6-20021220/arch/mips64/boot/Makefile
maciej> --- linux-mips-2.4.20-pre6-20021220.macro/arch/mips64/boot/Makefile 2002-06-26 03:04:47.000000000 +0000
maciej> +++ linux-mips-2.4.20-pre6-20021220/arch/mips64/boot/Makefile 2002-12-21 14:23:32.000000000 +0000
maciej> @@ -22,11 +22,11 @@ all: vmlinux.ecoff addinitrd
maciej> vmlinux.ecoff: $(CONFIGURE) elf2ecoff $(TOPDIR)/vmlinux
maciej> ./elf2ecoff $(TOPDIR)/vmlinux vmlinux.ecoff $(E2EFLAGS)

maciej> -elf2ecoff: elf2ecoff.c
maciej> - $(HOSTCC) -o $@ $^
maciej> +elf2ecoff: $(TOPDIR)/arch/mips/boot/elf2ecoff.c
maciej> + $(HOSTCC) -I$(TOPDIR)/arch/mips/boot -I- -o $@ $^

maciej> -addinitrd: addinitrd.c
maciej> - $(HOSTCC) -o $@ $^
maciej> +addinitrd: $(TOPDIR)/arch/mips/boot/addinitrd.c
maciej> + $(HOSTCC) -I$(TOPDIR)/arch/mips/boot -I- -o $@ $^

maciej> # Don't build dependencies, this may die if $(CC) isn't gcc maciej> dep:

It is better than mine.

Later, Juan.

Signature · 2 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
#10 lore raw
Quoted 2 lines · Juan Quintela

BTW, are you using mips64 in a r4k? If so, do you need any additional patches?

Yep, for quite some time now, running a DECstation 5000/260 with an
R4400SC. Yep, a few.

I'm merging the patches slowly, but it's not that easy. Errata for the
R4000 and the R4400 require toolchain changes and bits in the patches depend on fixed tools. So chances are I won't merge everything until changes are applied to tools.

Quoted 1 line

I am having some memory corruption :(

What kind of? And what processor (PRId) have you got?

My system seems reasonably stable, but sometimes it crashes under a load.
I have yet to get at tracking the problem down.

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +
#11 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"maciej" == Maciej W Rozycki <[email protected]> writes:

Quoted 2 lines · Juan Quintela
Quoted 2 lines

BTW, are you using mips64 in a r4k? If so, do you need any additional patches?

maciej> Yep, for quite some time now, running a DECstation 5000/260 with an maciej> R4400SC. Yep, a few.

Here it is bigendian (SGI Indigo 2).

ARCH: SGI-IP22
PROMLIB: ARC firmware Version 1 Revision 10
CPU: MIPS-R4400 FPU<MIPS-R4400FPC> ICACHE DCACHE SCACHE CPU revision is: 00000450
FPU revision is: 00000500
Primary instruction cache 16kb, linesize 16 bytes. Primary data cache 16kb, linesize 16 bytes. Secondary cache sized at 1024K linesize 128 bytes.

I am using the egcs-1.1.2 from ralf for doing compiles, I think that you have a more modern compiler, if so, I will be happy to download.

maciej> I'm merging the patches slowly, but it's not that easy. Errata for the maciej> R4000 and the R4400 require toolchain changes and bits in the patches maciej> depend on fixed tools. So chances are I won't merge everything until maciej> changes are applied to tools.

Quoted 1 line
Quoted 1 line

I am having some memory corruption :(

maciej> What kind of? And what processor (PRId) have you got?

PRid show before.

Corruption is that when I do a ssh to that host, I got parts of /proc/ksyms into the console.

maciej> My system seems reasonably stable, but sometimes it crashes under a load. maciej> I have yet to get at tracking the problem down.

mine in 32bits is stable, don't crash under load (not very high load yet). But in 64bits (with exactly the same userland) got losts of problems.

Already found a couple of problems in c-r4k.c send to the list, and now a couple of problems in sgiseeq.c and sgiserial.c. Notice that I am running that machine with nfsroot, i.e. I don't have basically more devices than the serial console and the network card. No real console support and not harddisk support either.

If you have any patches, I will like to take a look.

Later, Juan.

Signature · 2 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
#12 lore raw
Quoted 4 lines · Juan Quintela

maciej> Yep, for quite some time now, running a DECstation 5000/260 with an maciej> R4400SC. Yep, a few.

Here it is bigendian (SGI Indigo 2).

The endianness shouldn't matter, but who knows?

Quoted 8 lines

ARCH: SGI-IP22
PROMLIB: ARC firmware Version 1 Revision 10
CPU: MIPS-R4400 FPU<MIPS-R4400FPC> ICACHE DCACHE SCACHE CPU revision is: 00000450
FPU revision is: 00000500
Primary instruction cache 16kb, linesize 16 bytes. Primary data cache 16kb, linesize 16 bytes. Secondary cache sized at 1024K linesize 128 bytes.

Please get:
'ftp://ftp.ds2.pg.gda.pl/pub/macro/linux/patch-mips-2.4.20-pre6-20021212-mips-bugs-14mod.gz' try it and send me the boot log, specifically the bug checks. My PRId is 00000440 and that is definitely buggy revision 1.0. Yours is probably revision 2.0 and should work better, but it won't hurt checking.

Note the patch is unfinished code; I had to modify it a bit for you to
make it work at all with standard tools. It does not necessarily make much sense. ;-)

Quoted 2 lines

I am using the egcs-1.1.2 from ralf for doing compiles, I think that you have a more modern compiler, if so, I will be happy to download.

Indeed, I use heavily patched gcc 2.95.4. It's available at my site,
too, as RPM packages. For mips64 there are only source and i386 binary packages of a bootstrap cross-compiler -- look for mips64el-linux-boot-gcc. It should be fairly easy to build big-endian packages from the sources.

But there is a drawback -- the packages have a patch to handle the daddiu
erratum and the workaround is unconditional now. The result is somewhat worse code is emitted.

Quoted 2 lines

Corruption is that when I do a ssh to that host, I got parts of /proc/ksyms into the console.

SSH works just fine for me. I haven't tried connecting over IPv6 to
64-bit Linux, though (for 32-bit version it works).

Quoted 6 lines

maciej> My system seems reasonably stable, but sometimes it crashes under a load. maciej> I have yet to get at tracking the problem down.

mine in 32bits is stable, don't crash under load (not very high load yet). But in 64bits (with exactly the same userland) got losts of problems.

Well, for me the 32-bit configuration is rock-solid. It's the 64-bit one
that causes some problems, but it's stable enough for most of the recent package builds to be done with it. I debugged showstopper problems last Summer.

Quoted 1 line

Already found a couple of problems in c-r4k.c send to the list, and

I haven't seen any problems with caching recently. I might have been
lucky. But my cache configuration differs a bit:

CPU revision is: 00000440
FPU revision is: 00000500
Loading R4000 MMU routines.
Primary instruction cache 16kb, linesize 16 bytes. Primary data cache 16kb, linesize 16 bytes. Secondary cache sized at 1024K linesize 32 bytes.

Quoted 1 line

now a couple of problems in sgiseeq.c and sgiserial.c. Notice that I

That's driver-specific. The declance.c and zs.c drivers work.

Quoted 3 lines

am running that machine with nfsroot, i.e. I don't have basically more devices than the serial console and the network card. No real console support and not harddisk support either.

Ditto here. Except a keyboard and a framebuffer also work; the latter
also under X11.

Quoted 1 line

If you have any patches, I will like to take a look.

Nothing ready for inclusion. And probably nothing critical (except for
the DECstation), but please send me the report first.

Maciej

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +