diff -Nur haret-cvs-20060903/Makefile haret.mine/Makefile
--- haret-cvs-20060903/Makefile	2006-09-03 19:04:59.000000000 +0200
+++ haret.mine/Makefile	2006-09-25 20:24:39.000000000 +0200
@@ -15,7 +15,7 @@
 TARGET = wince
 
 # Program version
-VERSION=0.3.6
+VERSION=cvs-20060903-G500
 
 # Output directory
 OUT=out/
@@ -39,7 +39,7 @@
 $(OUT)haret$E: $(addprefix $(OUT),haret$O haret-res$O \
   s-cpu$O s-util$O memory$O gpio$O uart$O video$O \
   asmstuff$O irqchain$O getsetcp$O irq$O cpu-pxa$O cpu-s3c24xx$O \
-  util$O output$O script$O network$O cpu$O terminal$O linboot$O bw_mem$O lib_timing$O)
+  util$O output$O script$O network$O cpu$O terminal$O linboot$O bw_mem$O lib_timing$O com_port$O)
 	$(LINK)
 
 # WinCE resources (not used under Linux)
@@ -55,10 +55,10 @@
   include/s3c24xx.h include/s3c24xx/map.h include/s3c24xx/regs-dma.h \
   include/s3c24xx/regs-gpio.h include/s3c24xx/regs-serial.h \
   include/output.h include/haret.h include/memory.h include/util.h
-$(OUT)gpio$O: include/xtypes.h gpio.h include/memory.h include/output.h
+$(OUT)gpio$O: include/xtypes.h include/gpio.h include/memory.h include/output.h
 $(OUT)lib_timing$O: include/xtypes.h include/bench.h include/output.h
 $(OUT)linboot$O: include/haret.h include/xtypes.h include/setup.h \
-  include/memory.h include/util.h include/output.h gpio.h include/video.h \
+  include/memory.h include/util.h include/output.h include/gpio.h include/video.h \
   include/cpu.h include/pxa2xx.h include/s3c24xx.h include/s3c24xx/map.h \
   include/s3c24xx/regs-dma.h include/s3c24xx/regs-gpio.h \
   include/s3c24xx/regs-serial.h include/resource.h
@@ -75,7 +75,7 @@
   include/video.h include/output.h include/util.h include/cpu.h \
   include/pxa2xx.h include/s3c24xx.h include/s3c24xx/map.h \
   include/s3c24xx/regs-dma.h include/s3c24xx/regs-gpio.h \
-  include/s3c24xx/regs-serial.h gpio.h include/linboot.h include/bench.h \
+  include/s3c24xx/regs-serial.h include/gpio.h include/linboot.h include/bench.h \
   include/irq.h
 $(OUT)terminal$O: include/xtypes.h include/terminal.h
 $(OUT)uart$O: include/haret.h include/uart.h
@@ -83,12 +83,12 @@
 $(OUT)video$O: include/xtypes.h include/video.h include/haret.h \
   include/memory.h include/output.h
 $(OUT)cpu-pxa$O: include/haret.h include/xtypes.h include/setup.h \
-  include/memory.h include/util.h include/output.h gpio.h include/video.h \
+  include/memory.h include/util.h include/output.h include/gpio.h include/video.h \
   include/cpu.h include/pxa2xx.h include/s3c24xx.h include/s3c24xx/map.h \
   include/s3c24xx/regs-dma.h include/s3c24xx/regs-gpio.h \
   include/s3c24xx/regs-serial.h include/resource.h
 $(OUT)cpu-s3c24xx$O: include/haret.h include/xtypes.h include/setup.h \
-  include/memory.h include/util.h include/output.h gpio.h include/video.h \
+  include/memory.h include/util.h include/output.h include/gpio.h include/video.h \
   include/cpu.h include/pxa2xx.h include/s3c24xx.h include/s3c24xx/map.h \
   include/s3c24xx/regs-dma.h include/s3c24xx/regs-gpio.h \
   include/s3c24xx/regs-serial.h include/uart.h include/resource.h
