<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kmi/src/main.c, branch master</title>
<subtitle>ACTIVE - Kernel with migrating threads as IPC</subtitle>
<id>https://metanimi.dy.fi/cgit/kmi/atom?h=master</id>
<link rel='self' href='https://metanimi.dy.fi/cgit/kmi/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://metanimi.dy.fi/cgit/kmi/'/>
<updated>2024-10-29T19:17:31Z</updated>
<entry>
<title>start moving towards threads always being in rpc</title>
<updated>2024-10-29T19:17:31Z</updated>
<author>
<name>Kimplul</name>
<email>kimi.h.kuparinen@gmail.com</email>
</author>
<published>2024-10-29T19:17:31Z</published>
<link rel='alternate' type='text/html' href='https://metanimi.dy.fi/cgit/kmi/commit/?id=5976ad390a15726c3ddfacf8c8b282c8350f9554'/>
<id>urn:sha1:5976ad390a15726c3ddfacf8c8b282c8350f9554</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix LLVM</title>
<updated>2024-07-08T15:04:03Z</updated>
<author>
<name>Kimplul</name>
<email>kimi.h.kuparinen@gmail.com</email>
</author>
<published>2024-07-08T14:43:59Z</published>
<link rel='alternate' type='text/html' href='https://metanimi.dy.fi/cgit/kmi/commit/?id=e134202611a50b358c147c92bfb8a7f443030b8b'/>
<id>urn:sha1:e134202611a50b358c147c92bfb8a7f443030b8b</id>
<content type='text'>
+ Anything extern is right out as LLVM doesn't produce correct code for
  them. Maybe if I added some extra attributes but I'm skeptical.
  Replaced with static variables and getters/setters.

+ Inline ASM is apparently a bit buggy, so use an assembly stub when jumping to init.

+ Minimize work done in main() to minimize chance of LLVM doing something silly.
  Still not 100% certain that I shouldn't just write the main() as an assembly stub
  in arch/riscv64 to be absolutely sure everything works as intended.

+ Make .kernel.start section SHF_ALLOC, otherwise lld complains about
  pc-relative addressing

Probably some other stuff as well that I'm forgetting right now. But at least with
LLVM14 LTO seems to work, which is pretty cool?
</content>
</entry>
<entry>
<title>misc fixes</title>
<updated>2024-07-07T11:34:39Z</updated>
<author>
<name>Kimplul</name>
<email>kimi.h.kuparinen@gmail.com</email>
</author>
<published>2024-07-07T11:34:39Z</published>
<link rel='alternate' type='text/html' href='https://metanimi.dy.fi/cgit/kmi/commit/?id=d592abd8ccc4026c51e196777031eb65c4acc4de'/>
<id>urn:sha1:d592abd8ccc4026c51e196777031eb65c4acc4de</id>
<content type='text'>
+ Align kernel to 2MiB boundary in u-boot

+ Optimize alignment functions a little bit, should still have to check
  on real hardware but 'feels' more clean

+ Add early boot debugging

+ Put extra cores we aren't ready to account for to sleep if/when they
  boot.

+ Make BASE_PAGE_SIZE constant on riscv64/32, helps the compiler with
  some alignment checks among other things.
</content>
</entry>
<entry>
<title>smp now seems to work</title>
<updated>2024-07-07T04:00:43Z</updated>
<author>
<name>Kimplul</name>
<email>kimi.h.kuparinen@gmail.com</email>
</author>
<published>2024-07-07T04:00:43Z</published>
<link rel='alternate' type='text/html' href='https://metanimi.dy.fi/cgit/kmi/commit/?id=122374c362ba8bb9082385da3c82e264ab594f15'/>
<id>urn:sha1:122374c362ba8bb9082385da3c82e264ab594f15</id>
<content type='text'>
+ Had some minor issues with a wraparound of size_t that effectively
  meant that some regions were allocated twice. Also, booting should be
  a bit more reliable now, turned out that the previous iteration of the
  booting was just accidentally working due to the kernel being placed
  'close enough' in RAM to where it was linked to. Fixed by allocating a
  vmem of O1 that maps the kernel to a 2MiB boundary at boot, pretty
  nifty.
