Page allocation for a custom OS

2024-02-05 Thread khaledh-nim
Thanks! It works now. I had to remove `-d:useMalloc` from my configs as well, since it bypasses osalloc altogether.

Page allocation for a custom OS

2024-02-04 Thread foxoman
As Araq said it should be "stdlib" This was for me a learning point on how to use patchFile :

Page allocation for a custom OS

2024-02-04 Thread Araq
As far as I can tell it should work for `include` too but you need "stdlib" instead of "nim".

Page allocation for a custom OS

2024-02-04 Thread khaledh-nim
Oh, interesting. Didn't know about `patchFile`. Now that I read the docs on nimscript and did some research on the compiler code, I can't seem to get it to work. This is what I have: # src/kernel/config.nims patchFile("nim", "osalloc", "../nimpatches/osalloc")

Page allocation for a custom OS

2024-02-04 Thread Araq
Provide your own `osalloc.nim` file and use the `patchFile` configuration mechanism to use it.

Page allocation for a custom OS

2024-02-04 Thread khaledh-nim
I'm working on a hobby OS, and one thing I'm tackling next is trying to leverage Nim's heap allocator instead of writing my own allocator. I know that in [osalloc.nim](https://github.com/nim-lang/Nim/blob/devel/lib/system/osalloc.nim) Nim uses the underlying OS page allocator to allocate/free p