Code NVMM to DragonFly, it's more OS independence

DragonFlyBSD has integrated the NetBSD Virtual Machine Monitor (NVMM) hypervisor that can be used with QEMU.

https://gitweb.dragonflybsd.org/dragonfly.git?a=search&h=HEAD&st=commit&s=NVMM

2 Likes

I was looking at NVMM before and wondering if it would be tricky to port as we have a FreeBSD, not a NetBSD, compatibility layer. DragonFlyBSD is indeed much closer to FreeBSD than NetBSD; so maybe if they ported it, we can reuse their work (or follow what they did…)

5 Likes

It will be wonderful to see running NVMM in Haiku!

Already has documentation:
https://www.dragonflybsd.org/docs/docs/howtos/nvmm/

1 Like

Hi, when I was working on porting NVMM to DragonFly, I found a partial work by you guys to bring NVMM to Haiku, which was really cool and interesting.

We’re really lucky that the author (Maxime) helped us with the port at a later time. He improved the NVMM a lot to make it much more OS-independent and shared us with the code, which made the port quite clean. See:

https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/42862644e8ee2665cba60cb87a8169a3292cda97

We’ve further adjusted the code a bit more, like:

https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/df3af4c9b44add09ccedaf63d67d0553bd9e184f

So, if you’d like to work on NVMM, the version in DragonFly is a better start point.

Cheers,
Aaron

18 Likes

Thank you for sharing this info!

2 Likes

Nice! Putting everything in an _os C file makes things really clean for sure.

I guess NetBSD remains the definitive upstream for NVMM, though? So hopefully these changes will make it back into NetBSD’s trunk, too?

And, welcome to the Haiku forums! (How’d you run into this thread, if I might ask?)

I guess NetBSD remains the definitive upstream for NVMM, though?

Well, no. The NVMM development is being basically stale since the Maxime’s leave from the NetBSD project.

So hopefully these changes will make it back into NetBSD’s trunk, too?

Yes, I hope so. But currently I’m busying with other things (work and life), so I haven’t contacted NetBSD guys about this yet.

It’s a bit sad that Maxime has no plan to continue the development. However, the NVMM is quite complete and just works, and it’s well designed and cleanly implemented. So it would not be too hard to maintain and to continue the development.

I hope we could join the force to continue the NVMM development (as well as QEMU and other emulators’ support). I’m not an expert in this area, but I’m studying and trying :smile:

And, welcome to the Haiku forums! (How’d you run into this thread, if I might ask?)

Thanks. Google search took me here :smile:

3 Likes

It definitely looks like it. I have a branch with NVMM for Haiku where I even got it to compile, but got bogged down in implementing compatibility with OS-specific parts. This and my relative inexperience with kernel-mode stuff made it fairly hard to progress.

I’ll try to update the branch with DragonFlyBSD code and see what I can do with it soonish™.

Thanks!

13 Likes

This webpage shows a list of OSes working with QEMU+NVMM:

And Haiku is part of the list:


Maybe some developer is having a happy time hacking HAIKU. :smiley:

1 Like

Haiku is part of the tested guest OSes list…

1 Like

To clarify that further: this means it is possible to run Haiku inside QEMU + NVMM

What we want to do here is run accelerated QEMU with NVMM inside Haiku, so, the opposite thing. Haiku deserves to be the native OS, while Windows and Linux are run in virtual machines, and used less and less often until they disappear :smiley:

12 Likes

Maybe so… but perhaps it should actually implement some acceleration interface before we get ahead of ourselves, especially since its been on the want list for like a decade and nobody has done it to completion yet.

Probably would be forward thinking to keep the native 3d drivers in mind as well, when implementing it, since its becoming pretty common to want to run 3d software in VMs.

I guess the lack of windows 9x compatibility isn’t a big deal either since those are better off in something like PCEM these days.