• Please review our updated Terms and Rules here

8086 emulator tech discussion

I don't remember the exact quote circumstances. The point was that when the 286 was being rolled out, even 1MB was still quite a lot of RAM. The earliest 8086/8088 systems typically shipped with 64KB.

And you're right, even with segment separation, the x86 wouldn't be pure Harvard as many of the data instructions operate against all 4 segments. And I don't consider immediate operands a corruption of the model. I'm just frustrated at some current project where I am forced to use a pure Harvard processor (LM8 ) with a fixed 18K code space to do way too much.
 
Recall that the basis of the original von Neumann architecture was self-modifying code. On some architectures, that's all you've got--no index registers, nothing (e.g. IBM 1620 CADET). On the 8080/8085, the only form of I/O space addressing is with immediate operands, so if you need to dynamically configure a port address, code modification is the only way. And a STA plugging the operand of a MVI can be two or three bytes shorter on the 8080 than using LDA/STA and a separate data location.

I've got to admit that I dislike storing constant and pre-set data in the code address space of many microprocessors, but it's just a minor annoyance at this point. At least the code space can expand gracefully without impacting the addressing of the data space. Microcontrollers like the MSP430 with von Neumann addressing can be pretty limiting.
 
alright, guys... i've spent some time tonight tidying up the code and fixing some rough edges, and i put the first release for public consumption up on the website as a sort of preview. i've got both a ZIP with Windows binaries, plus a .tar.gz of the source for those who want to compile it on Linux.

http://fake86.rubbermallet.org/

i would looove to hear some feedback if any of you guys try it out. it comes with a small utility i wrote called imagegen as well that you can use to quickly make blank fresh hard disk image files. it also comes with a custom FreeDOS floppy image, which includes an installation program which i slapped together in QB45 in like 30 minutes but it works well.

big thanks to anybody who gives it a try. :)
 
I've been having a tinker with this over lunch... looking good! Does it execute instructions at a particular speed?
 
I've been having a tinker with this over lunch... looking good! Does it execute instructions at a particular speed?

thanks. no, it just runs as fast as the CPU can do it. that might not be a bad idea to implement in the future, but it doesn't keep track of how many CPU cycles each instruction takes. i would need to add that for any real accuracy.
 
I should think that would add a lot of complexity, but it would be good - maybe even a command line option to select some regular clock points.

A couple of quick Q's... is it possible to change the floppy image whilst the VM is running? And, does it support 160KB disks?

Many thanks!
 
nope, i know that's kind of an important thing - should have thrown in disk switching in before putting that up. i'll probably make it similar to QEMU's monitor when you hit ctrl-alt-2. i'll get a new version up in the next day or two with that and 160 KB disk support. right now it only goes down to 320 KB. i am also going to work on PC speaker and sound blaster emulation.
 
oh hell yes... finally, i got around to spending a few hours coding the basic of an Adlib (OPL2) emulator.

still primitive sounding, missing a whole lot of variables to help shape the final output still but it works.

this MP3 is fake86 emulating adlib while playing Ultima 6 - http://rubbermallet.org/fake86.mp3

banana.gif
 
Not sure if this is the feedback you're looking for, but if so then I can't get DOS 3.2 or higher to boot - it just hangs at a black screen. 2.1, 3.0 and 3.1 run just fine. The 3.2+ images work OK on vmware though. Here is a 3.2 image.

Perhaps 3.2+ are trying to detect the CPU type?

Cheers!
 
yeah, i'm actually aware of it.. i havent figured it out yet, and i've been trying. i am pretty sure it's related to disk stuff, like it's not able to figure out the correct data for the drives or something. that's merely an educated guess though.

only MS-DOS seems to be affected. no problems with DR-DOS, tested all the way up to 7.03, and of course FreeDOS works fine.
 
There could be something in that... DOS 2.1 gets very confused with disks larger than 15MB or so; format reporting more free space than total space (or something like that).
 
okay, who here has good experience programming the adlib? i've been working on adlib emulation, and it's coming along well but i cant find any good info on programming the percussion stuff.

here is some adlib music emulated by fake86 while playing ultima 6 - http://rubbermallet.org/fake86-adlib(attack-decay).mp3

i know there are some percussion type bits and then another bit that enables percussion mode on 3 channels, but beyond that i have no idea how it works. anybody worked with this before?
 
screenshot time. got it compiled on OS X (both PPC - on my G3 running Tiger, and my Pentium 4 hackintosh running Leopard)

why? why not!

fake86-osx-ultima6.png
 
ah, that's right he did some work with adlib for his paku paku game.

also, i'm pretty sure i just did something awesome:

fake86-ethernet.png


heavily modified the crynwr packet driver for the 3C509, and designed it to work with an ethernet bridge interface in fake86. i'm using the pcap lib, so it will work in windows or *nix. 8)


fake86-ircjr.png
 
Last edited:
Awesome is an understatement!

Have you considered trying to emulate some actual vintage PC so that it behaves very much like the real thing - I'm thinking along the lines of having sampled sound of the hard drive when it's seeking for example (and IO going at roughly the right rate).
 
lol, hard drive sounds... that would be interesting. i'd actually like to make it run as quickly as possible, BUT... a fork to make it imitate an actual XT or something like that down the road sure couldn't hurt. :)
 
so, i've uploaded a current snapshot which should be considered unstable, but it's got Adlib emulation (not the greatest yet), plus Disney Sound Source, PC speaker, and networking support. if anybody wants to try it and let me know how it works for them, that would be awesome. :D

some programs dont like work with the networking yet for some reason, for example arachne. i'm trying to find out why. all of mbbrutman's mTCP stuff works fine.

my announcement of it with more detailed info:
http://fake86.rubbermallet.org/?articles/2011/06/24/uploaded-an-unstable-release

download the win32 compiled binaries package:
http://fake86.rubbermallet.org/?downloads/downloading-fake86-0-11-6-24-win32-zip

or, if you're on linux, the source tarball. run build.sh in it:
http://fake86.rubbermallet.org/?downloads/downloading-fake86-0-11-6-24-tar-gz

you must have the libsdl 1.2 development library installed to compile. in debian/ubuntu - apt-get install libsdl1.2-dev

and here is a 20 MB sample hard drive image with FreeDOS pre-installed, along with Wolfenstein 3D (which is really nice now with complete sound) and some other games:
http://fake86.rubbermallet.org/?downloads/downloading-fake86_drive-7z


have fun! the code is quick enough to play Wolf3D smoothly on a 1 GHz pentium 3. 8)
 
Hey Mike, any plans for Tandy/PCjr graphics & sound?

I know I'd *love* that, and I'm sure more than a few others.

I've really enjoyed following your progress and am very impressed. Keep up the good work!
__
Trevor
 
Back
Top