From: Dmitriy K. <dm...@ka...> - 2004-02-26 15:48:11
|
Welcome all I tried using 0.5.3 and 0.5.4 on old machine with amd k6-3+ CPU 0.5.3 runs ok but 0.5.4 crash my win2k (I tried only Debian 1gb imaged,updated to 3.0r1 using Debian CDs) After investing this issue I think I found the problem: 1.almost all is cross-compiled with i686-pc-cygwin 2.context switch code in src\colinux\arch\i386\passage.c use fxsave/fxrestor(which just not avaible on old CPUs)(fsave/frestor is avaible but not save SSE context but SSE is not exist on k6 anyway) here is patch for build 0.5.4 which will work on old CPUs (possible problem is that SSE state will not be saved when patched version runs on modern CPUs,better use some #define to detect minimal target CPU) diff -r -u colinux-20040225.k6/src/Makefile colinux-20040225/src/Makefile --- colinux-20040225.k6/src/Makefile 2004-02-26 03:28:39.496512000 +0600 +++ colinux-20040225/src/Makefile 2004-02-25 08:13:22.000000000 +0600 @@ -81,7 +81,7 @@ HOST_API_CFLAGS=-DCO_HOST_API -AR=i586-pc-cygwin-ar +AR=i686-pc-cygwin-ar TOOL_USER_CC=$(CC) $(USER_CFLAGS) $(CO_INCLUDES) -c $^ -o $@ TOOL_USER_GPP=$(GPP) $(USER_CFLAGS) $(CO_INCLUDES) -c $^ -o $@ diff -r -u colinux-20040225.k6/src/colinux/arch/i386/passage.c colinux-20040225/src/colinux/arch/i386/passage.c --- colinux-20040225.k6/src/colinux/arch/i386/passage.c 2004-02-26 21:24:34.790468800 +0600 +++ colinux-20040225/src/colinux/arch/i386/passage.c 2004-02-22 04:55:14.000000000 +0600 @@ -65,8 +65,9 @@ /* save return address */ " movl %ebx, 0x38(%ebp)" "\n" -/* " fxsave 0x70(%ebp)" "\n" */ - " fsave 0x70(%ebp)" "\n" + +/* save FPU / MMX / SSE state */ + " fxsave 0x70(%ebp)" "\n" /* Put the virtual address of the passage page in EBX */ " movl %ecx, %ebx" "\n" @@ -141,6 +142,7 @@ " movl %ebx, 0x0C(%ebp)" "\n" " movl %cs, %ebx" "\n" " movl %ebx, 0x04(%ebp)" "\n" + /* be on the safe side and nullify the segment registers */ " movl $0, %ebx" "\n" " movl %ebx, %fs" "\n" @@ -312,7 +314,7 @@ "1:" "\n" /* restore FPU / MMX / SSE state */ - " frstor 0x70(%ebp)" "\n" + " fxrstor 0x70(%ebp)" "\n" /* get old ESP in EAX */ " lss 0x40(%ebp), %eax" "\n" diff -r -u colinux-20040225.k6/src/colinux/os/winnt/Makefile colinux-20040225/src/colinux/os/winnt/Makefile --- colinux-20040225.k6/src/colinux/os/winnt/Makefile 2004-02-26 03:58:59.884100800 +0600 +++ colinux-20040225/src/colinux/os/winnt/Makefile 2004-02-05 03:32:54.000000000 +0600 @@ -7,7 +7,7 @@ #----------------------------------------------------------------- ifeq ($(COLINUX_ARCH),i386) -CROSS_TARGET=i586-pc-cygwin- +CROSS_TARGET=i686-pc-cygwin- else $(error Other Windows architectures not supported yet!) endif diff -r -u colinux-20040225.k6/src/colinux/os/winnt/build/Makefile colinux-20040225/src/colinux/os/winnt/build/Makefile --- colinux-20040225.k6/src/colinux/os/winnt/build/Makefile 2004-02-26 03:29:09.109092800 +0600 +++ colinux-20040225/src/colinux/os/winnt/build/Makefile 2004-02-25 05:21:30.000000000 +0600 @@ -24,7 +24,7 @@ CLEAN_FILES += $(BUILD_PATH)/driver.base.tmp $(BUILD_PATH)/driver.base.tmp: $(BUILD_PATH)/driver.o - i586-pc-cygwin-gcc -Wl,--base-file,$@ \ + i686-pc-cygwin-gcc -Wl,--base-file,$@ \ -Wl,--entry,_DriverEntry@8 \ -nostartfiles -nostdlib \ -o junk.tmp $^ -lntoskrnl -lhal -lgcc @@ -32,12 +32,12 @@ CLEAN_FILES += $(BUILD_PATH)/driver.base.exp $(BUILD_PATH)/driver.base.exp: $(BUILD_PATH)/driver.base.tmp - i586-pc-cygwin-dlltool --dllname linux.sys \ + i686-pc-cygwin-dlltool --dllname linux.sys \ --base-file $^ \ --output-exp $@ $(DRIVER_TARGET): $(BUILD_PATH)/driver.o $(BUILD_PATH)/driver.base.exp - i586-pc-cygwin-gcc \ + i686-pc-cygwin-gcc \ -Wl,--subsystem,native \ -Wl,--image-base,0x10000 \ -Wl,--file-alignment,0x1000 \ -- p.s.sorry for bad English With regads, Dmitriy mailto:dm...@ka... |