Unicorn - The ultimate CPU emulator

If it doesn't fit anywhere else, drop it in here. (not to be used as a chat/nonsense section)

Moderator: Moderator Team

Post Reply
Alahndro
Posts: 137
Joined: Thu Jun 25, 2009 2:04 pm

Unicorn - The ultimate CPU emulator

Post by Alahndro »

Unicorn permits to run any code for any CPU on any OS

I found this very interesting OS/Emulator project when searching for ways to workaround the dreaded "No SSE2-capable CPU" problem (Firefox etc.)

I first tried to find out if there's any way to emulate the SSE2 instruction set for CPUs that only have SSE/MMX.
Then I found out that Qemu also has a User Mode that permits running processes on a different CPU without emulating a whole system, while transparently providing access to the host apis. Unfortunately this is only available for linux as of yet.

Last I found Unicorn-
http://www.unicorn-engine.org/showcase/

containing the subproject Usercorn:
https://github.com/lunixbochs/usercorn

The following image was used on the usercorn site, but is from randal as next post cites:
(sorry, did not know!)
[ external image ]
Last edited by Alahndro on Sat Nov 05, 2016 1:16 am, edited 1 time in total.
middings
Posts: 1073
Joined: Tue May 07, 2013 9:18 pm
Location: California, USA

Re: Unicorn - The ultimate CPU emulator

Post by middings »

Universal Converter Box.
Give Randall credit when using his comics.
PurpleGurl
Posts: 1790
Joined: Fri Aug 07, 2009 5:11 am
Location: USA

Re: Unicorn - The ultimate CPU emulator

Post by PurpleGurl »

I wonder if we can use any of this at a low level. I'm not 100% sure what it does. Now if it can handle various architectures, could any of it be used in HAL? I mean, if we can see how other deep-level software deals with different real hardware, we could detect and adjust for it, providing a consistent hardware and kernel environment to the rest. I don't know much about the kernel, but I understand HAL is much like a master driver and minimizes the hardware differences to Windows. Of course, in this case, it is x86 to x86.

Just thinking out loud.
hbelusca
Developer
Posts: 1204
Joined: Sat Dec 26, 2009 10:36 pm
Location: Zagreb, Croatia

Re: Unicorn - The ultimate CPU emulator

Post by hbelusca »

It seems to use parts of QEMU, and its JIT. And to implement a JIT you need to use the OS' memory manager API. This is something that you won't be able to do at very low level, such as inside the HAL.
PurpleGurl
Posts: 1790
Joined: Fri Aug 07, 2009 5:11 am
Location: USA

Re: Unicorn - The ultimate CPU emulator

Post by PurpleGurl »

Yeah, I was afraid it would be like that.
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests