Kernel 2.5.8 on Alpha
Subsystems (2)
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.cinit/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.oinit/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.csched.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
Quoted 5 lines · Oliver Pitzeier
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
include/asm-alpha/thread_info.h +2 -0
@@ -53,6 +53,8 @@#endif /* __ASSEMBLY__ */ +#define PREEMPT_ACTIVE 0x4000000 +/* * Thread information flags: * - these are process state flags and used from assembly
Quoted 1 line · Robert Love
+#define
PREEMPT_ACTIVE0x4000000
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.
include/asm-alpha/pgalloc.h +1 -1
@@ -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
include/asm-alpha/thread_info.h +4 -0
@@ -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 */
include/asm-alpha/mman.h +1 -0
@@ -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 */
include/asm-alpha/siginfo.h +1 -0
@@ -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)
include/asm-alpha/unistd.h +1 -1
@@ -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 */
arch/alpha/kernel/ptrace.c +5 -5
@@ -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, longif (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, longif ((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. */
arch/alpha/kernel/osf_sys.c +1 -1
@@ -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. */ - (®s)->r20 = tsk->p_opptr->pid; + (®s)->r20 = tsk->real_parent->pid;return tsk->pid; }
arch/alpha/kernel/signal.c +4 -3
@@ -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_recase 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 ();
arch/alpha/kernel/semaphore.c +1 -0
@@ -6,6 +6,7 @@*/ #include <linux/sched.h> +#include <asm/errno.h> /*
arch/alpha/kernel/process.c +4 -0
@@ -54,6 +54,10 @@ sys_sethae(unsigned long hae, unsigned lreturn 0 ; } +void default_idle (void ) +{ +} +void cpu_idle (void ) {
arch/alpha/kernel/setup.c +2 -0
@@ -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);
Success Story: Kernel 2.5.11 on Alpha (AS1000)
In reply to Oliver PitzeierHi 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