TUD-OS / NRE

NOVA runtime environment (official branch)
GNU General Public License v2.0
33 stars 12 forks source link

Does NRE Seoul run 64-bit guests? #55

Closed lonnietc closed 3 years ago

lonnietc commented 3 years ago

Hello,

I have been lately booting the vmmng example that has a TinyCore 32-guest, but also did some testing and swapped out the escape.iso and modifications to see if I could boot a small 64-bit ISO guest, but that did not seem to work with Seoul (Vancouver).

Also, could not get any type of guest with a GUI to boot so I am also assuming that more work needs to be done on Seoul before it could handle that as well.

In the meantime, I am thinking that I might try to take the Seoul code and integrate it with the Fabrice Ballard TinyEMU

https://bellard.org/tinyemu/

and web demo that uses it:

https://bellard.org/jslinux/

anyway, I was just wondering if the current version of Seoul can run 64-bit guests?

Thanks in advance

Nils-TUD commented 3 years ago

I'm not absolute sure, but I vaguely remember that it does not. Also, this recent (in commits, not time) commit in NOVA says that only 32-bit guests are supported. But I think this is mostly a Seoul limitation. NOVA and NRE should be (modulo bugs) fine with 64-bit guests.

lonnietc commented 3 years ago

Yea, you are probably correct as I also came across a similar message, but as the older NUL Userland Demos (Alpha-NOVA-Xmas, 0.2 Demo, 0.3 Demo, and 0.4 Demo) all had 32-bit ELF NOVA cores, I would also expect that Vancouver (Seoul) also would be limited to 32-bit platforms.

Now, NOVA builds and runs NRE on 64-bit platforms so a VMM that can handle 64-bit guests is definitely what is needed if my project is going to advance.

Because I do not know Vancouver (Seoul) well enough to update it to 64-bit guests as well as to add in more features like Virtual GPU support, and other things that are needed and already in some of the other VMM's, it looks like I might have to get a feel for NRE and then to see if I can use it as the glue layer to port in either TinyEMU (if it has 64-bit support), QEMU, Bhyve/Xhyve, or possibly even VirtualBox but any of those will also be a challenge so, I guess that this will be a good learning opportunity for me as well. (ha ha ha)

On a side and related question, I noticed that when the base NRE Github repo is cloned, that it does not bring on NOVA and /libs/libseoul by default and that is brought in via Step 2 of "Getting Started" which is fine, but it led me to a question.

Is the libs/libseoul only used for the needed for the "vancouver" app that is ultimately compiled such that if I were building a NRE boots example using novaboot that did not use vancouver then the NRE libraries and services would still compile and run?

Or, do they depend upon the libs/libseoul as part of a dependency library in order to compile basic NRE applications?

I ask this, because I am wondering what is the basic minimal needs that NRE uses so that I can get handle just on the NRE code and not worry about the libs/libseoul (vancouver) code for now. Basically, I want to walk through the NRE code and libraries just by themselves without the VMM part, if possible and I do not know what level of integration and dependence NRE has on the libs/libseoul libraries.

Can you please tell me just a little bit on this?

If I can compile the rest of NRE without the vancouver app, for now as a test then I can dig into vancouver later when I need to see how it, as a VMM uses NRE to talk to NOVA when I port another VMM.

Basically wanting to take things in baby steps here to learn as I go. Cheers and have a great day, my friend.

Nils-TUD commented 3 years ago

Is the libs/libseoul only used for the needed for the "vancouver" app that is ultimately compiled such that if I were building a NRE boots example using novaboot that did not use vancouver then the NRE libraries and services would still compile and run?

Or, do they depend upon the libs/libseoul as part of a dependency library in order to compile basic NRE applications?

The console service depends on Seoul as well to interpret BIOS code for getting and setting VBE modes. However, this could be replaced by something else such as x86emu. Apart from this, Seoul is not needed for anything else IIRC.

lonnietc commented 3 years ago

Thanks for your response on this.

I think, in my opinion, that NRE would be better if it were to be independent of Seoul and only have integrate with it when needed to build the vancouver application as the libseoul has a sub directory for changed files when built against NRE. This way NRE is more self-contained.

