OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 18, 2024 6:24 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 60 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: Design Choices of my OS
PostPosted: Thu Mar 05, 2015 12:43 pm 
Offline
Member
Member

Joined: Wed Jan 11, 2012 6:10 pm
Posts: 193
cmdrcoriander wrote:
SoulofDeity wrote:
Then I got to thinking, what's the point in using a virtual machine if the application is still platform dependent? It makes no sense. You're just sacrificing speed. This applies to Java as well. So, what I want to do is create a virtual machine/platform abstraction layer. It'll have a single interface for devices and absolutely will not allow peeking at hardware or executing/linking against programs and libraries not built for it. By doing this, all of the software written for it will be 100% platform independent. Porting the VM/PAL to a different platform would mean that anything ever written for it is guaranteed to work on that platform; thus the software never becomes obsolete. The only factor that matters is performance.

Uhhh... how is this not Java? Or at least conceptually really, really similar?


soulofdeity wrote:
It'll have a single interface for devices and absolutely will not allow peeking at hardware or executing/linking against programs and libraries not built for it.

Java lets you do this. When someone builds a library trying to take advantage of this (eg. exposing an OpenGL interface via DLL), they are instantly locked to a specific hardware and platform. When the libraries become popular, you then have a whole bunch of hardware/platform dependant software. For 100% portability, hardware acceleration should only be performed by the VM via HLE and applications should be entirely ignorant of these things.

Rusky wrote:
As soon as you start versioning the VM/PAL you're back where you were with some people stuck on the equivalent of GL 1.1.


soulofdeity wrote:
It's a very ambitious project though. It requires defining new standards for pretty much everything. And they're not something that can just be changed on a whim; once they're written, they're set in stone (otherwise they'd become the cause of what they're seeking to fix).

There will never be a change in design. Only bug fixes and HLE hooks for the VM to speed things up.


Top
 Profile  
 
 Post subject: Re: Design Choices of my OS
PostPosted: Thu Mar 05, 2015 1:52 pm 
Offline
Member
Member
User avatar

Joined: Wed Jan 06, 2010 7:07 pm
Posts: 792
That's not a solution. Even if you design a flawless system (you won't), the requirements people place on their systems will change out from under you someday and you'll still have to adjust. The only way to solve that problem is by accepting that things will change occasionally and designing the system to keep the impact of those changes to a minimum.

_________________
[www.abubalay.com]


Top
 Profile  
 
 Post subject: Re: Design Choices of my OS
PostPosted: Thu Mar 05, 2015 2:04 pm 
Offline
Member
Member

Joined: Wed Jan 11, 2012 6:10 pm
Posts: 193
Rusky wrote:
That's not a solution. Even if you design a flawless system (you won't), the requirements people place on their systems will change out from under you someday and you'll still have to adjust. The only way to solve that problem is by accepting that things will change occasionally and designing the system to keep the impact of those changes to a minimum.


I don't think I explained it well enough, so I'll take another stab at it. When I say, "VM" I mean literally, a Virtual Machine or console. The machine will have simulated virtual hardware. The drivers and libraries for this VM will be implemented in software for the VM itself. The libraries may change over time, but the (virtual) hardware will not. (Physical) hardware acceleration would work via HLE hooks. If the libraries update, the user just has to download the latest version of the library. But regardless, anything written form the VM will work on any version of the VM for any platform without question.


Last edited by SoulofDeity on Thu Mar 05, 2015 2:07 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Design Choices of my OS
PostPosted: Thu Mar 05, 2015 2:06 pm 
Offline
Member
Member

Joined: Tue Jan 20, 2015 8:33 pm
Posts: 29
SoulofDeity wrote:
cmdrcoriander wrote:
Uhhh... how is this not Java? Or at least conceptually really, really similar?


soulofdeity wrote:
It'll have a single interface for devices and absolutely will not allow peeking at hardware or executing/linking against programs and libraries not built for it.

Java lets you do this. When someone builds a library trying to take advantage of this (eg. exposing an OpenGL interface via DLL), they are instantly locked to a specific hardware and platform. When the libraries become popular, you then have a whole bunch of hardware/platform dependant software. For 100% portability, hardware acceleration should only be performed by the VM via HLE and applications should be entirely ignorant of these things.

Okay, I see. I didn't realize it was possible to do that in Java (I'm not a Java programmer okay :P). But isn't this basically what Java is *trying* to do? It seems to me like you're starting from the same base idea as a JVM, and your only difference is that they compromised a little, and let you use platform-specific features if you really, really want to.


