HX icon indicating copy to clipboard operation
HX copied to clipboard

Is HX 64bit possible?

Open MrMadguy64 opened this issue 2 years ago • 4 comments

As you know, my dream since discovering Borland 32rtm has been to make universal DOS/Windows program. And it has taken many years to achieve this goal. I've already shown you my previous program. But it was old and wasn't made the way, I wanted. This new application is much better. My engine is somewhat similar to SDL, but in my case exactly the same application can be used for both DOS and Windows. It's also my first C++ experience. It's made via Code::Blocks and GCC. Simply because I wanted to have access to more or less modern development tools, instead of relying on old obsoleted ones. For example I still have problems with debugging DOS version of my program. I just don't understand, how to use WD for this purpose. So DOS driver in my program is developed via "zero debugging" technique. But at the same time being able to use the same application in both DOS and Windows allows me to debug it via modern Windows tools. So, if DOS drivers work correctly - same program will just work in DOS without any debugging.

https://github.com/MrMadguy64/Engine

For now it's closed source as I personally don't like open source. May be I'll open it's sources some day, if I'll decide, that this application has no value for me.

What I tried to do in this application - to use macros instead of raw ASM programming in order to allow 64bit version of DOS driver. But I can't test it. While such exotic thing as 64bit version of DOS can possibly be found, 64bit version Windows emulator just doesn't exist. How hard would it be to make 64bit HX version? Is it possible? Is 64bit mode compatible with DOS?

MrMadguy64 avatar Jun 22 '23 20:06 MrMadguy64

Necromancer DOS Navigator appears to have a 64-bit DOS version (D64).

Torinde avatar Sep 10 '23 15:09 Torinde

DOS itself isn't enough. HX would also need 64bit XMS server or DPMI64.

After switching from raw asm code to embedded asm I'm 99% sure, that DOS code would work on 64bit. Only doubtful thing - IRQ handlers. Because there is difference between 32bit and 64bit interrupt handling.

MrMadguy64 avatar Sep 18 '23 19:09 MrMadguy64

IRQ and exception handlers must always be 64-bit in long mode.

a 64-bit XMS host already exists: himemsx.

A first step to make HDPMI "more 64-bit" would be to implement PAE paging. Then it could use physical memory beyond the 4GB barrier directly. That's quite a bit of work, but doable, since the adjustments are mostly to be done in pagemgr.asm.

Baron-von-Riedesel avatar Jan 26 '24 07:01 Baron-von-Riedesel

I mean this and this.

In 64bit mode old IRQ handler call code would be different. In easy case stack wouldn't change, so I would need to push current SS:RSP before RFLAGS. But in the worst case I would also need to know new SS:RSP value. And it would require DPMI API change. Some way to retrieve it would be needed. As I don't have such details now, I just can't write proper code, that would be compatible with future HX64.

And of course having 64bit addressing isn't enough. Win64 API emulation would be needed to run real Win64 application. And, I guess, it's would require lots of work.

MrMadguy64 avatar Jan 26 '24 20:01 MrMadguy64