Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x86-64 and some upgrade? #29

Open
therealbrate opened this issue Jun 23, 2021 · 3 comments
Open

x86-64 and some upgrade? #29

therealbrate opened this issue Jun 23, 2021 · 3 comments

Comments

@therealbrate
Copy link

yeah i know it'll be hard to do, but a 64-bit pentium 4 upgrade would be very nice
i think 386/486 emulator is really good for low-end hosts, so you might think about adding it in the browser, nepx :)
and about video card, i think i would be great to add a 3dfx voodoo 3 or 5 or cga (low-end) or even nvidia geforce 256 i think ;)
also, network and sounds :)

@nepx
Copy link
Owner

nepx commented Jun 24, 2021

Thanks for the interest!

I've been very busy with work, school, etc. lately, and unfortunately, that means that I have almost no time to spend on this project. Pull requests are always welcome, though I was working on a rewrite before I got overwhelmed with work.

Addressing a few points that you made:

x64 support is doable, but not with the way that the emulator is currently set up. In particular, the following would have to be improved:

  • The internal decoded instruction format only accepts four bits (16 possibilities) for the register number, but it would need to be expanded to five bits (16 GPRs + RIP + the zero register) to support x64
  • The TLB is designed to be very fast at the expense of memory usage. It currently consumes ~9 MB for a 32-bit address space; I would need to design a smaller or multilevel TLB for a 64-bit address space
    The Rust rewrite addresses a number of these concerns. This is something that I'm actively interested in.

It would be easy to modify the decoding tables in src/cpu/decoder.c and add/remove instructions based on the CPU level chosen. Not only would it be simple, it would also have zero runtime cost. For instance, if you chose to emulate a 486, you'd replace all of the SSE instructions with op_exception_ud handlers. It would be difficult to support all the steppings and bugs; for that, I'd advise you to look into PCjs or PCem.

One thing that doesn't need to be changed is speed: the emulator is slow enough that it feels like a real 386 :)

With some time and effort, it would be possible to port over a 3dfx card from another emulator, though I was hoping to add all of the ET4000's SVGA modes first. I'd have to look into documentation and code for that Nvidia card. Hopefully it's simple enough to implement in software. This would not be a trivial project.

There's a stub network card, but it doesn't work, and it needs to be run as root. I was thinking about writing a fully virtual network stack that'd piggyback off of the current host's network stack; this would allow me to run it without root and perhaps even use XMLHttpRequest in the browser...

Timing is terrible enough that sound would probably kill your ears. But once accurate timing is added, SoundBlaster support doesn't seem all that difficult.

I apologize for not having time to work on this project more. I am (was?) working on a Rust rewrite, but any pull requests to the current repo would be appreciated, and I'll be sure to incorporate them into the Rust rewrite.

@fuel-pcbox
Copy link

Hi, I've been working on nVidia Riva 128 emulation for 86Box for years now. The Geforce 256 would not be simple in the SLIGHTEST. Even the Riva 128 is ridiculously complex.

@nepx
Copy link
Owner

nepx commented Nov 19, 2023

Hello all,

I've been working on this for the past several months. x86-64 support has been added to the interpreter, and the emulator can now boot a Linux kernel I compiled with Buildroot. There's some sort of device bug preventing the x64 version of Windows XP from booting that appears unrelated to the CPU.

I'm also adding a dynamic recompiler, which is taking much longer. The challenge is in designing a backend flexible enough to support both native code and WASM emission, and to minimize the amount of redundant host-specific code I need to write.

I got this to run back in July, but since then the dynamic recompiler and school have taken over my life.

Screenshot from 2023-07-02 20-23-50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants