Page 1 of 2
PC/MS DOS emulator?
Posted: Sun Sep 29, 2024 1:08 pm
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?
Re: PC/MS DOS emulator?
Posted: Sun Sep 29, 2024 4:11 pm
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.
Re: PC/MS DOS emulator?
Posted: Sun Sep 29, 2024 4:15 pm
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.
Re: PC/MS DOS emulator?
Posted: Mon Sep 30, 2024 12:44 am
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.
Re: PC/MS DOS emulator?
Posted: Mon Sep 30, 2024 2:02 am
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....
Re: PC/MS DOS emulator?
Posted: Mon Sep 30, 2024 7:22 am
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.
Re: PC/MS DOS emulator?
Posted: Wed Oct 02, 2024 12:42 am
by fenriswolf039
OK... next question, since the aim is not necessarily to run DOS games.
Ultima is the target here. It was available for the C64, I should be able to run that version on the X16, no?
Re: PC/MS DOS emulator?
Posted: Wed Oct 02, 2024 6:33 am
by TomXP411
fenriswolf039 wrote: ↑Wed Oct 02, 2024 12:42 am
OK... next question, since the aim is not necessarily to run DOS games.
Ultima is the target here. It was available for the C64, I should be able to run that version on the X16, no?
Again, the X16's doesn't have the ability to emulate other computers. So no, it can't run the Commodore 64 version or any other version.
The Commander X16 runs Commander X16 programs and Commodore BASIC programs. Even BASIC programs may require porting, since any PEEK and POKE statements will be different. (For the most part, there are new BASIC commands to replace anything that used PEEK or POKE on the C64 or VIC-20.)
Re: PC/MS DOS emulator?
Posted: Fri Oct 04, 2024 4:51 pm
by voidstar
Was the original Akalabeth done in BASIC? I recall here in the forum, someone had ported it to the X16 - and that was done in BASIC, but maybe "wayback" in R37 or so days, so I remember it didn't run quite right. But now having more experience with the system, maybe it's time to revisit that.
I've wrestled with how to explain the X16 - I tend to think it is better to view it as its own whole new system, rather than saying it is "based on XYZ" (since many people have no experience with XYZ anyway). For example, saying it is "like CBM BASIC" isn't that helpful to anyone who never knew any BASIC in the first place. At some point I envisioned making a chart, to try to depict the overlap between the BASIC and KERNAL (in comparison to "classic" CBM systems) - but things were still in flux then. And while C64-folks will feel some familiarity, everything works quite differently (you can't poke directly to the screen, you have to proxy through VERA; you can't just PEEK last keypress, SID audio is all different, etc.). So in that regard, there is going to be a learning curve for anyone on how to use this system.
The X16 won't directly/natively run Ultima as-is, but the C64 version of it would probably be the logical place to start in doing a port. Many get nervous on the legal-aspects of such things (i.e. who owns Origin IP these days), which is a fair concern. But on the flip side, porting or emulating past work helps us "calibrate" expectations of what the system can do (and helps developers dial in their understanding of how to make the system do those things). It's a similar thing in astrophotography: everyone has taken an image of M42, but repeating that with new equipment helps verify that the equipment is operating well. One other aspect here: I never knew much about Time Pilot until there was an X16 port, and I imagine some people actually aren't familiar with Qbert, Frogger, Robotron, Gauntlet - so it's like new translations of old titles, it's good to see those "old classics" touched up for a new generation to enjoy again.
Welcome to the X16, there is a lot of development tool choices now, and look forward to seeing however you choose to approach learning about it
EDIT: One thing to add, it is interesting how one thing QDOS/86-DOS (ancestor to MS-DOS) did a bit better than CP/M was that segment memory management. I imagine a similar approach could be done here- but slower due to being 8K chunks instead of 64K. But an X16 OS that lets applications more seamlessly "break the 32K barrier" would be at least a little interesting. Right now, once your code-space creeps past about 29K (LoRAM), it's tough to grow the program further (not impossible, just no "standard" solution about it). And that's one of the things MS-DOS EXE's helped tackled (as opposed to .COMs).
Re: PC/MS DOS emulator?
Posted: Mon Oct 07, 2024 11:49 pm
by nopethx
Asking for a MS DOS emulator for a 8(?) MHz 6502 retro platform is so out of place! I love it, haha. It's all the same because it's old, right?