2002-04-14 21:06:42

by Oliver Pitzeier

[permalink] [raw]
Subject: Kernel 2.5.8 on Alpha

I tried to compile kernel 2.5.8 on an Alpha. I just wanted to try it...
This happens:
(Any ideas?)

[root@xxx linux-2.5.8]# make menuconfig
[ ... ]
[root@xxx linux-2.5.8]# make dep
[ ... ]
[root@xxx linux-2.5.8]# make
gcc -D__KERNEL__ -I/usr/src/linux-2.5.8/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev5
-Wa,-mev6 -DKBUILD_BASENAME=main -c -o init/main.o init/main.c
init/main.c: In function `start_kernel':
init/main.c:347: warning: implicit declaration of function
`setup_per_cpu_areas'
. scripts/mkversion > .tmpversion
gcc -D__KERNEL__ -I/usr/src/linux-2.5.8/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev5
-Wa,-mev6 -DUTS_MACHINE='"alpha"' -DKBUILD_BASENAME=version -c -o
init/version.o init/version.c
gcc -D__KERNEL__ -I/usr/src/linux-2.5.8/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev5
-Wa,-mev6 -DKBUILD_BASENAME=do_mounts -c -o init/do_mounts.o
init/do_mounts.c
make CFLAGS="-D__KERNEL__ -I/usr/src/linux-2.5.8/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev5
-Wa,-mev6 " -C kernel
make[1]: Entering directory `/usr/src/linux-2.5.8/kernel'
make all_targets
make[2]: Entering directory `/usr/src/linux-2.5.8/kernel'
gcc -D__KERNEL__ -I/usr/src/linux-2.5.8/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev5
-Wa,-mev6 -DKBUILD_BASENAME=sched -fno-omit-frame-pointer -c -o
sched.o sched.c
sched.c: In function `schedule':
sched.c:771: `PREEMPT_ACTIVE' undeclared (first use in this function)
sched.c:771: (Each undeclared identifier is reported only once
sched.c:771: for each function it appears in.)
sched.c: In function `init_idle':
sched.c:1556: structure has no member named `preempt_count'
make[2]: *** [sched.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.5.8/kernel'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux-2.5.8/kernel'
make: *** [_dir_kernel] Error 2

-Oliver



2002-04-15 18:47:50

by Robert Love

[permalink] [raw]
Subject: [PATCH] Re: Kernel 2.5.8 on Alpha

On Sun, 2002-04-14 at 17:01, Oliver Pitzeier wrote:
> I tried to compile kernel 2.5.8 on an Alpha. I just wanted to try it...
> This happens:
> <snip>
> sched.c: In function `schedule':
> sched.c:771: `PREEMPT_ACTIVE' undeclared (first use in this function)

2.5.8-pre2 uses PREEMPT_ACTIVE directly in entry.S and thus moved the
definition of PREEMPT_ACTIVE into include/asm/thread_info.h from
include/linux/sched.h, presumably because including sched.h in entry.S
would not be pretty.

Each arch thus needs to define PREEMPT_ACTIVE ... patch applied.

Robert Love

diff -urN linux-2.5.8/include/asm-alpha/thread_info.h linux/include/asm-alpha/thread_info.h
--- linux-2.5.8/include/asm-alpha/thread_info.h Sun Apr 14 15:18:56 2002
+++ linux/include/asm-alpha/thread_info.h Mon Apr 15 14:32:50 2002
@@ -53,6 +53,8 @@

#endif /* __ASSEMBLY__ */

+#define PREEMPT_ACTIVE 0x4000000
+
/*
* Thread information flags:
* - these are process state flags and used from assembly


2002-04-16 14:43:33

by Ivan Kokshaysky

[permalink] [raw]
Subject: Re: [PATCH] Re: Kernel 2.5.8 on Alpha

On Mon, Apr 15, 2002 at 02:47:42PM -0400, Robert Love wrote:
> +#define PREEMPT_ACTIVE 0x4000000

This is not enough. Currently I'm running 2.5.8 with following:
- fix pmd_populate;
- fix ptrace wrt thread_info - gdb and strace are working again;
- fix cond_syscall macro;
- various compile fixes, mostly from Chris Meadors.

Ivan.

--- 2.5.8/include/asm-alpha/pgalloc.h Sun Apr 14 23:18:42 2002
+++ linux/include/asm-alpha/pgalloc.h Mon Apr 15 18:36:43 2002
@@ -12,7 +12,7 @@
static inline void
pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *pte)
{
- pmd_set(pmd, (pte_t *)((pte - mem_map) << PAGE_SHIFT));
+ pmd_val(*pmd) = _PAGE_TABLE | ((pte - mem_map) << 32);
}

static inline void
--- 2.5.8/include/asm-alpha/thread_info.h Sun Apr 14 23:18:56 2002
+++ linux/include/asm-alpha/thread_info.h Tue Apr 16 17:14:46 2002
@@ -9,6 +9,8 @@
#include <asm/hwrpb.h>
#endif

+#define PREEMPT_ACTIVE 0x4000000
+
#ifndef __ASSEMBLY__
struct thread_info {
struct pcb_struct pcb; /* palcode state */
@@ -18,6 +20,8 @@ struct thread_info {
unsigned int ieee_state; /* see fpu.h */

struct exec_domain *exec_domain; /* execution domain */
+ int preempt_count;
+
mm_segment_t addr_limit; /* thread address space */
int cpu; /* current CPU */

--- 2.5.8/include/asm-alpha/mman.h Sun Apr 14 23:18:43 2002
+++ linux/include/asm-alpha/mman.h Mon Apr 15 18:36:43 2002
@@ -4,6 +4,7 @@
#define PROT_READ 0x1 /* page can be read */
#define PROT_WRITE 0x2 /* page can be written */
#define PROT_EXEC 0x4 /* page can be executed */
+#define PROT_SEM 0x8 /* page may be used for atomic ops */
#define PROT_NONE 0x0 /* page can not be accessed */

#define MAP_SHARED 0x01 /* Share changes */
--- 2.5.8/include/asm-alpha/siginfo.h Sun Apr 14 23:18:51 2002
+++ linux/include/asm-alpha/siginfo.h Tue Apr 16 17:14:46 2002
@@ -108,6 +108,7 @@ typedef struct siginfo {
#define SI_ASYNCIO -4 /* sent by AIO completion */
#define SI_SIGIO -5 /* sent by queued SIGIO */
#define SI_TKILL -6 /* sent by tkill system call */
+#define SI_DETHREAD -7 /* sent by execve() killing subsidiary threads */

#define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
#define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
--- 2.5.8/include/asm-alpha/unistd.h Sun Apr 14 23:18:51 2002
+++ linux/include/asm-alpha/unistd.h Tue Apr 16 17:14:52 2002
@@ -603,6 +603,6 @@ static inline long delete_module(const c
* What we want is __attribute__((weak,alias("sys_ni_syscall"))),
* but it doesn't work on all toolchains, so we just do it by hand
*/
-#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall");
+#define cond_syscall(x) asm(".weak " #x "; " #x " = sys_ni_syscall");

#endif /* _ALPHA_UNISTD_H */
--- 2.5.8/arch/alpha/kernel/ptrace.c Sun Apr 14 23:18:55 2002
+++ linux/arch/alpha/kernel/ptrace.c Mon Apr 15 18:36:43 2002
@@ -106,7 +106,7 @@ get_reg_addr(struct task_struct * task,
zero = 0;
addr = &zero;
} else {
- addr = (long *)((long)task + regoff[regno]);
+ addr = (long *)((long)task->thread_info + regoff[regno]);
}
return addr;
}
@@ -292,7 +292,7 @@ sys_ptrace(long request, long pid, long
if (request != PTRACE_KILL)
goto out;
}
- if (child->p_pptr != current) {
+ if (child->parent != current) {
DBG(DBG_MEM, ("child not parent of this process\n"));
goto out;
}
@@ -340,9 +340,9 @@ sys_ptrace(long request, long pid, long
if ((unsigned long) data > _NSIG)
goto out;
if (request == PTRACE_SYSCALL)
- set_thread_flag(TIF_SYSCALL_TRACE);
+ set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
else
- clear_thread_flag(TIF_SYSCALL_TRACE);
+ clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
child->exit_code = data;
wake_up_process(child);
/* make sure single-step breakpoint is gone. */
@@ -371,7 +371,7 @@ sys_ptrace(long request, long pid, long
goto out;
/* Mark single stepping. */
child->thread_info->bpt_nsaved = -1;
- clear_thread_flag(TIF_SYSCALL_TRACE);
+ clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
wake_up_process(child);
child->exit_code = data;
/* give it a chance to run. */
--- 2.5.8/arch/alpha/kernel/osf_sys.c Sun Apr 14 23:18:42 2002
+++ linux/arch/alpha/kernel/osf_sys.c Mon Apr 15 18:36:43 2002
@@ -219,7 +219,7 @@ asmlinkage unsigned long sys_getxpid(int
* isn't actually going to matter, as if the parent happens
* to change we can happily return either of the pids.
*/
- (&regs)->r20 = tsk->p_opptr->pid;
+ (&regs)->r20 = tsk->real_parent->pid;
return tsk->pid;
}

--- 2.5.8/arch/alpha/kernel/signal.c Sun Apr 14 23:18:52 2002
+++ linux/arch/alpha/kernel/signal.c Mon Apr 15 18:36:43 2002
@@ -18,6 +18,7 @@
#include <linux/smp_lock.h>
#include <linux/stddef.h>
#include <linux/tty.h>
+#include <linux/binfmts.h>

#include <asm/bitops.h>
#include <asm/uaccess.h>
@@ -661,8 +662,8 @@ do_signal(sigset_t *oldset, struct pt_re
info.si_signo = signr;
info.si_errno = 0;
info.si_code = SI_USER;
- info.si_pid = current->p_pptr->pid;
- info.si_uid = current->p_pptr->uid;
+ info.si_pid = current->parent->pid;
+ info.si_uid = current->parent->uid;
}

/* If the (new) signal is now blocked, requeue it. */
@@ -701,7 +702,7 @@ do_signal(sigset_t *oldset, struct pt_re
case SIGSTOP:
current->state = TASK_STOPPED;
current->exit_code = signr;
- if (!(current->p_pptr->sig->action[SIGCHLD-1]
+ if (!(current->parent->sig->action[SIGCHLD-1]
.sa.sa_flags & SA_NOCLDSTOP))
notify_parent(current, SIGCHLD);
schedule();
--- 2.5.8/arch/alpha/kernel/semaphore.c Sun Apr 14 23:18:53 2002
+++ linux/arch/alpha/kernel/semaphore.c Mon Apr 15 18:36:43 2002
@@ -6,6 +6,7 @@
*/

#include <linux/sched.h>
+#include <asm/errno.h>


/*
--- 2.5.8/arch/alpha/kernel/process.c Sun Apr 14 23:18:49 2002
+++ linux/arch/alpha/kernel/process.c Mon Apr 15 18:36:43 2002
@@ -54,6 +54,10 @@ sys_sethae(unsigned long hae, unsigned l
return 0;
}

+void default_idle(void)
+{
+}
+
void
cpu_idle(void)
{
--- 2.5.8/arch/alpha/kernel/setup.c Sun Apr 14 23:18:46 2002
+++ linux/arch/alpha/kernel/setup.c Tue Apr 16 18:23:52 2002
@@ -326,6 +326,8 @@ setup_memory(void *kernel_end)
goto try_again;
}

+ max_pfn = max_low_pfn;
+
/* Allocate the bootmap and mark the whole MM as reserved. */
bootmap_size = init_bootmem(bootmap_start, max_low_pfn);

2002-04-30 15:36:55

by Oliver Pitzeier

[permalink] [raw]
Subject: Success Story: Kernel 2.5.11 on Alpha (AS1000)

Hi volks!

I just wanted to tell you, that I have sucessfully compiled
kernel 2.5.11 on my AS1000.

Works great... Except on point: I forgot to compile the module
for my networkcard. :o) But nobody can help me with this, I
guess...

Greetz,
Oliver