Meaty Skeleton: Difference between revisions
Jump to navigation
Jump to search
[unchecked revision] | [unchecked revision] |
Content deleted Content added
Undo corrects I disagree with |
|||
Line 59: | Line 59: | ||
== System Root == |
== System Root == |
||
Normally when you compile programs for your local operating system, the compiler |
Normally when you compile programs for your local operating system, the compiler locates development files such as headers and libraries in system directories such as: |
||
:<tt>/usr/include</tt> |
:<tt>/usr/include</tt> |
||
:<tt>/usr/lib</tt> |
:<tt>/usr/lib</tt> |
||
These files are of course not usable for your operating system. Instead you |
These files are of course not usable for your operating system. Instead you want to have your own version of these directories that contains files for your operating system: |
||
:<tt>/home/bwayne/myos/sysroot/usr/include</tt> |
:<tt>/home/bwayne/myos/sysroot/usr/include</tt> |
||
Line 151: | Line 151: | ||
The special <tt>__is_myos_kernel</tt> macro lets the source code detect whether |
The special <tt>__is_myos_kernel</tt> macro lets the source code detect whether |
||
it is |
it is part of the kernel. |
||
The kernel is built with <tt>-fbuiltin</tt>, which promises that the C standard |
The kernel is built with <tt>-fbuiltin</tt>, which promises that the C standard |
||
Line 196: | Line 196: | ||
The special <tt>__is_myos_libc</tt> macro lets the source code detect whether |
The special <tt>__is_myos_libc</tt> macro lets the source code detect whether |
||
it is |
it is part of the libc. |
||
This example comes with a small number of standard functions that serve as |
|||
examples and serve to satisfy ABI requirements. Note that the <tt>printf</tt> |
examples and serve to satisfy ABI requirements. Note that the <tt>printf</tt> |
||
function included is very minimal and doesn't handle |
function included is very minimal and doesn't handle most common features, this |
||
is intentional. |
is intentional. |
||
Line 211: | Line 211: | ||
---> |
---> |
||
You can easily download the source code using |
You can easily download the source code using [[git]] from the [https://gitorious.org/sortie/meaty-skeleton/ Meaty Skeleton git repository]. This is preferable to doing a manual error-prone copy, as you may make mistake or whitespace gets garbled due to bugs in our syntax highlighting. To clone the git repository, do: |
||
<source lang="bash"> |
<source lang="bash"> |