developers for emulator

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
asdfgh
Member
Member
Posts: 42
Joined: Fri Apr 18, 2008 9:14 pm

developers for emulator

Post by asdfgh »

hi i am writing an emulator for x86 architecture.

currently i disassembles the object file and emulates some of the instructions

if anyone is interested we can work to gether
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: developers for emulator

Post by Combuster »

what's wrong with bochs and qemu?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
OrOS
Member
Member
Posts: 143
Joined: Sat Sep 08, 2007 11:26 pm
Location: Canada

Re: developers for emulator

Post by OrOS »

It's typically an attractive school project, or just for fun. Example, look at yourself, what's wrong with windows, mac, and linux?
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: developers for emulator

Post by Love4Boobies »

Combuster wrote:what's wrong with bochs and qemu?
Lol. What's wrong with Linux/Windows/Mac OS/Solaris/BSD/whatever? Why would there be any need for MOS86 or whatever it's called?
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: developers for emulator

Post by Combuster »

Oh, the world doesn't need my OS, if that's what you're asking.

The question was serious nonetheless - if you want to attract people you must have a plan. Not just a simple "help wanted".
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: developers for emulator

Post by Love4Boobies »

True. Sorry, I thought you were just being a troll :oops:
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: developers for emulator

Post by Combuster »

Even then you should know better to not feed it :)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: developers for emulator

Post by bewing »

Combuster wrote:what's wrong with bochs and qemu?
Bochs is slow, its memory structures are awful, its external debugger interface is awful, it is coded inefficiently, its "features" are silly and obsolete, its configure script makes me want to cry, it is not built to be thread safe, and it suffers from having too many fingers in the pie. It is in desperate need of a complete rewrite.

QEMU is not being well supported, it does not compile on current GCC, its simulation is not particularly accurate, it is lacking the stunningly wonderful GUI debugger that bochs has, and its coding is overly intricate.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Re: developers for emulator

Post by Alboin »

It's actually really hard to make a beautiful emulator. At least...in C\C++....

Perhaps we should try writing one in Haskell.... :twisted:
C8H10N4O2 | #446691 | Trust the nodes.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: developers for emulator

Post by pcmattman »

Considering Bochs at the moment, I'd imagine that would be an immense project that no single person would be able to pull off (at least, if they keep their sanity).

A new emulator would be interesting, but to truly compete against Bochs and QEMU it would have to be designed well, implemented well, and tested thoroughly.
JohnnyTheDon
Member
Member
Posts: 524
Joined: Sun Nov 09, 2008 2:55 am
Location: Pennsylvania, USA

Re: developers for emulator

Post by JohnnyTheDon »

Try writing a VT-x (Intel) or AMD-V (AMD obviously) emulator. The processor does all the actual execution of code, you just have to point it in the right direction. It can also give you experience for developing an exokernel OS.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: developers for emulator

Post by bewing »

berkus wrote:bewing, why not slowly rewrite bochs to better shape? you can do it step by step without major breakage and in a controllable manner, can't you?
If I were to take all the bochs sourcecode, rename it "rebochs" (with a shoe for an icon), and begin a rewrite -- some of it could be done in that way, yes. The configure script, the param_tree, the main cpu_loop that runs the sim, the breakpoints, the "BX_Events", and making the "devices" threadsafe.

The memory code is already good, and so is the disassembler (and the gui debugger, of course).

However, the main thing that needs the most help is that the model of the CPU is all stored in C structures. Structures (and C++ objects) are SLOW. I know that programmers hate to hear that, but it is true. Arrays are MUCH FASTER. So, the basis of the rewrite would be to recode the entire CPU model using arrays instead of structures. Sadly, this would completely and utterly break every bit of the code in the entire program. And that is such a major design change that it would need to be done FIRST. Which means that the program WOULD be broken for the first 3 months.

But, overall, the answer to your question is:
Yes, I could probably get a really good rewrite started on the thing. I have spent 4 months on the user interface already. If I were to spend another 6 on bochs itself, I could probably get it to the point where it was singificantly simplified, and significantly faster -- with only easy incremental changes required to further improve it.

And I am tempted to do it, too. But I am also tempted to get back to working on my assembler, and my OS. And I am also tempted to spend some time trying to make some money, too. :wink:
JohnnyTheDon
Member
Member
Posts: 524
Joined: Sun Nov 09, 2008 2:55 am
Location: Pennsylvania, USA

Re: developers for emulator

Post by JohnnyTheDon »

Structures (and C++ objects) are SLOW.
Why? If they're aligned properly there won't be any problems with actually reading the data. Finding an offset might take a bit longer, but in the end

Code: Select all

     mov rbx, arrayBase
     mov rax, index
     shl rax, log2(elementSize)
     mov rdx, [rbx+rax]
is not much shorter or faster than:

Code: Select all

     mov rbx, arrayBase
     mov rax, index
     shl rax, log2(structSize)
     add rax, offsetInStruct
     mov rdx, [rbx+rax]
Unless I'm oversimplifying (which I might be, I haven't run efficiency tests on this).
JohnnyTheDon
Member
Member
Posts: 524
Joined: Sun Nov 09, 2008 2:55 am
Location: Pennsylvania, USA

Re: developers for emulator

Post by JohnnyTheDon »

Did some follow up with a little C program. Results:

Structure Time: 39163486164. Array Time: 38919099390.
Winner: Array. Difference: 244386774.

I had both do 1 billion random accesses of the same size (long). The results are in clocks (retrieved from rdtsc). My computer clocks at around 3.02 GHZ. That means the structure took 12.97 seconds, and the array took 12.89 seconds. The difference was 0.08 seconds. That is a 0.6% speed up. Ultimately, it doesn't seem like there is much of a difference. I got a higher speed increase with bochs when I compiled it using LLVM (which does robust link-time optimization).

I agree that bochs is one of the slower emulators. However, it also gives a lot more information about what is going on, especially in simulated hardware devices. And structures don't appear to be that slow, so you can't blame boch's speed issues on structures.
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: developers for emulator

Post by Creature »

Why not organize some sort of community project where there is one main developer (or a few main developers) and others can contribute code? I know community projects usually aren't a good idea, but if it works you'd have a nice emulator. You could use parts of the Bochs/QEMU source code (after they've been rewritten to be more efficient).
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
Post Reply