Kernel hangs in KernelFindMemory

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,

I am new to kernel porting and i am porting WINCE5.0 to ARM926EJS
SOC.
I started by cloning the Mainstone BSP and i am not using a
bootloader to download the image.I am directly downloading the image
to the RAM through LAUTERBACH.

I have started in a simple manner like not even mapped all
peripherals in the OEMaddresstable and no peripherals are initialized
other than uart.

SDRAM starts with 0x2C000000 and size is 16MB
and i am downloading the nk.nb0 to 0x20100000(i left 1 MB for future
scope like bootloader)

Since i dont know how to create a .nb0 through the config.bib,i am
creating nk.nb0 from NK.BIN using viewbin and cvrtbin sequence.

My oemaddrtab_cfg.inc contains the following OEMaddresstable

DCD 0x80000000, 0x20000000, 16 ; SDRAM (16MB).
DCD 0x81000000, 0x30000000, 1 ; Memory controller.
DCD 0x81100000, 0x40000000, 1 ; DMA controller.
DCD 0x81200000, 0x60000000, 1 ; DISPLAY
DCD 0x81300000, 0xC0000000, 1 ; TIMER0
DCD 0x81400000, 0xC2000000, 1 ; UART controller.
DCD 0x81500000, 0xC6000000, 1 ; GPIO
DCD 0x81600000, 0xCA000000, 1 ; CLOCK
DCD 0x81700000, 0xF0000000, 1 ; VIC
DCD 0x00000000, 0x00000000, 0 ; end of table

The config.bib is as follows

MEMORY

; Name Start Size Type
; ------- -------- -------- ----
RSVD 80000000 000FF000 RESERVED
ARGS 800FF000 00001000 RESERVED
NK 80100000 00500000 RAMIMAGE ; 5 MB
RAM 80600000 00600000 RAM ; 6 MB

; ZBANK 96500000 00100000 RESERVED

CONFIG

AUTOSIZE=OFF
KERNELFIXUPS=ON

ROMSTART=80100000
ROMWIDTH=32
;ROMSIZE=20000

;
; ROMFLAGS is a bitmask of options for the kernel
; ROMFLAGS 0x0001 Disallow Paging
; ROMFLAGS 0x0002 Not all KMode
; ROMFLAGS 0x0010 Trust Module only
;
IF IMGTRUSTROMONLY
IF IMGNOTALLKMODE
ROMFLAGS=12
ELSE
ROMFLAGS=10
ENDIF
ELSE
IF IMGNOTALLKMODE
ROMFLAGS=02
ELSE
ROMFLAGS=00
ENDIF
ENDIF


My Uart output is
Windows CE Kernel for ARM (Thumb Enabled) Built on Jun 24 2004 at
18:21:58
ProcessorType=0926 Revision=5
sp_abt=ffff5000 sp_irq=ffff2800 sp_undef=ffffc800 OEMAddressTable =
80115920



OEMInit :->
+OEMInit

Initialize Interrupts :
+OALInterruptInit

OALInterruptInit:->

OALIntrMapInit:->
+OALIntrMapInit
-OALIntrMapInit

OALIntrMapInit:<-


+OALPAtoVA(0xf0000000, 0)
-OALPAtoVA(va = 0xa1700000)

+OALIntrStaticTranslate(1, 26)
-OALIntrStaticTranslate

static mapping:<-

OALInterruptInit: <-
-OALInterruptInit(rc = 0)

OALTimerInit :->
+OALPAtoVA(0xc0000000, 0)
-OALPAtoVA(va = 0xa1300000)

OALTimerInit :<-
-OEMInit
+OEMCacheRangeFlush(0x00000000, 0, 0x00000004)
-OEMCacheRangeFlush

OEMInit :<-
Forcing clean reboot
Booting Windows CE version 5.00 for (ARM)
&pTOC = 80109cac, pTOC = 801f28e4, pTOC->ulRamFree = 80285000,
MemForPT = 000000
00

Old or invalid version stamp in kernel structures - starting clean!
Configuring: Primary pages: 15734, Secondary pages: 0, Filesystem
pages = 7867

