Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - emulate linux kernel api: (6 Items)
   
emulate linux kernel api  
It's possible and an good idea to emulate linux kernel api, that will make port linux driver to qnx more easy. 
freebsd and netbsd have an linux emulator, but that seems mainly for run linux application directly. 
Re: emulate linux kernel api  
Since QNX system architecture (microkernel) is quite different from Linux (monolith), I wonder how far that would get 
you ...


-- Michael


________________________________
From: lin xiang <community-noreply@qnx.com>
Sent: Thursday, September 7, 2023 05:53
To: ostech-core_os
Subject: emulate linux kernel api

It's possible and an good idea to emulate linux kernel api, that will make port linux driver to qnx more easy.
freebsd and netbsd have an linux emulator, but that seems mainly for run linux application directly.



_______________________________________________

OSTech
http://community.qnx.com/sf/go/post122366
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
Attachment: HTML sf-attachment-mime41183 2.13 KB
Re: emulate linux kernel api  
opposite, because qnx is microkernel, all device is on userspace that make it possible to  emulate core linux kernel 
program api(lkpi) and linux device driver module api, and maximum extent, reuse linux device driver 
this maybe an reusable device driver framework for all microkernel. 
Re: emulate linux kernel api  
seems  already have an similar project: https://os.inf.tu-dresden.de/ddekit/
Re: emulate linux kernel api  
> seems  already have an similar project: https://os.inf.tu-dresden.de/ddekit/

Seems to be very old and was used to run Linux UIO-drivers only, if I understand that approach right.
Re: emulate linux kernel api  
> It's possible and an good idea to emulate linux kernel api, that will make 
> port linux driver to qnx more easy. 

Linux kernel API? I have never seen one.
Or do you mean the sum of all functions and macros, a special Linux Kernel configuration provides?

Well, since hardware is not documented any more and chip makers patch their stuff in the Linux Kernel only, driver 
developers need to be creative.

To answer your question, using unchanged Linux Kernel driver code is already done under QNX.
Actually Intel Graphics needs the drm-intel resource manager, emulating half of the Linux-Kernel, to use a million of 
unchanged lines of Linux Driver Code from Intel.
# drm-intel -v
i915/DRM Linux kernel 4.14.14
# 

If you like to use that emulation code, simply ask Blackberry for the source of drm-intel. 

From my point of view this approach is very ugly, but indeed a  cool demonstration of the QNX mircokernel architecture, 
allowing to hide a Linux Kernel in one resource manager process and for example a NetBSD Kernel in an other process to 
realize a TCP/IP stack.


> freebsd and netbsd have an linux emulator, but that seems mainly for run linux
>  application directly.

freebsd and netbsd utilize a Linux binary compatible trap-Interface. Yes, this is for using Linux userland stuff.
So you can bootstrap a GNU/Linux OS, like debian, normally using a Linux-Kernel, without a Linux Kernel.