<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pub/teachos/kernel.git/cmake/Platforms, branch develop</title>
<subtitle>An educational OS kernel</subtitle>
<link rel='alternate' type='text/html' href='http://source.arknet.ch/pub/teachos/kernel.git/'/>
<entry>
<title>build/x86_64: add missing -ffreestanding flag</title>
<updated>2026-09-17T12:17:22+00:00</updated>
<author>
<name>Felix Morgner</name>
<email>felix.morgner@ost.ch</email>
</author>
<published>2026-09-17T12:17:22+00:00</published>
<link rel='alternate' type='text/html' href='http://source.arknet.ch/pub/teachos/kernel.git/commit/?id=5bad38935238da045d9fd467eae9dfd958deea34'/>
<id>5bad38935238da045d9fd467eae9dfd958deea34</id>
<content type='text'>
Enable the '-ffreestanding' flag in the x86_64 toolchain file to inform
the compiler about the fact that it cannot rely on the presence of a
standard library implementation, thereby suppressing some optimizations
designed for regular user applications.

GCC supports a number of clever optimizations, some of which rely on the
presence of a standard library. One of them is
"-ftree-loop-distribute-patterns". This optimization performs detection
of certain loop patterns, replacing them with library calls when
applicable. This is problematic for cases in which we implement the
standard library functionality. Consider, a schematic, `memset``:

```c++
void memset(void * d, int v, size_t n)
{
  for(auto i = 0uz; i &lt; n: ++i)
  {
    d[i] = static_cast&lt;std::byte&gt;(v);
  }
}
```

GCC recognizes this loop, and similar versions of it, as an
implementation of `memset`. In a hosted implementation, this is an
important optimization, since a standard library may be able to provide
a specifically optimized version of `memset``. So the compiler replaces
this `memset` loop with a call to `memset`, since it is not aware of the
fact we are currently implementing `memset`. Interestingly, tail
recursion optimization eliminates the call, transforming it into a jump
to the start of `memset`. This leads to execution getting stuck inside
`memset` with no way of exiting and no stack usage increase, thus
causing an infinite lockup.

While we could suppress the specific optimization, it is more effective
to tell the compiler "why" it can emit a call to memset in those cases.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Enable the '-ffreestanding' flag in the x86_64 toolchain file to inform
the compiler about the fact that it cannot rely on the presence of a
standard library implementation, thereby suppressing some optimizations
designed for regular user applications.

GCC supports a number of clever optimizations, some of which rely on the
presence of a standard library. One of them is
"-ftree-loop-distribute-patterns". This optimization performs detection
of certain loop patterns, replacing them with library calls when
applicable. This is problematic for cases in which we implement the
standard library functionality. Consider, a schematic, `memset``:

```c++
void memset(void * d, int v, size_t n)
{
  for(auto i = 0uz; i &lt; n: ++i)
  {
    d[i] = static_cast&lt;std::byte&gt;(v);
  }
}
```

GCC recognizes this loop, and similar versions of it, as an
implementation of `memset`. In a hosted implementation, this is an
important optimization, since a standard library may be able to provide
a specifically optimized version of `memset``. So the compiler replaces
this `memset` loop with a call to `memset`, since it is not aware of the
fact we are currently implementing `memset`. Interestingly, tail
recursion optimization eliminates the call, transforming it into a jump
to the start of `memset`. This leads to execution getting stuck inside
`memset` with no way of exiting and no stack usage increase, thus
causing an infinite lockup.

