VOGONS


First post, by jhhoward

User metadata
Rank Newbie
Rank
Newbie

Faux86 is an 8086 emulator that I have been developing to run bare metal on a Raspberry Pi. This means that the Pi does not have to boot Linux or any other OS first - it just boots straight into MS-DOS. This means a fast boot time and externally it looks like an actual x86 PC is booting.

Faux86 started as a fork of Mike Chamber's Fake86 emulator but a lot of the code has been shuffled around or rewritten.

Release binaries can be found here:
https://github.com/jhhoward/Faux86/releases

The emulator features:
- 8086 and 80186 instruction set emulation
- CGA / EGA / VGA emulation is mostly complete
- PC speaker, Adlib and Soundblaster sound emulation
- Serial mouse emulation

Currently Raspberry Pi models zero, 1, 2 and 3 are supported. To get up and running:
- Download the SD card image from the releases page
- Write the image to an SD card (e.g. using Win32DiskImager on Windows)
- Plug in your SD card to your Raspberry Pi and switch it on!

The release image has an included floppy disk boot image that the emulator will mount as drive A and boot from. The SD card will be mounted by the emulator as drive C. Just copy your favourite DOS games / apps to the SD card and you will be able to access them from the emulator.

The SD card image is fixed at 32MB as I had some problems with the emulator when trying to use larger disk sizes.

Reply 1 of 19, by digger

User metadata
Rank Member
Rank
Member

Cool project! And it's also interesting to find out about the existence of Circle. I had no idea a bare metal SDK existed for the Raspbery Pi family.

Although it's cool to see bare metal software being developed for the Raspberry Pi, I wonder how much actual speed gain it would offer us over a highly optimized emulator such as DOSBox running on top of a lightweight Linux distro.

Perhaps it could be potentially faster once highly optimized, but does an underlying lightweight OS such as Alpine Linux really cause that much overhead?

Just genuinely curious. I don't want to disparage the project.

Using something like Circle to develop a bare metal "booter" game for the Raspberry Pi would turn it it into something of a gaming console. 🙂

Reply 2 of 19, by jhhoward

User metadata
Rank Newbie
Rank
Newbie

Circle is excellent and I would definitely recommend it for embedded Raspberry Pi projects.

I'm not sure how much difference there would be in performance vs running on top of Linux but the one thing I was aiming for was a quick boot straight into the emulator (and DOS) instead of booting Linux first. The idea being that externally from a casual glance it would just look like an old x86 DOS machine right from the moment of switching it on. For increased performance you would probably get more from either hand coding ARM assembly to emulate the x86 CPU like Patrick Aalto's rpix86 emulator or writing something to dynamically recompile x86 instructions to ARM on the fly. Potentially there could also be optimisations made by using the multiple cores of the Pi 2/3/4, e.g. video emulation on a separate core.

Something that I would like to explore in the future is using the GPIO pins for additional PC peripherals. It would be fairly straightforward to hook up a PC speaker for authentic beeps but maybe serial / parallel / game ports could be hooked up to GPIO pins for old joysticks, game pads etc. Potentially null modem multiplayer with a real PC.

I've also considered writing a driver layer for SDL/SDL2 to wrap around the Circle library. It would make it easier to port other projects to a bare metal environment. e.g. DOOM, DOSBox

Reply 3 of 19, by SirNickity

User metadata
Rank Oldbie
Rank
Oldbie

That is awesome. One step closer to x86-ASIC, which is a dream project of my own. (I'm woefully incompetent to pursue that lofty goal just yet, but I'm learning.)

I would love to see a GPIO emulation of ISA. (Are there enough pins for that?)

Reply 4 of 19, by Jo22

User metadata
Rank l33t
Rank
l33t

I'd also like to see some serial port support in the future, even if it would be very barebone at first (RX/TX, GND; maybe RI, RTS/CTS too).
This would be enough for little projects, such as game play and file transfer via mull-modem or setting up a little BBS/PacketRadio system (using TNC).

SirNickity wrote on 2020-02-17, 20:57:

I would love to see a GPIO emulation of ISA. (Are there enough pins for that?)

