fix linebreaks
authormichael <michael>
Sun, 24 Jul 2005 17:30:28 +0000 (17:30 +0000)
committermichael <michael>
Sun, 24 Jul 2005 17:30:28 +0000 (17:30 +0000)
17 files changed:
ReadMe.txt
StdAfx.h
asm/asm-wince.asm
asm/asm.asm
asm/asmstuff-wince.asm
asm/asmstuff.asm
asm/test123.asm
boot.cpp
config.h
gpio.cpp
memory.cpp
newres.h
resource.h
setup.h
tester1.cpp
tester1.h
uart.cpp

index c5d3c5764aa95a798ed6eb8aec138c17c350ec9a..037b2f715fde2bd71c4c702716045db5457f6403 100644 (file)
@@ -1,77 +1,77 @@
-Linux loader for Pocket PC\r
-\r
-\r
-How to compile:\r
-\r
-1. Two asm files from asm directory has to be compiled with armasm.exe. This will create two \r
-obj files, that should be copied into lib directory(and will be included in the project)\r
-2. Compile & link project\r
-\r
-The c++ source file also contains some routines to read physical memory and to translate virtual mem to phys.\r
-However, the translation is limited and not fully implemented.\r
-\r
-The booting of Linux begins IMMEDIATELLY after program is started.\r
-zImage filename is "image2" (without "")\r
-initrd filename is "initrd"\r
-\r
-If it for some reason freezes try removing pieces of code that write into Frame buffer on Axim\r
-(this fb is beyond limits of physical memory and should not cause problems on IPAQ. adr=0x14042000)\r
-\r
-Limitations: There are some limitations of file sizes.\r
-\r
-If a screen with Hello World appears, there was a problem in booting. Check filenames.\r
-\r
-To make it work for SA11x0 you will have to change these lines in asm.asm:\r
-       ldr     r5, =0xa0000100\r
-\r
-       ldr     r7, =0xa0400000\r
-\r
-with proper adresses and limits of memory( just change the "a" with "8" I think)\r
-Also KERNELCOPY and INITRD macros have to be changed.\r
-\r
-\r
-author: Demo; cooldemo@inmail.sk\r
-\r
-\r
-================================================================================\r
-\r
-Amendment by Pigeon:\r
-\r
-linexec has been changed a lot and therefore some stuff in the above readme\r
-might not be true anymore. But anyway, here is how you use linexec:\r
-\r
-\r
-To use linexec, you need 4 files.\r
-\r
-linexec config file: params\r
-\r
-Create a file called "params", and put it under either "\My Documents\", or\r
-"\CF Card\". If you really care where and what this file is called, edit\r
-tester1.cpp and look for load_boot() call.\r
-\r
-This params file specifies three lines of config for:\r
-kernel image\r
-initrd image\r
-kernel args\r
-\r
-For example, my params looks like this:\r
-\My Documents\zimage\r
-\My Documents\initrd.gz\r
-init=/linuxrc keepinitrd root=/dev/rd/0\r
-\r
-\r
-(This is what I actually have in my params file, but remember this might not\r
-work for your kernel/device)\r
-\r
-(Also a note for the params file, seems that the code is only happy if the\r
-file is in unix format, i.e. newline as \r, but not dos format)\r
-\r
-\r
-And yes, if you see "Hello World", you've got something wrong.\r
-\r
-\r
-Pigeon.\r
-\r
-\r
-\r
-\r
+Linux loader for Pocket PC
+
+
+How to compile:
+
+1. Two asm files from asm directory has to be compiled with armasm.exe. This will create two 
+obj files, that should be copied into lib directory(and will be included in the project)
+2. Compile & link project
+
+The c++ source file also contains some routines to read physical memory and to translate virtual mem to phys.
+However, the translation is limited and not fully implemented.
+
+The booting of Linux begins IMMEDIATELLY after program is started.
+zImage filename is "image2" (without "")
+initrd filename is "initrd"
+
+If it for some reason freezes try removing pieces of code that write into Frame buffer on Axim
+(this fb is beyond limits of physical memory and should not cause problems on IPAQ. adr=0x14042000)
+
+Limitations: There are some limitations of file sizes.
+
+If a screen with Hello World appears, there was a problem in booting. Check filenames.
+
+To make it work for SA11x0 you will have to change these lines in asm.asm:
+       ldr     r5, =0xa0000100
+
+       ldr     r7, =0xa0400000
+
+with proper adresses and limits of memory( just change the "a" with "8" I think)
+Also KERNELCOPY and INITRD macros have to be changed.
+
+
+author: Demo; cooldemo@inmail.sk
+
+
+================================================================================
+
+Amendment by Pigeon:
+
+linexec has been changed a lot and therefore some stuff in the above readme
+might not be true anymore. But anyway, here is how you use linexec:
+
+
+To use linexec, you need 4 files.
+
+linexec config file: params
+
+Create a file called "params", and put it under either "\My Documents\", or
+"\CF Card\". If you really care where and what this file is called, edit
+tester1.cpp and look for load_boot() call.
+
+This params file specifies three lines of config for:
+kernel image
+initrd image
+kernel args
+
+For example, my params looks like this:
+\My Documents\zimage
+\My Documents\initrd.gz
+init=/linuxrc keepinitrd root=/dev/rd/0
+
+
+(This is what I actually have in my params file, but remember this might not
+work for your kernel/device)
+
+(Also a note for the params file, seems that the code is only happy if the
+file is in unix format, i.e. newline as \r, but not dos format)
+
+
+And yes, if you see "Hello World", you've got something wrong.
+
+
+Pigeon.
+
+
+
+
index fbbf3eeee657b08325dc18d8a837c8c76827f19f..6a85852dbfbd969ff2825848270bbb0d8fadc350 100644 (file)
--- a/StdAfx.h
+++ b/StdAfx.h
@@ -1,49 +1,49 @@
 // stdafx.h : include file for standard system include files,
 // stdafx.h : include file for standard system include files,
-\r
+
 //  or project specific include files that are used frequently, but
 //  or project specific include files that are used frequently, but
-\r
+
 //      are changed infrequently
 //      are changed infrequently
-\r
+
 //
 //
-\r
 
 
-\r
+
+
 #if !defined(AFX_STDAFX_H__E553AB80_24B1_4900_9879_D30DA5DD7F8A__INCLUDED_)
 #if !defined(AFX_STDAFX_H__E553AB80_24B1_4900_9879_D30DA5DD7F8A__INCLUDED_)
-\r
+
 #define AFX_STDAFX_H__E553AB80_24B1_4900_9879_D30DA5DD7F8A__INCLUDED_
 #define AFX_STDAFX_H__E553AB80_24B1_4900_9879_D30DA5DD7F8A__INCLUDED_
-\r
 
 
-\r
+
+
 #if _MSC_VER > 1000
 #if _MSC_VER > 1000
-\r
+
 #pragma once
 #pragma once
-\r
+
 #endif // _MSC_VER > 1000
 #endif // _MSC_VER > 1000
-\r
 
 
-\r
+
+
 #define WIN32_LEAN_AND_MEAN            // Exclude rarely-used stuff from Windows headers
 #define WIN32_LEAN_AND_MEAN            // Exclude rarely-used stuff from Windows headers
-\r
 
 
-\r
+
+
 // Windows Header Files:
 // Windows Header Files:
-\r
+
 #include <windows.h>
 #include <windows.h>
-\r
-\r
+
+
 // Local Header Files
 // Local Header Files
-\r
 
 
-\r
+
+
 // TODO: reference additional headers your program requires here
 // TODO: reference additional headers your program requires here
-\r
 
 
-\r
+
+
 //{{AFX_INSERT_LOCATION}}
 //{{AFX_INSERT_LOCATION}}
-\r
+
 // Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
 // Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
-\r
 
 
-\r
+
+
 #endif // !defined(AFX_STDAFX_H__E553AB80_24B1_4900_9879_D30DA5DD7F8A__INCLUDED_)
 #endif // !defined(AFX_STDAFX_H__E553AB80_24B1_4900_9879_D30DA5DD7F8A__INCLUDED_)
