What about using the L4Re microkernel to boot FreeBSD on a mobile device (or whatever else kind of device) ?

Hello.

Do you want to give a look here ? ---> https://l4re.org/download/snapshots/

They say :

You are free to use any Linux distribution you like, or even BSDs or any of its derivatives. But then you should know the game. Especially tool versions should be recent, as installed on the listed distributions below. We are confident that the snapshot works on the following distributions:
  • Debian 11 or later
  • Ubuntu 22.04 or later
so the idea can be to use the L4Re microkernel (and its own booting files and procedure) that can be found here :


with a FreeBSD userland compatible with the Pinephone or any other mobile or not mobile device. Is this approach interesting and doable ?
 
They say :

You are free to use any Linux distribution you like, or even BSDs or any of its derivatives.
This is from the section about building this thing.

use the L4Re microkernel [...] with a FreeBSD userland [...]. Is this approach interesting and doable ?
Sure. There's just a "little" thing missing. A FreeBSD "personality" (consisting of services for the L4 microkernel) that's fully compatible with the plain FreeBSD kernel. What's offered on the site you linked is "L4Linux", you'll have to implement "L4FreeBSD" yourself though, have fun. 🤪

By all means, please do some research (like here, learn what a microkernel is and how it works) before flooding the forums with weird ideas.
 
This is from the section about building this thing.


Sure. There's just a "little" thing missing. A FreeBSD "personality" (consisting of services for the L4 microkernel) that's fully compatible with the plain FreeBSD kernel. What's offered on the site you linked is "L4Linux", you'll have to implement "L4FreeBSD" yourself though, have fun. 🤪

By all means, please do some research (like here, learn what a microkernel is and how it works) before flooding the forums with weird ideas.

Due to the high level of technicalities,I prefer if someone wants to explain things to me using concise and self explanatory sentences. You always forget that I'm a psychologist and only secondly I have the hobby of the system administration. What you define "flooding" I define it as "avid curiosity". As you can see we have different opinions about the same phenomenon. And your opinion is not very edifying.
 
What would you gain from that effort, seriously? Micro kernels are really a decade old concept nowadays, which sounded cool on paper back in their time they were still young.

But when people started really building micro kernels also the ugly closets they had were discovered like cost of messaging required if your drivers are all userland. So they are nowadays a kernel type used in certain areas, but not much more.

If you want a micro kernel with BSD personality take Minix 3, which runs NetBSD's userland.

View: https://www.youtube.com/watch?v=jMkR9VF2GNY
 
But when people started really building micro kernels also the ugly closets they had were discovered like cost of context switches.
The Windows NT kernel is conceptually a microkernel. When they ran into this issue, they did a silly thing: Run all kernel services in ring-0 as well, so context switching there is eliminated, of course together with one of the biggest pros of the concept.

GNU Hurd is will wants to be a microkernel 😈

L4 tried to address this issue by implementing relevant code in highly optimized x86 assembly and also limiting the IPC that can be done, mostly to passing stuff in CPU registers. That of course trades portability for performance, which might be a reason why you see quite a few L4 forks out there.

All in all, I don't think the concept is dead. And performance is probably not the most relevant drawback any more either, hardware compensated for a lot. If anything, it's the huge amount of work to create a whole OS (with microkernel plus lots and lots of kernel services just to provide the same functionality as the traditional monolithic kernel) that prevents us from seeing some major microkernel-based OS soon. After all, monoliths exist and many of them work very well in practice.
 
There ARE major microkernel-bases OSes around, which in fact are pretty widespread and used mostly on embedded systems. They are just so invisible to us because the areas in which they are used don't have much interaction with those to a user, if any at all.

Stuff like L4 and QNX comes to mind. And in the past AmigaOS or MacOS 8 on the PowerPC.
 
My goal is still the same,I'm only trying to understand if I can achieve it in a way that for me is easier and doable. To install FreeBSD on a mobile device. I've understood that do it directly is almost impossible for many reasons. I also see that Android and Linux are in almost every mobile devices. So,for a low / medium experienced user like me,if I want to install FreeBSD into a mobile device,the only chance I have is to understand if I can have an hybrid configuration between Android and or Linux and FreeBSD. Until now I've explored a little bit two methods :

