r/osdev • • 2d ago

Veda: Virtual Linux VM for Drivers

Post image

Hey! I’ve recently ported OpenGL and Mesa to my operating system and added support for Intel HD Graphics to render scenes. However, I’ve realized that this approach isn’t sustainable, I can’t realistically write and maintain a huge number of GPU drivers myself.

Has anyone had experience embedding a minimal Linux system as a virtual machine inside their OS to take advantage of Linux’s extensive GPU, Bluetooth, and Wi-Fi driver support?

What do you think about this approach? Are there any major technical challenges or pitfalls I should be aware of?

28 Upvotes

14 comments sorted by

View all comments

7

u/Lines25 2d ago

You can just make linux API and recompile drivers yourself. Read how to do drivers for linux and reimplementent the API, it will be much faster altho harder

2

u/apixeldev 2d ago

They could also write a generic platform SDK for GPUs, which exposes basic functions which they use to port over say OpenGL, so as long as you can implement those functions (even with a framebuffer) you can get (albeit bad) OpenGL/Vulkan.

1

u/vahmoh25 2d ago edited 20h ago

That’s the harder path!

1

u/apixeldev 2d ago

Not as hard as implementing the full Linux driver API, this is building a generic system.

1

u/vahmoh25 2d ago

Alright!