-\r
+
index a34be6e70ea7b8a69072d2546b219ac60c696dea..0cf3fad66210abeee7ae1b34987aa4cae1392960 100644 (file)
@@ -1,99 +1,99 @@
-       TTL     C:\pocket\test\asm.cpp\r\r
-\r\r
-       AREA    |.drectve|, DRECTVE\r\r
-       DCB     "-defaultlib:coredll.lib "\r\r
-       DCB     "-defaultlib:corelibc.lib "\r\r
-\r\r
-       EXPORT  |?do_it@@YAXXZ|                         ; do_it\r\r
-       AREA    |.pdata|, PDATA\r\r
-|$T222|        DCD     |?do_it@@YAXXZ|\r\r
-       DCD     0x40000100\r\r
-       AREA    |.text|, CODE\r\r
-|?do_it@@YAXXZ| PROC                                   ; do_it\r\r
-|$M220|\r\r
-       \r\r
-       mcr     p15, 0, r0, c7, c5, 0           ;/* invalidate i cache & BTB */\r\r
-                                                                               ;       CPWAIT  r0\r\r
-       mrc     p15, 0, r0, c2, c0, 0\r\r
-       mov     r0, r0\r\r
-       sub     pc, pc, #4              \r\r
-                                                                               ;       ldr     r9, =0xa1300100\r\r
-\r\r
-               mov             r9, r1                                  ;       add             r9, r1, #0x100  \r\r
-               ldr             r5, =0xa0000100                 ;       ldr             r5, =0xa0000100\r\r
-               ldr             r7, =0xa0100000\r\r
-label   ldr     r8, [r9]\r\r
-        str     r8, [r5]\r\r
-               add     r9, r9, #4 \r\r
-               add     r5, r5, #4 \r\r
-               cmp             r5, r7\r\r
-               blt             label\r\r
-\r\r
-crash  b crash\r\r
-\r\r
-       MOV             r4, #0xA0000000\r\r
-       add             r2,r4,#0x8000\r\r
-       \r\r
-       mov     r11,r2\r\r
-       ldr             r10,=337\r\r
-\r\r
-;      mcr     p15, 0, r0, c7, c10, 4 ;/* drain the write buffer*/\r\r
-\r\r
-;      CPWAIT  r0\r\r
-;      mrc     p15, 0, r0, c2, c0, 0\r\r
-;      mov     r0, r0\r\r
-;      sub     pc, pc, #4              \r\r
-\r\r
-\r\r
-       mcr     p15, 0, r0, c8, c7, 0x00        ;/* invalidate I+D TLB */\r\r
-;      CPWAIT  r0\r\r
-       mrc     p15, 0, r0, c2, c0, 0\r\r
-       mov     r0, r0\r\r
-       sub     pc, pc, #4              \r\r
-\r\r
-;      //; they skipped this, unnecessary? seems like we need to do this\r\r
-       mcr     p15, 0, r0, c7, c5, 0           ;/* invalidate i cache & BTB */\r\r
-       \r\r
-; S bit set, p and d bit set (no 26 bit mode)\r\r
-;      mov     r3, #0x120      ; xscale says p needs to be 0 ???\r\r
-;      mcr     p15, 0, r3, c1, c0, 0   ;/* disable the MMU */\r\r
-\r\r
-;      CPWAIT  r0\r\r
-;      mrc     p15, 0, r0, c2, c0, 0\r\r
-;      mov     r0, r0\r\r
-;      sub     pc, pc, #4              \r\r
-\r\r
-\r\r
-;        /*; make sure the pipeline is emptied*/\r\r
-        mov     r0,#0\r\r
-        mov     r0,r0\r\r
-        mov     r0,r0\r\r
-        mov     r0,r0\r\r
-\r\r
-;      /* zero PID in Process ID Virtual Address Map register. */\r\r
-;      mov     r0, #0\r\r
-       mcr     p15, 0, r0, c13, c0, 0\r\r
-\r\r
-\r\r
-;      CPWAIT  r0\r\r
-       mrc     p15, 0, r0, c2, c0, 0\r\r
-       mov     r0, r0\r\r
-       sub     pc, pc, #4              \r\r
-\r\r
-;      ldr     r5, =0xA00512F5\r\r
-;      ldr     r8, =0xefef0000\r\r
-;      str     r8, [r5] \r\r
-\r\r
-\r\r
-       mov     r0, #0\r\r
-    mov     r1, r10\r\r
-       ldr     r2, [r2, #0]\r\r
-       mov     r2, #0\r\r
-       mov     pc, r11 \r\r
-\r\r
-\r\r
-|$M221|\r\r
-\r\r
-       ENDP  ; |?do_it@@YAXXZ|, do_it\r\r
-\r\r
-       END\r\r
+       TTL     C:\pocket\test\asm.cpp\r
+\r
+       AREA    |.drectve|, DRECTVE\r
+       DCB     "-defaultlib:coredll.lib "\r
+       DCB     "-defaultlib:corelibc.lib "\r
+\r
+       EXPORT  |?do_it@@YAXXZ|                         ; do_it\r
+       AREA    |.pdata|, PDATA\r
+|$T222|        DCD     |?do_it@@YAXXZ|\r
+       DCD     0x40000100\r
+       AREA    |.text|, CODE\r
+|?do_it@@YAXXZ| PROC                                   ; do_it\r
+|$M220|\r
+       \r
+       mcr     p15, 0, r0, c7, c5, 0           ;/* invalidate i cache & BTB */\r
+                                                                               ;       CPWAIT  r0\r
+       mrc     p15, 0, r0, c2, c0, 0\r
+       mov     r0, r0\r
+       sub     pc, pc, #4              \r
+                                                                               ;       ldr     r9, =0xa1300100\r
+\r
+               mov             r9, r1                                  ;       add             r9, r1, #0x100  \r
+               ldr             r5, =0xa0000100                 ;       ldr             r5, =0xa0000100\r
+               ldr             r7, =0xa0100000\r
+label   ldr     r8, [r9]\r
+        str     r8, [r5]\r
+               add     r9, r9, #4 \r
+               add     r5, r5, #4 \r
+               cmp             r5, r7\r
+               blt             label\r
+\r
+crash  b crash\r
+\r
+       MOV             r4, #0xA0000000\r
+       add             r2,r4,#0x8000\r
+       \r
+       mov     r11,r2\r
+       ldr             r10,=337\r
+\r
+;      mcr     p15, 0, r0, c7, c10, 4 ;/* drain the write buffer*/\r
+\r
+;      CPWAIT  r0\r
+;      mrc     p15, 0, r0, c2, c0, 0\r
+;      mov     r0, r0\r
+;      sub     pc, pc, #4              \r
+\r
+\r
+       mcr     p15, 0, r0, c8, c7, 0x00        ;/* invalidate I+D TLB */\r
+;      CPWAIT  r0\r
+       mrc     p15, 0, r0, c2, c0, 0\r
+       mov     r0, r0\r
+       sub     pc, pc, #4              \r
+\r
+;      //; they skipped this, unnecessary? seems like we need to do this\r
+       mcr     p15, 0, r0, c7, c5, 0           ;/* invalidate i cache & BTB */\r
+       \r
+; S bit set, p and d bit set (no 26 bit mode)\r
+;      mov     r3, #0x120      ; xscale says p needs to be 0 ???\r
+;      mcr     p15, 0, r3, c1, c0, 0   ;/* disable the MMU */\r
+\r
+;      CPWAIT  r0\r
+;      mrc     p15, 0, r0, c2, c0, 0\r
+;      mov     r0, r0\r
+;      sub     pc, pc, #4              \r
+\r
+\r
+;        /*; make sure the pipeline is emptied*/\r
+        mov     r0,#0\r
+        mov     r0,r0\r
+        mov     r0,r0\r
+        mov     r0,r0\r
+\r
+;      /* zero PID in Process ID Virtual Address Map register. */\r
+;      mov     r0, #0\r
+       mcr     p15, 0, r0, c13, c0, 0\r
+\r
+\r
+;      CPWAIT  r0\r
+       mrc     p15, 0, r0, c2, c0, 0\r
+       mov     r0, r0\r
+       sub     pc, pc, #4              \r
+\r
+;      ldr     r5, =0xA00512F5\r
+;      ldr     r8, =0xefef0000\r
+;      str     r8, [r5] \r
+\r
+\r
+       mov     r0, #0\r
+    mov     r1, r10\r
+       ldr     r2, [r2, #0]\r
+       mov     r2, #0\r
+       mov     pc, r11 \r
+\r
+\r
+|$M221|\r
+\r
+       ENDP  ; |?do_it@@YAXXZ|, do_it\r
+\r
+       END\r
index fa9a15c7a6b57b1901ddd16988da606db9b34da3..ddc6ef538431d735a35725bac39e7ed6e2abbed7 100644 (file)
-       TTL     C:\pocket\test\asm.cpp\r
-\r
-       AREA    |.drectve|, DRECTVE\r
-       DCB     "-defaultlib:coredll.lib "\r
-       DCB     "-defaultlib:corelibc.lib "\r
-\r
-       EXPORT  |?do_it@@YAXXZ|                         ; do_it\r
-       AREA    |.pdata|, PDATA\r
-|$T222|        DCD     |?do_it@@YAXXZ|\r
-       DCD     0x40000100\r
-       AREA    |.text|, CODE\r
-|?do_it@@YAXXZ| PROC                                   ; do_it\r
-|$M220|\r
-\r
-\r
-               mcr     p15, 0, r0, c7, c5, 0   ;/* invalidate i cache & BTB */\r
-               mrc     p15, 0, r0, c2, c0, 0\r
-               mov     r0, r0\r
-               sub     pc, pc, #4              \r
-\r
-\r
-; turn off LCD controller...\r
-; I couldn't figure out how to use armasm.exe conditional with variables\r
-; #if xscale\r
-;              ldr     r9, =0x44000000\r
-;              ldr     r8, [r9]\r
-;              orr     r8, r8, #0x400\r
-;              str     r8, [r9]\r
-\r
-; #elif strongarm\r
-               ldr     r9, =0xb0100000\r
-               ldr     r8, [r9]\r
-               bic     r8, r8, #1\r
-               str     r8, [r9]\r
-\r
-; turn off unused serial ports\r
-\r
-               mov r8, #0\r
-               ldr r9, =0x80010000\r
-               str r8, [r9, #0xC]\r
-               ldr r9, =0x80050000\r
-               str r8, [r9, #0xC]\r
-\r
-; #endif\r
-\r
-               add     r9, r1, #0x100\r
-\r
-; #if xscale\r
-;              ldr     r5, =0xa0000100\r
-;              ldr     r7, =0xa0400000\r
-\r
-; #elif strongarm\r
-               ldr     r5, =0xc0000100\r
-               ldr     r7, =0xc0400000\r
-; #endif\r
-\r
-\r
-label          ldr     r8, [r9]\r
-               str     r8, [r5]\r
-               add     r9, r9, #4 \r
-               add     r5, r5, #4 \r
-               cmp     r5, r7\r
-               blt     label\r
-\r
-; #if xscale\r
-;              MOV     r4, #0xA0000000\r
-\r
-; #elif strongarm\r
-               MOV     r4, #0xc0000000\r
-; #endif\r
-\r
-               add     r11,r4,#0x8000\r
-\r
-               mov     r10,r2          ;machine number passed from DRAMloader\r
-\r
-               mcr     p15, 0, r0, c8, c7, 0x00 ;/* invalidate I+D TLB */\r
-               mrc     p15, 0, r0, c2, c0, 0\r
-               mov     r0, r0\r
-               sub     pc, pc, #4              \r
-\r
-; they skipped this, unnecessary? seems like we need to do this\r
-\r
-               mcr     p15, 0, r0, c7, c5, 0   ;/* invalidate i cache & BTB */\r
-       \r
-               mov     r0, #0\r
-               mcr     p15, 0, r0, c13, c0, 0\r
-               mrc     p15, 0, r0, c2, c0, 0\r
-               mov     r0, r0\r
-               sub     pc, pc, #4              \r
-\r
-               mov     r0, #0\r
-               mov     r1, r10\r
-               ldr     r2, [r2, #0]\r
-               mov     r2, #0\r
-\r
-; Jump into the kernel:\r
-               mov             pc, r11 \r
-\r
-\r
-|$M221|\r
-       ENDP  ; |?do_it@@YAXXZ|, do_it\r
-       END\r
-\r
+       TTL     C:\pocket\test\asm.cpp
+
+       AREA    |.drectve|, DRECTVE
+       DCB     "-defaultlib:coredll.lib "
+       DCB     "-defaultlib:corelibc.lib "
+
+       EXPORT  |?do_it@@YAXXZ|                         ; do_it
+       AREA    |.pdata|, PDATA
+|$T222|        DCD     |?do_it@@YAXXZ|
+       DCD     0x40000100
+       AREA    |.text|, CODE
+|?do_it@@YAXXZ| PROC                                   ; do_it
+|$M220|
+
+
+               mcr     p15, 0, r0, c7, c5, 0   ;/* invalidate i cache & BTB */
+               mrc     p15, 0, r0, c2, c0, 0
+               mov     r0, r0
+               sub     pc, pc, #4              
+
+
+; turn off LCD controller...
+; I couldn't figure out how to use armasm.exe conditional with variables
+; #if xscale
+;              ldr     r9, =0x44000000
+;              ldr     r8, [r9]
+;              orr     r8, r8, #0x400
+;              str     r8, [r9]
+
+; #elif strongarm
+               ldr     r9, =0xb0100000
+               ldr     r8, [r9]
+               bic     r8, r8, #1
+               str     r8, [r9]
+
+; turn off unused serial ports
+
+               mov r8, #0
+               ldr r9, =0x80010000
+               str r8, [r9, #0xC]
+               ldr r9, =0x80050000
+               str r8, [r9, #0xC]
+
+; #endif
+
+               add     r9, r1, #0x100
+
+; #if xscale
+;              ldr     r5, =0xa0000100
+;              ldr     r7, =0xa0400000
+
+; #elif strongarm
+               ldr     r5, =0xc0000100
+               ldr     r7, =0xc0400000
+; #endif
+
+
+label          ldr     r8, [r9]
+               str     r8, [r5]
+               add     r9, r9, #4 
+               add     r5, r5, #4 
+               cmp     r5, r7
+               blt     label
+
+; #if xscale
+;              MOV     r4, #0xA0000000
+
+; #elif strongarm
+               MOV     r4, #0xc0000000
+; #endif
+
+               add     r11,r4,#0x8000
+
+               mov     r10,r2          ;machine number passed from DRAMloader
+
+               mcr     p15, 0, r0, c8, c7, 0x00 ;/* invalidate I+D TLB */
+               mrc     p15, 0, r0, c2, c0, 0
+               mov     r0, r0
+               sub     pc, pc, #4              
+
+; they skipped this, unnecessary? seems like we need to do this
+
+               mcr     p15, 0, r0, c7, c5, 0   ;/* invalidate i cache & BTB */
+       
+               mov     r0, #0
+               mcr     p15, 0, r0, c13, c0, 0
+               mrc     p15, 0, r0, c2, c0, 0
+               mov     r0, r0
+               sub     pc, pc, #4              
+
+               mov     r0, #0
+               mov     r1, r10
+               ldr     r2, [r2, #0]
+               mov     r2, #0
+
+; Jump into the kernel:
+               mov             pc, r11 
+
+
+|$M221|
+       ENDP  ; |?do_it@@YAXXZ|, do_it
+       END
+
index 76095e1d1bf9d3e0904a00cb09bbeab74c651317..dd0abce16bb7d955c3304988eed54df519e0850a 100644 (file)
@@ -1,70 +1,70 @@
-       TTL     C:\pocket\asmstuff\asmstuff.cpp\r\r
-\r\r
-       AREA    |.drectve|, DRECTVE\r\r
-       DCB     "-defaultlib:coredll.lib "\r\r
-       DCB     "-defaultlib:corelibc.lib "\r\r
-\r\r
-       EXPORT  |?read_mmu@@YAHXZ|                      ; read_mmu\r\r
-       AREA    |.pdata|, PDATA\r\r
-|$T229|        DCD     |?read_mmu@@YAHXZ|\r\r
-       DCD     0x40000200\r\r
-       AREA    |.text|, CODE\r\r
-|?read_mmu@@YAHXZ| PROC                                        ; read_mmu\r\r
-|$M227|\r\r
-       mov       r0, #0x33  ; 0x33 = 51\r\r
-       mrc     p15, 0, r0, c2, c0, 0 \r\r
-       mov       pc, lr\r\r
-|$M228|\r\r
-       ENDP  ; |?read_mmu@@YAHXZ|, read_mmu\r\r
-\r\r
-       EXPORT  |?IntOff@@YAXXZ|                        ; IntOff\r\r
-       AREA    |.pdata|, PDATA\r\r
-|$T233|        DCD     |?IntOff@@YAXXZ|\r\r
-       DCD     0x40000100\r\r
-       AREA    |.text|, CODE\r\r
-|?IntOff@@YAXXZ| PROC                                  ; IntOff\r\r
-; Line 9\r\r
-       mrs     r4,cpsr\r\r
-       orr     r1,r4,#0xef\r\r
-       msr     cpsr_c,r1\r\r
-       mov       pc, lr\r\r
-|$M231|\r\r
-       mov       pc, lr\r\r
-|$M232|\r\r
-       ENDP  ; |?IntOff@@YAXXZ|, IntOff\r\r
-\r\r
-\r\r
-       EXPORT  |?DRAMloader@@YAXI@Z|           ; DRAMloader\r\r
-       AREA    |.pdata|, PDATA\r\r
-|$T237|        DCD     |?DRAMloader@@YAXI@Z|\r\r
-       DCD     0x40000b04\r\r
-       AREA    |.text|, CODE\r\r
-|?DRAMloader@@YAXI@Z| PROC                             ; DRAMloader\r\r
-       mov       r12, sp\r\r
-       stmdb     sp!, {r0}                                     ; stmfd\r\r
-       stmdb     sp!, {r12, lr}                        ; stmfd\r\r
-       sub       sp, sp, #4\r\r
-|$M235|\r\r
-       ldr       r3, [sp, #0xC]                        ; 0xC = 12\r\r
-       str       r3, [sp]\r\r
-       ldr       r1, [sp]\r\r
-       ldr     r0, =0x3fff\r\r
-       mcr     p15, 0, r0, c7, c10, 4          ; Enable access\r\r
-       mrc             p15, 0, r0, c2, c0, 0\r\r
-       mov             r0, r0\r\r
-       mrc     p15, 0, r3, c1, c0, 0           ;/* disable the MMU */\r\r
-       and     r3, r3, #0xfffffffe             ; xscale says p needs to be 0 ???\r\r
-       mov             r3, #0x120\r\r
-       mcr     p15, 0, r3, c1, c0, 0           ;/* disable the MMU */\r\r
-                                                                               ;       CPWAIT  r0\r\r
-       mrc             p15, 0, r0, c2, c0, 0\r\r
-       mov             r0, r0                                          \r\r
-\r\r
-       mov             pc,r1                                           ; GO GO GO GO GO\r\r
-                                                                               ; can't get here ??? -- jw, 20030517\r\r
-       add       sp, sp, #4\r\r
-       ldmia     sp, {sp, pc}  ; ldmfd\r\r
-|$M236|\r\r
-       ENDP  ; |?DRAMloader@@YAXI@Z|, DRAMloader\r\r
-\r\r
-       END
\ No newline at end of file
+       TTL     C:\pocket\asmstuff\asmstuff.cpp\r
+\r
+       AREA    |.drectve|, DRECTVE\r
+       DCB     "-defaultlib:coredll.lib "\r
+       DCB     "-defaultlib:corelibc.lib "\r
+\r
+       EXPORT  |?read_mmu@@YAHXZ|                      ; read_mmu\r
+       AREA    |.pdata|, PDATA\r
+|$T229|        DCD     |?read_mmu@@YAHXZ|\r
+       DCD     0x40000200\r
+       AREA    |.text|, CODE\r
+|?read_mmu@@YAHXZ| PROC                                        ; read_mmu\r
+|$M227|\r
+       mov       r0, #0x33  ; 0x33 = 51\r
+       mrc     p15, 0, r0, c2, c0, 0 \r
+       mov       pc, lr\r
+|$M228|\r
+       ENDP  ; |?read_mmu@@YAHXZ|, read_mmu\r
+\r
+       EXPORT  |?IntOff@@YAXXZ|                        ; IntOff\r
+       AREA    |.pdata|, PDATA\r
+|$T233|        DCD     |?IntOff@@YAXXZ|\r
+       DCD     0x40000100\r
+       AREA    |.text|, CODE\r
+|?IntOff@@YAXXZ| PROC                                  ; IntOff\r
+; Line 9\r
+       mrs     r4,cpsr\r
+       orr     r1,r4,#0xef\r
+       msr     cpsr_c,r1\r
+       mov       pc, lr\r
+|$M231|\r
+       mov       pc, lr\r
+|$M232|\r
+       ENDP  ; |?IntOff@@YAXXZ|, IntOff\r
+\r
+\r
+       EXPORT  |?DRAMloader@@YAXI@Z|           ; DRAMloader\r
+       AREA    |.pdata|, PDATA\r
+|$T237|        DCD     |?DRAMloader@@YAXI@Z|\r
+       DCD     0x40000b04\r
+       AREA    |.text|, CODE\r
+|?DRAMloader@@YAXI@Z| PROC                             ; DRAMloader\r
+       mov       r12, sp\r
+       stmdb     sp!, {r0}                                     ; stmfd\r
+       stmdb     sp!, {r12, lr}                        ; stmfd\r
+       sub       sp, sp, #4\r
+|$M235|\r
+       ldr       r3, [sp, #0xC]                        ; 0xC = 12\r
+       str       r3, [sp]\r
+       ldr       r1, [sp]\r
+       ldr     r0, =0x3fff\r
+       mcr     p15, 0, r0, c7, c10, 4          ; Enable access\r
+       mrc             p15, 0, r0, c2, c0, 0\r
+       mov             r0, r0\r
+       mrc     p15, 0, r3, c1, c0, 0           ;/* disable the MMU */\r
+       and     r3, r3, #0xfffffffe             ; xscale says p needs to be 0 ???\r
+       mov             r3, #0x120\r
+       mcr     p15, 0, r3, c1, c0, 0           ;/* disable the MMU */\r
+                                                                               ;       CPWAIT  r0\r
+       mrc             p15, 0, r0, c2, c0, 0\r
+       mov             r0, r0                                          \r
+\r
+       mov             pc,r1                                           ; GO GO GO GO GO\r
+                                                                               ; can't get here ??? -- jw, 20030517\r
+       add       sp, sp, #4\r
+       ldmia     sp, {sp, pc}  ; ldmfd\r
+|$M236|\r
+       ENDP  ; |?DRAMloader@@YAXI@Z|, DRAMloader\r
+\r
+       END
index e737febe875176a94f2dbb55bf52f91fe1454219..05bdac6a7107da7cc58b6530af9aef838e80e28f 100644 (file)
@@ -1,9 +1,9 @@
        TTL     C:\pocket\asmstuff\asmstuff.cpp
        TTL     C:\pocket\asmstuff\asmstuff.cpp
-\r
+
        AREA    |.drectve|, DRECTVE
        DCB     "-defaultlib:coredll.lib "
        DCB     "-defaultlib:corelibc.lib "
        AREA    |.drectve|, DRECTVE
        DCB     "-defaultlib:coredll.lib "
        DCB     "-defaultlib:corelibc.lib "
-\r
+
        EXPORT  |?read_mmu@@YAHXZ|                      ; read_mmu
        AREA    |.pdata|, PDATA
 |$T231|        DCD     |?read_mmu@@YAHXZ|
        EXPORT  |?read_mmu@@YAHXZ|                      ; read_mmu
        AREA    |.pdata|, PDATA
 |$T231|        DCD     |?read_mmu@@YAHXZ|
        AREA    |.text|, CODE
 |?read_mmu@@YAHXZ| PROC                                        ; read_mmu
 |$M229|
        AREA    |.text|, CODE
 |?read_mmu@@YAHXZ| PROC                                        ; read_mmu
 |$M229|
-\r
+
        mrc     p15, 0, r0, c2, c0, 0 
        mov       pc, lr
        mrc     p15, 0, r0, c2, c0, 0 
        mov       pc, lr
-\r
+
 |$M230|
        ENDP  ; |?read_mmu@@YAHXZ|, read_mmu
 |$M230|
        ENDP  ; |?read_mmu@@YAHXZ|, read_mmu
-\r
+
        EXPORT  |?IntOff@@YAXXZ|                        ; IntOff
        AREA    |.pdata|, PDATA
 |$T235|        DCD     |?IntOff@@YAXXZ|
        EXPORT  |?IntOff@@YAXXZ|                        ; IntOff
        AREA    |.pdata|, PDATA
 |$T235|        DCD     |?IntOff@@YAXXZ|
        AREA    |.text|, CODE
 |?IntOff@@YAXXZ| PROC                                  ; IntOff
 |$M233|
        AREA    |.text|, CODE
 |?IntOff@@YAXXZ| PROC                                  ; IntOff
 |$M233|
-\r
+
        mrs             r4,cpsr
        orr             r1,r4,#0xef
        msr             cpsr_c,r1
        mov             pc, lr
        mrs             r4,cpsr
        orr             r1,r4,#0xef
        msr             cpsr_c,r1
        mov             pc, lr
-\r
+
 |$M234|
        ENDP  ; |?IntOff@@YAXXZ|, IntOff
 |$M234|
        ENDP  ; |?IntOff@@YAXXZ|, IntOff
-\r
-\r
+
+
        EXPORT  |?DRAMloader@@YAXII@Z|                  ; DRAMloader
        AREA    |.pdata|, PDATA
 |$T239|        DCD     |?DRAMloader@@YAXII@Z|
        DCD     0x40001004
        AREA    |.text|, CODE
 |?DRAMloader@@YAXII@Z| PROC                            ; DRAMloader
        EXPORT  |?DRAMloader@@YAXII@Z|                  ; DRAMloader
        AREA    |.pdata|, PDATA
 |$T239|        DCD     |?DRAMloader@@YAXII@Z|
        DCD     0x40001004
        AREA    |.text|, CODE
 |?DRAMloader@@YAXII@Z| PROC                            ; DRAMloader
-\r
+
        mov       r12, sp
        stmdb     sp!, {r0, r1}  ; stmfd
        stmdb     sp!, {r12, lr}  ; stmfd
        sub       sp, sp, #8
        mov       r12, sp
        stmdb     sp!, {r0, r1}  ; stmfd
        stmdb     sp!, {r12, lr}  ; stmfd
        sub       sp, sp, #8
-\r
+
 |$M237|
 |$M237|
-\r
+
        ldr             r3, [sp, #0x10]  ; 0x10 = 16
        str             r3, [sp]
        ldr             r2, [sp, #0x14]  ; 0x14 = 20
        str             r2, [sp, #4]
        ldr             r3, [sp, #0x10]  ; 0x10 = 16
        str             r3, [sp]
        ldr             r2, [sp, #0x14]  ; 0x14 = 20
        str             r2, [sp, #4]
-\r
+
        ldr             r1, [sp]           ; jump address
        ldr             r2, [sp, #4]       ; machine number
        ldr             r1, [sp]           ; jump address
        ldr             r2, [sp, #4]       ; machine number
-\r
+
        ldr             r0, =0x3fff
        mcr     p15, 0, r0, c7, c10, 4 ;Enable access
        ldr             r0, =0x3fff
        mcr     p15, 0, r0, c7, c10, 4 ;Enable access
-       mrc             p15, 0, r0, c2, c0, 0\r
+       mrc             p15, 0, r0, c2, c0, 0
        mov             r0, r0
        mov             r0, r0
-\r
-       mrc     p15, 0, r3, c1, c0, 0   ;/* disable the MMU */\r
-       and     r3, r3, #0xfffffffe     ; xscale says p needs to be 0 ???\r
-       mov     r3, #0x120\r
+
+       mrc     p15, 0, r3, c1, c0, 0   ;/* disable the MMU */
+       and     r3, r3, #0xfffffffe     ; xscale says p needs to be 0 ???
+       mov     r3, #0x120
        mcr     p15, 0, r3, c1, c0, 0   ;/* disable the MMU */
        mrc     p15, 0, r0, c2, c0, 0
        mov     r0, r0
 
        mcr     p15, 0, r3, c1, c0, 0   ;/* disable the MMU */
        mrc     p15, 0, r0, c2, c0, 0
        mov     r0, r0
 
-; Jump into do_it and the kernel\r
+; Jump into do_it and the kernel
        mov     pc,r1                   ; machine number is in register r2
        mov     pc,r1                   ; machine number is in register r2
-\r
+
 |$M238|
        ENDP  ; |?DRAMloader@@YAXII@Z|, DRAMloader
        END
 |$M238|
        ENDP  ; |?DRAMloader@@YAXII@Z|, DRAMloader
        END
-\r
+
index 25595527545259c825b20b3ec96c5cc9239de351..de4fe71072e07c2706a5d6f01b3fd856b6b4431f 100644 (file)
@@ -1,7 +1,7 @@
-loopl  ldr             r5, =0xA0051000                                 ; right before we jump in\r\r
-       ldr             r6, =0xA0051100\r\r
-       ldr             r8, =0xFE00FE00\r\r
-       str     r8, [r5] \r\r
-       add             r5, r5, #0x04\r\r
-       cmp                     r5,r6\r\r
-       blt             loopl
\ No newline at end of file
+loopl  ldr             r5, =0xA0051000                                 ; right before we jump in\r
+       ldr             r6, =0xA0051100\r
+       ldr             r8, =0xFE00FE00\r
+       str     r8, [r5] \r
+       add             r5, r5, #0x04\r
+       cmp                     r5,r6\r
+       blt             loopl
index 1d3706a4f429c82382dfd42872f3fec4aa049f54..1204c7973214a7d2f6a756f8792133f2c071f99e 100644 (file)
--- a/boot.cpp
+++ b/boot.cpp
-#include "stdafx.h"\r
-#include "tester1.h"\r
-#include <commctrl.h>\r
-//#include <aygshell.h>\r
-#include <sipapi.h>\r
-#include "setup.h"\r
-\r
-\r
-#define BOOT_LOGO_PATH "\\My Documents\\booting.bmp"\r
-#define BOOT_LOGO_PATH_CF "\\CF Card\\booting.bmp"\r
-#define BOOT_LOGO_DONE_PATH "\\My Documents\\done.bmp"\r
-#define BOOT_LOGO_DONE_PATH_CF "\\CF Card\\done.bmp"\r
-#define DONE1_X        100\r
-#define DONE1_Y        100\r
-#define DONE2_X        100\r
-#define DONE2_Y        130\r
-\r
-\r
-void setup_linux_params(long bootimg_dest, UINT32 initrd,UINT32 initrdl, long dram_size, const char *cmdline, char*base)\r
-{\r
-       int rootdev = 0x00ff;\r
-       struct tag *tag;\r
-       int newcmdlinelen = 0;\r
-       char *newcmdline = NULL;\r
-\r
-\r
-       tag = (struct tag *)(base+0x100);\r
-\r
-       tag->hdr.tag = ATAG_CORE;\r
-       tag->hdr.size = tag_size(tag_core);\r
-       tag->u.core.flags =0;\r
-       tag->u.core.pagesize = 0x00001000;\r
-       tag->u.core.rootdev = rootdev;\r
-       tag = tag_next(tag);\r
-\r
-       // now the cmdline tag\r
-       tag->hdr.tag = ATAG_CMDLINE;\r
-       // must be at least +3!! 1 for the null and 2 for the ???\r
-       tag->hdr.size = (strlen(cmdline) + 3 + sizeof(struct tag_header)) >> 2;\r
-       //tag->hdr.size = (strlen(cmdline) + 10 + sizeof(struct tag_header)) >> 2;\r
-       strcpy(tag->u.cmdline.cmdline,cmdline);\r
-       tag = tag_next(tag);\r
-\r
-\r
-       // now the mem32 tag\r
-       tag->hdr.tag = ATAG_MEM;\r
-       tag->hdr.size = tag_size(tag_mem32);\r
-       tag->u.mem.size = dram_size;\r
-       tag->u.mem.start = MEM_START;\r
-       tag = tag_next(tag);\r
-       \r
-\r
-       /* and now the initrd tag */\r
-       if (initrdl) {\r
-               tag->hdr.tag = INITRD_TAG;\r
-               tag->hdr.size = tag_size(tag_initrd);\r
-               tag->u.initrd.start = initrd;\r
-               tag->u.initrd.size = initrdl;\r
-               tag = tag_next(tag);\r
-       }\r
-   \r
-       tag->hdr.tag = ATAG_VIDEOTEXT;\r
-       tag->hdr.size = tag_size(tag_videotext);\r
-       tag->u.videotext.video_lines = 40;\r
-       tag->u.videotext.video_cols = 30;\r
-       tag = tag_next(tag);\r
-\r
-       // now the NULL tag\r
-       tag->hdr.tag = ATAG_NONE;\r
-       tag->hdr.size = 0;\r
-}\r
-\r
-\r
-\r
-\r
-\r
-/* loading process:\r
-function do_it is loaded onto address KERNELCOPY along with parameters(offset=0x100) and\r
-kernel image(offset=0x8000). Afterwards DRAMloader is called; it disables MMU and\r
-jumps onto KERNELCOPY. Function do_it then copies kernel image to its proper address(0xA0008000) \r
-and calls it.\r
-Initrd is loaded onto address INITRD and the address is passed to kernel via ATAG\r
-*/\r
-\r
-\r
-// This resets some devices\r
-void ResetDevices()\r
-{\r
-#ifndef STRONGARM\r
-       WritePhysical(0x4050000C,0); // Reset AC97\r
-       WritePhysical(0x48000014,0); // Reset PCMCIA\r
-       for(int i=0;i<0x3C;i+=4)\r
-               WritePhysical(0x40000000,8); // Set DMAs to Stop state\r
-       WritePhysical(0x400000F0,0); // DMA do not gen interrupt\r
-       SetGPIOio(28,0);                        // AC97\r
-       SetGPIOio(29,0);                        // AC97/I2S\r
-       SetGPIOio(30,0);                        // I2S/AC97\r
-       SetGPIOio(31,0);                        // I2S/AC97\r
-       SetGPIOio(32,0);                        // AC97/I2S\r
-       SetGPIOalt(28,0);\r
-       SetGPIOalt(29,0);\r
-       SetGPIOalt(30,0);\r
-       SetGPIOalt(31,0);\r
-       SetGPIOalt(32,0);\r
-#endif\r
-}\r
-\r
-\r
-\r
-\r
-void mymemcpy(char* a, char* b, int size);\r
-\r
-void boot_linux(char *filename,char* initrd,char *param)\r
-{\r
-       FILE *fd=fopen(filename,"rb");\r
-       int ret;\r
-\r
-       FILE* fd1;\r
-\r
-       long initrdl;\r
-       long len;\r
-\r
-#ifndef STRONGARM\r
-       Image image;\r
-       Image image_done;\r
-#endif\r
-\r
-\r
-\r
-       if(!fd)\r
-       {\r
-               FILE *logfd=fopen("\\bootlog.txt","a");\r
-               fprintf(logfd, "Booting: ***FAILED TO OPEN %s***\n",filename);\r
-               fclose(logfd);\r
-               return;\r
-       }\r
-\r
-       fseek(fd,0,SEEK_END);\r
-       len=ftell(fd);\r
-       fseek(fd,0,SEEK_SET);\r
-\r
-       fd1=fopen(initrd,"rb");\r
-       initrdl=0;\r
-       if(fd1) \r
-       {\r
-               fseek(fd1,0,SEEK_END);\r
-               initrdl=ftell(fd1);\r
-               fseek(fd1,0,SEEK_SET);\r
-       }\r
-       FILE *logfd=fopen("\\bootlog.txt","a");\r
-       fprintf(logfd, "Booting: Images.");\r
-       fclose(logfd);\r
-\r
-       \r
-#ifndef STRONGARM\r
-       /* i haven't ported this to strongarm, hope this is not important to\r
-        * anyone */\r
-       init_fb();\r
-       try_fb();\r
-\r
-       image=ReadBMP(BOOT_LOGO_PATH);\r
-       if (!image.p) image=ReadBMP(BOOT_LOGO_PATH_CF);\r
-       image_done=ReadBMP(BOOT_LOGO_DONE_PATH);\r
-       if (!image_done.p) image_done = ReadBMP(BOOT_LOGO_DONE_PATH_CF);\r
-       if (image.p) ShowImage(image.p,image.x,image.y);\r
-#endif\r
-       \r
-       logfd=fopen("\\bootlog.txt","a");\r
-       fprintf(logfd, "Booting: entering supervisor mode.");\r
-       fclose(logfd);\r
-\r
-       /* now becoming supervisor. */\r
-       SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_TIME_CRITICAL);\r
-//     CeSetThreadQuantum(GetCurrentThread(),0);\r
-       SetKMode(1);\r
-       SetProcPermissions(0xffffffff);\r
-       /* <ibot> rooooooooot has landed! */\r
-\r
-       logfd=fopen("\\bootlog.txt","a");\r
-       fprintf(logfd, "Booting: supervisor mode.");\r
-       fclose(logfd);\r
-\r
-       void *mmu=(void*)read_mmu();\r
-       UINT32 *data=NULL,*lcd=NULL,*intr=NULL,*_mmu=NULL;\r
-       char *watch=NULL,*krnl=NULL;\r
-\r
-\r
-       IntOff();\r
-\r
-\r
-       char *kernel_copy2=(char*)VirtualAlloc((void*)0x0,0x8000+len, MEM_RESERVE|MEM_TOP_DOWN,PAGE_READWRITE);\r
-       ret=VirtualCopy((void*)kernel_copy2,(void *) (KERNELCOPY/256),  0x8000+len, PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL);\r
-\r
-       char *initrd_copy2;\r
-\r
-\r
-       if(fd1)\r
-       {\r
-               initrd_copy2=(char*)VirtualAlloc((void*)0x0,initrdl, MEM_RESERVE|MEM_TOP_DOWN,PAGE_READWRITE);\r
-               ret=VirtualCopy((void*)initrd_copy2,(void *) (INITRD/256),      initrdl, PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL);\r
-       }\r
-\r
-       void(*relmemcpy)(char*,char*,int);\r
-       relmemcpy=(void (__cdecl *)(char *,char *,int))VirtualAlloc((void*)0x0, 1024, MEM_RESERVE|MEM_TOP_DOWN,PAGE_READWRITE);\r
-\r
-       /* ask joshua */\r
-#ifndef STRONGARM\r
-       ret=VirtualCopy((void*)relmemcpy,(void *) (0xa0001000/256),     1024, PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL);\r
-#else\r
-       ret=VirtualCopy((void*)relmemcpy,(void *) (0xc0001000/256),     1024, PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL);\r
-#endif\r
-\r
-       if(!kernel_copy2) return;\r
-\r
-\r
-       UINT32 phys_addr;\r
-       phys_addr=KERNELCOPY;\r
-\r
-\r
-       char *data1,*data2;\r
-\r
-       data1=(char*)malloc(len);\r
-\r
-       char *initrd1=NULL;\r
-\r
-       if(fd1) initrd1=(char*)malloc(initrdl);\r
-\r
-       if(!data1) return;\r
-\r
-       if(!ret) return;\r
-\r
-       data2= (char*)do_it;\r
-\r
-\r
-       fread(data1,len,1,fd);\r
-       fclose(fd);\r
-\r
-\r
-       if(fd1)\r
-       {\r
-               fread(initrd1,initrdl,1,fd1);\r
-               fclose(fd1);\r
-       }\r
-\r
-       // Do not block interrupts before they are needed anymore\r
-       // Like reading the SD card.\r
-       intr=(UINT32*)VirtualAlloc((void*)0x0,0x100, MEM_RESERVE,PAGE_READWRITE);\r
-\r
-       // Interrupt control registers\r
-       ret=VirtualCopy((void*)intr,(void *) (ICIP/256), 0x100, PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL);\r
-\r
-       intr[1]=0;\r
-\r
-//     ResetDevices();\r
-\r
-       UART_puts("LinExec: Passing the point of no return.. Now.\r\n");\r
-\r
-       UINT32  crc=0;\r
-\r
-       setup_linux_params(BOOTIMG, INITRD,initrdl, MEM_SIZE*1024*1024 , param,kernel_copy2);\r
-\r
-       memcpy(relmemcpy,mymemcpy,1024);\r
-       relmemcpy(kernel_copy2,data2,0x100);\r
-\r
-       if(fd1)\r
-               relmemcpy(initrd_copy2,initrd1,initrdl);\r
-\r
-       relmemcpy(kernel_copy2+0x8000,data1,len);\r
-\r
-       UART_puts("LinExec: Entering DRAMloader...\r\n");\r
-       \r
-       DRAMloader(phys_addr, MACH_TYPE);\r
-}\r
-\r
-void mymemcpy(char* a, char* b, int size)\r
-{\r
-       while (size)\r
-       {\r
-               *a=*b;\r
-               size--;\r
-               a++; b++;\r
-       };\r
-};\r
-\r
-/*\r
-       Loads parameters from file given.\r
-       The file has to be:\r
-       kernel image\r
-       initrd\r
-       kernel cmdline\r
-*/\r
-\r
-void load_boot(char *ParamFile)\r
-{\r
-       FILE *stream;\r
-\r
-       UART_setup();\r
-\r
-       stream=fopen(ParamFile,"r");\r
-       if(!stream) {\r
-               FILE *logfd=fopen("\\bootlog.txt","a");\r
-               fprintf(logfd, "Booting: ***FAILED TO OPEN %s***\n",ParamFile);\r
-               fclose(logfd);\r
-               return;\r
-       }\r
-       char cmd[200],image[50],initrd[50];\r
-\r
-       fgets(image,50,stream);\r
-       image[strlen(image)-1]=0; // remove \n from the end\r
-       \r
-       fgets(initrd,50,stream);\r
-       initrd[strlen(initrd)-1]=0;\r
-       \r
-       fgets(cmd,200,stream);\r
-       cmd[strlen(cmd)-1]=0;\r
-\r
-       fclose(stream);\r
-\r
-       UART_puts("LinExec: Beginning boot_linux.\r\n");\r
-       boot_linux(image,initrd,cmd);\r
-}      \r
+#include "stdafx.h"
+#include "tester1.h"
+#include <commctrl.h>
+//#include <aygshell.h>
+#include <sipapi.h>
+#include "setup.h"
+
+
+#define BOOT_LOGO_PATH "\\My Documents\\booting.bmp"
+#define BOOT_LOGO_PATH_CF "\\CF Card\\booting.bmp"
+#define BOOT_LOGO_DONE_PATH "\\My Documents\\done.bmp"
+#define BOOT_LOGO_DONE_PATH_CF "\\CF Card\\done.bmp"
+#define DONE1_X        100
+#define DONE1_Y        100
+#define DONE2_X        100
+#define DONE2_Y        130
+
+
+void setup_linux_params(long bootimg_dest, UINT32 initrd,UINT32 initrdl, long dram_size, const char *cmdline, char*base)
+{
+       int rootdev = 0x00ff;
+       struct tag *tag;
+       int newcmdlinelen = 0;
+       char *newcmdline = NULL;
+
+
+       tag = (struct tag *)(base+0x100);
+
+       tag->hdr.tag = ATAG_CORE;
+       tag->hdr.size = tag_size(tag_core);
+       tag->u.core.flags =0;
+       tag->u.core.pagesize = 0x00001000;
+       tag->u.core.rootdev = rootdev;
+       tag = tag_next(tag);
+
+       // now the cmdline tag
+       tag->hdr.tag = ATAG_CMDLINE;
+       // must be at least +3!! 1 for the null and 2 for the ???
+       tag->hdr.size = (strlen(cmdline) + 3 + sizeof(struct tag_header)) >> 2;
+       //tag->hdr.size = (strlen(cmdline) + 10 + sizeof(struct tag_header)) >> 2;
+       strcpy(tag->u.cmdline.cmdline,cmdline);
+       tag = tag_next(tag);
+
+
+       // now the mem32 tag
+       tag->hdr.tag = ATAG_MEM;
+       tag->hdr.size = tag_size(tag_mem32);
+       tag->u.mem.size = dram_size;
+       tag->u.mem.start = MEM_START;
+       tag = tag_next(tag);
+       
+
+       /* and now the initrd tag */
+       if (initrdl) {
+               tag->hdr.tag = INITRD_TAG;
+               tag->hdr.size = tag_size(tag_initrd);
+               tag->u.initrd.start = initrd;
+               tag->u.initrd.size = initrdl;
+               tag = tag_next(tag);
+       }
+   
+       tag->hdr.tag = ATAG_VIDEOTEXT;
+       tag->hdr.size = tag_size(tag_videotext);
+       tag->u.videotext.video_lines = 40;
+       tag->u.videotext.video_cols = 30;
+       tag = tag_next(tag);
+
+       // now the NULL tag
+       tag->hdr.tag = ATAG_NONE;
+       tag->hdr.size = 0;
+}
+
+
+
+
+
+/* loading process:
+function do_it is loaded onto address KERNELCOPY along with parameters(offset=0x100) and
+kernel image(offset=0x8000). Afterwards DRAMloader is called; it disables MMU and
+jumps onto KERNELCOPY. Function do_it then copies kernel image to its proper address(0xA0008000) 
+and calls it.
+Initrd is loaded onto address INITRD and the address is passed to kernel via ATAG
+*/
+
+
+// This resets some devices
+void ResetDevices()
+{
+#ifndef STRONGARM
+       WritePhysical(0x4050000C,0); // Reset AC97
+       WritePhysical(0x48000014,0); // Reset PCMCIA
+       for(int i=0;i<0x3C;i+=4)
+               WritePhysical(0x40000000,8); // Set DMAs to Stop state
+       WritePhysical(0x400000F0,0); // DMA do not gen interrupt
+       SetGPIOio(28,0);                        // AC97
+       SetGPIOio(29,0);                        // AC97/I2S
+       SetGPIOio(30,0);                        // I2S/AC97
+       SetGPIOio(31,0);                        // I2S/AC97
+       SetGPIOio(32,0);                        // AC97/I2S
+       SetGPIOalt(28,0);
+       SetGPIOalt(29,0);
+       SetGPIOalt(30,0);
+       SetGPIOalt(31,0);
+       SetGPIOalt(32,0);
+#endif
+}
+
+
+
+
+void mymemcpy(char* a, char* b, int size);
+
+void boot_linux(char *filename,char* initrd,char *param)
+{
+       FILE *fd=fopen(filename,"rb");
+       int ret;
+
+       FILE* fd1;
+
+       long initrdl;
+       long len;
+
+#ifndef STRONGARM
+       Image image;
+       Image image_done;
+#endif
+
+
+
+       if(!fd)
+       {
+               FILE *logfd=fopen("\\bootlog.txt","a");
+               fprintf(logfd, "Booting: ***FAILED TO OPEN %s***\n",filename);
+               fclose(logfd);
+               return;
+       }
+
+       fseek(fd,0,SEEK_END);
+       len=ftell(fd);
+       fseek(fd,0,SEEK_SET);
+
+       fd1=fopen(initrd,"rb");
+       initrdl=0;
+       if(fd1) 
+       {
+               fseek(fd1,0,SEEK_END);
+               initrdl=ftell(fd1);
+               fseek(fd1,0,SEEK_SET);
+       }
+       FILE *logfd=fopen("\\bootlog.txt","a");
+       fprintf(logfd, "Booting: Images.");
+       fclose(logfd);
+
+       
+#ifndef STRONGARM
+       /* i haven't ported this to strongarm, hope this is not important to
+        * anyone */
+       init_fb();
+       try_fb();
+
+       image=ReadBMP(BOOT_LOGO_PATH);
+       if (!image.p) image=ReadBMP(BOOT_LOGO_PATH_CF);
+       image_done=ReadBMP(BOOT_LOGO_DONE_PATH);
+       if (!image_done.p) image_done = ReadBMP(BOOT_LOGO_DONE_PATH_CF);
+       if (image.p) ShowImage(image.p,image.x,image.y);
+#endif
+       
+       logfd=fopen("\\bootlog.txt","a");
+       fprintf(logfd, "Booting: entering supervisor mode.");
+       fclose(logfd);
+
+       /* now becoming supervisor. */
+       SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_TIME_CRITICAL);
+//     CeSetThreadQuantum(GetCurrentThread(),0);
+       SetKMode(1);
+       SetProcPermissions(0xffffffff);
+       /* <ibot> rooooooooot has landed! */
+
+       logfd=fopen("\\bootlog.txt","a");
+       fprintf(logfd, "Booting: supervisor mode.");
+       fclose(logfd);
+
+       void *mmu=(void*)read_mmu();
+       UINT32 *data=NULL,*lcd=NULL,*intr=NULL,*_mmu=NULL;
+       char *watch=NULL,*krnl=NULL;
+
+
+       IntOff();
+
+
+       char *kernel_copy2=(char*)VirtualAlloc((void*)0x0,0x8000+len, MEM_RESERVE|MEM_TOP_DOWN,PAGE_READWRITE);
+       ret=VirtualCopy((void*)kernel_copy2,(void *) (KERNELCOPY/256),  0x8000+len, PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL);
+
+       char *initrd_copy2;
+
+
+       if(fd1)
+       {
+               initrd_copy2=(char*)VirtualAlloc((void*)0x0,initrdl, MEM_RESERVE|MEM_TOP_DOWN,PAGE_READWRITE);
+               ret=VirtualCopy((void*)initrd_copy2,(void *) (INITRD/256),      initrdl, PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL);
+       }
+
+       void(*relmemcpy)(char*,char*,int);
+       relmemcpy=(void (__cdecl *)(char *,char *,int))VirtualAlloc((void*)0x0, 1024, MEM_RESERVE|MEM_TOP_DOWN,PAGE_READWRITE);
+
+       /* ask joshua */
+#ifndef STRONGARM
+       ret=VirtualCopy((void*)relmemcpy,(void *) (0xa0001000/256),     1024, PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL);
+#else
+       ret=VirtualCopy((void*)relmemcpy,(void *) (0xc0001000/256),     1024, PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL);
+#endif
+
+       if(!kernel_copy2) return;
+
+
+       UINT32 phys_addr;
+       phys_addr=KERNELCOPY;
+
+
+       char *data1,*data2;
+
+       data1=(char*)malloc(len);
+
+       char *initrd1=NULL;
+
+       if(fd1) initrd1=(char*)malloc(initrdl);
+
+       if(!data1) return;
+
+       if(!ret) return;
+
+       data2= (char*)do_it;
+
+
+       fread(data1,len,1,fd);
+       fclose(fd);
+
+
+       if(fd1)
+       {
+               fread(initrd1,initrdl,1,fd1);
+               fclose(fd1);
+       }
+
+       // Do not block interrupts before they are needed anymore
+       // Like reading the SD card.
+       intr=(UINT32*)VirtualAlloc((void*)0x0,0x100, MEM_RESERVE,PAGE_READWRITE);
+
+       // Interrupt control registers
+       ret=VirtualCopy((void*)intr,(void *) (ICIP/256), 0x100, PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL);
+
+       intr[1]=0;
+
+//     ResetDevices();
+
+       UART_puts("LinExec: Passing the point of no return.. Now.\r\n");
+
+       UINT32  crc=0;
+
+       setup_linux_params(BOOTIMG, INITRD,initrdl, MEM_SIZE*1024*1024 , param,kernel_copy2);
+
+       memcpy(relmemcpy,mymemcpy,1024);
+       relmemcpy(kernel_copy2,data2,0x100);
+
+       if(fd1)
+               relmemcpy(initrd_copy2,initrd1,initrdl);
+
+       relmemcpy(kernel_copy2+0x8000,data1,len);
+
+       UART_puts("LinExec: Entering DRAMloader...\r\n");
+       
+       DRAMloader(phys_addr, MACH_TYPE);
+}
+
+void mymemcpy(char* a, char* b, int size)
+{
+       while (size)
+       {
+               *a=*b;
+               size--;
+               a++; b++;
+       };
+};
+
+/*
+       Loads parameters from file given.
+       The file has to be:
+       kernel image
+       initrd
+       kernel cmdline
+*/
+
+void load_boot(char *ParamFile)
+{
+       FILE *stream;
+
+       UART_setup();
+
+       stream=fopen(ParamFile,"r");
+       if(!stream) {
+               FILE *logfd=fopen("\\bootlog.txt","a");
+               fprintf(logfd, "Booting: ***FAILED TO OPEN %s***\n",ParamFile);
+               fclose(logfd);
+               return;
+       }
+       char cmd[200],image[50],initrd[50];
+
+       fgets(image,50,stream);
+       image[strlen(image)-1]=0; // remove \n from the end
+       
+       fgets(initrd,50,stream);
+       initrd[strlen(initrd)-1]=0;
+       
+       fgets(cmd,200,stream);
+       cmd[strlen(cmd)-1]=0;
+
+       fclose(stream);
+
+       UART_puts("LinExec: Beginning boot_linux.\r\n");
+       boot_linux(image,initrd,cmd);
+}      
index e2f6029cd3861b7e9b582d6dcfdd0cec5fa3f9e4..f7c1b584c5f60c482b2a8e6321ce7af3b56213ec 100644 (file)
--- a/config.h
+++ b/config.h
@@ -1,13 +1,13 @@
-#define STRONGARM 1\r
+#define STRONGARM 1
 
 #ifndef STRONGARM
 
 /* xscale */
 
 #define MEM_START      0xa0000000
 
 #ifndef STRONGARM
 
 /* xscale */
 
 #define MEM_START      0xa0000000
-\r
-/* Memory in MByte */\r
-#define MEM_SIZE       64\r
+
+/* Memory in MByte */
+#define MEM_SIZE       64
 
 #define KERNELCOPY     0xa0a00000
 //#define KERNELCOPY   0xa0800000  
 
 #define KERNELCOPY     0xa0a00000
 //#define KERNELCOPY   0xa0800000  
 /* Interrupt controller */
 #define ICIP           0x40D00000
 
 /* Interrupt controller */
 #define ICIP           0x40D00000
 
-#define UARTBASE       0x40100000\r
-#define UARTDATA       0x00\r
-#define UARTSTATUS     0x14\r
-#define UARTTXRDY      5\r
-#define UARTTXBIT      0\r
-\r
+#define UARTBASE       0x40100000
+#define UARTDATA       0x00
+#define UARTSTATUS     0x14
+#define UARTTXRDY      5
+#define UARTTXBIT      0
+
 /* Not used */
 #define BOOTIMG                0xa0008000
 /* Not used */
 #define BOOTIMG                0xa0008000
-\r
+
 /* MACH_TYPE_H1900 */
 /* MACH_TYPE_H1900 */
-#define MACH_TYPE_JORNADA720           48\r
+#define MACH_TYPE_JORNADA720           48
 #define MACH_TYPE      48
 
 #else
 #define MACH_TYPE      48
 
 #else
@@ -37,9 +37,9 @@
 
 #define MEM_START      0xc0000000
 
 
 #define MEM_START      0xc0000000
 
-/* Memory in MByte */\r
-#define MEM_SIZE       32\r
-\r
+/* Memory in MByte */
+#define MEM_SIZE       32
+
 #define KERNELCOPY     0xc0a00000
 
 #define INITRD         0xc0d00000
 #define KERNELCOPY     0xc0a00000
 
 #define INITRD         0xc0d00000
 /* Interrupt controller */
 #define ICIP           0x90050000
 
 /* Interrupt controller */
 #define ICIP           0x90050000
 
-#define UARTBASE       0x80030000\r
-#define UARTDATA       0x14\r
-#define UARTSTATUS     0x20\r
-#define UARTTXRDY      2\r
-#define UARTTXBIT      0\r
-\r
+#define UARTBASE       0x80030000
+#define UARTDATA       0x14
+#define UARTSTATUS     0x20
+#define UARTTXRDY      2
+#define UARTTXBIT      0
+
 /* Not used */
 #define BOOTIMG                0xc0008000
 /* Not used */
 #define BOOTIMG                0xc0008000
-\r
+
 /* MACH_TYPE_H3600 */
 //#define MACH_TYPE    22
 
 /* MACH_TYPE_H3800 */
 //#define MACH_TYPE    137
 /* MACH_TYPE_H3600 */
 //#define MACH_TYPE    22
 
 /* MACH_TYPE_H3800 */
 //#define MACH_TYPE    137
-\r
-/* MACH_TYPE_XDA */\r
-#define MACH_TYPE_JORNADA720           48\r
-#define MACH_TYPE      48\r
+
+/* MACH_TYPE_XDA */
+#define MACH_TYPE_JORNADA720           48
+#define MACH_TYPE      48
 
 #endif
 
 
 #endif
 
index d1d6f6548e57aa7efac58fdb903ad8ae592c535a..4e43c84ce1e5cdc0715cbe44630273b8222ca123 100644 (file)
--- a/gpio.cpp
+++ b/gpio.cpp
@@ -8,9 +8,9 @@
 #define GPIO   0x40E00000
 #define GPIO_MEDIAQ 0x14040000
 #define MQ_OFF 0x008
 #define GPIO   0x40E00000
 #define GPIO_MEDIAQ 0x14040000
 #define MQ_OFF 0x008
-\r
+
 int GPIOalt[81],GPIOio[81],GPIOst[81],mediaq;
 int GPIOalt[81],GPIOio[81],GPIOst[81],mediaq;
-\r
+
 void SetGPIOio(int i,int io) // set GPIO as io == 1 output  io == 0 input
 {
        UINT32 *gpio=(UINT32*)VirtualAlloc((void*)0x0,0x100, MEM_RESERVE,PAGE_READWRITE);
 void SetGPIOio(int i,int io) // set GPIO as io == 1 output  io == 0 input
 {
        UINT32 *gpio=(UINT32*)VirtualAlloc((void*)0x0,0x100, MEM_RESERVE,PAGE_READWRITE);
index 96ff4331e54860dddb166344b8b2bda56931cf29..563e6ade3c7396d3b1f5ff5f459812ae61051963 100644 (file)
-#include "stdafx.h"\r
-#include "tester1.h"\r
-#include <commctrl.h>\r
-//#include <aygshell.h>\r
-#include <sipapi.h>\r
-#include "setup.h"\r
-\r
-UINT32 ReadPhysical(UINT32 adr)\r
-{\r
-       UINT32 base=  adr&0xffff0000;\r
-       UINT32 offset=adr&0x0000ffff;\r
-       UINT32 *p=(UINT32*)VirtualAlloc(0,0x10000,MEM_RESERVE,PAGE_READWRITE);\r
-       if(!p) return 0xFFFFFFFF;\r
-       if(!VirtualCopy((void*)p,(void*)(base/256),0x10000,PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL)) return 0xFFFFFFFF;\r
-       UINT32 val=p[offset/4];\r
-       VirtualFree(p,0,MEM_RELEASE);\r
-       return val;\r
-}\r
-\r
-void WritePhysical(UINT32 adr,UINT32 val)\r
-{\r
-       UINT32 base=  adr&0xffff0000;\r
-       UINT32 offset=adr&0x0000ffff;\r
-       UINT32 *p=(UINT32*)VirtualAlloc(0,0x10000,MEM_RESERVE,PAGE_READWRITE);\r
-       VirtualCopy((void*)p,(void*)(base/256),0x10000,PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL);\r
-       p[offset/4]=val;\r
-       VirtualFree(p,0,MEM_RELEASE);\r
-}\r
-\r
-UINT32 VirtualToPhysical(UINT32 Virtual)\r
-{\r
-       FILE *log=fopen("\\logger1.txt","w");\r
-\r
-       fprintf(log,"virtual: 0x%lx\n",Virtual);\r
-       UINT32 mmu=(UINT32)read_mmu();\r
-//     mmu=0xa0000000;\r
-       fprintf(log,"mmu:  0x%lx \n",mmu);\r
-\r
-       UINT32 AdrFirstLevDesc=(mmu&0xffffc000)+((Virtual>>18)&0xfffffffc);\r
-       fprintf(log,"AdrFirstLevDesc:  0x%lx \n",AdrFirstLevDesc);\r
-\r
-       UINT32 FirstLevDesc=ReadPhysical(AdrFirstLevDesc);\r
-       fprintf(log,"FirstLevDesc:  0x%lx \n",FirstLevDesc);\r
-\r
-       \r
-       if(0)\r
-       {\r
-               fprintf(log,"Page\n");\r
-               UINT32 PhysAddr=(FirstLevDesc&0xfff00000)+(Virtual&0xfffff);\r
-               fprintf(log,"Physical address:  0x%lx \n",PhysAddr);\r
-               fclose(log);\r
-               return PhysAddr;\r
-       }\r
-\r
-       if(FirstLevDesc&0x3==3) // tiny page\r
-       {\r
-               fprintf(log,"Tiny page\n");\r
-               UINT32 AdrSecondLevDesc=(FirstLevDesc&0xfffff000)+((Virtual>>8)&0xffc);\r
-               fprintf(log,"AdrSecondLevDesc:  0x%lx \n",AdrSecondLevDesc);\r
-\r
-               UINT32 SecondLevDesc=ReadPhysical(AdrSecondLevDesc);\r
-               fprintf(log,"SecondLevDesc:  0x%lx \n",SecondLevDesc);\r
-       \r
-               UINT32 PhysAddr=(SecondLevDesc&0xffffc000)+(Virtual&0x3ff);\r
-               fprintf(log,"Physical address:  0x%lx \n",PhysAddr);\r
-               fclose(log);\r
-               return PhysAddr;\r
-       }\r
-//     if(FirstLevDesc&0x3==3) // small page\r
-       {\r
-               fprintf(log,"Else page\n");\r
-               UINT32 AdrSecondLevDesc=(FirstLevDesc&0xfffffc00)+((Virtual>>10)&0x03fc);\r
-               fprintf(log,"AdrSecondLevDesc:  0x%lx \n",AdrSecondLevDesc);\r
-\r
-               UINT32 SecondLevDesc=ReadPhysical(AdrSecondLevDesc);\r
-               fprintf(log,"SecondLevDesc:  0x%lx \n",SecondLevDesc);\r
-\r
-               UINT32 PhysAddr=(SecondLevDesc&0xffff0000)+(Virtual&0xffff);\r
-               fprintf(log,"Physical address:  0x%lx \n",PhysAddr);\r
-               fclose(log);\r
-               return PhysAddr;\r
-\r
-       }\r
-}\r
-\r
-\r
-\r
-\r
-\r
-\r
-void DumpMMU()\r
-{\r
-       void *mmu=(void*)(MEM_START);\r
-\r
-       UINT32 *_mmu=(UINT32*)VirtualAlloc((void*)0x0,sizeof(void*)*0xffff, MEM_RESERVE,PAGE_READWRITE);\r
-       int ret=VirtualCopy(_mmu,(void *) ((UINT32)mmu/256),sizeof(void*)*0xffff        , PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL);\r
-\r
-       FILE *log=fopen("\\logger2.txt","w");\r
-       fprintf(log,"mmu_table=0x%lx : \n",_mmu);\r
-       fprintf(log,"mmu=0x%lx : \n",mmu);\r
-       fprintf(log,"ret=0x%x : \n",ret);\r
-       for(UINT32 z=0;z<=0x0100;z++)\r
-               fprintf(log,"mmu_table[0x%x]=0x%lx: \n",z,_mmu[z]);\r
-       fclose(log);\r
-       return;\r
-}\r
+#include "stdafx.h"
+#include "tester1.h"
+#include <commctrl.h>
+//#include <aygshell.h>
+#include <sipapi.h>
+#include "setup.h"
+
+UINT32 ReadPhysical(UINT32 adr)
+{
+       UINT32 base=  adr&0xffff0000;
+       UINT32 offset=adr&0x0000ffff;
+       UINT32 *p=(UINT32*)VirtualAlloc(0,0x10000,MEM_RESERVE,PAGE_READWRITE);
+       if(!p) return 0xFFFFFFFF;
+       if(!VirtualCopy((void*)p,(void*)(base/256),0x10000,PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL)) return 0xFFFFFFFF;
+       UINT32 val=p[offset/4];
+       VirtualFree(p,0,MEM_RELEASE);
+       return val;
+}
+
+void WritePhysical(UINT32 adr,UINT32 val)
+{
+       UINT32 base=  adr&0xffff0000;
+       UINT32 offset=adr&0x0000ffff;
+       UINT32 *p=(UINT32*)VirtualAlloc(0,0x10000,MEM_RESERVE,PAGE_READWRITE);
+       VirtualCopy((void*)p,(void*)(base/256),0x10000,PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL);
+       p[offset/4]=val;
+       VirtualFree(p,0,MEM_RELEASE);
+}
+
+UINT32 VirtualToPhysical(UINT32 Virtual)
+{
+       FILE *log=fopen("\\logger1.txt","w");
+
+       fprintf(log,"virtual: 0x%lx\n",Virtual);
+       UINT32 mmu=(UINT32)read_mmu();
+//     mmu=0xa0000000;
+       fprintf(log,"mmu:  0x%lx \n",mmu);
+
+       UINT32 AdrFirstLevDesc=(mmu&0xffffc000)+((Virtual>>18)&0xfffffffc);
+       fprintf(log,"AdrFirstLevDesc:  0x%lx \n",AdrFirstLevDesc);
+
+       UINT32 FirstLevDesc=ReadPhysical(AdrFirstLevDesc);
+       fprintf(log,"FirstLevDesc:  0x%lx \n",FirstLevDesc);
+
+       
+       if(0)
+       {
+               fprintf(log,"Page\n");
+               UINT32 PhysAddr=(FirstLevDesc&0xfff00000)+(Virtual&0xfffff);
+               fprintf(log,"Physical address:  0x%lx \n",PhysAddr);
+               fclose(log);
+               return PhysAddr;
+       }
+
+       if(FirstLevDesc&0x3==3) // tiny page
+       {
+               fprintf(log,"Tiny page\n");
+               UINT32 AdrSecondLevDesc=(FirstLevDesc&0xfffff000)+((Virtual>>8)&0xffc);
+               fprintf(log,"AdrSecondLevDesc:  0x%lx \n",AdrSecondLevDesc);
+
+               UINT32 SecondLevDesc=ReadPhysical(AdrSecondLevDesc);
+               fprintf(log,"SecondLevDesc:  0x%lx \n",SecondLevDesc);
+       
+               UINT32 PhysAddr=(SecondLevDesc&0xffffc000)+(Virtual&0x3ff);
+               fprintf(log,"Physical address:  0x%lx \n",PhysAddr);
+               fclose(log);
+               return PhysAddr;
+       }
+//     if(FirstLevDesc&0x3==3) // small page
+       {
+               fprintf(log,"Else page\n");
+               UINT32 AdrSecondLevDesc=(FirstLevDesc&0xfffffc00)+((Virtual>>10)&0x03fc);
+               fprintf(log,"AdrSecondLevDesc:  0x%lx \n",AdrSecondLevDesc);
+
+               UINT32 SecondLevDesc=ReadPhysical(AdrSecondLevDesc);
+               fprintf(log,"SecondLevDesc:  0x%lx \n",SecondLevDesc);
+
+               UINT32 PhysAddr=(SecondLevDesc&0xffff0000)+(Virtual&0xffff);
+               fprintf(log,"Physical address:  0x%lx \n",PhysAddr);
+               fclose(log);
+               return PhysAddr;
+
+       }
+}
+
+
+
+
+
+
+void DumpMMU()
+{
+       void *mmu=(void*)(MEM_START);
+
+       UINT32 *_mmu=(UINT32*)VirtualAlloc((void*)0x0,sizeof(void*)*0xffff, MEM_RESERVE,PAGE_READWRITE);
+       int ret=VirtualCopy(_mmu,(void *) ((UINT32)mmu/256),sizeof(void*)*0xffff        , PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL);
+
+       FILE *log=fopen("\\logger2.txt","w");
+       fprintf(log,"mmu_table=0x%lx : \n",_mmu);
+       fprintf(log,"mmu=0x%lx : \n",mmu);
+       fprintf(log,"ret=0x%x : \n",ret);
+       for(UINT32 z=0;z<=0x0100;z++)
+               fprintf(log,"mmu_table[0x%x]=0x%lx: \n",z,_mmu[z]);
+       fclose(log);
+       return;
+}
index e6e2a53ad0b7cba9c794f374b38beaf6f0d7137c..8289ebe2d12f9c1ff0e2a9dd48f439dac5c713d4 100644 (file)
--- a/newres.h
+++ b/newres.h
@@ -1,41 +1,41 @@
-#ifndef __NEWRES_H__\r\r
-#define __NEWRES_H__\r\r
-\r\r
-#if !defined(UNDER_CE)\r\r
-#define UNDER_CE _WIN32_WCE\r\r
-#endif\r\r
-\r\r
-#if defined(_WIN32_WCE)\r\r
-       #if !defined(WCEOLE_ENABLE_DIALOGEX)\r\r
-               #define DIALOGEX DIALOG DISCARDABLE\r\r
-       #endif\r\r
-       #include <commctrl.h>\r\r
-       #define  SHMENUBAR RCDATA\r\r
-       #if defined(WIN32_PLATFORM_PSPC) && (_WIN32_WCE >= 300)\r\r
-               #include <aygshell.h>\r\r
-               #define AFXCE_IDR_SCRATCH_SHMENU  28700\r\r
-       #else\r\r
-               #define I_IMAGENONE             (-2)\r\r
-               #define NOMENU                  0xFFFF\r\r
-               #define IDS_SHNEW               1\r\r
-\r\r
-               #define IDM_SHAREDNEW        10\r\r
-               #define IDM_SHAREDNEWDEFAULT 11\r\r
-       #endif // _WIN32_WCE_PSPC\r\r
-       #define AFXCE_IDD_SAVEMODIFIEDDLG 28701\r\r
-#endif // _WIN32_WCE\r\r
-\r\r
-#ifdef RC_INVOKED\r\r
-#ifndef _INC_WINDOWS\r\r
-#define _INC_WINDOWS\r\r
-       #include "winuser.h"           // extract from windows header\r\r
-       #include "winver.h"   \r\r
-#endif\r\r
-#endif\r\r
-\r\r
-#ifdef IDC_STATIC\r\r
-#undef IDC_STATIC\r\r
-#endif\r\r
-#define IDC_STATIC      (-1)\r\r
-\r\r
-#endif //__NEWRES_H__\r\r
+#ifndef __NEWRES_H__\r
+#define __NEWRES_H__\r
+\r
+#if !defined(UNDER_CE)\r
+#define UNDER_CE _WIN32_WCE\r
+#endif\r
+\r
+#if defined(_WIN32_WCE)\r
+       #if !defined(WCEOLE_ENABLE_DIALOGEX)\r
+               #define DIALOGEX DIALOG DISCARDABLE\r
+       #endif\r
+       #include <commctrl.h>\r
+       #define  SHMENUBAR RCDATA\r
+       #if defined(WIN32_PLATFORM_PSPC) && (_WIN32_WCE >= 300)\r
+               #include <aygshell.h>\r
+               #define AFXCE_IDR_SCRATCH_SHMENU  28700\r
+       #else\r
+               #define I_IMAGENONE             (-2)\r
+               #define NOMENU                  0xFFFF\r
+               #define IDS_SHNEW               1\r
+\r
+               #define IDM_SHAREDNEW        10\r
+               #define IDM_SHAREDNEWDEFAULT 11\r
+       #endif // _WIN32_WCE_PSPC\r
+       #define AFXCE_IDD_SAVEMODIFIEDDLG 28701\r
+#endif // _WIN32_WCE\r
+\r
+#ifdef RC_INVOKED\r
+#ifndef _INC_WINDOWS\r
+#define _INC_WINDOWS\r
+       #include "winuser.h"           // extract from windows header\r
+       #include "winver.h"   \r
+#endif\r
+#endif\r
+\r
+#ifdef IDC_STATIC\r
+#undef IDC_STATIC\r
+#endif\r
+#define IDC_STATIC      (-1)\r
+\r
+#endif //__NEWRES_H__\r
index 635cd99e4ed0f255d7d555d35b9b330aa9351d8a..726a0d5debfb1b5bccd49c11f078c4e4b1c69c5d 100644 (file)
@@ -1,27 +1,27 @@
-//{{NO_DEPENDENCIES}}\r\r
-// Microsoft eMbedded Visual C++ generated include file.\r\r
-// Used by TESTER1.RC\r\r
-//\r\r
-#define IDS_APP_TITLE                                  1\r\r
-#define IDS_HELLO                                              2\r\r
-#define IDC_TESTER1                            3\r\r
-#define IDI_TESTER1                            101\r\r
-#define IDM_MENU                                               102\r\r
-#define IDD_ABOUTBOX                                   103\r\r
-#define IDS_HELP                                               104\r\r
-\r\r
-#define IDS_COMMAND1                                   301\r\r
-\r\r
-#define IDM_MAIN_COMMAND1                              40001\r\r
-#define IDM_HELP_ABOUT                                 40003\r\r
-\r\r
-// Next default values for new objects\r\r
-// \r\r
-#ifdef APSTUDIO_INVOKED\r\r
-#ifndef APSTUDIO_READONLY_SYMBOLS\r\r
-#define _APS_NEXT_RESOURCE_VALUE        104\r\r
-#define _APS_NEXT_COMMAND_VALUE         40004\r\r
-#define _APS_NEXT_CONTROL_VALUE         1001\r\r
-#define _APS_NEXT_SYMED_VALUE           101\r\r
-#endif\r\r
-#endif\r\r
+//{{NO_DEPENDENCIES}}\r
+// Microsoft eMbedded Visual C++ generated include file.\r
+// Used by TESTER1.RC\r
+//\r
+#define IDS_APP_TITLE                                  1\r
+#define IDS_HELLO                                              2\r
+#define IDC_TESTER1                            3\r
+#define IDI_TESTER1                            101\r
+#define IDM_MENU                                               102\r
+#define IDD_ABOUTBOX                                   103\r
+#define IDS_HELP                                               104\r
+\r
+#define IDS_COMMAND1                                   301\r
+\r
+#define IDM_MAIN_COMMAND1                              40001\r
+#define IDM_HELP_ABOUT                                 40003\r
+\r
+// Next default values for new objects\r
+// \r
+#ifdef APSTUDIO_INVOKED\r
+#ifndef APSTUDIO_READONLY_SYMBOLS\r
+#define _APS_NEXT_RESOURCE_VALUE        104\r
+#define _APS_NEXT_COMMAND_VALUE         40004\r
+#define _APS_NEXT_CONTROL_VALUE         1001\r
+#define _APS_NEXT_SYMED_VALUE           101\r
+#endif\r
+#endif\r
diff --git a/setup.h b/setup.h
index 1bc06c88164d47c74745bbe036630f63a648d26a..46ca48337c708ce298b6e0e4dfd82e9953b5c463 100644 (file)
--- a/setup.h
+++ b/setup.h
-/*\r
- *  linux/include/asm/setup.h\r
- *\r
- *  Copyright (C) 1997-1999 Russell King\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License version 2 as\r
- * published by the Free Software Foundation.\r
- *\r
- *  Structure passed to kernel to tell it about the\r
- *  hardware it's running on.  See linux/Documentation/arm/Setup\r
- *  for more info.\r
- *\r
- * NOTE:\r
- *  This file contains two ways to pass information from the boot\r
- *  loader to the kernel. The old struct param_struct is deprecated,\r
- *  but it will be kept in the kernel for 5 years from now\r
- *  (2001). This will allow boot loaders to convert to the new struct\r
- *  tag way.\r
- */\r
-#ifndef __ASMARM_SETUP_H\r
-#define __ASMARM_SETUP_H\r\r
-\r\r
-#define u32    UINT32\r\r
-#define u16    UINT16\r\r
-#define u8     UINT8\r\r
-\r
-\r
-/*#ifndef CONFIG_ACCEPT_GPL\r
-#error This file covered by GPL but CONFIG_ACCEPT_GPL undefined.\r
-#endif*/\r
-\r
-/*\r
- * Usage:\r
- *  - do not go blindly adding fields, add them at the end\r
- *  - when adding fields, don't rely on the address until\r
- *    a patch from me has been released\r
- *  - unused fields should be zero (for future expansion)\r
- *  - this structure is relatively short-lived - only\r
- *    guaranteed to contain useful data in setup_arch()\r
- */\r
-#define COMMAND_LINE_SIZE 1024\r
-\r
-/* This is the old deprecated way to pass parameters to the kernel */\r
-struct param_struct {\r
-    union {\r
-       struct {\r
-           unsigned long page_size;            /*  0 */\r
-           unsigned long nr_pages;             /*  4 */\r
-           unsigned long ramdisk_size;         /*  8 */\r
-           unsigned long flags;                /* 12 */\r
-#define FLAG_READONLY  1\r
-#define FLAG_RDLOAD    4\r
-#define FLAG_RDPROMPT  8\r
-           unsigned long rootdev;              /* 16 */\r
-           unsigned long video_num_cols;       /* 20 */\r
-           unsigned long video_num_rows;       /* 24 */\r
-           unsigned long video_x;              /* 28 */\r
-           unsigned long video_y;              /* 32 */\r
-           unsigned long memc_control_reg;     /* 36 */\r
-           unsigned char sounddefault;         /* 40 */\r
-           unsigned char adfsdrives;           /* 41 */\r
-           unsigned char bytes_per_char_h;     /* 42 */\r
-           unsigned char bytes_per_char_v;     /* 43 */\r
-           unsigned long pages_in_bank[4];     /* 44 */\r
-           unsigned long pages_in_vram;        /* 60 */\r
-           unsigned long initrd_start;         /* 64 */\r
-           unsigned long initrd_size;          /* 68 */\r
-           unsigned long rd_start;             /* 72 */\r
-           unsigned long system_rev;           /* 76 */\r
-           unsigned long system_serial_low;    /* 80 */\r
-           unsigned long system_serial_high;   /* 84 */\r
-           unsigned long mem_fclk_21285;       /* 88 */\r
-       } s;\r
-       char unused[256];\r
-    } u1;\r
-    union {\r
-       char paths[8][128];\r
-       struct {\r
-           unsigned long magic;\r
-           char n[1024 - sizeof(unsigned long)];\r
-       } s;\r
-    } u2;\r
-    char commandline[COMMAND_LINE_SIZE];\r
-};\r
-\r
-\r
-\r
-/*\r
- * The new way of passing information: a list of tagged entries\r
- */\r
-\r
-/* The list ends with an ATAG_NONE node. */\r
-#define ATAG_NONE      0x00000000\r
-\r
-struct tag_header {\r
-       u32 size;\r
-       u32 tag;\r
-};\r
-\r
-/* The list must start with an ATAG_CORE node */\r
-#define ATAG_CORE      0x54410001\r
-\r
-struct tag_core {\r
-       u32 flags;              /* bit 0 = read-only */\r
-       u32 pagesize;\r
-       u32 rootdev;\r
-};\r
-\r
-/* it is allowed to have multiple ATAG_MEM nodes */\r
-#define ATAG_MEM       0x54410002\r
-\r
-struct tag_mem32 {\r
-       u32     size;\r
-       u32     start;  /* physical start address */\r
-};\r
-\r
-/* VGA text type displays */\r
-#define ATAG_VIDEOTEXT 0x54410003\r
-\r
-struct tag_videotext {\r
-       u8              x;\r
-       u8              y;\r
-       u16             video_page;\r
-       u8              video_mode;\r
-       u8              video_cols;\r
-       u16             video_ega_bx;\r
-       u8              video_lines;\r
-       u8              video_isvga;\r
-       u16             video_points;\r
-};\r
-\r
-/* describes how the ramdisk will be used in kernel */\r
-#define ATAG_RAMDISK   0x54410004\r
-\r
-struct tag_ramdisk {\r
-       u32 flags;      /* bit 0 = load, bit 1 = prompt */\r
-       u32 size;       /* decompressed ramdisk size in _kilo_ bytes */\r
-       u32 start;      /* starting block of floppy-based RAM disk image */\r
-};\r
-\r
-/* describes where the compressed ramdisk image lives */\r
-#define ATAG_INITRD    0x54410005\r\r
-\r\r
-#define ATAG_INITRD2   0x54420005\r
-\r
-struct tag_initrd {\r
-       u32 start;      /* physical start address */\r
-       u32 size;       /* size of compressed ramdisk image in bytes */\r
-};\r
-\r
-/* board serial number. "64 bits should be enough for everybody" */\r
-#define ATAG_SERIAL    0x54410006\r
-\r
-struct tag_serialnr {\r
-       u32 low;\r
-       u32 high;\r
-};\r
-\r
-/* board revision */\r
-#define ATAG_REVISION  0x54410007\r
-\r
-struct tag_revision {\r
-       u32 rev;\r
-};\r
-\r
-/* initial values for vesafb-type framebuffers. see struct screen_info\r
- * in include/linux/tty.h\r
- */\r
-#define ATAG_VIDEOLFB  0x54410008\r
-\r
-struct tag_videolfb {\r
-       u16             lfb_width;\r
-       u16             lfb_height;\r
-       u16             lfb_depth;\r
-       u16             lfb_linelength;\r
-       u32             lfb_base;\r
-       u32             lfb_size;\r
-       u8              red_size;\r
-       u8              red_pos;\r
-       u8              green_size;\r
-       u8              green_pos;\r
-       u8              blue_size;\r
-       u8              blue_pos;\r
-       u8              rsvd_size;\r
-       u8              rsvd_pos;\r
-};\r
-\r
-/* command line: \0 terminated string */\r
-#define ATAG_CMDLINE   0x54410009\r
-\r
-struct tag_cmdline {\r
-       char    cmdline[1];     /* this is the minimum size */\r
-};\r
-\r
-/* acorn RiscPC specific information */\r
-#define ATAG_ACORN     0x41000101\r
-\r
-struct tag_acorn {\r
-       u32 memc_control_reg;\r
-       u32 vram_pages;\r
-       u8 sounddefault;\r
-       u8 adfsdrives;\r
-};\r
-\r
-#define ATAG_PTABLE    0x53410001\r
-\r
-/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */\r
-#define ATAG_MEMCLK    0x41000402\r
-\r
-struct tag_memclk {\r
-       u32 fmemclk;\r
-};\r
-\r
-struct tag {\r
-       struct tag_header hdr;\r
-       union {\r
-               struct tag_core         core;\r
-               struct tag_mem32        mem;\r
-               struct tag_videotext    videotext;\r
-               struct tag_ramdisk      ramdisk;\r
-               struct tag_initrd       initrd;\r
-               struct tag_serialnr     serialnr;\r
-               struct tag_revision     revision;\r
-               struct tag_videolfb     videolfb;\r
-               struct tag_cmdline      cmdline;\r
-//                struct tag_ptable       ptable;  \r
-\r
-               /*\r
-                * Acorn specific\r
-                */\r
-               struct tag_acorn        acorn;\r
-\r
-               /*\r
-                * DC21285 specific\r
-                */\r
-               struct tag_memclk       memclk;\r
-           \r
-       } u;\r
-};\r
-\r
-struct tagtable {\r
-       u32 tag;\r
-       int (*parse)(const struct tag *);\r
-};\r
-\r
-#define __tag __attribute__((unused, __section__(".taglist")))\r
-#define __tagtable(tag, fn) \\r
-static struct tagtable __tagtable_##fn __tag = { tag, fn }\r
-\r
-#define tag_member_present(tag,member)                         \\r
-       ((unsigned long)(&((struct tag *)0L)->member + 1)       \\r
-               <= (tag)->hdr.size * 4)\r
-\r
-#define tag_next(t)    ((struct tag *)((u32 *)(t) + (t)->hdr.size))\r
-#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)\r
-\r
-#define for_each_tag(t,base)           \\r
-       for (t = base; t->hdr.size; t = tag_next(t))\r
-\r
-/*\r
- * Memory map description\r
- */\r
-#define NR_BANKS 8\r
-\r
-struct meminfo {\r
-       int nr_banks;\r
-       unsigned long end;\r
-       struct {\r
-               unsigned long start;\r
-               unsigned long size;\r
-               int           node;\r
-       } bank[NR_BANKS];\r
-};\r
-\r
-extern struct meminfo meminfo;\r
-\r
-#endif\r
+/*
+ *  linux/include/asm/setup.h
+ *
+ *  Copyright (C) 1997-1999 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  Structure passed to kernel to tell it about the
+ *  hardware it's running on.  See linux/Documentation/arm/Setup
+ *  for more info.
+ *
+ * NOTE:
+ *  This file contains two ways to pass information from the boot
+ *  loader to the kernel. The old struct param_struct is deprecated,
+ *  but it will be kept in the kernel for 5 years from now
+ *  (2001). This will allow boot loaders to convert to the new struct
+ *  tag way.
+ */
+#ifndef __ASMARM_SETUP_H
+#define __ASMARM_SETUP_H\r
+\r
+#define u32    UINT32\r
+#define u16    UINT16\r
+#define u8     UINT8\r
+
+
+/*#ifndef CONFIG_ACCEPT_GPL
+#error This file covered by GPL but CONFIG_ACCEPT_GPL undefined.
+#endif*/
+
+/*
+ * Usage:
+ *  - do not go blindly adding fields, add them at the end
+ *  - when adding fields, don't rely on the address until
+ *    a patch from me has been released
+ *  - unused fields should be zero (for future expansion)
+ *  - this structure is relatively short-lived - only
+ *    guaranteed to contain useful data in setup_arch()
+ */
+#define COMMAND_LINE_SIZE 1024
+
+/* This is the old deprecated way to pass parameters to the kernel */
+struct param_struct {
+    union {
+       struct {
+           unsigned long page_size;            /*  0 */
+           unsigned long nr_pages;             /*  4 */
+           unsigned long ramdisk_size;         /*  8 */
+           unsigned long flags;                /* 12 */
+#define FLAG_READONLY  1
+#define FLAG_RDLOAD    4
+#define FLAG_RDPROMPT  8
+           unsigned long rootdev;              /* 16 */
+           unsigned long video_num_cols;       /* 20 */
+           unsigned long video_num_rows;       /* 24 */
+           unsigned long video_x;              /* 28 */
+           unsigned long video_y;              /* 32 */
+           unsigned long memc_control_reg;     /* 36 */
+           unsigned char sounddefault;         /* 40 */
+           unsigned char adfsdrives;           /* 41 */
+           unsigned char bytes_per_char_h;     /* 42 */
+           unsigned char bytes_per_char_v;     /* 43 */
+           unsigned long pages_in_bank[4];     /* 44 */
+           unsigned long pages_in_vram;        /* 60 */
+           unsigned long initrd_start;         /* 64 */
+           unsigned long initrd_size;          /* 68 */
+           unsigned long rd_start;             /* 72 */
+           unsigned long system_rev;           /* 76 */
+           unsigned long system_serial_low;    /* 80 */
+           unsigned long system_serial_high;   /* 84 */
+           unsigned long mem_fclk_21285;       /* 88 */
+       } s;
+       char unused[256];
+    } u1;
+    union {
+       char paths[8][128];
+       struct {
+           unsigned long magic;
+           char n[1024 - sizeof(unsigned long)];
+       } s;
+    } u2;
+    char commandline[COMMAND_LINE_SIZE];
+};
+
+
+
+/*
+ * The new way of passing information: a list of tagged entries
+ */
+
+/* The list ends with an ATAG_NONE node. */
+#define ATAG_NONE      0x00000000
+
+struct tag_header {
+       u32 size;
+       u32 tag;
+};
+
+/* The list must start with an ATAG_CORE node */
+#define ATAG_CORE      0x54410001
+
+struct tag_core {
+       u32 flags;              /* bit 0 = read-only */
+       u32 pagesize;
+       u32 rootdev;
+};
+
+/* it is allowed to have multiple ATAG_MEM nodes */
+#define ATAG_MEM       0x54410002
+
+struct tag_mem32 {
+       u32     size;
+       u32     start;  /* physical start address */
+};
+
+/* VGA text type displays */
+#define ATAG_VIDEOTEXT 0x54410003
+
+struct tag_videotext {
+       u8              x;
+       u8              y;
+       u16             video_page;
+       u8              video_mode;
+       u8              video_cols;
+       u16             video_ega_bx;
+       u8              video_lines;
+       u8              video_isvga;
+       u16             video_points;
+};
+
+/* describes how the ramdisk will be used in kernel */
+#define ATAG_RAMDISK   0x54410004
+
+struct tag_ramdisk {
+       u32 flags;      /* bit 0 = load, bit 1 = prompt */
+       u32 size;       /* decompressed ramdisk size in _kilo_ bytes */
+       u32 start;      /* starting block of floppy-based RAM disk image */
+};
+
+/* describes where the compressed ramdisk image lives */
+#define ATAG_INITRD    0x54410005\r
+\r
+#define ATAG_INITRD2   0x54420005
+
+struct tag_initrd {
+       u32 start;      /* physical start address */
+       u32 size;       /* size of compressed ramdisk image in bytes */
+};
+
+/* board serial number. "64 bits should be enough for everybody" */
+#define ATAG_SERIAL    0x54410006
+
+struct tag_serialnr {
+       u32 low;
+       u32 high;
+};
+
+/* board revision */
+#define ATAG_REVISION  0x54410007
+
+struct tag_revision {
+       u32 rev;
+};
+
+/* initial values for vesafb-type framebuffers. see struct screen_info
+ * in include/linux/tty.h
+ */
+#define ATAG_VIDEOLFB  0x54410008
+
+struct tag_videolfb {
+       u16             lfb_width;
+       u16             lfb_height;
+       u16             lfb_depth;
+       u16             lfb_linelength;
+       u32             lfb_base;
+       u32             lfb_size;
+       u8              red_size;
+       u8              red_pos;
+       u8              green_size;
+       u8              green_pos;
+       u8              blue_size;
+       u8              blue_pos;
+       u8              rsvd_size;
+       u8              rsvd_pos;
+};
+
+/* command line: \0 terminated string */
+#define ATAG_CMDLINE   0x54410009
+
+struct tag_cmdline {
+       char    cmdline[1];     /* this is the minimum size */
+};
+
+/* acorn RiscPC specific information */
+#define ATAG_ACORN     0x41000101
+
+struct tag_acorn {
+       u32 memc_control_reg;
+       u32 vram_pages;
+       u8 sounddefault;
+       u8 adfsdrives;
+};
+
+#define ATAG_PTABLE    0x53410001
+
+/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
+#define ATAG_MEMCLK    0x41000402
+
+struct tag_memclk {
+       u32 fmemclk;
+};
+
+struct tag {
+       struct tag_header hdr;
+       union {
+               struct tag_core         core;
+               struct tag_mem32        mem;
+               struct tag_videotext    videotext;
+               struct tag_ramdisk      ramdisk;
+               struct tag_initrd       initrd;
+               struct tag_serialnr     serialnr;
+               struct tag_revision     revision;
+               struct tag_videolfb     videolfb;
+               struct tag_cmdline      cmdline;
+//                struct tag_ptable       ptable;  
+
+               /*
+                * Acorn specific
+                */
+               struct tag_acorn        acorn;
+
+               /*
+                * DC21285 specific
+                */
+               struct tag_memclk       memclk;
+           
+       } u;
+};
+
+struct tagtable {
+       u32 tag;
+       int (*parse)(const struct tag *);
+};
+
+#define __tag __attribute__((unused, __section__(".taglist")))
+#define __tagtable(tag, fn) \
+static struct tagtable __tagtable_##fn __tag = { tag, fn }
+
+#define tag_member_present(tag,member)                         \
+       ((unsigned long)(&((struct tag *)0L)->member + 1)       \
+               <= (tag)->hdr.size * 4)
+
+#define tag_next(t)    ((struct tag *)((u32 *)(t) + (t)->hdr.size))
+#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
+
+#define for_each_tag(t,base)           \
+       for (t = base; t->hdr.size; t = tag_next(t))
+
+/*
+ * Memory map description
+ */
+#define NR_BANKS 8
+
+struct meminfo {
+       int nr_banks;
+       unsigned long end;
+       struct {
+               unsigned long start;
+               unsigned long size;
+               int           node;
+       } bank[NR_BANKS];
+};
+
+extern struct meminfo meminfo;
+
+#endif
index fe629ba82bb4c7e1595f664882799e4027edc2e3..ed74c414596f63832049dd601fdf3051ed8f7ff6 100644 (file)
@@ -22,7 +22,7 @@ LRESULT CALLBACK      WndProc                 (HWND, UINT, WPARAM, LPARAM);
 LRESULT CALLBACK       About                   (HWND, UINT, WPARAM, LPARAM);
 HWND                           CreateRpCommandBar(HWND);
 
 LRESULT CALLBACK       About                   (HWND, UINT, WPARAM, LPARAM);
 HWND                           CreateRpCommandBar(HWND);
 
-\r
+
 #pragma warning(disable: 4100 4710 4189; error: 4701)
 /* who cares?! 
        4100: whining about parameters not being used.
 #pragma warning(disable: 4100 4710 4189; error: 4701)
 /* who cares?! 
        4100: whining about parameters not being used.
@@ -30,7 +30,7 @@ HWND                          CreateRpCommandBar(HWND);
        4189: initialized but not used. make that an error: later.
        4701: usage w/o initialization.
        */
        4189: initialized but not used. make that an error: later.
        4701: usage w/o initialization.
        */
-\r
+
 int WINAPI WinMain(    HINSTANCE hInstance,
                                        HINSTANCE hPrevInstance,
                                        LPTSTR    lpCmdLine,
 int WINAPI WinMain(    HINSTANCE hInstance,
                                        HINSTANCE hPrevInstance,
                                        LPTSTR    lpCmdLine,
@@ -87,42 +87,42 @@ ATOM MyRegisterClass(HINSTANCE hInstance, LPTSTR szWindowClass)
 
        return RegisterClass(&wc);
 }
 
        return RegisterClass(&wc);
 }
-\r
-HANDLE OpenCOM1() {\r
-\r
-       static HANDLE COM1handle = INVALID_HANDLE_VALUE;\r
-       const char msg[] = "\r\n--------linexec--------\r\n";\r
-       unsigned long wrote;\r
-       int speed = CBR_115200;\r
-       HANDLE h;\r
-\r
-       if (COM1handle != INVALID_HANDLE_VALUE)\r
-               return (COM1handle);\r
-\r
-       h = CreateFile(TEXT("COM1:"),\r
-           GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0,\r
-           NULL);\r
-       if (h == INVALID_HANDLE_VALUE)\r
-               return (h);\r
-\r
-       DCB dcb;\r
-       if (!GetCommState(h, &dcb))\r
-               goto bad;\r
-\r
-       dcb.BaudRate = speed;\r
-       if (!SetCommState(h, &dcb))\r
-               goto bad;\r
-\r
-       // Print banner on serial console.\r
-       WriteFile(h, msg, sizeof msg, &wrote, 0);\r
-\r
-       COM1handle = h;\r
-\r
-       return (h);\r
- bad:\r
-       CloseHandle(h);\r
-       return (INVALID_HANDLE_VALUE);\r
-}\r
+
+HANDLE OpenCOM1() {
+
+       static HANDLE COM1handle = INVALID_HANDLE_VALUE;
+       const char msg[] = "\r\n--------linexec--------\r\n";
+       unsigned long wrote;
+       int speed = CBR_115200;
+       HANDLE h;
+
+       if (COM1handle != INVALID_HANDLE_VALUE)
+               return (COM1handle);
+
+       h = CreateFile(TEXT("COM1:"),
+           GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0,
+           NULL);
+       if (h == INVALID_HANDLE_VALUE)
+               return (h);
+
+       DCB dcb;
+       if (!GetCommState(h, &dcb))
+               goto bad;
+
+       dcb.BaudRate = speed;
+       if (!SetCommState(h, &dcb))
+               goto bad;
+
+       // Print banner on serial console.
+       WriteFile(h, msg, sizeof msg, &wrote, 0);
+
+       COM1handle = h;
+
+       return (h);
+ bad:
+       CloseHandle(h);
+       return (INVALID_HANDLE_VALUE);
+}
 
 //
 //  FUNCTION: InitInstance(HANDLE, int)
 
 //
 //  FUNCTION: InitInstance(HANDLE, int)
@@ -137,15 +137,15 @@ HANDLE OpenCOM1() {
 
 BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
 {
 
 BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
 {
-       HWND    hWnd = NULL;\r
-       TCHAR   szTitle[MAX_LOADSTRING];                        // The title bar text\r
+       HWND    hWnd = NULL;
+       TCHAR   szTitle[MAX_LOADSTRING];                        // The title bar text
        TCHAR   szWindowClass[MAX_LOADSTRING];          // The window class name
        TCHAR   szWindowClass[MAX_LOADSTRING];          // The window class name
-\r
-       hInst = hInstance;              // Store instance handle in our global variable\r
-       // Initialize global string\r
-       LoadString(hInstance, IDC_TESTER1, szWindowClass, MAX_LOADSTRING);\r
+
+       hInst = hInstance;              // Store instance handle in our global variable
+       // Initialize global string
+       LoadString(hInstance, IDC_TESTER1, szWindowClass, MAX_LOADSTRING);
        LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
        LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
-\r
+
        //If it is already running, then focus on the window
        hWnd = FindWindow(szWindowClass, szTitle);      
        if (hWnd) 
        //If it is already running, then focus on the window
        hWnd = FindWindow(szWindowClass, szTitle);      
        if (hWnd) 
@@ -158,11 +158,11 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
        
        RECT    rect;
        GetClientRect(hWnd, &rect);
        
        RECT    rect;
        GetClientRect(hWnd, &rect);
-\r
+
        OpenCOM1();
        load_boot("\\My Documents\\params.txt");
        load_boot("\\Storage Card\\params.txt");
        OpenCOM1();
        load_boot("\\My Documents\\params.txt");
        load_boot("\\Storage Card\\params.txt");
-       load_boot("\\ÒÓØ ¶°ÄÞ\\params.txt");\r
+       load_boot("\\ÒÓØ ¶°ÄÞ\\params.txt");
 
        hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE,
                CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
 
        hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE,
                CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
@@ -203,187 +203,187 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
 //
 LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
 //
 LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
-\r
+
        HDC hdc;
        HDC hdc;
-\r
+
        int wmId, wmEvent;
        int wmId, wmEvent;
-\r
+
        PAINTSTRUCT ps;
        PAINTSTRUCT ps;
-\r
+
        TCHAR szHello[MAX_LOADSTRING];
        TCHAR szHello[MAX_LOADSTRING];
-\r
 
 
-\r
+
+
        switch (message) 
        switch (message) 
-\r
+
        {
        {
-\r
+
                case WM_COMMAND:
                case WM_COMMAND:
-\r
+
                        wmId    = LOWORD(wParam); 
                        wmId    = LOWORD(wParam); 
-\r
+
                        wmEvent = HIWORD(wParam); 
                        wmEvent = HIWORD(wParam); 
-\r
+
                        // Parse the menu selections:
                        // Parse the menu selections:
-\r
+
                        switch (wmId)
                        switch (wmId)
-\r
+
                        {       
                        {       
-\r
+
                                case IDM_HELP_ABOUT:
                                case IDM_HELP_ABOUT:
-\r
+
                                        DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
                                        DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
-\r
+
                                    break;
                                    break;
-\r
+
                                case IDOK:
                                case IDOK:
-\r
+
                                        SendMessage(hWnd, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE, 0), (LPARAM)hWnd);
                                        SendMessage(hWnd, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE, 0), (LPARAM)hWnd);
-\r
+
                                        SendMessage (hWnd, WM_CLOSE, 0, 0);
                                        SendMessage (hWnd, WM_CLOSE, 0, 0);
-\r
+
                                        break;
                                        break;
-\r
+
                                default:
                                default:
-\r
+
                                   return DefWindowProc(hWnd, message, wParam, lParam);
                                   return DefWindowProc(hWnd, message, wParam, lParam);
-\r
+
                        }
                        }
-\r
+
                        break;
                        break;
-\r
+
                case WM_CREATE:
                case WM_CREATE:
-\r
+
                        hwndCB = CreateRpCommandBar(hWnd);
                        hwndCB = CreateRpCommandBar(hWnd);
-\r
+
                        break;
                        break;
-\r
+
                case WM_PAINT:
                case WM_PAINT:
-\r
+
                        RECT rt;
                        RECT rt;
-\r
+
                        hdc = BeginPaint(hWnd, &ps);
                        hdc = BeginPaint(hWnd, &ps);
-\r
+
                        GetClientRect(hWnd, &rt);
                        GetClientRect(hWnd, &rt);
-\r
+
                        LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
                        LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
-\r
+
                        DrawText(hdc, szHello, _tcslen(szHello), &rt, 
                        DrawText(hdc, szHello, _tcslen(szHello), &rt, 
-\r
+
                                DT_SINGLELINE | DT_VCENTER | DT_CENTER);
                                DT_SINGLELINE | DT_VCENTER | DT_CENTER);
-\r
+
                        EndPaint(hWnd, &ps);
                        EndPaint(hWnd, &ps);
-\r
+
                        break; 
                        break; 
-\r
+
                case WM_DESTROY:
                case WM_DESTROY:
-\r
+
                        CommandBar_Destroy(hwndCB);
                        CommandBar_Destroy(hwndCB);
-\r
+
                        PostQuitMessage(0);
                        PostQuitMessage(0);
-\r
+
                        break;
                        break;
-\r
+
                case WM_SETTINGCHANGE:
                case WM_SETTINGCHANGE:
-\r
+
 //                     SHHandleWMSettingChange(hWnd, wParam, lParam, &s_sai);
 //                     SHHandleWMSettingChange(hWnd, wParam, lParam, &s_sai);
-\r
+
                break;
                break;
-\r
+
                default:
                default:
-\r
+
                        return DefWindowProc(hWnd, message, wParam, lParam);
                        return DefWindowProc(hWnd, message, wParam, lParam);
-\r
+
    }
    }
-\r
+
    return 0;
    return 0;
-\r
+
 }
 }
-\r
 
 
-\r
+
+
 HWND CreateRpCommandBar(HWND hwnd)
 HWND CreateRpCommandBar(HWND hwnd)
-\r
+
 {
 {
-/*\r
+/*
        SHMENUBARINFO mbi;
        SHMENUBARINFO mbi;
-\r
 
 
-\r
+
+
        memset(&mbi, 0, sizeof(SHMENUBARINFO));
        memset(&mbi, 0, sizeof(SHMENUBARINFO));
-\r
+
        mbi.cbSize     = sizeof(SHMENUBARINFO);
        mbi.cbSize     = sizeof(SHMENUBARINFO);
-\r
+
        mbi.hwndParent = hwnd;
        mbi.hwndParent = hwnd;
-\r
+
        mbi.nToolBarId = IDM_MENU;
        mbi.nToolBarId = IDM_MENU;
-\r
+
        mbi.hInstRes   = hInst;
        mbi.hInstRes   = hInst;
-\r
+
        mbi.nBmpId     = 0;
        mbi.nBmpId     = 0;
-\r
+
        mbi.cBmpImages = 0;
        mbi.cBmpImages = 0;
-\r
 
 
-\r
+
+
        if (!SHCreateMenuBar(&mbi)) 
        if (!SHCreateMenuBar(&mbi)) 
-\r
+
                return NULL;
                return NULL;
-\r
 
 
-\r
+
+
        return mbi.hwndMB;
        return mbi.hwndMB;
-*/\r
-       return NULL;\r
+*/
+       return NULL;
 }
 }
-\r
 
 
-\r
+
+
 // Mesage handler for the About box.
 // Mesage handler for the About box.
-\r
+
 LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
-\r
+
 {
 {
-\r
+
 //     SHINITDLGINFO shidi;
 //     SHINITDLGINFO shidi;
-\r
 
 
-\r
+
+
        switch (message)
        switch (message)
-\r
+
        {
        {
-\r
+
                case WM_INITDIALOG:
                case WM_INITDIALOG:
-\r
+
                        // Create a Done button and size it.  
                        // Create a Done button and size it.  
-\r
+
 //                     shidi.dwMask = SHIDIM_FLAGS;
 //                     shidi.dwMask = SHIDIM_FLAGS;
-\r
+
 //                      shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | SHIDIF_SIZEDLGFULLSCREEN;
 //                      shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | SHIDIF_SIZEDLGFULLSCREEN;
-\r
+
 //                     shidi.hDlg = hDlg;
 //                     shidi.hDlg = hDlg;
-\r
+
 //                     SHInitDialog(&shidi);
 //                     SHInitDialog(&shidi);
-\r
+
                        return TRUE; 
                        return TRUE; 
-\r
 
 
-\r
+
+
                case WM_COMMAND:
                case WM_COMMAND:
-\r
+
                        if (LOWORD(wParam) == IDOK) {
                        if (LOWORD(wParam) == IDOK) {
-\r
+
                                EndDialog(hDlg, LOWORD(wParam));
                                EndDialog(hDlg, LOWORD(wParam));
-\r
+
                                return TRUE;
                                return TRUE;
-\r
+
                        }
                        }
-\r
+
                        break;
                        break;
-\r
+
        }
        }
-\r
+
     return FALSE;
     return FALSE;
-\r
+
 }
 }
-\r
+
index b793a85e4c0d8c8b5b469e65a75b00a94dd64fa6..7a949cdb26e3581a83ae166f754f4c93b7e237b6 100644 (file)
--- a/tester1.h
+++ b/tester1.h
@@ -1,71 +1,71 @@
-#include "config.h"\r
-\r
-\r\r
-#define BOOT_LOGO\r\r
-//#define BOOT_LOGO_DONE\r\r
-\r\r
-#if !defined(AFX_TESTER1_H__7D4A2D28_4650_475E_A82E_CF6F8E7BA839__INCLUDED_)\r\r
-#define AFX_TESTER1_H__7D4A2D28_4650_475E_A82E_CF6F8E7BA839__INCLUDED_\r\r
-\r\r
-#if _MSC_VER > 1000\r\r
-#pragma once\r\r
-#endif // _MSC_VER > 1000\r\r
-\r\r
-#include "resource.h"\r\r
-\r\r
-//////////////////////////////// Some type definitions /////////////////////\r\r
-struct Image {\r\r
- UINT16 *p;\r\r
- long x,y;\r\r
-};\r\r
-\r\r
-/////////////////////////////Functions /////////////////////////////////////\r\r
-Image ReadBMP(char[]);\r\r
-void ShowImage(UINT16*,int,int,int=0,int=0);\r\r
-void Gpio();\r\r
-void UART_setup();\r\r
-void DumpMMU();\r\r
-void UART_puts(char *);\r\r
-void init_fb();\r\r
-void try_fb();\r\r
-void boot_linux(char*,char*);\r\r
-UINT32 ReadPhysical(UINT32);\r\r
-void  WritePhysical(UINT32 addr,UINT32 val);\r\r
-UINT32 VirtualToPhysical(UINT32);\r\r
-void load_boot(char*);\r\r
-void SetGPIOalt(int,int);\r\r
-void SetGPIOio(int,int);\r\r
-\r\r
-\r\r
-////////////////////////////////////////////////////////////////////////////\r\r
-\r\r
-extern "C" BOOL VirtualCopy(LPVOID lpvDestMem, LPVOID lpvSrcMem, \r\r
-                                                       DWORD dwSizeInBytes, DWORD dwProtectFlag);\r\r
-\r\r
-extern void do_it();\r\r
-\r\r
-extern int read_mmu();         // reads where is/are descriptors located\r\r
-\r\r
-extern void IntOff();\r\r
-extern void DRAMloader(UINT32 adr,UINT32 machine_num); // this function turns off MMU and jumps onto physical address given\r\r
-\r\r
-extern "C" DWORD SetProcPermissions(\r\r
-DWORD newperms \r\r
-); \r\r
-\r\r
-extern "C" DWORD GetCurrentPermissions(\r\r
-);\r\r
-\r\r
-extern "C" BOOL SetKMode( \r\r
-BOOL fMode \r\r
-);\r\r
-\r\r
-extern "C" LPVOID CreateStaticMapping(\r\r
-DWORD dwPhysBase,\r\r
-DWORD dwSize\r\r
-);\r\r
-\r\r
-\r\r
-#define MENU_HEIGHT 26\r\r
-\r\r
-#endif // !defined(AFX_TESTER1_H__7D4A2D28_4650_475E_A82E_CF6F8E7BA839__INCLUDED_)\r\r
+#include "config.h"
+
+\r
+#define BOOT_LOGO\r
+//#define BOOT_LOGO_DONE\r
+\r
+#if !defined(AFX_TESTER1_H__7D4A2D28_4650_475E_A82E_CF6F8E7BA839__INCLUDED_)\r
+#define AFX_TESTER1_H__7D4A2D28_4650_475E_A82E_CF6F8E7BA839__INCLUDED_\r
+\r
+#if _MSC_VER > 1000\r
+#pragma once\r
+#endif // _MSC_VER > 1000\r
+\r
+#include "resource.h"\r
+\r
+//////////////////////////////// Some type definitions /////////////////////\r
+struct Image {\r
+ UINT16 *p;\r
+ long x,y;\r
+};\r
+\r
+/////////////////////////////Functions /////////////////////////////////////\r
+Image ReadBMP(char[]);\r
+void ShowImage(UINT16*,int,int,int=0,int=0);\r
+void Gpio();\r
+void UART_setup();\r
+void DumpMMU();\r
+void UART_puts(char *);\r
+void init_fb();\r
+void try_fb();\r
+void boot_linux(char*,char*);\r
+UINT32 ReadPhysical(UINT32);\r
+void  WritePhysical(UINT32 addr,UINT32 val);\r
+UINT32 VirtualToPhysical(UINT32);\r
+void load_boot(char*);\r
+void SetGPIOalt(int,int);\r
+void SetGPIOio(int,int);\r
+\r
+\r
+////////////////////////////////////////////////////////////////////////////\r
+\r
+extern "C" BOOL VirtualCopy(LPVOID lpvDestMem, LPVOID lpvSrcMem, \r
+                                                       DWORD dwSizeInBytes, DWORD dwProtectFlag);\r
+\r
+extern void do_it();\r
+\r
+extern int read_mmu();         // reads where is/are descriptors located\r
+\r
+extern void IntOff();\r
+extern void DRAMloader(UINT32 adr,UINT32 machine_num); // this function turns off MMU and jumps onto physical address given\r
+\r
+extern "C" DWORD SetProcPermissions(\r
+DWORD newperms \r
+); \r
+\r
+extern "C" DWORD GetCurrentPermissions(\r
+);\r
+\r
+extern "C" BOOL SetKMode( \r
+BOOL fMode \r
+);\r
+\r
+extern "C" LPVOID CreateStaticMapping(\r
+DWORD dwPhysBase,\r
+DWORD dwSize\r
+);\r
+\r
+\r
+#define MENU_HEIGHT 26\r
+\r
+#endif // !defined(AFX_TESTER1_H__7D4A2D28_4650_475E_A82E_CF6F8E7BA839__INCLUDED_)\r
index 98451fa889a7f55ae19cd80413e4d07658d7bf25..020852fdf26693490b4476fb87088681054c0f0b 100644 (file)
--- a/uart.cpp
+++ b/uart.cpp
@@ -5,9 +5,9 @@
 #include <sipapi.h>
 #include "setup.h"
 
 #include <sipapi.h>
 #include "setup.h"
 
-// moved to config.h\r
+// moved to config.h
 //#define FUART 0x40100000
 //#define FUART 0x40100000
-\r
+
 
 void UART_puts(char *s)
 {
 
 void UART_puts(char *s)
 {
@@ -26,21 +26,21 @@ void UART_setup()
 {
        UINT32 *base=(UINT32*)VirtualAlloc((void*)0x0,sizeof(void*)*0xffff, MEM_RESERVE,PAGE_READWRITE);
        int ret=VirtualCopy(base,(void *) ((UARTBASE)/256),sizeof(void*)*0xffff , PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL);
 {
        UINT32 *base=(UINT32*)VirtualAlloc((void*)0x0,sizeof(void*)*0xffff, MEM_RESERVE,PAGE_READWRITE);
        int ret=VirtualCopy(base,(void *) ((UARTBASE)/256),sizeof(void*)*0xffff , PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL);
-\r
-#ifdef STRONGARM\r
-// Apparently there is something we don't know. This is needed.\r
-       HANDLE hSerial = CreateFile(L"COM1:", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);\r
-// disable UART\r
-       base[0x0C/4] = 0;\r
-// clear status\r
-       base[0x1C/4] = 0xFF;\r
-// set 8 bit no parity 1 stopbit\r
-       base[0x00/4] = 9;\r
-// set 115200 bps\r
-       base[0x04/4] = 0;\r
-       base[0x08/4] = 1;\r
-// enable TX/RX\r
-       base[0x0C/4] = 3;\r
+
+#ifdef STRONGARM
+// Apparently there is something we don't know. This is needed.
+       HANDLE hSerial = CreateFile(L"COM1:", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+// disable UART
+       base[0x0C/4] = 0;
+// clear status
+       base[0x1C/4] = 0xFF;
+// set 8 bit no parity 1 stopbit
+       base[0x00/4] = 9;
+// set 115200 bps
+       base[0x04/4] = 0;
+       base[0x08/4] = 1;
+// enable TX/RX
+       base[0x0C/4] = 3;
 #else
 // set DLAB
        base[0x0C/4]=128+2+1;
 #else
 // set DLAB
        base[0x0C/4]=128+2+1;
@@ -52,7 +52,7 @@ void UART_setup()
 // UART enable & no FIFO
        base[0x04/4]=64;
        base[0x08/4]=0;
 // UART enable & no FIFO
        base[0x04/4]=64;
        base[0x08/4]=0;
-#endif\r
+#endif
 
        char test[]="LinExec: UART Initialized.\n\r";
        int a=0;
 
        char test[]="LinExec: UART Initialized.\n\r";
        int a=0;
Impressum, Datenschutz