Page 1 of 2

new ver of Fake86, my own 8086 PC emulator (v0.12.4.25)

Posted: Tue Apr 24, 2012 12:23 pm
by miker00lz
hi, i was wondering if anybody was interesting in giving the new version of my PC emulator Fake86 a try. i wanted to see if anybody ran into any sort of crippling issues that i don't know about before i actually make it an official release version and throw it up on my website for it.

a quick overview of what it is and is not. first it does not run 32-bit code or anything that needs protected mode. my CPU core is simply real-mode for the time being. it supports all of the 16-bit x86 opcodes up to the 80186/V20 instruction set. (it can't run windows 3.1, but it will run windows 3.0)

main emulation features besides the CPU core:
- Hercules/CGA/MCGA/VGA graphics emulation. the VGA support is actually not complete. it won't do 640x480 4-bit, but it does handle 320x200 8-bit unchained mode, which some games (like Wolf3D) require to run correctly.
- Intel 8253 programmable interrupt timer
- Intel 8259 interrupt controller
- Adlib FM synth emulation (a bit rough, but it's there and working)
- PC speaker (crappy)
- Disney Sound Source emulated (awesome for playing Wolf3D)
- Ethernet card emulation via winpcap (it doesn't emulate any existing real world card, i wrote a custom DOS packet driver for it)
- Uses raw hard disk and floppy images

i will also say in advance that the source code is not very well organized, i am going to re-organize it all sometime soon.

both of these downloads include a 30 MB pre-prepared hard drive image (drive0.raw) with DOS 6.22 and some old games/apps.

EDIT: i've updated these links with a new version that fixes a CPU bug that got introduced to 0.12.4.23.

win32 binaries: http://rubbermallet.org/fake86-0.12.4.25-win32.zip
NOTE: it must be run from the command line, you cant double-click it in explorer.

source code download for linux: http://rubbermallet.org/fake86-0.12.4.25.tar.gz

to compile in linux you need the libSDL 1.2 development files and runtime files installed. for debian users, simply use apt-get install libsdl1.2-dev libsdl1.2debian-all

i assume that works in ubuntu too.

compile like this:

Code: Select all

make
make install
it won't work if you just try to run it from the bin/fake86 after a make, you have to use make install so that it puts some data files in the correct places.

you can run it with the included hard drive image like this:

Code: Select all

fake86 -hd0 drive0.raw

a few screenshots:

Image
Wolfenstein 3D

Image
Prince of Persia

Image
Ultima VI: The False Prophet

Image
Mario Andretti's Racing Challenge

Re: new ver of Fake86, my own 8086 PC emulator (v0.12.4.23)

Posted: Tue Apr 24, 2012 3:14 pm
by Jezze
Nice job!

Have you done any performance comparison to any other emulator?

Also, will you add protected mode in the future?

Re: new ver of Fake86, my own 8086 PC emulator (v0.12.4.23)

Posted: Tue Apr 24, 2012 3:31 pm
by miker00lz
Jezze wrote:Nice job!

Have you done any performance comparison to any other emulator?

Also, will you add protected mode in the future?
thank you! i've been working on it for a year and a half so far. i'm actually in the middle of writing a new CPU core that supports 386 instructions and protected mode. :)

and i've done speed comparisons with DOSBox, and it's actually pretty close in performance. it generally runs at about 80-90% of what DOSBox can do speed-wise. i'm working on that, i'd like to get it at least as fast.

one idea i've got is to implement some kind of scheme that makes it delay flag result calculations until another instruction that needs to see the results is hit. hopefully that will give it a noticeable boost.

Re: new ver of Fake86, my own 8086 PC emulator (v0.12.4.23)

Posted: Tue Apr 24, 2012 5:15 pm
by miker00lz
i was just thinking, should i have posted this in general ramblings? if that's a better spot, maybe this thread should be moved. sorry. this isn't really OS-dev related.

Re: new ver of Fake86, my own 8086 PC emulator (v0.12.4.23)

Posted: Tue Apr 24, 2012 7:34 pm
by VolTeK
Its an announcement for an emulator to run operating systems for the 8086 ;)


I'm not sure, but if you have a debugger, id really like to use your emulator with my current project.

Re: new ver of Fake86, my own 8086 PC emulator (v0.12.4.23)

Posted: Tue Apr 24, 2012 8:01 pm
by miker00lz
i dont have any real debugging features in it, but i really would like to add some. what kind of debug featues would you be looking for? just the standard stuff like memory hex viewing/editing, breakpoints, single-step? right now it doesn't even have a proper disassembly-to-text engine. that shouldn't be difficult to add though.

Re: new ver of Fake86, my own 8086 PC emulator (v0.12.4.23)

Posted: Tue Apr 24, 2012 9:16 pm
by VolTeK
miker00lz wrote:i dont have any real debugging features in it, but i really would like to add some. what kind of debug featues would you be looking for? just the standard stuff like memory hex viewing/editing, breakpoints, single-step? right now it doesn't even have a proper disassembly-to-text engine. that shouldn't be difficult to add though.
Im a bochs debugger user, If you could get similar to work that would be more then awesome for me. Showing a dissassembly, being able to see raw hex values at certain addresses, showing registers, setting break points, breaking at errors and being able to single step all from a command line would be great. Surely many others would enjoy this feature as well.

If your willing to take that request into consideration, take your time :) Would like to make it an every day use when its done

