<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kmi/src/debug.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-07-09T16:24:12Z</updated>
<entry>
<title>allow regions to have reserved areas</title>
<updated>2024-07-09T16:24:12Z</updated>
<author>
<name>Kimplul</name>
<email>kimi.h.kuparinen@gmail.com</email>
</author>
<published>2024-07-09T16:24:12Z</published>
<link rel='alternate' type='text/html' href='https://metanimi.dy.fi/cgit/kmi/commit/?id=89d7cf197b2cae130565467bdfad5d5ef5fed2dd'/>
<id>urn:sha1:89d7cf197b2cae130565467bdfad5d5ef5fed2dd</id>
<content type='text'>
+ A reserved area is an area at the start of the region that should not
  be used unless explicitly asked for, for example null pages.

  As such, a small correction to my previous commit message: There's no
  danger in not locking req_mem() etc, as a null page will only be
  allocated when explicitly asked for.
</content>
</entry>
<entry>
<title>allow mapping null page</title>
<updated>2024-07-09T14:35:56Z</updated>
<author>
<name>Kimplul</name>
<email>kimi.h.kuparinen@gmail.com</email>
</author>
<published>2024-07-09T14:35:56Z</published>
<link rel='alternate' type='text/html' href='https://metanimi.dy.fi/cgit/kmi/commit/?id=298636079d912d0936f8156a609fe74b839c547b'/>
<id>urn:sha1:298636079d912d0936f8156a609fe74b839c547b</id>
<content type='text'>
+ User has to 'free' the 0 page before it becomes accessible to mapping.
  Probably worth noting that this is likely VERY niche and mainly
  concerns stuff like certain kinds of emulators that I'm still
  eons from implementing, but still.

  Unbacked pages can also be useful for some kinds of notifications,
  like 'if someone writes to this page, please report it to me with this
  ID' or whatever, I remember seeing some discussion about it somewhere
  but that's also not really relevant for the moment.

  Most significantly, at least with the current design,
  after the null page is freed it becomes available for use to regular req_mem()
  calls, so users should probably using locks around memory requests.
  That's probably a good idea anyway as internally the kernal has to
  lock the virtual memory, and without a scheduler it might cause
  threads to spin for a while in the kernel which is rather bad.
</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>add req_page back in as I realized it's useful</title>
<updated>2024-07-07T18:47:14Z</updated>
<author>
<name>Kimplul</name>
<email>kimi.h.kuparinen@gmail.com</email>
</author>
<published>2024-07-07T18:47:14Z</published>
<link rel='alternate' type='text/html' href='https://metanimi.dy.fi/cgit/kmi/commit/?id=219c27d420fe0abe5515cefc2513c6fe60aafdf9'/>
<id>urn:sha1:219c27d420fe0abe5515cefc2513c6fe60aafdf9</id>
<content type='text'>
+ Can be used to pass contiguous memory regions to things like virtio
  block devices for implementing disk drivers etc.
</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>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>rename common to src</title>
<updated>2024-05-24T15:13:43Z</updated>
<author>
<name>Kimplul</name>
<email>kimi.h.kuparinen@gmail.com</email>
</author>
<published>2024-05-24T10:24:27Z</published>
<link rel='alternate' type='text/html' href='https://metanimi.dy.fi/cgit/kmi/commit/?id=bc600ecc3bdf0f189861dfb840f70c2339a7a853'/>
<id>urn:sha1:bc600ecc3bdf0f189861dfb840f70c2339a7a853</id>
<content type='text'>
+ I keep starting to type src and wondering why autocomplete won't work,
  I guess src is just uncounciously a better name
</content>
</entry>
</feed>
