Getting user programs into my boot image (microkernel)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
pearmypie
Posts: 21
Joined: Sat Mar 01, 2025 8:06 pm
GitHub: https://github.com/ionutcatana

Getting user programs into my boot image (microkernel)

Post by pearmypie »

I am trying to write a microkernel. I need to set up my task array with user programs, and I am looking at two approaches: limine modules and baking them into my kernel (not to run in ring 0, but simply to be available in my code).

Limine doesn't guarantee page alignment for modules, so it makes my job more difficult. I am thinking of including `ALIGN(4096)` statements in my linker scripts, flattening the resulting elf file with `objcopy`, then ultimately including them in my kernel using `.incbin`. It sounds very cumbersome.

The main constraint is the microkernel design
, I would love not to include my bitmap frame allocator and virtual memory manager inside the kernel itself.

What's the best way to include user programs in your kernel? Thank you all :)
User avatar
CodePoet2005
Posts: 17
Joined: Sat Dec 28, 2024 1:02 pm
Libera.chat IRC: CodePoet2005
Location: Always @ Home
GitHub: https://codeberg.org/CodePoet2005

Re: Getting user programs into my boot image (microkernel)

Post by CodePoet2005 »

Hi,

If i understand correctly you have some trouble getting files into your kernel, without drivers ready?

Usually you'd use a ramdisk for such tings.
Basically your os reads all required files from a simple filesystem / archive such as tar.
The easiest way would be to include the archive as a limine module.

Btw, if you want a *Really* small microkernel, you might be interested in a bootloader specifically for microkernels. (Limine is pretty huge in my opinion :D )


best regards,
CodePoet2005
User avatar
pearmypie
Posts: 21
Joined: Sat Mar 01, 2025 8:06 pm
GitHub: https://github.com/ionutcatana

Re: Getting user programs into my boot image (microkernel)

Post by pearmypie »

Thanks for the suggestion, I'll try to see if BOOTBOOT makes my job easier. I've looked into it in the past as well, but I strayed away seeing it's only updated a few times a year, and recently the donation banner was removed as well.

Also, I've just found out that I've read misinformation on the internet once again. limine_file->address seems to be >=4096 bytes aligned after all.
User avatar
CodePoet2005
Posts: 17
Joined: Sat Dec 28, 2024 1:02 pm
Libera.chat IRC: CodePoet2005
Location: Always @ Home
GitHub: https://codeberg.org/CodePoet2005

Re: Getting user programs into my boot image (microkernel)

Post by CodePoet2005 »

pearmypie wrote: Wed Mar 04, 2026 6:25 am Thanks for the suggestion, I'll try to see if BOOTBOOT makes my job easier. I've looked into it in the past as well, but I strayed away seeing it's only updated a few times a year, and recently the donation banner was removed as well.

Also, I've just found out that I've read misinformation on the internet once again. limine_file->address seems to be >=4096 bytes aligned after all.
No problem,

Happy coding :wink:

best gegards,
CodePoet2005
Post Reply