Top
 Profile  
 
 Post subject: Re: Design Choices of my OS
PostPosted: Thu Mar 05, 2015 2:07 pm 
Offline
Member
Member
User avatar

Joined: Wed Jan 06, 2010 7:07 pm
Posts: 792
That's no different. Imagine if someone had executed on this idea back in the DOS days- would their virtual hardware interface still be sufficient today? If so, would it have worked well at all back then?

_________________
[www.abubalay.com]


Top
 Profile  
 
 Post subject: Re: Design Choices of my OS
PostPosted: Thu Mar 05, 2015 2:12 pm 
Offline
Member
Member

Joined: Wed Jan 11, 2012 6:10 pm
Posts: 193
cmdrcoriander wrote:
Okay, I see. I didn't realize it was possible to do that in Java (I'm not a Java programmer okay :P). But isn't this basically what Java is *trying* to do? It seems to me like you're starting from the same base idea as a JVM, and your only difference is that they compromised a little, and let you use platform-specific features if you really, really want to.


That's the gist of it. I basically want to provide a compromise that works the opposite way. VM software cannot ask for resources outside of the VM, but resources that are outside of the VM can poke into it with HLE hooks. The VM software has no way whatsoever of knowing about these hooks. They are totally ignorant of anything outside the VM.


Top
 Profile  
 
 Post subject: Re: Design Choices of my OS
PostPosted: Thu Mar 05, 2015 2:21 pm 
Offline
Member
Member

Joined: Wed Jan 11, 2012 6:10 pm
Posts: 193
Rusky wrote:
That's no different. Imagine if someone had executed on this idea back in the DOS days- would their virtual hardware interface still be sufficient today? If so, would it have worked well at all back then?


It is very different. And yes, it would still be sufficient. As I said before, the hardware doesn't change. Think of it as how an emulator works. When it begins executing a rom, the first thing it does is search through the executable code and apply patches to hook OS calls. The code in the rom itself doesn't know this is happening. All it knows is that 'osLoadProgram' loads a program. It just executes faster or slower for some magical unknown reason.


Top
 Profile  
 
 Post subject: Re: Design Choices of my OS
PostPosted: Thu Mar 05, 2015 3:00 pm 
Offline
Member
Member
User avatar

Joined: Wed Jan 06, 2010 7:07 pm
Posts: 792
So you want us to write software for what will become the equivalent of an SNES and never go beyond that? Sure, all the old stuff will continue to work as the VM gets ported to new systems, but it won't be able to take advantage of the new systems either.

_________________
[www.abubalay.com]


Top
 Profile  
 
 Post subject: Re: Design Choices of my OS
PostPosted: Thu Mar 05, 2015 3:10 pm 
Offline
Member
Member

Joined: Tue Aug 19, 2014 1:20 pm
Posts: 74
cmdrcoriander wrote:
SoulofDeity wrote:
cmdrcoriander wrote:
Uhhh... how is this not Java? Or at least conceptually really, really similar?


soulofdeity wrote:
It'll have a single interface for devices and absolutely will not allow peeking at hardware or executing/linking against programs and libraries not built for it.

Java lets you do this. When someone builds a library trying to take advantage of this (eg. exposing an OpenGL interface via DLL), they are instantly locked to a specific hardware and platform. When the libraries become popular, you then have a whole bunch of hardware/platform dependant software. For 100% portability, hardware acceleration should only be performed by the VM via HLE and applications should be entirely ignorant of these things.

Okay, I see. I didn't realize it was possible to do that in Java (I'm not a Java programmer okay :P). But isn't this basically what Java is *trying* to do? It seems to me like you're starting from the same base idea as a JVM, and your only difference is that they compromised a little, and let you use platform-specific features if you really, really want to.


Writing native (non-Java) code and executing it with Java is called the Java Native Interface (JNI).
Is this what your trying to accomplish, OP?


Top
 Profile  
 
 Post subject: Re: Design Choices of my OS
PostPosted: Thu Mar 05, 2015 3:23 pm 
Offline
Member
Member

Joined: Wed Jan 11, 2012 6:10 pm
Posts: 193
Rusky wrote:
So you want us to write software for what will become the equivalent of an SNES and never go beyond that? Sure, all the old stuff will continue to work as the VM gets ported to new systems, but it won't be able to take advantage of the new systems either.


