PC/MS DOS emulator?

Get technical support from the community & developers with specific X16 programs if you can't find the solution elsewhere
(for general non-support related chat about programs please comment directly under the program in the software library)
Post Reply
fenriswolf039
Posts: 2
Joined: Sat Jan 28, 2023 10:50 pm

Hardware PC/MS DOS emulator?

Post by fenriswolf039 »

I've pre-ordered everything that is currently offered for sale and am very much looking forward to digging in to all that the X16 has to offer.

That being said, I've not seen - or perhaps I missed - any mention of a DOS emulator, or some way to load PC DOS software.

Specifically, I'm hoping that at some point I'll be able to play through the entire Ultima series of games, starting with Akalabeth.

So... will there be something like DOSBox for X16?
m00dawg
Posts: 341
Joined: Wed Jul 08, 2020 12:41 am
Contact:

Re: PC/MS DOS emulator?

Post by m00dawg »

I suspect DOS would be a heavy lift. I wouldn't say impossible because I don't like to "no, but" vs "yes, and" though there's a lot that would need to be written and handled. Virtual memory for instance doesn't exist here, as the X16 is meant to be a baremetal computer. DOS is close to metal, but it has virtual memory among other things. I'm also not a DOS expert so don't want to make hard claims here.

I'll leave the reasons why it is difficult to the reader as that would be a fun exploration into the hardware differences of the 65C02/65816 and x86 as well as how the software side differs. One hint is that, x86, while it is less efficient in terms of instructions per clock than 6502, has way more registers. Another is examining the x16 memory map to see how it's structured (noting again no virtual memory in the standard sense - it can be approximated with banking but that's not the same thing).

The X16 does support the CP437 (IBM ANSI) character set. So you can write apps that look kinda like PC textmode apps. The SD card additions to the KERNAL extend some things that the original commodore KERNAL didn't have and it's very fast.

There are a few operating systems being developed for the X16. None akin to DOS but might be worth looking into to see what they are doing (and importantly why as that also helps answer the DOS question). There are also a few shells now (I use x16-shell, which presents a Unix-like shell).

All that to say though, X16 is about looking forward more than looking backward. Yes it's based on heritage (being a VIC-20 successor in terms of architecture, and using the Commodore KERNAL) but it's really more a celebration of what a modern full 8-bit baremetal computer could be like. As such while there have been already some amazing ports to the X16 (the 2nd Reality demo is sooo good! Though one could argue that's also sort of a "new" app as it was written from the ground up - it doesn't run on any interpretive layer or anything like that), I'm excited about new apps that exploit what the X16 and celebrating that. Running DOS would require lots of dev work, and there will be big tradeoffs into trying to make that work. That time and effort could be spent writing new games and apps that exploit the system for what it is and I personally find that quite intriguing.
Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
Edmond D
Posts: 485
Joined: Thu Aug 19, 2021 1:42 am

Re: PC/MS DOS emulator?

Post by Edmond D »

fenriswolf039 wrote: Sun Sep 29, 2024 1:08 pm
That being said, I've not seen - or perhaps I missed - any mention of a DOS emulator, or some way to load PC DOS software.

So... will there be something like DOSBox for X16?
I've not seen anything mentioning getting DOS onto the X16, and I've read everything on this site.

It's a big request - making an emulator to take on a 16 bit OS and hardware that post dates the "origins" of the X16.

Possible? - perhaps. Probable? that is the real question.
Ser Olmy
Posts: 39
Joined: Thu Aug 18, 2022 8:20 pm

Re: PC/MS DOS emulator?

Post by Ser Olmy »

Edmond D wrote: Sun Sep 29, 2024 4:15 pmPossible? - perhaps. Probable? that is the real question.
Someone recently managed to boot Linux on an Intel 4004, so anything's possible. He did it by creating a MIPS emulator for the 4004, and then booted a Linux distribution with a MIPS kernel.

The 65C02 in the X16 has a 16-bit address bus which gives a memory map of 64k with some bank switching on top. It has a tiny, fixed stack and three 8-bit registers.

On the other hand, the 8086 that runs DOS has a 20-bit address bus and an address space that's accessed in 64k chunks via 16-bit segment registers (code and data). It has 8 general-purpose registers that can be paired up to form 4 16-bit registers, and also a 16-bit stack pointer + a stack segment register, allowing it to put its stack anywhere within its 1Mb address space.

Would it be possible to write an 8086 emulator for the 6502 and then use it to run x86 code from the memory banks? Sure, but the result would look something like the 4004 MIPS emulator: It boots Linux, but it takes roughly a week to get to the command prompt.

Will this ever happen? Short answer: No. Longer answer: Nooooooooo, because it would be a monumental waste of time.
Edmond D
Posts: 485
Joined: Thu Aug 19, 2021 1:42 am

Re: PC/MS DOS emulator?

Post by Edmond D »

I'm familiar with both the 6502 and X86 architecture. Then I got hooked on the 68HC11 microcontroller at school ....

I'll get back to 6502 once I get a fencing project done, a greenhouse finished, upgrades to my workshop too and a whole lot of whitewater kayaking trips this winter. I've got an X16 and 2025 will be its year!
Ser Olmy wrote: Mon Sep 30, 2024 12:44 am Will this ever happen? Short answer: No. Longer answer: Nooooooooo, because it would be a monumental waste of time.
Some people think an 8 bit machine is a waste of time. Luckily my wife doesn't event know the difference between any computer processor, nor does she think my hobby is a waste of time. It makes me happy, and she is glad.

Someone may get MS DOS to work on the X16, it won't be me (or you.) It certainly sounds like a lot of labour of love; I hope they enjoy the time doing so.


PS - building a 4004 emulator would be "doable" then run the mips emulator to get linux on an X16. Might take a month to boot, but it could be done....
TomXP411
Posts: 1763
Joined: Tue May 19, 2020 8:49 pm

Re: PC/MS DOS emulator?

Post by TomXP411 »

fenriswolf039 wrote: Sun Sep 29, 2024 1:08 pm I've pre-ordered everything that is currently offered for sale and am very much looking forward to digging in to all that the X16 has to offer.

That being said, I've not seen - or perhaps I missed - any mention of a DOS emulator, or some way to load PC DOS software.

Specifically, I'm hoping that at some point I'll be able to play through the entire Ultima series of games, starting with Akalabeth.

So... will there be something like DOSBox for X16?
No. That's not going to happen.

The X16's hardware is completely different, and it simply doesn't have the ability to emulate other computers.

If you really want to run DOS software like it's 1985, but you want modern keyboards, mice, and monitors, then MiSTer is the way to get what you're looking for.
Post Reply