diff -Nur haret-cvs-20060903/src/cpu.cpp haret.mine/src/cpu.cpp
--- haret-cvs-20060903/src/cpu.cpp	2006-09-03 19:04:58.000000000 +0200
+++ haret.mine/src/cpu.cpp	2006-09-03 19:09:04.000000000 +0200
@@ -49,6 +49,9 @@
 
 void cpuDetect ()
 {
+  cpu=&cpu_s3c24xx;
+  return;
+  /*
   for (int i = 0; i < sizeof (cpus) / sizeof (cpus [0]); i++)
     if (cpus [i]->detect ())
     {
@@ -58,6 +61,7 @@
     }
   Complain (C_ERROR ("Cannot detect the family of your CPU:\n"
                     L"some functions will not be available"));
+  */
 }
 
 uint32 cpuGetFamily (bool setval, uint32 *args, uint32 val)
diff -Nur haret-cvs-20060903/src/linboot.cpp haret.mine/src/linboot.cpp
--- haret-cvs-20060903/src/linboot.cpp	2006-09-03 19:04:58.000000000 +0200
+++ haret.mine/src/linboot.cpp	2006-09-25 20:21:58.000000000 +0200
@@ -362,16 +362,16 @@
     ptable [i] = memVirtToPhys ((uint32)kernel_bundle + (i << 12));
 
   // Recommended kernel placement = RAM start + 32K
-  // Initrd will be put at the address of kernel + 4Mb
+  // Initrd will be put at the address of kernel + 8Mb
   // (let's hope uncompressed kernel never happens to be larger than that).
-  uint32 initrd_phys_addr = memPhysAddr + 0x8000 + 0x400000;
+  uint32 initrd_phys_addr = memPhysAddr + 0x8000 + 0x800000;
   if (isize)
     Output (L"Physical initrd address: %08x", initrd_phys_addr);
 
   setup_linux_params (taglist, initrd_phys_addr, isize);
 
   Output (L"Goodbye cruel world ...");
-  Sleep (500);
+  //Sleep (500);
 
   // Reset AC97
   memPhysWrite (0x4050000C,0);
@@ -394,7 +394,9 @@
   uint32 *mmu = (uint32 *)memPhysMap (cpuGetMMU ());
 
    // call SetupLoad()
+  /* removed for the G500 : it makes the device hangs after disabling the MMU
   (cpu->setup_load)();
+  */
 
   cli ();
 
@@ -409,8 +411,11 @@
     // 1st level descriptor table. These addresses are hopefully
     // unused by WindowsCE (or rather unimportant for us now).
     cpuFlushCache ();
-    mmu [preloaderPA >> 20] = (preloaderPA & MMU_L1_SECTION_MASK) |
-        MMU_L1_SECTION | MMU_L1_AP_MASK;
+    mmu [preloaderPA >> 20] = (preloaderPA & MMU_L1_SECTION_MASK) | MMU_L1_SECTION | MMU_L1_AP_MASK;
+
+    // screen framebuffer 1:1 mapping if you want to use the test video always with the physical address
+    // for convenience
+    // mmu [0x33f40000 >> 20] = (0x33f40000 & MMU_L1_SECTION_MASK) | MMU_L1_SECTION | MMU_L1_AP_MASK;
 
     // Penguinize!
     linux_start (bootMachineType, npages, memPhysAddr, preloaderPA,
diff -Nur haret-cvs-20060903/src/wince/asmstuff.asm haret.mine/src/wince/asmstuff.asm
--- haret-cvs-20060903/src/wince/asmstuff.asm	2006-09-03 19:04:58.000000000 +0200
+++ haret.mine/src/wince/asmstuff.asm	2006-09-11 13:52:29.000000000 +0200
@@ -162,11 +162,27 @@
 		movne	r5, r2			; save kernel physical address in r5
 
 		subs	r4, r4, #1		; skip tags and kernel pages
-		addeq	r2, r5, #0x00400000	; place initrd at kernel + 4Mb
+		addeq	r2, r5, #0x00800000	; place initrd at kernel + 8Mb
 
 		subs	r1, r1, #1
 		bne	|nextpage|
 
+
+; sample test code that fills the screen with various garbage (infinite loop)
+;|testVideo|
+		;mov	r0, #0x47000000 ; virtual address
+		;add	r0, r0, #0x00e00000
+;		mov	r0, #0x33000000  ; physical address
+;		add	r0, r0, #0x00f40000
+;                mov     r2, #0x4b00
+;|toto|
+;                str     r3, [r0], #4
+;                add     r3, r3, #1
+;                subs     r2, r2, #1
+;                bne     |toto|
+;                b     |testVideo|
+                
+
 ; turn off LCD controller...
 ;		mov	r1, #0x44000000
 ;		ldr	r2, [r1]
diff -Nur haret-cvs-20060903/src/wince/haret.cpp haret.mine/src/wince/haret.cpp
--- haret-cvs-20060903/src/wince/haret.cpp	2006-09-03 19:04:58.000000000 +0200
+++ haret.mine/src/wince/haret.cpp	2006-09-03 19:13:11.000000000 +0200
@@ -25,7 +25,6 @@
 #include "cpu.h"
 #include "com_port.h"
 
-#define VERSION "0.3.7"
 #define WINDOW_CLASS TEXT("pmret")
 #define WINDOW_TITLE TEXT("HaRET")
 
@@ -94,7 +93,7 @@
 }
 
 /* avoid useless LCD calibration 950 times per session :) */