No. Alright, look at it like this. The (virtual) hardware give it's (virtual) drivers access to a (virtual) framebuffer. The (virtual) driver implements a software 3D renderer. Other libraries use this driver. The VM sees this driver and patches it with HLE hooks that redirect to (physical) driver functions when the code is recompiled. The VM software only knows and cares about it's virtual hardware and drivers. These work 100% standalone of the physical hardware or platform because it's all software implemented. Because it uses virtual hardware, people can write their own drivers. However, they won't run as fast unless they are recognized and patched by the VM.


Top
 Profile  
 
 Post subject: Re: Design Choices of my OS
PostPosted: Thu Mar 05, 2015 4:05 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
I guess it might be of interest to people who don't care about the performance implications of virtualizing the hardware, but I'm not sure that's a very large target audience. It just sounds like an unholy mess to me with all sort of potential for failure and security issues. A complicated solution in search of a simple question.


Top
 Profile  
 
 Post subject: Re: Design Choices of my OS
PostPosted: Thu Mar 05, 2015 4:18 pm 
Offline
Member
Member

Joined: Wed Jan 11, 2012 6:10 pm
Posts: 193
iansjack wrote:
I guess it might be of interest to people who don't care about the performance implications of virtualizing the hardware, but I'm not sure that's a very large target audience. It just sounds like an unholy mess to me with all sort of potential for failure and security issues. A complicated solution in search of a simple question.


When the drivers are hooked, there are no performance implications (aside from the time it takes to perform JIT compiling). Also, how can there be security issues when the software has no way, shape, or form of communicating directly with the hardware or operating system? That would be like saying that playing a gameboy game on my pc through an emulator is somehow more insecure than running the game natively.


Top
 Profile  
 
 Post subject: Re: Design Choices of my OS
PostPosted: Thu Mar 05, 2015 4:52 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
Quote:
When the drivers are hooked, there are no performance implications (aside from the time it takes to perform JIT compiling).
If you have discovered a way to virtualize, for example, a graphics card without any loss of performance then I congratulate you.
Quote:
Also, how can there be security issues when the software has no way, shape, or form of communicating directly with the hardware or operating system?
Any time you allow external drivers to hook into the OS you are exposing it to security risks. It is naive to suppose that people won't be able to take advantage of these hooks.

Anyway, I wish you the best of luck and look forward to seeing your code in action.


Top
 Profile  
 
 Post subject: Re: Design Choices of my OS
PostPosted: Thu Mar 05, 2015 5:03 pm 
Offline
Member
Member

Joined: Wed Jan 11, 2012 6:10 pm
Posts: 193
iansjack wrote:
Quote:
When the drivers are hooked, there are no performance implications (aside from the time it takes to perform JIT compiling).
If you have discovered a way to virtualize, for example, a graphics card without any loss of performance then I congratulate you.
Accepted.

iansjack wrote:
Quote:
Also, how can there be security issues when the software has no way, shape, or form of communicating directly with the hardware or operating system?
Any time you allow external drivers to hook into the OS you are exposing it to security risks. It is naive to suppose that people won't be able to take advantage of these hooks.
What I'm trying to explain is that the drivers for the VM don't have anything to do with the OS. The VM is a thick iron wall between the systems applications and user applications. The user applications implement their own sandboxed drivers for the virtual hardware which are guaranteed to work, and the VM decides whether to execute these via LLE (slow), or use HLE hooks that translate those functions into functions for the physical drivers. At the very worst scenario, the software will run slow; at the very best scenario, all of the virtual driver functions translate directly to physical driver functions and the VM software is just as fast as .NET or Java. In either case, the software is 100% guaranteed to work regardless of the hardware or platform. This is something that can't be said for the other two because they allow native code execution.


Top
 Profile  
 
 Post subject: Re: Design Choices of my OS
PostPosted: Thu Mar 05, 2015 7:38 pm 
Offline
Member
Member
User avatar

Joined: Wed Jan 06, 2010 7:07 pm
Posts: 792
The point is, the software must be written to some particular interface (which you intend to set in stone), but that interface cannot provide optimal performance for all hardware configurations and designs. This was hinted at by iansjack's comment here:
iansjack wrote:
If you have discovered a way to virtualize, for example, a graphics card without any loss of performance then I congratulate you.

Try coming up with a specific design for one of these virtual drivers and we'll see how it fares.

_________________
[www.abubalay.com]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 60 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 76 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group