Re: new ver of Fake86, my own 8086 PC emulator (v0.12.4.23)

Posted: Tue Apr 24, 2012 10:08 pm
by miker00lz
yeah, i can definitely do that. it's something i've been meaning to add since i started writing the emulator, but i've been lazy about it.

so what's your current project that you wanted to use it on? (if you dont mind going into it)

Re: new ver of Fake86, my own 8086 PC emulator (v0.12.4.23)

Posted: Tue Apr 24, 2012 10:28 pm
by VolTeK
I'm currently writing another multitasking 8086 terminal, maybe with a little GUI this time, for a professor at the near by college. Not in college yet, but he's been talking very highly of my work which made me kinda happy.

If you could get a debugger working please announce it as id really like to use it

Re: new ver of Fake86, my own 8086 PC emulator (v0.12.4.23)

Posted: Tue Apr 24, 2012 10:39 pm
by miker00lz
awesome. i've been working on a multitasking 8086 OS too, but i haven't done anything for a few months on it. co-operative or pre-emptive multitasking?

Re: new ver of Fake86, my own 8086 PC emulator (v0.12.4.23)

Posted: Tue Apr 24, 2012 10:54 pm
by VolTeK
Pre-emptive Multitasking, maybe we could help each other out some time?


Just realized Image

Re: new ver of Fake86, my own 8086 PC emulator (v0.12.4.23)

Posted: Wed Apr 25, 2012 1:40 am
by miker00lz
yeah, that would be cool. speaking of which, i just tried running the most recent floppy image of my OS in this new version of Fake86 and it says disk error. ****, i think i've recently introduced some kind of CPU bug into Fake86. it ran about a month ago, dammit.. glad i tried it. i need to figure out what i broke. the same image works in qemu.

Re: new ver of Fake86, my own 8086 PC emulator (v0.12.4.23)

Posted: Wed Apr 25, 2012 1:24 pm
by miker00lz
alright, i fixed the bug. i'm not even sure exactly what caused the problem, but i replaced cpu.c with a version that is a few days older that i had on my netbook's hard drive.

fixed version download links:

windows binaries: http://rubbermallet.org/fake86-0.12.4.25-win32.zip
source code to compile on linux: http://rubbermallet.org/fake86-0.12.4.25.tar.gz

i also updated the links in the first post.

Re: new ver of Fake86, my own 8086 PC emulator (v0.12.4.25)

Posted: Sat Apr 28, 2012 4:37 am
by 0x3B0
Why you don't give the source code for Visual C?

Re: new ver of Fake86, my own 8086 PC emulator (v0.12.4.25)

Posted: Sat Apr 28, 2012 12:50 pm
by miker00lz
0x3B0 wrote:Why you don't give the source code for Visual C?
back when i started writing this in 2010, i didn't have any experience with Visual C so i wrote it in the Dev-C++ IDE. you can still easily compile the files under windows. i plan to go through the code and clean everything up so that it looks nicer and is more organized/compatible, but for now there are some things in the code that Visual C will not like. for example, switch blocks with case lines that include ranges. (i.e. they use "...")

but anyway, you can compile on windows if you get MinGW, the libSDL dev files, and the winpcap dev files. the winpcap stuff is not even necessary as long as "#define ENABLE_NETWORKING" is commented out in global.h

i'm actually going to start working on cleaning the code up today, i've been putting it off long enough. i'll post it up probably by tomorrow.