-void kill_welcome ()
+/*void kill_welcome ()
 {
   HANDLE hts = INVALID_HANDLE_VALUE;
   HANDLE hproc = INVALID_HANDLE_VALUE;
@@ -124,7 +123,7 @@
   }
 
   CloseToolhelp32Snapshot (hts);
-}
+}*/
 
 int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
   LPTSTR lpCmdLine, int nCmdShow)
@@ -165,8 +164,8 @@
   }
 
   /* kill LCD calibration app */
-  if (kill == 1)
-    kill_welcome();
+  /*if (kill == 1)
+    kill_welcome();*/
 
   if (run != 1)
   {
diff -Nur haret-cvs-20060903/src/wince/haret.rc haret.mine/src/wince/haret.rc
--- haret-cvs-20060903/src/wince/haret.rc	2006-09-03 19:04:58.000000000 +0200
+++ haret.mine/src/wince/haret.rc	2006-09-03 19:09:04.000000000 +0200
@@ -7,7 +7,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winres.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
diff -Nur haret-cvs-20060903/wince.smak haret.mine/wince.smak
--- haret-cvs-20060903/wince.smak	2006-09-03 19:04:59.000000000 +0200
+++ haret.mine/wince.smak	2006-09-03 19:11:38.000000000 +0200
@@ -11,29 +11,29 @@
 # The directory where your MSVC for StrongARM and the SDK is installed.
 # You should set up WINE (see /etc/wine.reg) so that it "sees" this drive
 # Overwrite this in config.smak
-DIR.MSVC.ARM ?= d:\\msvc-arm
+DIR.MSVC.ARM ?= c:\\msvc-arm
 
 # Set some env vars for msvc to use
 export WINEPATH = $(DIR.MSVC.ARM)\\bin
 export INCLUDE = $(DIR.MSVC.ARM)\\include
 export LIB = $(DIR.MSVC.ARM)\\lib
 
-CXX = wine -- $(DIR.MSVC.ARM)\\bin\\clarm.exe -c
+CXX = wine $(DIR.MSVC.ARM)\\bin\\clarm.exe -c
 CXXFLAGS.DEF = -DARM -DUNICODE -DUNDER_CE=0x0300 -D_WIN32_WCE=0x0300 -DNDEBUG
 CXXFLAGS.INC = -Iinclude
 # Do not enable optimization! msvc generates invalid code with -Oxs !!!
 CXXFLAGS = -nologo -W3 $(CXXFLAGS.DEF) $(CXXFLAGS.INC)
 
-ASM = wine -- $(DIR.MSVC.ARM)\\bin\\armasm.exe
-ASMFLAGS = -arch 4 -cpu StrongARM1 -32
+ASM = wine $(DIR.MSVC.ARM)\\bin\\armasm.exe
+ASMFLAGS = -arch 4 -32
 
-RC = wine -- $(DIR.MSVC.ARM)\\bin\\rc.exe
+RC = wine $(DIR.MSVC.ARM)\\bin\\rc.exe
 RCFLAGS = -r -l 0x409 $(CXXFLAGS.DEF) $(CXXFLAGS.INC)
 
-CVTRES = wine -- $(DIR.MSVC.ARM)\\bin\\cvtres.exe
+CVTRES = wine $(DIR.MSVC.ARM)\\bin\\cvtres.exe
 CVTRESFLAGS = -machine:arm -windowsce
 
-LD = wine -- $(DIR.MSVC.ARM)\\bin\\link.exe
+LD = wine $(DIR.MSVC.ARM)\\bin\\link.exe
 LDFLAGS = -nologo -base:0x10000 -stack:0x10000,0x1000 -entry:WinMainCRTStartup \
   -align:4096 -machine:ARM -subsystem:WindowsCE,3
 LIBS = aygshell.lib winsock.lib

