Page 1 of 1

Getting user programs into my boot image (microkernel)

Posted: Wed Mar 04, 2026 5:01 am
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 :)

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

Posted: Wed Mar 04, 2026 6:04 am
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

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

Posted: Wed Mar 04, 2026 6:25 am
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.

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

Posted: Wed Mar 04, 2026 6:31 am
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