While we could suppress the specific optimization, it is more effective
to tell the compiler "why" it can emit a call to memset in those cases.
</pre>
</div>
</content>
</entry>
<entry>
<title>build: clean up available build types</title>
<updated>2026-09-04T20:12:57+00:00</updated>
<author>
<name>Felix Morgner</name>
<email>felix.morgner@ost.ch</email>
</author>
<published>2026-09-04T20:12:57+00:00</published>
<link rel='alternate' type='text/html' href='http://source.arknet.ch/pub/teachos/kernel.git/commit/?id=29960e6df864310f20b83da596dc0210c4dd0b62'/>
<id>29960e6df864310f20b83da596dc0210c4dd0b62</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>libs: begin ELF support implementation</title>
<updated>2025-10-30T14:59:48+00:00</updated>
<author>
<name>Felix Morgner</name>
<email>felix.morgner@ost.ch</email>
</author>
<published>2025-10-30T14:59:48+00:00</published>
<link rel='alternate' type='text/html' href='http://source.arknet.ch/pub/teachos/kernel.git/commit/?id=78f0df1cf849af8b0ade40a8ebcffd7fb53635cb'/>
<id>78f0df1cf849af8b0ade40a8ebcffd7fb53635cb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>chore: configure clang-tidy</title>
<updated>2025-10-29T16:01:22+00:00</updated>
<author>
<name>Felix Morgner</name>
<email>felix.morgner@ost.ch</email>
</author>
<published>2025-10-29T16:01:22+00:00</published>
<link rel='alternate' type='text/html' href='http://source.arknet.ch/pub/teachos/kernel.git/commit/?id=7b9df8bec5038e0316540d2397df632fb14c9169'/>
<id>7b9df8bec5038e0316540d2397df632fb14c9169</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>build: simplify toolchain setup</title>
<updated>2025-10-28T08:42:31+00:00</updated>
<author>
<name>Felix Morgner</name>
<email>felix.morgner@ost.ch</email>
</author>
<published>2025-10-28T08:42:31+00:00</published>
<link rel='alternate' type='text/html' href='http://source.arknet.ch/pub/teachos/kernel.git/commit/?id=081edba16a917f5a56dd2c1c39eceb5e20f600b1'/>
<id>081edba16a917f5a56dd2c1c39eceb5e20f600b1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>build: clean up x86_64 toolchain</title>
<updated>2025-07-24T13:16:20+00:00</updated>
<author>
<name>Felix Morgner</name>
<email>felix.morgner@ost.ch</email>
</author>
<published>2025-07-24T13:16:20+00:00</published>
<link rel='alternate' type='text/html' href='http://source.arknet.ch/pub/teachos/kernel.git/commit/?id=017e6e1f8eb413e86738d2f2cfb4e8b29ebe26dc'/>
<id>017e6e1f8eb413e86738d2f2cfb4e8b29ebe26dc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>x86_64: implement high/low split</title>
<updated>2025-07-24T10:17:53+00:00</updated>
<author>
<name>Felix Morgner</name>
<email>felix.morgner@ost.ch</email>
</author>
<published>2025-07-24T10:17:53+00:00</published>
<link rel='alternate' type='text/html' href='http://source.arknet.ch/pub/teachos/kernel.git/commit/?id=2ebf8d525e6a030efc8ca23bcbdf92c2d0cb8985'/>
<id>2ebf8d525e6a030efc8ca23bcbdf92c2d0cb8985</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ide: start large-scale restructuring</title>
<updated>2025-07-14T16:02:43+00:00</updated>
<author>
<name>Felix Morgner</name>
<email>felix.morgner@ost.ch</email>
</author>
<published>2025-07-14T16:02:43+00:00</published>
<link rel='alternate' type='text/html' href='http://source.arknet.ch/pub/teachos/kernel.git/commit/?id=25483b7af8df6b08d460f807fda04c6d409bd44e'/>
<id>25483b7af8df6b08d460f807fda04c6d409bd44e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>build: upgrade x86-64 toolchain</title>
<updated>2025-07-14T13:07:01+00:00</updated>
<author>
<name>Felix Morgner</name>
<email>felix.morgner@ost.ch</email>
</author>
<published>2025-07-14T13:07:01+00:00</published>
<link rel='alternate' type='text/html' href='http://source.arknet.ch/pub/teachos/kernel.git/commit/?id=9bfd5652e865505ae73f5ae3ba70f384d7418e84'/>
<id>9bfd5652e865505ae73f5ae3ba70f384d7418e84</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>build: update toolchain</title>
<updated>2025-07-13T14:17:21+00:00</updated>
<author>
<name>Felix Morgner</name>
<email>felix.morgner@ost.ch</email>
</author>
<published>2025-07-13T14:17:21+00:00</published>
<link rel='alternate' type='text/html' href='http://source.arknet.ch/pub/teachos/kernel.git/commit/?id=bfe60f1c0f316cc512dd61f82667e59b284d3271'/>
<id>bfe60f1c0f316cc512dd61f82667e59b284d3271</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
