<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=DE link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal>Hello<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><span lang=EN-US>During the ongoing adaption to the ATMEL
AT91SAM9263-EK board (which has a non-XIP configuration) I observed that the
initial code located in file <b>head.spp</b> is partly overwritten. In a non-XIP
configuration the kernel is linked to the virtual start address of the RAM
which maps to the start address of the physical memory as defined in ‘platform/<platform>/tools/machine.py’.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Responsible for this behaviour is procedure
<b>init_arm_globals()</b> which is called after the MMU has been switched to
virtual addressing mode. The procedure obtains from function <b>get_arm_globals()</b>
a pointer of type <b>arm_globals_t</b> which is a structure holding various variables
and pointers the kernel is using. Function <b>get_arm_globals()</b> returns the
constant <b>ARM_GLOBAL_BASE</b> as the address of the structure. This constant is
identical with constant <b>VIRT_ADDR_RAM</b> which holds the value 0xF000.0000
to which the kernel code is allocated.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Although the overwriting is not hazardous
while the system is running, since head.spp is only executed ones, it makes it
impossible to restart it w/o reloading it into RAM. And it casts doubt on the
MMU configuration: the successful execution of <b>init_arm_globals()</b> is an
indication that the kernel code (at least the <b>.init</b> section) is not
write-protected by the MMU as I would expect.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Can anyone clarify whether the allocation
of the structure <b>arm_globals_t</b> to the kernel’s <b>.init</b> section
is intentional, and whether there is an effective write-protection set up in
the MMU for the kernel code?<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Regards<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Frank<o:p></o:p></span></p>
</div>
</body>
</html>