unhandled trap problem

fabs0028 at free.fr fabs0028 at free.fr
Mon Jun 13 15:11:56 CEST 2005

first i 'd like to thank you one more time for you support.
It seems that my path to a proper l4linux is coming to an end but i still have
one problem:
at boot time when launching l4linux i got this problem :

l4lx    | mainmem: Number of physical regions: 1, 33554432 Bytes
l4lx    | mainmem: 1: Phys: 0x03182000 to 0x05182000, Size:  6175342
l4lx    | Filling lower ptabs...
l4lx    | Done (885 entries).
l4lx    | l4x_setup_ti_thread_stack: ti = 0x905fe000
l4lx    | l4lx_thread_create: Created thread 0c.05 (IRQ0 (Timer))

KERNEL: c.4 (tcb=c0302000) killed:
Unhandled trap

EAX ffffffff EBX 0071e000 ECX 00000064 EDX 0071d000
ESI 0100e3c0 EDI 0061f124 EBP 00665ec4 ESP 00665ec0
EIP 004e00dc EFLAGS 00013296
CS 001b SS 0023 DS 0023 ES 0023 FS 0023 GS 0043
trapno 13, error 00000000, from user mode
(internal event regarding GDT entry no. 0x00)

i want precise that i'm running fiasco and not fiasco-ux.

so i disassembled at the given eip and i found that :

... linux-env/l4linux-2.6/arch/l4/lib/arch-i386/../../../i386/lib/mmx.c:158
004e00d9        sfence
... linux-env/l4linux-2.6/arch/l4/lib/arch-i386/../../../i386/lib/mmx.c:161
004e00dc        mov    %cr0,%eax
004e00df        or     $0x8,%eax
004e00e2        mov    %eax,%cr0
004e00e5        pop    %ebx
004e00e6        leave
004e00e7        ret

so the problem occurs when the value of eax is put into cr0.
i took a look into the source, the error was in
static void fast_clear_page(void *page) and the line was
kernel_fpu_end(); which is a macro for

do { stts(); preempt_enable(); } while(0)

in i387.h  and stts is also a macro : #define stts() write_cr0(8 | read_cr0())

and we got those last two macro :

#define read_cr0() ({ \
	unsigned int __dummy; \
	__asm__( \
		"movl %%cr0,%0\n\t" \
		:"=r" (__dummy)); \
	__dummy; \
#define write_cr0(x) \
	__asm__("movl %0,%%cr0": :"r" (x));

I don't know what the problem is, i thought i had left a bad option in my kernel
configuration but i checked it and i saw nothing wrong for me (maybe i didn't
see it).

Thanx for your help.

Fabien Chaillou

More information about the l4-hackers mailing list