Index: arch/ia32/Makefile.inc
===================================================================
--- arch/ia32/Makefile.inc	(revision bc4a49f35b822101a8e091d5cd55e8e58ae06be1)
+++ arch/ia32/Makefile.inc	(revision af22f1588ae217fb7d524e7971a8d40647a9e7a7)
@@ -14,5 +14,5 @@
 
 CPPFLAGS=$(DEFS) -nostdinc -I../include
-CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -fomit-frame-pointer -Wmissing-prototypes -Werror -O3
+CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -fomit-frame-pointer -Wmissing-prototypes -Werror -O0
 LFLAGS=-M -no-check-sections -T ../arch/ia32/_link.ld
 
Index: arch/ia32/src/cpu/cpu.c
===================================================================
--- arch/ia32/src/cpu/cpu.c	(revision bc4a49f35b822101a8e091d5cd55e8e58ae06be1)
+++ arch/ia32/src/cpu/cpu.c	(revision af22f1588ae217fb7d524e7971a8d40647a9e7a7)
@@ -132,4 +132,5 @@
 		CPU->arch.stepping = (info.cpuid_eax>>0)&0xf;						
 	}
+    set_TS_flag();
 }
 
Index: arch/ia32/src/fpu_context.c
===================================================================
--- arch/ia32/src/fpu_context.c	(revision bc4a49f35b822101a8e091d5cd55e8e58ae06be1)
+++ arch/ia32/src/fpu_context.c	(revision af22f1588ae217fb7d524e7971a8d40647a9e7a7)
@@ -52,26 +52,28 @@
 void fpu_lazy_context_save(fpu_context_t *fctx)
 {
-    printf("");
-    asm(
-        "mov %0,%%eax;"
-        "fxsave (%%eax);"
-	:"=m"(fctx)
-	:
-	:"eax"
-    );	
-    printf("");
+	asm
+	(
+		"push %%eax;"
+		"mov 0x8(%%esp),%%eax;"
+		"fnsave (%%eax);"
+		"pop %%eax;"
+		:"=m"(fctx)
+		:
+		:"eax"
+	);	
 }
 
 void fpu_lazy_context_restore(fpu_context_t *fctx)
 {
-    printf("");
-    asm(
-        "mov %0,%%eax;"
-        "fxrstor (%%eax);"
-	:"=m"(fctx)
-	:
-	:"eax"
-    );
-    printf("");    
+	asm
+	(
+		"push %%eax;"
+		"mov 0x8(%%esp),%%eax;"
+		"frstor (%%eax);"
+		"pop %%eax;"
+		:"=m"(fctx)
+		:
+		:"eax"
+	);
 }
 
Index: arch/ia32/src/interrupt.c
===================================================================
--- arch/ia32/src/interrupt.c	(revision bc4a49f35b822101a8e091d5cd55e8e58ae06be1)
+++ arch/ia32/src/interrupt.c	(revision af22f1588ae217fb7d524e7971a8d40647a9e7a7)
@@ -102,5 +102,6 @@
         if ((CPU->fpu_owner)!=NULL) 
 	{  
-//	        printf("owner %X\n",(int)(&((CPU->fpu_owner)->saved_fpu_context)));        
+//		printf("tid:%d \n", THREAD->tid);
+//		printf("owner:%d\n", (CPU->fpu_owner)->tid);
 	        fpu_lazy_context_save(&((CPU->fpu_owner)->saved_fpu_context));
 
Index: test/fpu/fpu0/test.c
===================================================================
--- test/fpu/fpu0/test.c	(revision bc4a49f35b822101a8e091d5cd55e8e58ae06be1)
+++ test/fpu/fpu0/test.c	(revision af22f1588ae217fb7d524e7971a8d40647a9e7a7)
@@ -45,16 +45,21 @@
 {
 	int i;
-	while(1) {
+	while(1) 
+	{
 		double e,d,le,f;
 		le=-1;
 		e=0;
 		f=1;
-		for(i=0,d=1;e!=le;d*=f,f+=1,i++) {
+		for(i=0,d=1;e!=le;d*=f,f+=1,i++) 
+		{
 			le=e;
 			e=e+1/d;
-			if (i>1000000) {
-				printf("tid%d: e LOOPING\n", THREAD->tid);
+			if (i>20000000) 
+			{
+//				printf("tid%d: e LOOPING\n", THREAD->tid);
+				putchar('!');
 				i = 0;
 			}
+			
 		}
     
@@ -75,4 +80,6 @@
 		thread_ready(t);
 	}
+	
+	while(1);
 
 }
