<feed xmlns='http://www.w3.org/2005/Atom'>
<title>fbos/include, branch main</title>
<subtitle>A RISC-V operating system devoted to running fizz/buzz processes.
</subtitle>
<id>https://git.mssola.com/os/fbos/atom?h=main</id>
<link rel='self' href='https://git.mssola.com/os/fbos/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/'/>
<updated>2024-12-05T13:03:09Z</updated>
<entry>
<title>Add a note on HSM</title>
<updated>2024-12-05T13:03:09Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-12-05T12:17:26Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/commit/?id=41fd52502ce7dcfcca8a67b06dab68a8e4aa35b9'/>
<id>urn:sha1:41fd52502ce7dcfcca8a67b06dab68a8e4aa35b9</id>
<content type='text'>
The hart lottery that we do on initialization is a bit rigged. Write a
note on that in the documentation of the 'hart_lottery' variable.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Pass the hart ID on start_kernel instead</title>
<updated>2024-12-04T16:23:57Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-12-04T16:23:57Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/commit/?id=22a681a07ab09922435ad0a9f665290a30f6b85b'/>
<id>urn:sha1:22a681a07ab09922435ad0a9f665290a30f6b85b</id>
<content type='text'>
Instead of storing the hard ID as given by the bootloader into a C
variable, pass it directly into the 'start_kernel' function since we
don't need to tamper the value as originally laid out on the 'a0'
register.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Move documentation to the proper places</title>
<updated>2024-12-04T13:23:44Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-12-04T13:23:44Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/commit/?id=ad072dbf39036eaeb2879bd39f5195175d8b1280'/>
<id>urn:sha1:ad072dbf39036eaeb2879bd39f5195175d8b1280</id>
<content type='text'>
Code documentation was scattered between header and source files. Since
the norm was already to have this documentation into header files, move
some comments from source files to their header counterparts. This
hopefully makes things more consistent.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Write down the requirement for the Zaamo extension</title>
<updated>2024-12-03T13:56:17Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-12-03T13:52:13Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/commit/?id=75fc0bb454b6da14ca42168006af65577fbdfc39'/>
<id>urn:sha1:75fc0bb454b6da14ca42168006af65577fbdfc39</id>
<content type='text'>
Since 2eead36f97fa ("Run a hart lottery on SMP") the kernel is making
use of the 'amoadd.w' instruction, which requires the Zaamo
extension (included in the base A extension). This is notable and is
worth a mention on the list of requirements.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Run a hart lottery on SMP</title>
<updated>2024-12-03T13:34:43Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-12-03T13:34:43Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/commit/?id=2eead36f97faf5bdad1abd60a220c0af72a5526c'/>
<id>urn:sha1:2eead36f97faf5bdad1abd60a220c0af72a5526c</id>
<content type='text'>
On systems with SMP multiple harts will try to run the kernel, and they
will appear at random. But in this kernel, in order to keep things
simple, we want to make sure that *only one* hart is running the show,
as it greatly simplifies things on these kinds of systems.

The solution is similar to what Linux does, which is to allow the first
hart to initialize things, but then (and different to what Linux does),
it will infinitely stall all the other harts that arrive at a random
later point in time.

In order to make this more apparent, I have also added a print message
showing which hart is being used to run the whole thing.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Remove stack pointer for each process</title>
<updated>2024-12-03T06:59:01Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-12-03T06:59:01Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/commit/?id=065f42adc9af7fc4adc391bb6961460010c30d08'/>
<id>urn:sha1:065f42adc9af7fc4adc391bb6961460010c30d08</id>
<content type='text'>
Since 6132623dbf30 ("Share the same stack everywhere") the same stack is
used everywhere. Hence, it's rather pointless for each task to have a
pointer to a stack which is the same and that is never read.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Simplify how we fetch the load address</title>
<updated>2024-12-03T06:47:56Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-12-03T06:47:56Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/commit/?id=4ab2ce3fb0e6b8085742c734a8f5437db5979046'/>
<id>urn:sha1:4ab2ce3fb0e6b8085742c734a8f5437db5979046</id>
<content type='text'>
Similarly to 58fcecc381be ("Simplify the constant on the size of the
stack"), the base and offset load addresses where taken from the Linux
kernel, which has to account for way more stuff than this poor kernel.

Hence, let's be more explicit about the base address and the offset
where the kernel will be located, so it's actually more clear both on
the linker, and on the kernel's header.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Simplify the constant on the size of the stack</title>
<updated>2024-12-03T06:41:45Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-12-03T06:41:45Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/commit/?id=58fcecc381be82992f718a6ef9bf7ddcd3bca369'/>
<id>urn:sha1:58fcecc381be82992f718a6ef9bf7ddcd3bca369</id>
<content type='text'>
At the beginning I carried over things from the Linux kernel just in
case I would need them in the future. As this project is very much at a
stage where I'm already happy with it, let's remove unneeded complexity.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Don't repeat the task name when printing the model</title>
<updated>2024-12-02T20:09:54Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-12-02T20:06:39Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/commit/?id=7b1b8ebb48174445083bc7fa336dc00619cbf126'/>
<id>urn:sha1:7b1b8ebb48174445083bc7fa336dc00619cbf126</id>
<content type='text'>
When printing the initial model message on DEBUG it repeated the "init"
message twice. Avoid that by directly using 'write' on some of the
calls.

Fixes: 32e880127366 ("Prepend the name of the task on debug")

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Share the same stack everywhere</title>
<updated>2024-12-02T20:02:35Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-12-02T20:02:35Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/commit/?id=6132623dbf3076da11cdb85c494fadd7ee0f0a93'/>
<id>urn:sha1:6132623dbf3076da11cdb85c494fadd7ee0f0a93</id>
<content type='text'>
As documented in the code, we are not implementing any kind of memory
protection, so in theory any process (regardless if running in user or
kernel space) would be able to tamper with other processes' stack.
Hence, don't even pretend that we are separating stacks and share the
same global stack everywhere. This simplifies things a bit.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
</feed>
