<feed xmlns='http://www.w3.org/2005/Atom'>
<title>fbos/kernel/main.c, 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-04T16:23:57Z</updated>
<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>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 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>
<entry>
<title>Prepend the name of the task on debug</title>
<updated>2024-12-02T19:47:19Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-12-02T19:47:19Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/commit/?id=32e880127366fabc3e8b4fecb642f1cc06b8fd71'/>
<id>urn:sha1:32e880127366fabc3e8b4fecb642f1cc06b8fd71</id>
<content type='text'>
On 'printk' and 'sys_write' calls, prepend the name of the task that is
being executed for each message. This is an easy way to show off that we
are doing the right thing with the 'tp' register, even if we don't do
much with it.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Show the detected machine model</title>
<updated>2024-11-26T20:43:54Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-11-26T20:43:54Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/commit/?id=87d1a2597ceedd03a7d4005db1bf82b72b423a18'/>
<id>urn:sha1:87d1a2597ceedd03a7d4005db1bf82b72b423a18</id>
<content type='text'>
Originally I was planning to detect the machine model just in case we
needed to do workaround for special cases. But since apparently even
VisionFive2 brings its own CPU frequency base on DT, this is not even
needed. Hence, fetching the model is now a cool message being shown on
boot.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>dt: Fetch the CPU frequency as well</title>
<updated>2024-11-26T12:59:54Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-11-26T12:59:54Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/commit/?id=7870d56b155c2be73cdacfba94eeb893cd55628e'/>
<id>urn:sha1:7870d56b155c2be73cdacfba94eeb893cd55628e</id>
<content type='text'>
If the 'timebase-frequency' property is available under the 'cpus' node
from the DTB blob, it makes sense to try to fetch this value from there
instead of hardcoding it. For other use-cases, where this information is
not available through DT (e.g. ACPI on the VisionFive2 board), we will
have to hardcode it with a default value even if it's not the proper
one.

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