compiling kernel 2.6.13
Hello,
I had some trouble compiling 2.6.13 for the mips architecture. I encountered two errors:
1)
In the file include/asm-mips/thread_info.h TIF_32BIT was undefined.
I added the following two lines which showed up in parisc and ppc64 's thread-info's. Don't know if these values are correct or if this actually works. It just gets it to compile...
#define TIF_32BIT 5 /* 32 bit binary */
#define _TIF_32BIT (1<<TIF_32BIT)
The error was in drivers/input/evdev.c which includes include/asm-mips/thread_info.h
The error was:
CC [M] drivers/input/evdev.odrivers/input/evdev.c: In function `evdev_write':drivers/input/evdev.c:193: error: `TIF_32BIT' undeclared (first use in this function)drivers/input/evdev.c:193: error: (Each undeclared identifier is reported only oncedrivers/input/evdev.c:193: error: for each function it appears in.) drivers/input/evdev.c: In function `evdev_read':drivers/input/evdev.c:254: error: `TIF_32BIT' undeclared (first use in this function)
2)
When linking .tmp_vmlinux1, KSEG1ADDR and KSEG1 where reported as undefined and linking failed.
LD .tmp_vmlinux1
arch/mips/sgi-ip22/built-in.o(.text+0x2854): In function `ip22_eisa_intr':
: undefined reference to KSEG1ADDR' arch/mips/sgi-ip22/built-in.o(.text+0x2864): In function ip22_eisa_intr':
: undefined reference to KSEG1ADDR' arch/mips/sgi-ip22/built-in.o(.text+0x2870): In function ip22_eisa_intr':
: undefined reference to KSEG1ADDR' arch/mips/sgi-ip22/built-in.o(.text+0x28ac): In function ip22_eisa_intr':
: undefined reference to KSEG1ADDR' arch/mips/sgi-ip22/built-in.o(.text+0x28c0): In function ip22_eisa_intr':
: undefined reference to KSEG1ADDR' arch/mips/sgi-ip22/built-in.o(.text+0x293c): more undefined references to KSEG1ADDR' follow
make: *** [.tmp_vmlinux1] Error 1
I fixed this by adding the lines:
#define KSEG1ADDR(a) (CPHYSADDR(a) | KSEG1)
#define KSEG1 0xa0000000
at the top of the file arch/mips/sgi-ip22/ip22-eisa.c These are copied from include/asm/addrspace.h
I found it quite strange that it only failed when linking the kernel and not earlier. The file asm/addrspace.h is included in ip22-eisa.c
eisa support is enabled and i'm compiling a 64 bit kernel. gcc is:
Reading specs from /usr/mips/lib/gcc-lib/mips-linux/3.3.3/specs Configured with: ../configure --prefix=/usr/mips --exec-prefix=/usr/mips --target=mips-linux --enable-shared --disable-nls --disable-multilib --enable-languages=c,c++,ada,f77,objc
Thread model: posix
gcc version 3.3.3 (Debian)
Cheers,
Damian
34c34,35
< #include <asm/addrspace.h>
---
Quoted 2 lines
//#include <
asm/addrspace.h>
#include <asm-mips/addrspace.h>
39a41,45
Quoted 5 lines
//Force redefine.. seems to fail to find it when linking kernel itself. //This is probably no good..
#define KSEG1ADDR(a) (CPHYSADDR(a) | KSEG1)
#define KSEG10xa0000000
38a39,45
Quoted 7 lines
/*Copied these from parisc and ppc64 - don't know any better.
TIF_32BITwas
* undefined when compiling for mips indrivers/input/evdev.cI do not
* understand this code. Just guessing...*/
#defineTIF_32BIT5 /* 32 bit binary */
#define_TIF_32BIT(1<<TIF_32BIT)
Quoted 16 lines · Damian Dimmich
I had some trouble compiling 2.6.13 for the mips architecture. I encountered two errors:
1)
In the file
include/asm-mips/thread_info.hTIF_32BITwas undefined.I added the following two lines which showed up in parisc and ppc64 's thread-info's. Don't know if these values are correct or if this actually works. It just gets it to compile...
#defineTIF_32BIT5 /* 32 bit binary */
#define_TIF_32BIT(1<<TIF_32BIT)The error was in
drivers/input/evdev.cwhich includesinclude/asm-mips/thread_info.h
Quoted 11 lines
The error was:
CC [M]drivers/input/evdev.odrivers/input/evdev.c: In function `evdev_write':drivers/input/evdev.c:193: error: `TIF_32BIT' undeclared (first use in this function)drivers/input/evdev.c:193: error: (Each undeclared identifier is reported only oncedrivers/input/evdev.c:193: error: for each function it appears in.)drivers/input/evdev.c: In function `evdev_read':drivers/input/evdev.c:254: error: `TIF_32BIT' undeclared (first use in this function)
That driver's 32-bit compatibility is totally broken, I'm afraid. It'll be easy to kludge though ...
Quoted 26 lines
2)
When linking .tmp_vmlinux1, KSEG1ADDR and KSEG1 where reported as undefined and linking failed.
LD .tmp_vmlinux1
arch/mips/sgi-ip22/built-in.o(.text+0x2854): In function `ip22_eisa_intr':
: undefined reference toKSEG1ADDR' arch/mips/sgi-ip22/built-in.o(.text+0x2864): In functionip22_eisa_intr':
: undefined reference toKSEG1ADDR' arch/mips/sgi-ip22/built-in.o(.text+0x2870): In functionip22_eisa_intr':
: undefined reference toKSEG1ADDR' arch/mips/sgi-ip22/built-in.o(.text+0x28ac): In functionip22_eisa_intr':
: undefined reference toKSEG1ADDR' arch/mips/sgi-ip22/built-in.o(.text+0x28c0): In functionip22_eisa_intr':
: undefined reference toKSEG1ADDR' arch/mips/sgi-ip22/built-in.o(.text+0x293c): more undefined references toKSEG1ADDR' follow
make: *** [.tmp_vmlinux1] Error 1I fixed this by adding the lines:
#define KSEG1ADDR(a) (CPHYSADDR(a) | KSEG1)
#define KSEG10xa0000000
at the top of the filearch/mips/sgi-ip22/ip22-eisa.cThese are copied frominclude/asm/addrspace.h
Quoted 4 lines
I found it quite strange that it only failed when linking the kernel and not earlier. The file
asm/addrspace.his included inip22-eisa.ceisa support is enabled and i'm compiling a 64 bit kernel.
Daring. Hardly anybody is using EISA on that machine and even less so on 64-bit, expect to find bugs.
Quoted 1 line
gcc version 3.3.3 (Debian)
Should be a safe choice of compiler.
Ralf
Quoted 5 lines
Quoted 1 line
eisa support is enabled and i'm compiling a 64 bit kernel.
Daring. Hardly anybody is using EISA on that machine and even less so on 64-bit, expect to find bugs.
Furthermore, 64-bit kernels are somewhat broken on ip22 right now. Something is wrong with memory allocation, and it really screws a lot of things up. Off the top of my head, you won't be able to turn on swap, mount a ricerfs partition, or dd large blocks from /dev/zero. You would be much better of sticking with 32-bit at this time.
-Steve
Quoted 8 lines · Stephen P. Becker
Quoted 2 lines
Daring. Hardly anybody is using EISA on that machine and even less so on 64-bit, expect to find bugs.
Furthermore, 64-bit kernels are somewhat broken on ip22 right now. Something is wrong with memory allocation, and it really screws a lot of things up. Off the top of my head, you won't be able to turn on swap, mount a ricerfs partition, or dd large blocks from
/dev/zero. You would be much better of sticking with 32-bit at this time.
But that seems an IP22-specific problem.
Ralf
Quoted 5 lines · Ralf Baechle
Quoted 3 lines · Stephen P. Becker
Quoted 2 lines
Daring. Hardly anybody is using EISA on that machine and even less so on 64-bit, expect to find bugs.
Quoted 7 lines
Quoted 5 lines
Furthermore, 64-bit kernels are somewhat broken on ip22 right now. Something is wrong with memory allocation, and it really screws a lot of things up. Off the top of my head, you won't be able to turn on swap, mount a ricerfs partition, or dd large blocks from
/dev/zero. You would be much better of sticking with 32-bit at this time.But that seems an IP22-specific problem.
I _think_ it hits every 64bit kernel which uses mappings in CKSEG0. Do you know a system where this works?
Thiemo
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line · Thiemo Seufer
But that seems an IP22-specific problem.
ths> I _think_ it hits every 64bit kernel which uses mappings in ths> CKSEG0. Do you know a system where this works?
Though I do not have IP22, I think this line in mach-ip22/space.h is inappropriate.
#define MAP_BASE 0xffffffffc0000000
It will make VMALLOC_END in pgtabe-64.h overflow.
#define VMALLOC_START MAP_BASE
#define VMALLOC_END \
(VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE)
Shoule we use 0xc000000000000000 as MAP_BASE for IP22 ?
---
Atsushi Nemoto
Quoted 11 lines · Atsushi Nemoto
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line · Thiemo Seufer
But that seems an IP22-specific problem.
ths> I _think_ it hits every 64bit kernel which uses mappings in ths> CKSEG0. Do you know a system where this works?
Though I do not have IP22, I think this line in
mach-ip22/space.his inappropriate.#define
MAP_BASE0xffffffffc0000000
Quoted 7 lines
It will make
VMALLOC_ENDinpgtabe-64.hoverflow.#define
VMALLOC_STARTMAP_BASE
#defineVMALLOC_END\
(VMALLOC_START+PTRS_PER_PGD*PTRS_PER_PMD*PTRS_PER_PTE*PAGE_SIZE)Shoule we use
0xc000000000000000asMAP_BASEfor IP22 ?
Thanks, this helped!
Thiemo
Damian Dimmich wrote:
[snip]
Quoted 24 lines
When linking .tmp_vmlinux1, KSEG1ADDR and KSEG1 where reported as undefined and linking failed.
LD .tmp_vmlinux1
arch/mips/sgi-ip22/built-in.o(.text+0x2854): In function `ip22_eisa_intr':
: undefined reference toKSEG1ADDR' arch/mips/sgi-ip22/built-in.o(.text+0x2864): In functionip22_eisa_intr':
: undefined reference toKSEG1ADDR' arch/mips/sgi-ip22/built-in.o(.text+0x2870): In functionip22_eisa_intr':
: undefined reference toKSEG1ADDR' arch/mips/sgi-ip22/built-in.o(.text+0x28ac): In functionip22_eisa_intr':
: undefined reference toKSEG1ADDR' arch/mips/sgi-ip22/built-in.o(.text+0x28c0): In functionip22_eisa_intr':
: undefined reference toKSEG1ADDR' arch/mips/sgi-ip22/built-in.o(.text+0x293c): more undefined references toKSEG1ADDR' follow
make: *** [.tmp_vmlinux1] Error 1I fixed this by adding the lines:
#define KSEG1ADDR(a) (CPHYSADDR(a) | KSEG1)
#define KSEG10xa0000000
at the top of the filearch/mips/sgi-ip22/ip22-eisa.cThese are copied frominclude/asm/addrspace.h
Quoted 4 lines
I found it quite strange that it only failed when linking the kernel and not earlier. The file
asm/addrspace.his included inip22-eisa.ceisa support is enabled and i'm compiling a 64 bit kernel.
You could try the patch in http://people.debian.org/~ths/foo/ip22-eisa.diff
which fixes that problem. I don't have the hardware to test it, and so far nobody else cared to tell me if works.
Thiemo
Quoted 3 lines · Thiemo Seufer
You could try the patch in http://people.debian.org/~ths/foo/ip22-eisa.diff
which fixes that problem. I don't have the hardware to test it, and so far nobody else cared to tell me if works.
At least it looks like an improvment and since it's probably save to consider the current IP22 EISA code as broken I wouldn't mind if you want to check this one in ...
Ralf
Quoted 9 lines · Ralf Baechle
Quoted 3 lines · Thiemo Seufer
You could try the patch in http://people.debian.org/~ths/foo/ip22-eisa.diff
which fixes that problem. I don't have the hardware to test it, and so far nobody else cared to tell me if works.At least it looks like an improvment and since it's probably save to consider the current IP22 EISA code as broken I wouldn't mind if you want to check this one in ...
Committed.
Thiemo
On Wed, Aug 31, 2005 at 05:12:23PM +0200, Thiemo Seufer wrote:
[snip]
Quoted 3 lines
You could try the patch in http://people.debian.org/~ths/foo/ip22-eisa.diff
which fixes that problem. I don't have the hardware to test it, and so far nobody else cared to tell me if works.
Yet another patch is laying here almost two years without any attention:
ftp://ftp.linux-mips.org/pub/linux/mips/people/ladis/eisa.diff
It is against some ancient 2.4 kernel (do we still about it?) and at least shows how to use common 8259A code to handle interrupts. Perhaps we could do the same in 2.6 and use new EISA code in drivers/eisa ?
ladis