1) using kvm or xen to virtualize FreeBSD on top of Android (this is valid in a small number of old smartphones),like this :


would be interesting to understand if following this method we will have the GPU acceleration.

2) using a microkernel,that can "run" FreeBSD in cooperation with Linux : even in this case would be interesting to understand if we will have the GPU acceleration.

3) using the virtualization inside Android. On the article below you will see that someone has been able to virtualize Windows in this way :


(unfortunately it doesn't support GPU acceleration)

I'm interested to understand if I can virtualize FreeBSD instead of Windows,but anyway,this is the tecnique I dislike more than the other ones.

I know that you want a pure FreeBSD experience. Me too,but at the moment the times aren't yet mature to achieve it,so I think that we should find some compromise,accepting that FreeBSD ran with the collaboration of Android or Linux.
 
ziomario you extremely underestimate the effort of porting an operation system to a new device with a completely different component architecture than a PC.
You do not only have to support the processor (i.e. arm), but you need to have device drivers for all components like graphics, network, mobile network, touchscreen, keyboard, you name it...
So if I had to estimate I would measure in man-years.
 
P.S.: In the past I ported CyanogenMod to 2 new mobile phones, even that was a looot of work and I needed help from experienced android developers. And for those phones all device drivers already existed. So it is nothing you can achieve by trial-and-error, you need to understand the architecture, how the drivers work, etc... You even need to write/adjust source code and so on.
 
ziomario you extremely underestimate the effort of porting an operation system to a new device with a completely different component architecture than a PC.
You do not only have to support the processor (i.e. arm), but you need to have device drivers for all components like graphics, network, mobile network, touchscreen, keyboard, you name it...
So if I had to estimate I would measure in man-years.

Did you understand what I wrote ? Is for the reasons that you have explained that I'm looking for a compromise,trying to understand if I can have FreeBSD virtualized or running it with a microkernel.
 
Did you understand what I wrote ? Is for the reasons that you have explained that I'm looking for a compromise,trying to understand if I can have FreeBSD virtualized or running with a microkernel.
Whatever...
Virtualization is most probably the only way you can achieve FreeBSD on an unsupported device... It may be possible to get a console up, Xorg/Wayland is another story.
 
There ARE major microkernel-bases OSes around [...] And in the past AmigaOS
please, -v, some links would be appreciated 🙏

Asking because I used AmigaOS a lot (the 1.x series and 2.0) before even diving into the x86/pc world. From what I remember, the OS ABI consisted of several libraries (quite similar to Windows) with one of them being mapped at the magic fixed address -4. Anyways, also from what I remember, this was just an "organizational" separation ... on the original 68000 CPU, there wasn't even virtual addressing and memory protection, any programming error could nuke the whole system (hello Guru 😈) which is far from the microkernel concept. Are you talking about later versions I missed? Or do I overlook something different? :-/
 
Did you understand what I wrote ? Is for the reasons that you have explained that I'm looking for a compromise,trying to understand if I can have FreeBSD virtualized or running it with a microkernel.
This is doable but a lot of work even for someone knowledgeable in microkernels and the FreeBSD kernel. Unlikely anyone will do this "out of curiosity" but if *you* want to do this, you can start with reading this paper: https://css.csail.mit.edu/6.858/2011/readings/keykos.pdf
See section 8. Conceptually KeyKOS and L4 are somewhat similar; though KeyKOS was much more fully fleshed out in terms of building services on top of their microkernel (they call it a "nanokernel" to distinguish it from all the *fat* "microkernels" such as mach). Not sure if there is such documentation for how linux was made to run on top of L4 but that'd be another thing to read and understand.
 
This is doable but a lot of work even for someone knowledgeable in microkernels and the FreeBSD kernel. Unlikely anyone will do this "out of curiosity" but if *you* want to do this, you can start with reading this paper: https://css.csail.mit.edu/6.858/2011/readings/keykos.pdf
See section 8. Conceptually KeyKOS and L4 are somewhat similar; though KeyKOS was much more fully fleshed out in terms of building services on top of their microkernel (they call it a "nanokernel" to distinguish it from all the *fat* "microkernels" such as mach). Not sure if there is such documentation for how linux was made to run on top of L4 but that'd be another thing to read and understand.

There is only a chance for me to do that : to find a good tutorial. It's not important if it is not perfect. I will start asking in a lot of places to fill the gap of the things that I don't understand. But without an almost ready tutorial,I will not be able even to start.
 
If only there were "good tutorials", I could have avoided spending several years at university 🤪

edit, to address foreseeable complaints: No, you don't necessarily need a CS degree to do anything meaningful in the "OS development" area. It just helps a lot. In any case, you have to learn lots of things and this will be a lot of work. It's certainly not following some recipe, so "just give me a tutorial" is a nonsense idea. Also "asking in a lot of places" only makes sense if you already have the generic knowledge and are missing some specific piece you can describe in detail. Otherwise, it's just annoying noise.
 
please, -v, some links would be appreciated 🙏

Asking because I used AmigaOS a lot (the 1.x series and 2.0) before even diving into the x86/pc world. From what I remember, the OS ABI consisted of several libraries (quite similar to Windows) with one of them being mapped at the magic fixed address -4. Anyways, also from what I remember, this was just an "organizational" separation ... on the original 68000 CPU, there wasn't even virtual addressing and memory protection, any programming error could nuke the whole system (hello Guru 😈) which is far from the microkernel concept. Are you talking about later versions I missed? Or do I overlook something different? :-/
AmigaOS is a microkernel message-passing design, with better response time
and performance than any other readily available PC operating system: including
MINIX, OS/2, Windows, MacOS, Linux, UNIX, and *certainly* MS-DOS.

The microkernel design has proven invaluable. Things like new file systems
that are normally available only from the vendor are hobbyist products on
the Amiga. Device drivers are simply shared libraries and tasks with specific
entry points and message ports. So are file systems, the window system, and
so on. It's a WONDERFUL design, and validates everything that people have
been saying about microkernels. Yes, it takes more work to get them off the
ground than a coroutine based macrokernel like UNIX, but the versatility
pays you back many times over.

Quote from Peter Da Silva back from the legendary Linus Torvalds/Tanenbaum debate.
 
If only there were "good tutorials", I could have avoided spending several years at university 🤪

edit, to address foreseeable complaints: No, you don't necessarily need a CS degree to do anything meaningful in the "OS development" area. It just helps a lot. In any case, you have to learn lots of things and this will be a lot of work. It's certainly not following some recipe, so "just give me a tutorial" is a nonsense idea. Also "asking in a lot of places" only makes sense if you already have the generic knowledge and are missing some specific piece you can describe in detail. Otherwise, it's just annoying noise.

It's not only a matter of finding good tutorials. I said that as a newbie without a solid tutorial I don't even start a project. There is also me,the time I spend to find the missing informations,the efforts to understand what I'm doing,the public relations I need to build to get help. A nice piece of my life that flies away. Yeah,all of that without going at university. The efforts I need to do are double than yours (so the next time that I don't understand something,don't blame me).
 
Ehy men,give a look at these products :


more especially,this :


FreeBSD supports RISC-V,right ?

 
I've read the "Tanenbaum-Torvalds Debate" and I've found the argumentation of Peter da silva very interesting :

peter@ferranti.com (peter da silva)
Subject: Re: LINUX is obsolete
Organization: Xenix Support, FICC
Date: Thu, 6 Feb 1992 16:00:22 GMT

AmigaOS is a microkernel message-passing design, with better response time and performance than any other readily available PC operating system: including MINIX, OS/2, Windows, MacOS, Linux, UNIX, and *certainly* MS-DOS.

The microkernel design has proven invaluable. Things like new file systems that are normally available only from the vendor are hobbyist products on the Amiga. Device drivers are simply shared libraries and tasks with specific entry points and message ports. So are file systems, the window system, and so on. It's a WONDERFUL design, and validates everything that people have been saying about microkernels. Yes, it takes more work to get them off the ground than a coroutine based macrokernel like UNIX, but the versatility pays you back many times over.

His words made me think and raised a question in me: "if the microkernel architecture of the Amiga OS was / is so good, why wasn't it as successful as that of Linux ? In fact even today the Amiga OS is also if technically more advanced than Linux (and than FreeBSD,that is also own a macrokernel), but it has become a niche system, Linux is everywhere. So basically, are we all using a system that has technically been outdated for at least 50 years ? Are we masochists ?
 
Back
Top