Rev 137 | Rev 151 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 137 | Rev 146 | ||
|---|---|---|---|
| Line 67... | Line 67... | ||
| 67 | expected to point just after the end of the thread local data. The |
67 | expected to point just after the end of the thread local data. The |
| 68 | application sometimes need to get a real address of the thread local |
68 | application sometimes need to get a real address of the thread local |
| 69 | data in its address space but it is impossible to read the base of the |
69 | data in its address space but it is impossible to read the base of the |
| 70 | FS segmentation register. The solution is to add the self-reference |
70 | FS segmentation register. The solution is to add the self-reference |
| 71 | address to the end of thread local data, so that the application can |
71 | address to the end of thread local data, so that the application can |
| 72 | read the address as %gs:0. </para> |
72 | read the address as %gs:0.</para> |
| 73 | 73 | ||
| 74 | <figure float="1"> |
74 | <figure float="1"> |
| 75 | <title>IA32 & AMD64</title> |
75 | <title>IA32 & AMD64</title> |
| 76 | 76 | ||
| 77 | <mediaobject id="tldia32"> |
77 | <mediaobject id="tldia32"> |
| Line 165... | Line 165... | ||
| 165 | <imagedata fileref="images/tld_mips.svg" format="SVG" /> |
165 | <imagedata fileref="images/tld_mips.svg" format="SVG" /> |
| 166 | </imageobject> |
166 | </imageobject> |
| 167 | </mediaobject> |
167 | </mediaobject> |
| 168 | </figure> |
168 | </figure> |
| 169 | </section> |
169 | </section> |
| - | 170 | ||
| - | 171 | <section> |
|
| - | 172 | <title>Lazy FPU Context Switching</title> |
|
| - | 173 | ||
| - | 174 | <para>Implementing lazy FPU switching on MIPS architecture is |
|
| - | 175 | straightforward. When coprocessor CP1 is disabled, any FPU intruction |
|
| - | 176 | raises a Coprocessor Unusable exception. The generic lazy FPU context |
|
| - | 177 | switch is then called that takes care of the correct context |
|
| - | 178 | save/restore.</para> |
|
| - | 179 | </section> |
|
| 170 | </section> |
180 | </section> |
| 171 | 181 | ||
| 172 | <section> |
182 | <section> |
| 173 | <title>Power PC</title> |
183 | <title>Power PC</title> |
| 174 | 184 | ||
| - | 185 | <para>PowerPC allows kernel to enable mode, where data and intruction |
|
| - | 186 | memory reads are not translated through virtual memory mapping |
|
| - | 187 | (<emphasis>real mode</emphasis>). The real mode is automatically enabled |
|
| - | 188 | when an exception occurs. However, the kernel uses the same memory |
|
| - | 189 | structure as on other 32-bit platforms - physical memory is mapped into |
|
| - | 190 | the top 2GB, userspace memory is available in the bottom half of the |
|
| - | 191 | 32-bit address space.</para> |
|
| - | 192 | ||
| - | 193 | <section> |
|
| - | 194 | <title>OpenFirmware Boot</title> |
|
| - | 195 | ||
| - | 196 | <para>The OpenFirmware loads an image of HelenOS operating system and |
|
| - | 197 | passes control to the HelenOS specific boot loader. The boot loader then |
|
| - | 198 | performs following tasks:</para> |
|
| - | 199 | ||
| - | 200 | <itemizedlist> |
|
| - | 201 | <listitem> |
|
| - | 202 | <para>Fetches information from OpenFirmware regarding memory |
|
| - | 203 | structure, device information etc.</para> |
|
| - | 204 | </listitem> |
|
| - | 205 | ||
| - | 206 | <listitem> |
|
| - | 207 | <para>Switches memory mapping to the real mode.</para> |
|
| - | 208 | </listitem> |
|
| - | 209 | ||
| - | 210 | <listitem> |
|
| - | 211 | <para>Copies the kernel to proper physical address.</para> |
|
| - | 212 | </listitem> |
|
| - | 213 | ||
| - | 214 | <listitem> |
|
| - | 215 | <para>Creates basic memory mapping and switches to the new kernel |
|
| - | 216 | mapping, in which the kernel can run.</para> |
|
| - | 217 | </listitem> |
|
| - | 218 | ||
| - | 219 | <listitem> |
|
| - | 220 | <para>Passes control to the kernel <function>main_bsp</function> |
|
| - | 221 | function.</para> |
|
| - | 222 | </listitem> |
|
| - | 223 | </itemizedlist> |
|
| 175 | <para></para> |
224 | </section> |
| 176 | 225 | ||
| 177 | <section> |
226 | <section> |
| 178 | <title>Thread Local Storage</title> |
227 | <title>Thread Local Storage</title> |
| 179 | 228 | ||
| 180 | <para>The Power PC thread local storage uses R2 register to hold an |
229 | <para>The Power PC thread local storage uses R2 register to hold an |
| Line 182... | Line 231... | ||
| 182 | data. Overally it is the same as on the MIPS architecture.</para> |
231 | data. Overally it is the same as on the MIPS architecture.</para> |
| 183 | </section> |
232 | </section> |
| 184 | </section> |
233 | </section> |
| 185 | 234 | ||
| 186 | <section> |
235 | <section> |
| 187 | <title>IA-64</title> |
236 | <title>IA64</title> |
| 188 | 237 | ||
| 189 | <para></para> |
238 | <para></para> |
| 190 | 239 | ||
| 191 | <figure float="1"> |
240 | <section> |
| 192 | <title>IA64</title> |
241 | <title>Thread Local Storage</title> |
| 193 | 242 | ||
| - | 243 | <para>Although thread local storage is not officially supported in |
|
| - | 244 | statically linked binaries, GCC supports it without any major obstacles. |
|
| - | 245 | As a thread pointer is designated register r13, the thread local data |
|
| - | 246 | section starts at an address r13+16.</para> |
|
| - | 247 | ||
| - | 248 | <para><figure float="1"> |
|
| - | 249 | <title>IA64</title> |
|
| - | 250 | ||
| 194 | <mediaobject id="tldia64"> |
251 | <mediaobject id="tldia64"> |
| 195 | <imageobject role="pdf"> |
252 | <imageobject role="pdf"> |
| 196 | <imagedata fileref="images/tld_ia64.pdf" format="PDF" /> |
253 | <imagedata fileref="images/tld_ia64.pdf" format="PDF" /> |
| 197 | </imageobject> |
254 | </imageobject> |
| 198 | 255 | ||
| 199 | <imageobject role="html"> |
256 | <imageobject role="html"> |
| 200 | <imagedata fileref="images/tld_ia64.png" format="PNG" /> |
257 | <imagedata fileref="images/tld_ia64.png" format="PNG" /> |
| 201 | </imageobject> |
258 | </imageobject> |
| 202 | 259 | ||
| 203 | <imageobject role="fop"> |
260 | <imageobject role="fop"> |
| 204 | <imagedata fileref="images/tld_ia64.svg" format="SVG" /> |
261 | <imagedata fileref="images/tld_ia64.svg" format="SVG" /> |
| 205 | </imageobject> |
262 | </imageobject> |
| 206 | </mediaobject> |
263 | </mediaobject> |
| - | 264 | </figure></para> |
|
| 207 | </figure> |
265 | </section> |
| 208 | </section> |
266 | </section> |
| 209 | </appendix> |
267 | </appendix> |
| 210 | 268 | ||