With that in mind maybe it could be investigated more to see about how something like x86emu could be added as a file(s) for the console service.

Cheers

lonnietc commented 3 years ago

Hi,

Been searching through all of the code and services and it seems that the only real tie to the libs/libseoul code is from the services/console

for:

VBE.cc VBE.h

If I can come up with a viable alternative for these then the libs/libseoul libraries can effectively be detached from NRE.

But it would be good to have some type of command line switch that could be added to the "./b" script to have it build the vancouver application if desired and if the libs/libseoul libraries are present.

Not sure how to completely remove the VBE dependency but am looking into it more since extracting NEW away from libseoul libraries will make the code base smaller and less complex to work with in the long run, I think (hopefully).

Cheers,

Nils-TUD commented 3 years ago

Well, you can change your fork in whatever way you like. And I also agree that the NRE-specific code in the Seoul repository should rather be in the NRE repository. However, while it should be relatively straightforward to replace Seoul in the console service, it will be quite some work to replace Seoul as NRE's VMM. And using different solutions for these cases will not necessarily result in a less complex code base ;)

Btw, if you want to see an example for using x86emu, you can look at Escape.

lonnietc commented 3 years ago

Hi Nils,

Was out for a bit, but now am back.

I see what you mean with regards to Seoul and I will be working on a fork of NRE, but still try to maintain close compatibility since the real main thing that it looks like I want to do, after doing a significant amount of research lately, is to basically work toward swapping our the Seoul VMM, which is created as "vancouver" during compile time by SCons, with a more up to date and industry tested Bhyve that has now been ported to a few OS's (FreeBSD, SmartOS, MAC OSX, etc.) which are used to offer server cloud services and which also supports 32-bit and 64-bit guests. It also comes in with a footprint of about 500 KB which is very small for a VMM. A number of cloud computing providers are switching away from QEMU/KVM in favor of Bhyve which seems to have better performance from what I understand.

Of course, that will be a lot of work to get done but I think that it is a worthy effort so that NOVA+NRE+Bhyve will be a very good combination.

In regards to your Escape, I looked at the screenshots and am actually going to play with it a bit more, but also noticed that when I run the NRE "boot/vmmng" that allows you to start up escape, that it definitely gives a garbled screen and does not seem to boot up all of the way when using the vancouver VMM.

Screenshot from 2021-07-07 10-11-12

Any ideas what is happening here?

Are your results different on your end?

Cheers and have a great day

Nils-TUD commented 3 years ago

I see what you mean with regards to Seoul and I will be working on a fork of NRE, but still try to maintain close compatibility since the real main thing that it looks like I want to do, after doing a significant amount of research lately, is to basically work toward swapping our the Seoul VMM, which is created as "vancouver" during compile time by SCons, with a more up to date and industry tested Bhyve that has now been ported to a few OS's (FreeBSD, SmartOS, MAC OSX, etc.) which are used to offer server cloud services and which also supports 32-bit and 64-bit guests. It also comes in with a footprint of about 500 KB which is very small for a VMM. A number of cloud computing providers are switching away from QEMU/KVM in favor of Bhyve which seems to have better performance from what I understand.

Of course, that will be a lot of work to get done but I think that it is a worthy effort so that NOVA+NRE+Bhyve will be a very good combination.

Ok, sounds good. I'm looking forward to see how that works out :)

In regards to your Escape, I looked at the screenshots and am actually going to play with it a bit more, but also noticed that when I run the NRE "boot/vmmng" that allows you to start up escape, that it definitely gives a garbled screen and does not seem to boot up all of the way when using the vancouver VMM.

Any ideas what is happening here?

Are your results different on your end?

The results are the same for me. I don't know what's happening there. I also quickly tried to boot a newer version of Escape, when I was playing with NRE again a couple of days ago, but that didn't work either. Not sure why. I don't have the time to investigate that further, unfortunately. But let me know in case you figure it out.

lonnietc commented 3 years ago

Thanks for the update and I'll keep you posted.

Cheers and have a great day.