Good microkernel for x86_64

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
GMorgan
Posts: 22
Joined: Sun Jul 14, 2019 4:27 pm

Good microkernel for x86_64

Post by GMorgan »

Hi Guys,

I'm wondering if anyone has successfully got anywhere getting a basic microkernel up and running for development? I've done some searching but most of the Google results are "wish there was documentation for this". Mostly I'm trying to get to the point where I can successfully launch an elf64 binary and output "Hello, world!" to the screen or serial port.

So far I've been trying with L4Ka:Pistachio. I've pulled in the Pistachio code from the github repository and followed a guide both linked below. There were a number of compile errors (I notice the repo is untouched for 5 years, most of the errors are related to trying to compare a char* to '\0' which doesn't seem to be allowed in the current GCC. I changed '\0' to "\0" to pass the error) which I made what seemed like reasonable fixes for them. When I boot my iso though I get an endless boot loop with the output below dumped into the serial console. I have no idea if this is what is intended or not because the guide neglects to mention what pingpong (the demo program) is actually supposed to do.

Anyone manage to either get this working or get something similar working with another micro kernel?

Thanks in advance.

Code: Select all

KickStart 0.1374389535
Detected multiboot compliant loader
 kernel    (0x0011f000-0x001791f0)   => 0x00d17000
  (0x0011f160-0x001486c0) -> 0x00600000-0x00629560
  (0x001486c0-0x00148fc3) -> 0x00800000-0x00800903
  (0x00149000-0x0014e1b4) -> 0x00a00000-0x00a051b4
  (0x0014f000-0x00165470) -> 0x00c00000-0x00c16470
  (0x00166000-0x0016dca0) -> 0x00d17000-0x00d1eca0
 sigma0    (0x0017a000-0x001a0c48)   => 0x00f00000
  (0x0017a0c0-0x001802a0) -> 0x00f00000-0x00f061e0
 roottask  (0x001a1000-0x001cc698)   => 0x01000820
  (0x001a10b0-0x001b20c8) -> 0x01000000-0x01011018
https://github.com/l4ka/pistachio

https://www.l4ka.org/english/120.php
Korona
Member
Member
Posts: 1000
Joined: Thu May 17, 2007 1:27 pm
Contact:

Re: Good microkernel for x86_64

Post by Korona »

There should be quite a lot of microkernels that can boot a "Hello world!". Aside from the "classical" ones like Mach and L4, you could also look at Minix or Fuchsia. If you feel like experimenting a bit more, you could look at smaller hobby OSes (e.g., those written by members of this forum). The microkernel-based OS in my signature, for example, can boot to either kmscon or Weston (although the boot process is not documented very well, either).

In general, however, modifying a microkernel to boot into some non-default environment will always be harder than booting a monolithic kernel. Microkernels often rely on support code in userspace, e.g., to enumerate devices, load drivers, or even to provide the basic libc functionality.
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].
User avatar
bzt
Member
Member
Posts: 1584
Joined: Thu Oct 13, 2016 4:55 pm
Contact:

Re: Good microkernel for x86_64

Post by bzt »

Hi,
GMorgan wrote:Mostly I'm trying to get to the point where I can successfully launch an elf64 binary and output "Hello, world!" to the screen or serial port.
Check out my bootloader, that was specifically designed for 64 bit and micro-kernels. Here's its forum thread with all the features detailed.

It loads an initrd into memory, maps the kernel executable inside into higher half and transfers control to it. It sets up the framebuffer as well as the serial port. It is well documented, and comes with an example "Hello World" kernel.
Image

Cheers,
bzt
Post Reply