<feed xmlns='http://www.w3.org/2005/Atom'>
<title>fbos/kernel/printk.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>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>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>Enable exception handling from user mode</title>
<updated>2024-11-22T22:00:46Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-11-22T22:00:46Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/commit/?id=7f6b234625a53d2ceb9ec80dc0172aac1cedb358'/>
<id>urn:sha1:7f6b234625a53d2ceb9ec80dc0172aac1cedb358</id>
<content type='text'>
This allows us to actually catch system calls and start to run user
space programs. That being said, the whole thing is still pretty
brittle, and the scheduler is not quite there yet.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Check the return value from SBI ecalls</title>
<updated>2024-11-19T14:22:35Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-11-19T14:22:35Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/commit/?id=d3afdd9284f7e9838fbde4c941193ec2032d6a26'/>
<id>urn:sha1:d3afdd9284f7e9838fbde4c941193ec2032d6a26</id>
<content type='text'>
Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Setup the stack for an init task</title>
<updated>2024-11-19T14:05:59Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-11-19T13:55:32Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/os/fbos/commit/?id=52a4afca71aee5c150c6c63e7c1a510501fce6f3'/>
<id>urn:sha1:52a4afca71aee5c150c6c63e7c1a510501fce6f3</id>
<content type='text'>
Bootstrap an init task which holds at least the initial stack that is to
be used when setting up the registers (such as `sp` and `tp`).

In order to guarantee that the stack and the rest of the registers are
set up correctly, this commit also provides a raw implementation of a
`printk` function.

Moreover, this commit also adds an argument that must be passed to
`start_kernel`, which is the pointer to the embedded `fdt` blob. This
argument will be used by later work so to fetch, at least, the base
address for the initial ram disk. This was also used to test that the
stack was working as expected.

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