News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

VESA programming with PowerBASIC 3.5

Started by Gunther, August 13, 2013, 07:49:10 AM

Previous topic - Next topic

sinsi

Quote from: Gunther on August 14, 2013, 03:24:47 AM
Please, check my above answer for Andreas. Moreover, unreal mode will only work under plain DOS, not with emulations or virtual machines. No Host OS can allow any Guest to manipulate CR0 directly. This could compromise the system security.
I use bochs/VMware/virtualpc to test my hobby OS which switches to 64-bit mode - it's an emulation, kept isolated from the host OS.
If what you say is true then how can I run a virtual XP machine?

Antariy

Hi Gunther :t

Quote from: Gunther on August 14, 2013, 03:27:01 AM
a lot of modes available with your graphics adaptor. Can you set every mode? Thanks for testing.  :t

Some of the may be set, but unsupported by my display, so I cannot see the results (display is "out of range"), but the code obviously works, because after pressing a key and changement the resolution to a standard textual, it shows the timing results.

japheth

Quote from: sinsi on August 14, 2013, 09:56:53 AM
Quote from: Gunther on August 14, 2013, 03:24:47 AM
Please, check my above answer for Andreas. Moreover, unreal mode will only work under plain DOS, not with emulations or virtual machines. No Host OS can allow any Guest to manipulate CR0 directly. This could compromise the system security.
I use bochs/VMware/virtualpc to test my hobby OS which switches to 64-bit mode - it's an emulation, kept isolated from the host OS.
If what you say is true then how can I run a virtual XP machine?

Emulating unreal-mode seems fairly easy. I'd say it's easier to emulate unreal-mode than to reject it ( which is necessary for a proper emulation of v86-mode ).

Gunther

Hi sinsi,

Quote from: sinsi on August 14, 2013, 09:56:53 AM
I use bochs/VMware/virtualpc to test my hobby OS which switches to 64-bit mode - it's an emulation, kept isolated from the host OS.
If what you say is true then how can I run a virtual XP machine?

but it's an emulation, with emulated hardware (CPU, graphics adaptor etc.) The boss of the entire circus is your host OS. For example: DOSBox emulates a S3 Trio64 card. But I haven't such card installed. If you would write for instance:

         mov       cr0, eax

is that the real, physical CR0 of your processor?

Gunther
You have to know the facts before you can distort them.

FORTRANS

Quote from: Gunther on August 14, 2013, 03:24:47 AM
Steve,

Quote from: FORTRANS on August 13, 2013, 11:55:10 PM
Hi,

   Tested on four computers.  If it supports VESA in a DOS like
environment, your program works nicely.  One laptop had
a corrupted desktop after leaving the NTVDM with Windows XP.
The other Windows XP laptop had no such problem, but I invoked
your program a bit differently.  I can test again if you want.
Two old OS/2 VDM's worked well.  Windows 2000 (dual boot)
does not support VESA for DOS programs.

Regards,

Steve N.

that would be nice. You have an OS/2 box running?

Hi Gunther,

   More than one, but only one that gets daily use.  Just as I have
more than one Windows computer, but only one gets used consistently.
It is a dual boot box that died a bit less than older and newer ones.
It is showing symptoms though, so I may have to upgrade sometime.

   Anyway I retested everything and did a screen grab for each.
Threw in a real DOS session as well.  The corrupted desktop can be
done with other graphics programs, such as the mode 13H demos
I posted recently.  So it has nothing to do with your program per se.
But it does not occur with the other Windows XP laptop with similar
graphics.  And I found that Windows XP does not really like the screen
grabber TSR I used.

   The laptops supported all the modes you prompted for, up to
the native resolution of their screens.  The desktop monitor failed
with the highest resolution mode, but the video card seemed to
be happy.

HTH,

Steve N.


Laptop 800 CS OS/2 VDM

VESA BIOS 1.2
MagicGraph NM2070 40K SVGA BIOS
Installed Video Frame Buffer = 786432 Bytes = 768 KB = .75 MB

VESA Modes available:
---------------------

100           101           10D           10E           110
111           102           103

Please, press any key to continue ...
Possible 256 color VESA Modes:
==============================

Mode Nr.:   X resoltion    Y resolution     Number
100h        640            400              1
101h        640            480              2
103h        800            600              8

Please enter the appropriate number:

The VESA Mode number was: 100h
The resolution was:  640 x 400 Pixel

Elepsedv Time: 8.73656 Seconds

The VESA Mode number was: 101h
The resolution was:  640 x 480 Pixel

Elepsedv Time: 13.73474 Seconds

The VESA Mode number was: 103h
The resolution was:  800 x 600 Pixel

