[okl4-developer] arm1176jz question on OKL4 2.1

Gabi Voiculescu b304_a at yahoo.com
Sat Apr 26 13:08:55 EST 2008


Hi again.

I would like to congratulate you for releasing another OKL4 SDK into the community, and with many new features included. 

I bet it took some effort from your part.

I was attempting today to port my ARM1176 board onto OKL4 2.1 but I ran in a few problems.

My machine.py has:

timer_driver = "brd1176_timer"
serial_driver = "drv_l4_kdb"
drivers = [timer_driver, serial_driver]


My problem
If I comment out in arch/arm/cpu/arm1176jz/syscon.h  
#define CONFIG_ARM_THREAD_REGISTERS     1 
I am getting a root task error (I have appended the output at the end of the document). If I don't I get the following build time error:

arch/arm/pistachio/v6/src/space.cc: In member function `void generic_space_t::activate(tcb_t*)':
arch/arm/pistachio/v6/src/space.cc:239: error: non-lvalue in assignment
scons: *** [build/pistachio/l4kernel/object/arch/arm/pistachio/v6/src/space.o] Error 1

My questions
I want to rule out some possible causes for the run time page fault.

1. For this I would like to ask how I can add more symbol information into the elf image (so I can use arm-linux-objdump -S- aka have the source text added). Is this feature available in OKL4 .2.1?

2. If not can you suggest additional parameters for me to give to the build system to get more output messages?

3. Can you explain a little the purpose of the USER_UTCB_REF and CONFIG_ARM_THREAD_REGISTERS macros. If I see correctly the first is a pointer to a table, either stored in user area ram or in hardware through CP15 register accesses, depending on the second being undefined or not. 


By the way: I think you meant to use
 #if !defined(CONFIG_ARM_THREAD_REGISTERS)
     USER_UTCB_REF = tcb->get_utcb_location();
 #else
     /* UTCB: Update User-RO Thread Register with UTCB */
     write_cp15_register(C15_pid, c0, 0x3, tcb->get_utcb_location());
 #endif

 instead of simply 

USER_UTCB_REF = tcb->get_utcb_location(); 

in generic_space_t::activate. Since ARM1136 does not take that into account you probably didn't see it.


Thank you 
Gabi Voiculescu

*********************************************************************************************
Below I have the output of the run (using parameters: project=l4test VERBOSE=1 VERBOSE_INIT=1 pistachio.enter_kdb = True):

*********************************************************************************************
OKL4 - (provider: Open Kernel Labs) built on Apr 25 2008 18:55:46 using gcc version 3.4.4.
Initialized tracebuffer @ 00240000
Init spaceids for 256 spaces
Initializing kernel space @ f001eb40...
Initializing kernel debugger...
Initializing interrupts...
System running with strict alignment exceptions disabled
System running with unaligned accesses enabled
Processor Id => 410fb764: Extended Info, ARM1176, rev 4
Initializing timer...
[plat/timer.cc] init_clocks TIMER_IRQ = 40
 [platform/.../interrupt.cc:pb1176_unmask_irq] Mask: 40, dc_dist->en_set[1] = 0x100
[plat/timer.cc] init_clocks done
Init mutexids for 256 mutexs
Init clistids for 16 clists
domain pairs: (0, 1)
Initialising scheduler...
Switching to idle thread
Initializing root servers
root-servers: utcb_area: eff00100 (64KB)
creating root server (00000001)
--- KD# System started (press 'g' to continue)  ---
> showtcb
tcb/tid/name [current]: current
=== idle == TCB: f0087ea0 == ID: 1d1e1d1e = f001ea40/f001ea40 == APRIO/EPRIO: 0xffffffff/0xffffffff ===
UIP: 00000000   queues: rb      space: f01026c8/0   pager: NIL_THRD
USP: 00000000   tstate: RUNNING   ready: NIL_THRD:NIL_THRD   pdir : f4024000
sndhd : NIL_THRD  blocked : NIL_THRD:NIL_THRD   waiting_for : NIL_THRD
ts length  :       0x2710 us, curr ts: 0x2710 us
resources:    00000000 [ek]
continuation: f0007968   preemption_cont: 00000000
scheduler: NIL_THRD    exception_handler: NIL_THRD
  partner: NIL_THRD        saved partner: NIL_THRD      saved state: ABORTED
  tcb_idx: 0
references: T 00000000
> go
roottask read pagefault at ffffffff, ip=0012a58c - deny
--- KD# roottask pagefault  ---
> showtcbext
tcb/tid/name [current]: current
=== roottask == TCB: f0030000 == ID: 00000001 = eff00000/f0103000 == APRIO/EPRIO: 0xff/0xff ===
UIP: 0012a58c   queues: rb      space: f01026c8/0   pager: NIL_THRD
USP: 00002fd8   tstate: RUNNING   ready: NIL_THRD:NIL_THRD   pdir : f4108000
sndhd : NIL_THRD  blocked : NIL_THRD:NIL_THRD   waiting_for : NIL_THRD
ts length  :       0x2710 us, curr ts: 0x2328 us
resources:    00000000 [ek]
continuation: f000d820   preemption_cont: 00000000
scheduler: roottask    exception_handler: NIL_THRD
  partner: NIL_THRD        saved partner: NIL_THRD      saved state: RUNNING
  tcb_idx: 0
references: T f010400c->f00300e0(I)

user handle:          00000000  cop flags:           00          preempt flags: 00 [~]
incoming notify bits: 00000000  notify mask:         00000000
last preempted_ip:    00000000  preempt_callback_ip: 0012c670

mr( 0): 80000000 00003000 00240000 00040000 00000000 00000000 00000000 00000000
mr( 8): 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
mr(16): 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
mr(24): 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Message Tag: 0 untyped, label = 8000, flags = -

Acceptor: 00000000 (a)  Error code: 0
> go
Assertion "get_saved_state() == thread_state_t::aborted" failed in file 'pistachio/src/thread.cc', line 702 (fn=f000af38)
--- KD# assert  ---
> showtcbext
tcb/tid/name [current]: current
=== roottask == TCB: f0030000 == ID: 00000001 = eff00000/f0103000 == APRIO/EPRIO: 0xff/0xff ===
UIP: 0012a58c   queues: rb      space: f01026c8/0   pager: NIL_THRD
USP: 00002fd8   tstate: RUNNING   ready: NIL_THRD:NIL_THRD   pdir : f4108000
sndhd : NIL_THRD  blocked : NIL_THRD:NIL_THRD   waiting_for : NIL_THRD
ts length  :       0x2710 us, curr ts: 0x2328 us
resources:    00000000 [ek]
continuation: f000d820   preemption_cont: 00000000
scheduler: roottask    exception_handler: NIL_THRD
  partner: NIL_THRD        saved partner: NIL_THRD      saved state: RUNNING
  tcb_idx: 0
references: T f010400c->f00300e0(I)

user handle:          00000000  cop flags:           00          preempt flags: 00 [~]
incoming notify bits: 00000000  notify mask:         00000000
last preempted_ip:    00000000  preempt_callback_ip: 0012c670

mr( 0): 80000000 00003000 00240000 00040000 00000000 00000000 00000000 00000000
mr( 8): 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
mr(16): 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
mr(24): 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Message Tag: 0 untyped, label = 8000, flags = -

Acceptor: 00000000 (a)  Error code: 0
> 

*********************************************************************************************
Output from arm-linux-objdump -S ./build/images/image.elf
*********************************************************************************************
......
0012a54c <l4test-malloc>:
  12a54c:       e3500000        cmp     r0, #0  ; 0x0
  12a550:       e92d4070        stmdb   sp!, {r4, r5, r6, lr}
  12a554:       01a02000        moveq   r2, r0
  12a558:       0a000020        beq     12a5e0 <l4test-malloc+0x94>
  12a55c:       e2803007        add     r3, r0, #7      ; 0x7
  12a560:       e1a031a3        mov     r3, r3, lsr #3
  12a564:       e59f00ac        ldr     r0, [pc, #172]  ; 12a618 <l4test-$d>
  12a568:       e2835001        add     r5, r3, #1      ; 0x1
  12a56c:       eb000817        bl      12c5d0 <l4test-okl4_mutex_count_lock>
  12a570:       e59f60a4        ldr     r6, [pc, #164]  ; 12a61c <l4test-$d+0x4>
  12a574:       e5962000        ldr     r2, [r6]
  12a578:       e3520000        cmp     r2, #0  ; 0x0
  12a57c:       e1a03002        mov     r3, r2
  12a580:       059f2098        ldreq   r2, [pc, #152]  ; 12a620 <l4test-$d+0x8>
  12a584:       05862000        streq   r2, [r6]
  12a588:       05822000        streq   r2, [r2]
  12a58c:       e5924000        ldr     r4, [r2]
  12a590:       05823004        streq   r3, [r2, #4]
  12a594:       ea000001        b       12a5a0 <l4test-malloc+0x54>
  12a598:       e1a02004        mov     r2, r4

*********************************************************************************************
What I think is happening
 If I figured out things correctly, the program:
 
 -  goes to CONTINUATION_FUNCTION(init_all_threads) from ./pistachio/src/schedule.cc
 
 - enters KDB (because of pistachio.kdb_enter =True in the command line)
 
 - calls the scheduler
 
 - in the end I get here:
 void generic_space_t::activate(tcb_t *tcb) from ./arch/arm/pistachio/v6/src/space.cc
 where I get a page fault on the first instruction.
 
 

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.okl4.org/pipermail/developer/attachments/20080425/e083ee2e/attachment.htm 


More information about the Developer mailing list