The MASM Forum

Miscellaneous => 16 bit DOS Programming => Topic started by: Gunther on May 17, 2013, 05:45:09 AM

Title: Virtual Machine with DOS
Post by: Gunther on May 17, 2013, 05:45:09 AM
I'm running Windows XP Mode under VirtualPC in my Windows 7 as host computer. That works fine. But some old DOS programs don't work, because I cant switch the console with Alt+Enter into the full screen modus.

So, I would like to make a new virtual machine for a native DOS. What is the best choice to do that? Has anyone experiences? Help is welcome.

By the way, I found a funny video here. (http://www.youtube.com/watch?v=WxC6PytZMqc) Have fun.

Gunther
Title: Re: Virtual Machine with DOS
Post by: anunitu on May 17, 2013, 10:44:06 AM
You might try dosbox for running dos,it also runs freedos and it is very close to the original Dos.
Title: Re: Virtual Machine with DOS
Post by: Gunther on May 17, 2013, 06:44:44 PM
Hi  anunitu,

thank you for the fast reply.

Quote from: anunitu on May 17, 2013, 10:44:06 AM
You might try dosbox for running dos,it also runs freedos and it is very close to the original Dos.

Is that VirtualBox or another emulator? Do you have a download link?

Gunther
Title: Re: Virtual Machine with DOS
Post by: sinsi on May 17, 2013, 08:35:30 PM
If you want to play old games, dosbox is the way to go - it's what gog.com give you to play things like Blake Stone.
It emulates DOS but doesn't have any DOS programs, just the kernel. Emulates the Sound Blaster too.

If you want to do other DOS-type stuff (or write your own 64-bit DOS :biggrin:) VMware player is good and probably the fastest.
You will need a copy of DOS though.
Title: Re: Virtual Machine with DOS
Post by: dedndave on May 17, 2013, 10:46:32 PM
i suspect the reason that 64-bit windows does not support 16-bit code is registry virtualization

if you go back in time a little, you may remember that the registry had a layer of virtualization
to make 32-bit windows compatible with older 16-bit windows

when ms came out with 64-bit windows, they required another layer of virtualization,
to make 64-bit windows compatible with 32-bit windows

they decided that having all the layers, 16-bit, 32-bit, 64-bit was too much   :P
probably would have made the registry overly-complex
so - they dropped 16-bit support

i think that is one difficulty you will face if you try to make a 64-bit version run 16-bit code
Title: Re: Virtual Machine with DOS
Post by: FORTRANS on May 17, 2013, 11:00:32 PM
Hi,

   In the thread "Re: Help i'm new" Reply #13;

Quote from: gbmach7 on May 13, 2013, 12:56:20 AM
Just installed DOSBOX and all the examples and my program work :icon_cool:

   Some of the examples were my DOS graphic programs in modes
12H and 13H.

Regards,

Steve N.
Title: Re: Virtual Machine with DOS
Post by: Gunther on May 18, 2013, 01:37:01 AM
That sounds interesting. I'll give DOSBOX a try.

Gunther
Title: Re: Virtual Machine with DOS
Post by: Gunther on May 18, 2013, 09:28:23 PM
So, it's time to give an interim report.

I've installed DOSBOX (nothing changed).

Quote from: FORTRANS on May 17, 2013, 11:00:32 PM
Some of the examples were my DOS graphic programs in modes 12H and 13H.

Regards,

Steve N.

Steve, that's true; your programs working fine. Furthermore, most of my Protected Mode stuff works well. Only some VESA modes didn't work (using the linear frame buffer); that's PowerBASIC code mixed with assembly language. It seems also that DOSBOX doesn't support XMS support, so some very old applications (my XMS manager for PowerBASIC from 1991) didn't work. But that's no tragedy. It might be that I've to change some configuration files.

Quote from: sinsi on May 17, 2013, 08:35:30 PM
If you want to play old games, dosbox is the way to go - it's what gog.com give you to play things like Blake Stone.
It emulates DOS but doesn't have any DOS programs, just the kernel. Emulates the Sound Blaster too.

If you want to do other DOS-type stuff (or write your own 64-bit DOS :biggrin:) VMware player is good and probably the fastest.
You will need a copy of DOS though.

Sinsi, one question: Is it really possible to switch into the LongMode as guest? Will the host allow that? The CPU is virtualized, but the entire code must be morphed and passed to the host.

Anyway, DOSBOX is very good, because the data exchange between host and guest isn't a point. Under VirtualBox is that a problem. Sure, one can install hardware extensions, but the guest must have, for example, appropriate drivers to use USB devices. Not so easy in that case.

Gunther
Title: Re: Virtual Machine with DOS
Post by: MichaelW on May 18, 2013, 09:46:44 PM
The attachment contains some simple test apps created with FreeBASIC DOS. You control them by pressing the spacebar key to continue to the next test or the escape key to exit. Other keys are ignored so you can use Alt+Enter without disturbing the application. There is one app to test the QB/FB modes 9, 10, 11, 12, and 13, corresponding to VGA modes 10h, 0fh, 11h, 12h, and 13h, and two others that test the FB modes 17 and 18, corresponding to VESA modes 100h and 101h. I didn't include tests for any of the higher resolution VESA modes because VBE could not identify the modes.

Running under the Windows XP NTVDM, on two different systems, all of the tests run full-screen only, Alt+Enter minimizes to the task bar, and restore returns to full-screen. One anomaly on the newer system was that the FreeBASIC graphics library substituted a mode that was reported as 30h for what should have been VGA mode 13h.

The display adapters in my test system are more or less old so they support the old lower-resolution modes, but I suspect that some of the recent hardware may lack support for these modes.


Title: Re: Virtual Machine with DOS
Post by: Dubby on May 18, 2013, 10:41:05 PM
Hi Gunther,
a hint you might want to read the manual and also the config file of DosBox..

also dosbox comes with integrated debugger.. in specialized version...
which you can find it here:
http://vogons.zetafleet.com/viewtopic.php?t=7323
Title: Re: Virtual Machine with DOS
Post by: FORTRANS on May 18, 2013, 10:52:22 PM
Hi Gunther,

   Look at LxPic at the site http://hplx.pgdn.de/.  It is a DOS image
viewer (JPG, BMP, PCX, and GIF mostly).  You can test a number of
VESA modes with it.  I have a number of VESA programs, but nothing
as nice as LxPic for what it does.

Cheers,

Steve N.
Title: Re: Virtual Machine with DOS
Post by: Gunther on May 18, 2013, 11:09:10 PM
Michael,
Quote from: MichaelW on May 18, 2013, 09:46:44 PM
The attachment contains some simple test apps created with FreeBASIC DOS. You control them by pressing the spacebar key to continue to the next test or the escape key to exit. Other keys are ignored so you can use Alt+Enter without disturbing the application. There is one app to test the QB/FB modes 9, 10, 11, 12, and 13, corresponding to VGA modes 10h, 0fh, 11h, 12h, and 13h, and two others that test the FB modes 17 and 18, corresponding to VESA modes 100h and 101h. I didn't include tests for any of the higher resolution VESA modes because VBE could not identify the modes.

Running under the Windows XP NTVDM, on two different systems, all of the tests run full-screen only, Alt+Enter minimizes to the task bar, and restore returns to full-screen. One anomaly on the newer system was that the FreeBASIC graphics library substituted a mode that was reported as 30h for what should have been VGA mode 13h.

The display adapters in my test system are more or less old so they support the old lower-resolution modes, but I suspect that some of the recent hardware may lack support for these modes.

your test programs are working fine under DOSBOX. They need a DPMI host. Is it for using the linear frame buffer or has it to do with the BASIC dialect?

Dubby,
Quote from: Dubby on May 18, 2013, 10:41:05 PM
a hint you might want to read the manual and also the config file of DosBox..

also dosbox comes with integrated debugger.. in specialized version...
which you can find it here:
http://vogons.zetafleet.com/viewtopic.php?t=7323

yes of course, I've to do: RTFM. But I've installed it in the middle of the night and hadn't enough time to do it. But thank you for the link.

Steve,
Quote from: FORTRANS on May 18, 2013, 10:52:22 PM
Look at LxPic at the site http://hplx.pgdn.de/.  It is a DOS image viewer (JPG, BMP, PCX, and GIF mostly).  You can test a number of VESA modes with it.  I have a number of VESA programs, but nothing as nice as LxPic for what it does.

Cheers,

Steve N.

I'll check it. Thank you for the hint.

Gunther
Title: Re: Virtual Machine with DOS
Post by: Dubby on May 19, 2013, 12:06:04 AM
Dude, I'm just referring to the right direction...

the link I've provided is the link to debugger enabled build of dosbox, which not by default provided by official download..
Title: Re: Virtual Machine with DOS
Post by: Gunther on May 19, 2013, 01:30:31 AM
Hi Dubby,

Quote from: Dubby on May 19, 2013, 12:06:04 AM
Dude, I'm just referring to the right direction...

that's clear, no offending.

Quote from: Dubby on May 19, 2013, 12:06:04 AM
the link I've provided is the link to debugger enabled build of dosbox, which not by default provided by official download..

That was my point. Good hint, thank you again.  :t

Gunther
Title: Re: Virtual Machine with DOS
Post by: Dubby on May 19, 2013, 02:14:38 AM
No offense taken.. I'm sorry, I'm not suppose to post something in the middle of the night...
my head is already populated with so many un-arranged memories..
my deep apologies to you sir...
Title: Re: Virtual Machine with DOS
Post by: Gunther on May 19, 2013, 04:02:39 AM
Hi Dubby,

there's really no need for apologies. It was my fault not to read the manual careful.

By the way, I've configured DOSBOX now for my needs. The PowerBASIC compiler works fine, several assemblers, too. The only thing is that some VESA modes doesn't work with my AMD Radeon 7570. That's a bit strange, because under a clean DOS (started from USB stick) they work properly. I think it's aproblem with Windows 7.

Gunther
Title: Re: Virtual Machine with DOS
Post by: MichaelW on May 19, 2013, 06:10:01 AM
Quote from: Gunther on May 18, 2013, 11:09:10 PM
your test programs are working fine under DOSBOX. They need a DPMI host. Is it for using the linear frame buffer or has it to do with the BASIC dialect?

FreeBASIC apps run in 32-bit protected mode. AFAIK for your original configuration Windows XP Mode would have provided a DPMI host as part of NTVDM. I didn't check DOSBox, but now that I have I find references to CWSDPMI working, and per Japheth his HDPMI has been tested with DOSBox (version >= 0.70).

http://www.japheth.de/HX/HDPMI.html


Title: Re: Virtual Machine with DOS
Post by: Gunther on May 19, 2013, 08:43:51 AM
Michael,

Quote from: MichaelW on May 19, 2013, 06:10:01 AM
FreeBASIC apps run in 32-bit protected mode.

that was the point. A DPMI host isn't a real problem; I've Sandmann's CWSDPMI which works fine under DOSBOX. I haven't tested Japheth's tool, but it'll work too.

Gunther