Elepsedv Time: 18.34781 Seconds
------------------------------------
Laptop 800 CS MS-DOS 6.22

VESA BIOS 1.2
MagicGraph NM2070 40K SVGA BIOS
Installed Video Frame Buffer = 786432 Bytes = 768 KB = .75 MB

VESA Modes available:
---------------------

100           101           10D           10E           110
111           102           103

Please, press any key to continue ...
Possible 256 color VESA Modes:
==============================

Mode Nr.:   X resoltion    Y resolution     Number
100h        640            400              1
101h        640            480              2
103h        800            600              8

Please enter the appropriate number:

The VESA Mode number was: 100h
The resolution was:  640 x 400 Pixel

Elepsedv Time: 8.566525 Seconds

The VESA Mode number was: 101h
The resolution was:  640 x 480 Pixel

Elepsedv Time: 10.32335 Seconds

The VESA Mode number was: 103h
The resolution was:  800 x 600 Pixel

Elepsedv Time: 16.09191 Seconds
--------------------------------------
Laptop U101 Windows XP (This is the one that gets corrupted.)

VESA BIOS 2.0
ATI MOBILITY RADEON
Installed Video Frame Buffer = 16777216 Bytes = 16384 KB = 16 MB

VESA Modes available:
---------------------

182           10D           10E           10F           120
192           193           194           195           196
1A2           1A3           1A4           1A5           1A6
1B2           1B3           1B4           1B5           1B6
1C2           1C3           1C4           1C5           1C6
100           183           184           185           186
101           110           111           112           121
103           113           114           115           122
105           116           117           118           123
107           119           11A           11B           124
140           141           142           143           144
172           173           174           175           176


Please, press any key to continue ...
Possible 256 color VESA Modes:
==============================

Mode Nr.:   X resoltion    Y resolution     Number
182h        320            200              1
192h        320            240              6
1A2h        400            300              11
1B2h        512            384              16
1C2h        640            350              21
100h        640            400              26
101h        640            480              31
103h        800            600              36
105h        1024           768              41
107h        1280           1024             46
140h        1400           1050             51
172h        1600           1200             56

Please enter the appropriate number:

The VESA Mode number was: 182h
The resolution was:  320 x 200 Pixel

Elepsedv Time: 1.314928 Seconds

The VESA Mode number was: 192h
The resolution was:  320 x 240 Pixel

Elepsedv Time: 1.536334 Seconds

The VESA Mode number was: 1A2h
The resolution was:  400 x 300 Pixel

Elepsedv Time: 2.360265 Seconds

The VESA Mode number was: 1B2h
The resolution was:  512 x 384 Pixel

Elepsedv Time: 3.957798 Seconds

The VESA Mode number was: 1C2h
The resolution was:  640 x 350 Pixel

Elepsedv Time: 4.56064 Seconds

The VESA Mode number was: 100h
The resolution was:  640 x 400 Pixel

Elepsedv Time: 5.162664 Seconds

The VESA Mode number was: 101h
The resolution was:  640 x 480 Pixel

Elepsedv Time: 6.204672 Seconds

The VESA Mode number was: 103h
The resolution was:  800 x 600 Pixel

Elepsedv Time: 9.613981 Seconds

The VESA Mode number was: 105h
The resolution was:  1024 x 768 Pixel

Elepsedv Time: 15.70577 Seconds

VESA mode setting failed.
Please try another mode.
Program ends now.
-----------------------------------------
Laptop T41 Windows XP

VESA BIOS 2.0
ATI MOBILITY RADEON 7500
Installed Video Frame Buffer = 33488896 Bytes = 32704 KB = 31.9375 MB

VESA Modes available:
---------------------

182           10D           10E           10F           120
192           193           194           195           196
1A2           1A3           1A4           1A5           1A6
1B2           1B3           1B4           1B5           1B6
1C2           1C3           1C4           1C5           1C6
100           183           184           185           186
101           110           111           112           121
103           113           114           115           122
105           116           117           118           123
107           119           11A           11B           124
140           141           142           143           144
172           173           174           175           176


Please, press any key to continue ...
Possible 256 color VESA Modes:
==============================

Mode Nr.:   X resoltion    Y resolution     Number
182h        320            200              1
192h        320            240              6
1A2h        400            300              11
1B2h        512            384              16
1C2h        640            350              21
100h        640            400              26
101h        640            480              31
103h        800            600              36
105h        1024           768              41
107h        1280           1024             46
140h        1400           1050             51
172h        1600           1200             56

Please enter the appropriate number:

The VESA Mode number was: 182h
The resolution was:  320 x 200 Pixel

Elepsedv Time: 1.485465 Seconds