Me, too. GPIO currently has about 28 free i/o pins. PC/XT-Bus (8-Bit ISA) uses 62 pins. A simple form of ISA without DMA/IRQ lines might be possible, I suppose, if some of the special lines are faked.
If not, a few I/O Port-Expander chips may help to overcome the limited number of pins. Ordinary shift registers may also work, not sure.

Edit: Analog gameport support would also be nice. There's STRIG and STICK in QB 4.0, which can be lots of fun.
When I was little, I made a little alarm system by using this port, for example. Other people also connected analog sensors like NTCs/PTCs and photo diodes to the analog pins.
This allowed for building a cheap long-time oscillograph, for example.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 5 of 19, by Jo22

User metadata
Rank l33t
Rank
l33t
SirNickity wrote on 2020-02-17, 20:57:

That is awesome. One step closer to x86-ASIC, which is a dream project of my own. (I'm woefully incompetent to pursue that lofty goal just yet, but I'm learning.)

This is slightly off-topic, but some single board computers with x86 do exist already, like 86Duino. They often use the Vortex86 processor.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 7 of 19, by Flanker27S

User metadata
Rank Newbie
Rank
Newbie

Thanks for the recommendation, I'll make sure to give it a try. I was looking for a light and compact way to emulate old systems and programs while I'm on holidays (I was looking at these houses in Greece, and figured I'd need something small enough not to take any significant places in my luggage to keep myself busy during rainy days) and this looks like what I was looking for.

Reply 8 of 19, by digger

User metadata
Rank Member
Rank
Member
Jo22 wrote on 2020-02-19, 19:59:

Me, too. GPIO currently has about 28 free i/o pins. PC/XT-Bus (8-Bit ISA) uses 62 pins. A simple form of ISA without DMA/IRQ lines might be possible, I suppose, if some of the special lines are faked.
If not, a few I/O Port-Expander chips may help to overcome the limited number of pins. Ordinary shift registers may also work, not sure.

Why reinvent the wheel here? Wouldn't it be possible to implement the Low Pin Count (LPC) bus instead? Quoting the Wikipedia article on LPC:

An integrated circuit using LPC will need 30 to 72 fewer pins than its ISA equivalent.

ISA is 16 bits wide and runs at 8MHz. LPC is 4 bits wide and runs at 33MHz, to compensate for the lower bus width.

Tiido is planning on developing an LPC-to-ISA adapter to allow ISA cards to be connected to motherboards that have a full-fledged LPC interface, support for LDRQ# signals being key.

If Faux86 could be extended to implement a complete LPC interface (providing that the Raspberry Pi has enough GPIO pins for that), then it might eventually be possible to connect physical ISA cards to it after all. 🙂

How feasible do you think this would be, jhhoward?

Reply 11 of 19, by Banjo

User metadata
Rank Newbie
Rank
Newbie

Just got a Raspberry Pi and have been looking all over for a way to boot straight into (emulated) DOS! This sounds amazing! Will it work on a Raspberry Pi 4 (i.e. is is just not well tested on anything above 3 or flat-out won't run)?

Reply 12 of 19, by Cyberdyne

User metadata
Rank Member
Rank
Member

Thank god, something useful is growing that does not need Linux run in the backround. There are so mutch nice affordable hardware, that can be used for cool stuff, but it usually starts with installing some sort of "Distribution".

I am aroused about any X86 motherboard that has full functional ISA slot. I think i have problem. Not really into that original (Turbo) XT,286,386 and CGA/EGA stuff. So just a DOS nut.

Reply 13 of 19, by Jo22

User metadata
Rank l33t
Rank
l33t

Well, Linux is like a gigantic, monolithic pack of drivers.
That's the main reason as to why it is so prefered. Android for example, is a framework in its own reign. It uses Linux as a "bootloader" mainly. Intel uses Minix in its chipset, which is a much friendlier OS.

Edit: Typos fixed (smartphones are mean, btw. 😭).

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 14 of 19, by held

User metadata
Rank Newbie
Rank
Newbie
Cyberdyne wrote on 2020-09-02, 13:12:

Thank god, something useful is growing that does not need Linux run in the backround. There are so mutch nice affordable hardware, that can be used for cool stuff, but it usually starts with installing some sort of "Distribution".

Whats wrong with Linux in the background ? too much overhead ?

Jo22 wrote on 2020-09-02, 14:02:

Well, Linux is like a gigantic, monolithic pack of drivers.
That's the main reason as to why it is so prefered. Android for example, is a framework in its own reign. It uses Linux as a "bootloader" mainly. Intel uses Minix in its chipset, which is a much friendlier OS.

Edit: Typos fixed (smartphones are mean, btw. 😭).

Android is a horrible piece of spyware designed to exfiltrate the most amount of user data possible.
Minix implemented by Intel is not really something to be happy about, remember the IME ?
https://www.zdnet.com/article/minix-intels-hi … erating-system/

On topic:

Did anyone use it,how is it ? and should I buy a PI because of it ?
It really looks tempting, but I could not find any youtube video's.

Last edited by held on 2020-09-02, 20:30. Edited 1 time in total.

Reply 15 of 19, by UselessSoftware

User metadata
Rank Newbie
Rank
Newbie

Hey, cool. Fake86 was my old PC emulator. The code is awful though.

It might be worth redoing this with my new emulator, XTulator. It's basically Fake86 2.0. The CPU code is still mostly the same (for now) but most of the rest is rewritten to be cleaner and better. There are some improvements (EGA/VGA is working a lot better for one, and it uses Nuked OPL now so the Adlib actually sounds good) but it's also missing a few features compared to Fake86, like it doesn't have Sound Source support yet.

https://github.com/mikechambers84/XTulator

I like this port, getting Linux out of the way is great idea.

Reply 16 of 19, by Cyberdyne

User metadata
Rank Member
Rank
Member
held wrote on 2020-09-02, 15:43:

Whats wrong with Linux in the background ? too much overhead ?

Not overhead, but loading, processes, your screen is riddled with somekind of text.

Really like the 80s philosophy, "text takes bytes, so mimimize it"

I really dont need to know that the "thing"is "gnu opensource" or something.
And that my "something" has mounted.

Same problem is with original FreeDOS

I have mimimized the text and some functions for my own use in the kernel and few components.
If i was more familiar with linux and i had more time i woud make a minimal output, ONE USER, no login Lunix.
Well i really do not like the unix file system philosophy also, but thats is impossible to dig out from the "thing".

I am aroused about any X86 motherboard that has full functional ISA slot. I think i have problem. Not really into that original (Turbo) XT,286,386 and CGA/EGA stuff. So just a DOS nut.

Reply 18 of 19, by held

User metadata
Rank Newbie
Rank
Newbie
Cyberdyne wrote on 2020-09-03, 05:33:
Not overhead, but loading, processes, your screen is riddled with somekind of text. […]
Show full quote
held wrote on 2020-09-02, 15:43:

Whats wrong with Linux in the background ? too much overhead ?

Not overhead, but loading, processes, your screen is riddled with somekind of text.

Really like the 80s philosophy, "text takes bytes, so mimimize it"

I really dont need to know that the "thing"is "gnu opensource" or something.
And that my "something" has mounted.

Same problem is with original FreeDOS

I have mimimized the text and some functions for my own use in the kernel and few components.
If i was more familiar with linux and i had more time i woud make a minimal output, ONE USER, no login Lunix.
Well i really do not like the unix file system philosophy also, but thats is impossible to dig out from the "thing".

Then I think you want to change the runlevel:
https://linoxide.com/linux-command/how-do-you … evels-in-linux/

(in case you have time, I think Arch Linux is as barebone as you can get without compiling your own: https://itsfoss.com/install-arch-raspberry-pi/)

UFS, yeah that's a big diff when you come from dos/win, although NTFS became complicated as well later on. With DOS you know what you have, it aint much, but its sufficient imo.

There is something magical about that dos prompt, turn it on and off you go: C:\> 😁

Reply 19 of 19, by Jo22

User metadata
Rank l33t
Rank
l33t
held wrote on 2020-09-03, 12:02:

There is something magical about that dos prompt, turn it on and off you go: C:\> 😁

In Japan, it's C:¥>. Or A>. 😁

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//