The debugger says its running and after some time it time outs.

The following are the iterations i have done and the queries i have

1) I have searched through the newsgroups and tested the RAM in the
OALstartup function as follows

ldr r3, =0x20300000 ;sdram base address
ldr r5, =0x00D00000 ;
1000
ldr r2, =0xAAAAAAAA
str r2, [r3]
mov r2, #0x0 ;clear r2
ldr r2, [r3] ;read out the data just wrote
ldr r4, =0xAAAAAAAA
sub r2, r2, r4
bne %F2000 ;compare
add r3, r3, #4 ;next address
sub r5, r5, #4 ;count-4
bne %B1000
b %3000
2000
//prints sucess
3000
//prints failure

and it was a success,the image was around 1356 KB (from the file
details)so i rounded to 2 MB ,i dont know how to find the exact size
of nk.nb0.

2) In the Uart output,my personal debugs messages are also there.Pls
ignore it.VIC and timers are not initialized so pls ignore those
messages and i mapped timer irq with sysintr.

3) what is the purpose of ZBANK ? i commented because i dont know
about it.

4) what is the purpose of ROMFLAGS ? what should be the ideal value ?

5)Pls verify that my configurations are correct ?

6)i just iterated with NK and RAM MEMORY sections with different
values and final one is
NK 80100000 00500000 RAMIMAGE ; 5 MB
RAM 80600000 00600000 RAM ; 6 MB

7) i havenot builded the nk.lib and cache libraries .I linked to 3
libraries.

$(_PLATCOMMONLIB)\$(_CPUDEPPATH)\oal_cache_arm926.lib \
$(_PLATCOMMONLIB)\$(_CPUDEPPATH)\oal_cache_arm.lib \
$(_PLATCOMMONLIB)\$(_CPUDEPPATH)\oal_cache.lib \

8) i used the following lines in the OEMInit()

TURN_ON_BTB();

// Set memory size for DrWatson kernel support.
//
// dwNKDrWatsonSize = 128 * 1024;
NKForceCleanBoot();

I havent modified the TURN_ON_BTB function,this is same as of
Mainstone's.I commented dwNKDrWatsonSize to avoid one debug message
that is
Error Reporting Memory Reserved, dump size =

9) i dont know what is the ideal value of ROMSIZE for my case,so i
commented.i have tried with AUTOSIZE for both ON and OFF values.No
Difference.

10) Finally,i am waiting for your valuable suggestions/opinions as i
think experience matters at this moment for me.

Hope there is a community for inexperienced WINCE developers to
have a confidence in ourelves that we are not lost.

Thanking you for a patient listening.

.



Relevant Pages

  • Kernel hangs in KernelFindMemory
    ... I am new to kernel porting and i am porting WINCE5.0 to ARM926EJS ... ; ROMFLAGS 0x0001 Disallow Paging ... ldr r3, =0x20300000;sdram base address ...
    (microsoft.public.windowsce.platbuilder)
  • (Kernel Init) NKDbgPrintfW generates abort
    ... SH4 Kernel initialization code calls NKDbgPrintfW right after enabling the ... ; @CESYSGEN ENDIF!NK_NKNOCOMP ... ROMFLAGS 0x0001 Demand paging is disabled. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: enable Full Kernel Mode
    ... The "Enable Full Kernel Mode"option in PB's menu is only unsetthe ... And the config.bib will assign a sutable value for ROMFLAGS by ... > ROMFLAGS settings in config.bib file. ... > having the 'Enable Full Kernel Mode' option ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Unresolved external _NkForceCleanBoot in function _OEMInit
    ... and the NKForceCleanBoot API was added to cover this condition. ... one recipe for forcing a clean boot was: ... void OEMInit() ... It seems strange that the kernel loaded coredll to call kernel-only ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Simple PB question...
    ... Anywhere in OEMInit() should be fine. ... that would be BSP specific. ... kernel portion of the BSP, it's probably easier to just rebuild the whole ... >>> power cycle, but now it seems this build does not. ...
    (microsoft.public.windowsce.embedded)