The VESA Mode number was: 192h
The resolution was:  320 x 240 Pixel

Elepsedv Time: 1.757316 Seconds

The VESA Mode number was: 1A2h
The resolution was:  400 x 300 Pixel

Elepsedv Time: 2.748622 Seconds

The VESA Mode number was: 1B2h
The resolution was:  512 x 384 Pixel

Elepsedv Time: 4.501596 Seconds

The VESA Mode number was: 1C2h
The resolution was:  640 x 350 Pixel

Elepsedv Time: 5.107285 Seconds

The VESA Mode number was: 100h
The resolution was:  640 x 400 Pixel

Elepsedv Time: 5.823618 Seconds

The VESA Mode number was: 101h
The resolution was:  640 x 480 Pixel

Elepsedv Time: 7.032132 Seconds

The VESA Mode number was: 103h
The resolution was:  800 x 600 Pixel

Elepsedv Time: 10.98466 Seconds

The VESA Mode number was: 105h
The resolution was:  1024 x 768 Pixel

Elepsedv Time: 17.90829 Seconds

VESA mode setting failed.
Please try another mode.
Program ends now.
---------------------------------------------
Desktop OS.2 VDM (With a TSR for more modes).

VESA BIOS 2.0
Matrox Graphics Inc.
Installed Video Frame Buffer = 33554432 Bytes = 32768 KB = 32 MB

VESA Modes available:
---------------------

100           101           102           103           105
107           108           109           10A           10B
10C           110           111           112           113
114           115           116           117           118
119           11A           11B           11C           11D
11E

Please, press any key to continue ...
Possible 256 color VESA Modes:
==============================

Mode Nr.:   X resoltion    Y resolution     Number
100h        640            400              1
101h        640            480              2
103h        800            600              4
105h        1024           768              5
107h        1280           1024             6
11Ch        1600           1200             24

Please enter the appropriate number:

The VESA Mode number was: 100h
The resolution was:  640 x 400 Pixel

Elepsedv Time: .4945058 Seconds

The VESA Mode number was: 101h
The resolution was:  640 x 480 Pixel

Elepsedv Time: .5494761 Seconds

The VESA Mode number was: 103h
The resolution was:  800 x 600 Pixel

Elepsedv Time: .9341547 Seconds

The VESA Mode number was: 105h
The resolution was:  1024 x 768 Pixel

Elepsedv Time: 1.538323 Seconds

The VESA Mode number was: 107h
The resolution was:  1280 x 1024 Pixel

Elepsedv Time: 2.526 Seconds

The VESA Mode number was: 11Ch
The resolution was:  1600 x 1200 Pixel

Elepsedv Time: 3.680719 Seconds

(No display, out of range for monitor.)
------------------------------------------------
Desktop Windows 2000

VESA BIOS 2.0
Matrox Graphics Inc.
Installed Video Frame Buffer = 33554432 Bytes = 32768 KB = 32 MB

VESA Modes available:
---------------------

100           101           102           103           110
111           112           113           114           115
10A

Please, press any key to continue ...
Possible 256 color VESA Modes:
==============================

Mode Nr.:   X resoltion    Y resolution     Number
100h        640            400              1
101h        640            480              2
103h        800            600              4

Please enter the appropriate number: 1

Function not supported.
Please try another mode.
Program ends now.

Gunther

Hi Steve,

a very special thank you for your test effort.  :t Enough material to analyze. Great job.

Gunther
You have to know the facts before you can distort them.

HSE

Hi Gunther!

Diamonds never die!

Very nice program (not so easy to understand in a minute, I have to say  :biggrin: )

Program show that virtual machine in the phone can emulate 256 colors 1280x1024 pixels, amazing  :thumbsup:

(I was thinking 640x480 was the limit)

Thanks, HSE.
Equations in Assembly: SmplMath

Gunther

HSE,

thanks for your reply to this old thread.
Quote from: HSE on September 08, 2023, 09:43:03 AMDiamonds never die!
Now you're exaggerating.

Quote from: HSE on September 08, 2023, 09:43:03 AMVery nice program (not so easy to understand in a minute, I have to say  :biggrin: )
It uses the Bank Switching algorithm (not very elegant), which should work with any reasonably common
VESA card.

Quote from: HSE on September 08, 2023, 09:43:03 AMProgram show that virtual machine in the phone can emulate 256 colors 1280x1024 pixels, amazing  :thumbsup:
That's indeed amazing.

Quote from: HSE on September 08, 2023, 09:43:03 AM(I was thinking 640x480 was the limit)
But with 16 colors. That would have been my guess. As I said before, truly amazing.
You have to know the facts before you can distort them.