flat assembler
Message board for the users of flat assembler.

Index > Heap > VM that runs natively?

Author
Thread Post new topic Reply to topic
sid123



Joined: 30 Jul 2013
Posts: 340
Location: Asia, Singapore
sid123
Just sayin',
Some sort of Virtual Machine that runs on bare hardware?
What do you think?
The Virtual machine will give the kernel ring 0 access,
for example if the VM encounters this instruction :
Code:
out 0x48, AL
    

It will REALLY write to port 0x48.
This'll produce a new architecture, maybe called GLOBAL (Just a name)
since the VM should be able to run ARM, x86, Z80 etc.
It should also have support for adding new architectures like your own architecture.
Maybe this is future? Previously people made DOS Hello World programs, then they made gui
apps in Win2 and Win3, then people made programs in Virtual Machines, then people made Cosmos
which will compile C# IL to x86asm, then we have OSDev, maybe we will have archdev? Razz
What do you think?
This is my dream project.
EDIT:
Just got another idea.
Like in x86 we have real, v86, protected, long mode.
The VM will define the following modes :
8086 Emulation Mode.
386 emulation mode.
x64 emulation mode.
ARM emulation mode.
.......
The user has the freedom to add his/her architecture and it's respective emulation modes.
Also, the OS can switch or create tasks that can run into emulation modes.
For example,
The VM is running Windows x86, suddenly I run a Windows ARM application, provided that the
syscalls match, Windows will create an ARM EMU Task, and execute it. The VM will gain control of
the task, and emulate the code. The VM will have the ability to multitask like it can create clones of itself, and assign them different emulation tasks. Maybe Architecture Switching is the next step?
The VM will have the lower 4GB of RAM reserved, and will emulate memory addresses such that
the kernel will feel that the 4GB=0MB.

_________________
"Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X
XD


Last edited by sid123 on 18 Feb 2014, 13:56; edited 1 time in total
Post 18 Feb 2014, 13:44
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
If it runs on the real hardware then it is not a VM. By definition the Virtual Machine must run in Virtual space.

However, I think you have just reinvented the Hypervisor.

Some VMs also copy portions of the VM code into real space and run from there to gain speed advantages. Also. .NET type code is compiled at runtime. This whole VM thing can get confusing.
Post 18 Feb 2014, 13:48
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8886
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
wow, idk about this,
isn't that extremely dangerous?
Post 18 Feb 2014, 13:49
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
sleepsleep wrote:
wow, idk about this,
isn't that extremely dangerous?
Yup. Just look at the security history of the JVM.
Post 18 Feb 2014, 13:56
View user's profile Send private message Visit poster's website Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 340
Location: Asia, Singapore
sid123
revolution wrote:
If it runs on the real hardware then it is not a VM. By definition the Virtual Machine must run in Virtual space.

However, I think you have just reinvented the Hypervisor.

Some VMs also copy portions of the VM code into real space and run from there to gain speed advantages. Also. .NET type code is compiled at runtime. This whole VM thing can get confusing.

I didn't think about this. Maybe it will be a Hypervisor will special capabilities like adding your architecture, Entering emulation modes (just edited the post to explain this), etc.
I guess I would called it something else with the definition given, Maybe Native-Multiple-Architecture-Emulator.

_________________
"Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X
XD
Post 18 Feb 2014, 14:02
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
I don't know if you already know this or not, but most VMs already run the code natively with hot patching as necessary. That is, they let the code run and patch the parts that cause security exceptions with calls to their library that emulates ring 0 instructions. I would think they probably just trap the security exceptions and react in real time, but that's just a guess; they may patch ahead of time as well/instead. This means that code runs very close to native speed. Bochs is the only x86 VM I know of that interprets instructions.

You might also be interested in reading about VT-x and AMD-V: http://en.wikipedia.org/wiki/X86_virtualization#Intel_virtualization_.28VT-x.29.
Post 18 Feb 2014, 14:46
View user's profile Send private message Reply with quote
m3ntal



Joined: 08 Dec 2013
Posts: 296
m3ntal
Nothing unique. For universal compatibility, what one needs is a good dynamic binary translator (a program that converts the machine code of one CPU to another).

Why don't we try to write code ourselves? Because it's easier to sit back and talk about it, hoping that someone else will do it. "Don't talk about it, be about it".

Check out: Marat Fayzullin's Emulation Site, Tutorials. Some interesting information on dynamic compilation from 6502 to X86 from a guy who wrote a N64 emulator. He seems to know what he's talking about.
Post 18 Feb 2014, 20:57
View user's profile Send private message Reply with quote
m3ntal



Joined: 08 Dec 2013
Posts: 296
m3ntal
Hey, I've got an idea! How about we make an emulator that's not really an emulator. Wouldn't that be awesome?

Q: May I help you?
A: Yes, I'd like to order a hamburger with cheese.
Q: So, you want a cheeseburger?
A: No, I want a hamburger with cheese.
Post 18 Feb 2014, 22:04
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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 vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.