While reading the documentation of sel4 and some discussion here about how microkernels for a POSIX subsystem are unsuitable, I was curious about if it's possible to write a POSIX API for a microkernel with low overhead and removing the obvious problems such as synchronous calls.
I've come to the conclusion that by giving the POSIX API less control over the execution flow these problems could be solved (the UNIX server behaving asynchronously despite the demands by the POSIX API) preserving the benefits of the microkernel.
I'm going to start with writing a pthreads implementation first but it'll progress into more and more things. I'll have a sample POSIX threads app dynamically linked with liblucy in QEMU and do some benchmarks. The features I have in mind right now:
process isolation
translation of POSIX calls into an optimized form of sel4 calls
emulation of certain UNIX interfaces such as the /dev folder, groups, signals, and other things
IPC management on behalf of the applications
At the end of the day I'm looking for a fast UNIX server that takes over alot of the things that would be done by the POSIX kernel.
Thoughts?
Lucy | A POSIX API server for the sel4 microkernel
Re: Lucy | A POSIX API server for the sel4 microkernel
Good luck.
I only could say that it's somewhat close to my goals, my plans are to make a POSIX environment subsystem for my NT-like kernel.
It would consist of
1) dynamic libraries implementing posix calls either directly or doing needed preprocessing and passing them farther, to the "default" WinAPI-like subsystem (always on subsystem) libraries, or "native" dll (ntdll.dll).
2) support processes dealing with making the environment look like unix for posix programs. this could involve many tasks I am not even aware of right now.
3) kernel extension driver implementing the needed system services (syscalls) too foreign for NT (fork() or whatever() x^D). as well as kernel part for signals (APC).
NT is highly asynchronous in its nature so I might face similar problems you mentioned. I am planning to make my PussyX (the name :^D) as posix-compliant as possible, but not more. It's all dreams for now. *sigh
I only could say that it's somewhat close to my goals, my plans are to make a POSIX environment subsystem for my NT-like kernel.
It would consist of
1) dynamic libraries implementing posix calls either directly or doing needed preprocessing and passing them farther, to the "default" WinAPI-like subsystem (always on subsystem) libraries, or "native" dll (ntdll.dll).
2) support processes dealing with making the environment look like unix for posix programs. this could involve many tasks I am not even aware of right now.
3) kernel extension driver implementing the needed system services (syscalls) too foreign for NT (fork() or whatever() x^D). as well as kernel part for signals (APC).
NT is highly asynchronous in its nature so I might face similar problems you mentioned. I am planning to make my PussyX (the name :^D) as posix-compliant as possible, but not more. It's all dreams for now. *sigh
-
- Member
- Posts: 595
- Joined: Mon Jul 05, 2010 4:15 pm
Re: Lucy | A POSIX API server for the sel4 microkernel
One thing that might be difficult for some microkernels is the inheritance of resources. As programs rely much on user space services, the access to those services and the associated resources might not be that straight forward as with a monolithic kernel. The services must simply know that a new process is a child of a previous one. QNX supports this but I'm not sure how it is handling the inheritance.
Re: Lucy | A POSIX API server for the sel4 microkernel
I'm writing a microkernel with a POSIX user space and fully asynchronous drivers (github). Most POSIX calls can easily be translated in the C standard library but others (e.g. ioctls that modify the memory map, create file descriptors or access arbitrary memory) are quite a mess.
I can elaborate on that if I have time. Let me know if you want to know about something specific.
I can elaborate on that if I have time. Let me know if you want to know about something specific.
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].