Self modifying code in ARM 11 architectures
Peter Teoh
htmldeveloper at gmail.com
Wed May 25 22:53:27 EDT 2011
On Thu, May 26, 2011 at 12:28 AM, Peter Teoh <htmldeveloper at gmail.com> wrote:
>
>
> On Tue, May 24, 2011 at 6:15 PM, Ashok Babu <ashok3d at gmail.com> wrote:
>>
>> Hi All,
>> I am no success in booting up the ARM1176 processor with the linux-2.6.32
>> kernel.
>> While googling about the ARM Harvard architecture, I came to know that we
>> have to flush/invalidate the D-Cache and I-Cache
>> when using the self modifying codes.
>> So here my questions/doubts :
>> 1) Is'nt it the kernel itself is self modifying code with lots of function
>> pointers ?
>> If yes, how is synchronization b/w d-cache and i-cache handled in the
>> kernel ?
>> 2) Can this be the reason for the kernel not booting for me ?
>> Because If i disable the I-Cache in the config, then the kernel boots
>> up without any issues.
>> Any pointers on this will be of great help.
>
> Here:
> http://blogs.arm.com/software-enablement/141-caches-and-self-modifying-code/
Based on the URL above (where it described to disable I cache to
execute self-modified codes), and your observation in (2), I guessed
that the behavior is correct. During bootup, linux kernel actually
unzip itself, and execute into the unzipped image. And so during
this time, the I-cache have to be disabled in order to bring the
instruction in from the external memory.
More information about the Kernelnewbies
mailing list