[okl4-developer] Stuck in kmem::free()
Charles Chiou
cchiou at ambarella.com
Thu Jul 24 13:39:53 EST 2008
Hi Geoffrey,
I think I may know what's going on. It looks like the content in the BSS are
not cleared. So does the loader need to clear the BSS after loading
image.boot?
I copied the file 'platform/pxa/pistachio/src/head.spp' for my own head.spp.
I suppose something could be added here to clear the sections "kernel.bss"
and "l4test.bss"?
Thanks
Charles
On 7/23/08 12:25 PM, "Geoffrey Lee" <glee at ok-labs.com> wrote:
> On Wed, Jul 23, 2008 at 12:09:41PM +0800, Charles Chiou wrote:
>> Hi Geoffrey,
>>
>> I'm building with "./tools/build.py machine=a2bub project=l4test" and trying
>> to follow the video "Porting OKL4 to a new SoC".
>>
>> I've implemented a serial driver that is supposed to run under the OKL4, but
>> since the code hasn't executed that far (the remapping of UART controller's
>> physical address to 0xf9000000 hasn't been run yet).
>>
>> Do you mean I should write another serial driver based on physical address?
>
> It may be possible to re-jig the initialization so that the serial
> gets initialized earlier.
>
> I've just had another look at the assembly dump and it seems to
> correspond to the tracebuffer.
>
>>>>>> 0xF00043E4 EAFFFFAD B 0xf00042a0> >>>> 0xF00043E8
>>>>>> E5933010 LDR R3,[R3,#+0x10] <--- !!!
>>>>>> 0xF00043EC E3130002 TST R3,#0x2
>>>>>> 0xF00043F0 0AFFFFA6 BEQ 0xf0004290
>>>>>> 0xF00043F4 E3A0003D MOV R0,#0x3d
>>>>>> 0xF00043F8 EB0026AB BL _Z12tb_log_eventm ;
>
> The offset 0x10 would correspond to the log mask, and the tracebuffer
> code looks like so:
>
> #define TBUF_RECORD_EVENT(tp)
> \
> if (EXPECT_FALSE(trace_buffer && trace_buffer->log_mask & (1UL <<
> tp##_major
> ))) \
> tb_log_event(tp)
>
> It may be worthwhile to further investigate why the tracebuffer
> pointer appears to be bad.
>
>>
>> Thanks
>>
>> Charles
>
> -gl
>
>>
>> On 7/23/08 12:00 PM, "Geoffrey Lee" <glee at ok-labs.com> wrote:
>>
>>> On Wed, Jul 23, 2008 at 10:06:19AM +0800, Charles Chiou wrote:
>>>> Hi Geoffrey,
>>>>
>>>
>>> Hi Charles
>>>
>>>> I'm loading image.boot to physical 0xc0100000. When it starts execution,
>>>> the
>>>> MMU is turned off.
>>>>
>>>> I've not modified kernel sources other than platform additions.
>>>
>>> What is the build command line you use to build your software?
>>> It may be worthwhile writing a simple serial console so that
>>> you can debug the kernel initialization.
>>>
>>>> Thanks
>>>>
>>>> Charles
>>>
>>> -gl
>>>
>>>>
>>>>
>>>> On 7/22/08 11:53 AM, "Geoffrey Lee" <glee at ok-labs.com> wrote:
>>>>
>>>>> On Sun, Jul 20, 2008 at 05:31:48PM +0800, Charles Chiou wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I'm in the process of trying to port pistachio to an SoC with an
>>>>>> ARM926EJ-S
>>>>>> core. It seems to run into prefetch abort exception in kmem::free(). I'd
>>>>>> appreciate if somebody could shed some lights on what I'm doing wrong.
>>>>>
>>>>> Hi Charles
>>>>>
>>>>> How did you load your binary to the system and which address did you
>>>>> load it to? Have you made any other modifications to the OKL4 source
>>>>> code other than adding in your platfrom description?
>>>>>
>>>>> -gl
>>>>>
>>>>>>
>>>>>> The place it occurs is (where r3 is 0x10000100):
>>>>>>
>>>>>> _ZN6kmem_t4freeEPvm:
>>>>>> 0xF0004268 E92D40F0 STMFD SP!,{R4-R7,LR}
>>>>>> 0xF000426C E59F318C LDR R3,[PC,#+0x18c]
>>>>>> 0xF0004270 E5933000 LDR R3,[R3,#+0]
>>>>>> 0xF0004274 E24DD010 SUB SP,SP,#0x10
>>>>>> ...
>>>>>> 0xF00043E4 EAFFFFAD B 0xf00042a0
>>>>>> 0xF00043E8 E5933010 LDR R3,[R3,#+0x10] <--- !!!
>>>>>> 0xF00043EC E3130002 TST R3,#0x2
>>>>>> 0xF00043F0 0AFFFFA6 BEQ 0xf0004290
>>>>>> 0xF00043F4 E3A0003D MOV R0,#0x3d
>>>>>> 0xF00043F8 EB0026AB BL _Z12tb_log_eventm ;
>>>>>> _Z12tb_log_eventm=0xf000deac
>>>>>> 0xF00043FC EAFFFFA3 B 0xf0004290
>>>>>>
>>>>>> It looks like kmem:free() is called with (start = 0xf0022590, end =
>>>>>> 0xf0100000).
>>>>>>
>>>>>> I'm stuck before the console is up, which is makes debugging very
>>>>>> difficult
>>>>>> :( However, I also think the init hasn't run into where I mapped the
>>>>>> physical memory of my uart to 0xf9000000 (writing there doesn't output
>>>>>> anything).
>>>>>>
>>>>>> This is my machine.py:
>>>>>>
>>>>>> class a2(arm926ejs):
>>>>>> platform = "ambarella"
>>>>>>
>>>>>> class a2bub(a2):
>>>>>> virtual = False
>>>>>> memory = a2.memory.copy()
>>>>>> memory['physical'] = [Region(0xc0100000L, 0xc1000000L)]
>>>>>> bootimage = "binary"
>>>>>>
>>>>>>
>>>>>> Thanks for the help!
>>>>>>
>>>>>> Charles
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Developer mailing list
>>>>>> Developer at okl4.org
>>>>>> https://lists.okl4.org/mailman/listinfo/developer
>>>>>>
>>>>
>>>>
>>
>>
More information about the Developer
mailing list