</content>
</entry>
<entry>
<title>fixed crash with dbg_fdt()</title>
<updated>2024-07-06T21:49:55Z</updated>
<author>
<name>Kimplul</name>
<email>kimi.h.kuparinen@gmail.com</email>
</author>
<published>2024-07-06T21:49:55Z</published>
<link rel='alternate' type='text/html' href='https://metanimi.dy.fi/cgit/kmi/commit/?id=03e12129927b0deba537a11bb5575bef93c57d0f'/>
<id>urn:sha1:03e12129927b0deba537a11bb5575bef93c57d0f</id>
<content type='text'>
+ Apparently dbg_fdt() itself wasn't buggy, but for whatever reason GCC
  produced an absolute load to the prefix string in __print_prefix()
  which caused all the issues. Unclear why, seems like a compiler bug.

  This commit is more of a workaround, I'd still like to investigate
  this further.
</content>
</entry>
<entry>
<title>core bringup + various warnings</title>
<updated>2024-07-06T20:37:11Z</updated>
<author>
<name>Kimplul</name>
<email>kimi.h.kuparinen@gmail.com</email>
</author>
<published>2024-07-06T20:37:11Z</published>
<link rel='alternate' type='text/html' href='https://metanimi.dy.fi/cgit/kmi/commit/?id=3fedbb6e1f849c5e0a4033d68201d60c2fc48121'/>
<id>urn:sha1:3fedbb6e1f849c5e0a4033d68201d60c2fc48121</id>
<content type='text'>
+ dbg_fdt() is apparently broken, possibly due to UB or something, but
  it causes some issues with optimizations enabled. Remove it
  temporarily
</content>
</entry>
<entry>
<title>pretty massive virtual memory rewrite</title>
<updated>2024-07-06T15:14:04Z</updated>
<author>
<name>Kimplul</name>
<email>kimi.h.kuparinen@gmail.com</email>
</author>
<published>2024-07-06T15:14:04Z</published>
<link rel='alternate' type='text/html' href='https://metanimi.dy.fi/cgit/kmi/commit/?id=76517486919657ecadda9867125dc6730f29a5b7'/>
<id>urn:sha1:76517486919657ecadda9867125dc6730f29a5b7</id>
<content type='text'>
+ The system is now a bit simpler and hopefully easier to understand, while also
  extending the shared memory to be 1:N, where there is one owner who
  may become a zombie while waiting for the N to die.
</content>
</entry>
<entry>
<title>implement bkl</title>
<updated>2024-07-05T18:02:52Z</updated>
<author>
<name>Kimplul</name>
<email>kimi.h.kuparinen@gmail.com</email>
</author>
<published>2024-07-05T18:02:52Z</published>
<link rel='alternate' type='text/html' href='https://metanimi.dy.fi/cgit/kmi/commit/?id=608f44306a6f0d5692f5c81bcbfe7a621ec254ba'/>
<id>urn:sha1:608f44306a6f0d5692f5c81bcbfe7a621ec254ba</id>
<content type='text'>
+ Start out using big kernel lock, apparently seL4 thinks its good
  enough. I might have a go at using a more fair lock, and possibly
  moving to more fine-grained locks if I really feel the need to get
  scalability up.
</content>
</entry>
<entry>
<title>formatting and documentation</title>
<updated>2024-07-05T17:14:46Z</updated>
<author>
<name>Kimplul</name>
<email>kimi.h.kuparinen@gmail.com</email>
</author>
<published>2024-07-05T17:14:46Z</published>
<link rel='alternate' type='text/html' href='https://metanimi.dy.fi/cgit/kmi/commit/?id=83a6fc687cab3ee87c6cae1324728521f9877ad0'/>
<id>urn:sha1:83a6fc687cab3ee87c6cae1324728521f9877ad0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>allow booting with Qemu's -kernel flag directly</title>
<updated>2024-07-05T16:38:11Z</updated>
<author>
<name>Kimplul</name>
<email>kimi.h.kuparinen@gmail.com</email>
</author>
<published>2024-07-05T16:38:11Z</published>
<link rel='alternate' type='text/html' href='https://metanimi.dy.fi/cgit/kmi/commit/?id=e09edb5d54e39bd9509a1dc450df5ab320759f97'/>
<id>urn:sha1:e09edb5d54e39bd9509a1dc450df5ab320759f97</id>
<content type='text'>
+ Took some fairly significant changes, for one the kernel is no longer
  relocated at the start of a boot, instead it sits wherever the user
  decides the kernel should sit. Similarly, the initial kernel stack and
  page table are stored within the binary, slightly bloating the size
  but making it much safer to boot since there's really no chance of us
  overwriting the fdt or initrd in memory.
</content>
</entry>
</feed>
