How to know the current Video Mode??

Hi gurus,

I want to know the current video mode in my driver, I only want to
distinguish the Graphics Mode or the Text Mode.
I have tested in several method, but all failed!
mov dx, 0x03CE
mov al, 6
out dx, al
mov dx, 0x03CF
in al, dx
and al, 0x1 ;if al & 0x01, it’s in graphics mode,
otherwise text mode.

but it’s not always right, for some card after we switch to full screen
text mode(eg.a dos command prompt),
the above check will be failed, it always said it’s text mode even if we
have back to graphics mode.

please help!

You cannot access the video ports. They are owned by the video driver and any interference with it, will produce random problems.

----- Original Message -----
From: xxxxx@kodak.com
To: NT Developers Interest List
Sent: Thursday, October 31, 2002 8:32 PM
Subject: [ntdev] How to know the current Video Mode??

Hi gurus,

I want to know the current video mode in my driver, I only want to distinguish the Graphics Mode or the Text Mode.
I have tested in several method, but all failed!
mov dx, 0x03CE
mov al, 6
out dx, al
mov dx, 0x03CF
in al, dx
and al, 0x1 ;if al & 0x01, it’s in graphics mode, otherwise text mode.

but it’s not always right, for some card after we switch to full screen text mode(eg.a dos command prompt),
the above check will be failed, it always said it’s text mode even if we have back to graphics mode.

please help! — You are currently subscribed to ntdev as: xxxxx@yoshimuni.com To unsubscribe send a blank email to %%email.unsub%%

But I only read it, no write, for a majority of Video Card, it seems can
return correct information.

Thanks for your reply!

If the video card happens to be VESA 1.0 or 2.0 compatible, you are sort of
lucky. However, video hardware designer could chose not support VESA 1.0/2.0
after its miniport driver is initialized and set it into proper graphics
mode and make your register reading meaningless.

Why are you trying to achieve? Are you trying to display something, such as
your Kodak logo or Koda supplied ads, during the Windows OS boot stage? I
consider that is a no no. I just want my PC boot to desktop as fast as
possible, no logo or ads allowed. If you do something like that, you will
piss your customers in a big way.

Bi

-----Original Message-----
From: xxxxx@kodak.com [mailto:xxxxx@kodak.com]
Sent: Thursday, October 31, 2002 6:54 PM
To: NT Developers Interest List
Subject: [ntdev] Re: How to know the current Video Mode??

But I only read it, no write, for a majority of Video Card, it seems can
return correct information.

Thanks for your reply! — You are currently subscribed to ntdev as:
xxxxx@appstream.com To unsubscribe send a blank email to
%%email.unsub%%

Hi Bi Chen,

Thank you for your reply.
I’m not want to display a logo or other things. I only study to do a
kernel mode debugger, It just like
SoftICE, When my keyboard filter driver receive the HOT key, I should
check the current video mode,
If it is Graphics mode, then I should show the popup debug console with
one method, if it’s text mode,
I should show the popup console in another way. That what I’m doing, have
nothing to do with my job, only
for studing. I don’t familiar video/mini driver, so , can you tell me how
to get the video mode in normal/other way.

Thank you.

Look into DDK display driver miniport spec. There are some ioctls you can
send to video port driver to query display mode. However, that mode is only
for different graphics mode, not text mode. I don’t know how Numega did with
their video driver. I assume they use DD interface for nonVGA display.

Bi

-----Original Message-----
From: xxxxx@kodak.com [mailto:xxxxx@kodak.com]
Sent: Thursday, October 31, 2002 9:07 PM
To: NT Developers Interest List
Subject: [ntdev] Re: How to know the current Video Mode??

Hi Bi Chen,

Thank you for your reply.
I’m not want to display a logo or other things. I only study to do a kernel
mode debugger, It just like
SoftICE, When my keyboard filter driver receive the HOT key, I should check
the current video mode,
If it is Graphics mode, then I should show the popup debug console with one
method, if it’s text mode,
I should show the popup console in another way. That what I’m doing, have
nothing to do with my job, only
for studing. I don’t familiar video/mini driver, so , can you tell me how to
get the video mode in normal/other way.

Thank you. — You are currently subscribed to ntdev as: xxxxx@appstream.com
To unsubscribe send a blank email to %%email.unsub%%

Since you will need some kind of video drivers (like SoftICE has) for your product anyway, then go the card-dependent way.
One of the simpliest drivers must be “VESA VGA”, which must really access the ports as under DOS, but sorry, it is not guaranteed to be runnable on all graphics cards.

Max

----- Original Message -----
From: xxxxx@kodak.com
To: NT Developers Interest List
Sent: Friday, November 01, 2002 8:07 AM
Subject: [ntdev] Re: How to know the current Video Mode??

Hi Bi Chen,

Thank you for your reply.
I’m not want to display a logo or other things. I only study to do a kernel mode debugger, It just like
SoftICE, When my keyboard filter driver receive the HOT key, I should check the current video mode,
If it is Graphics mode, then I should show the popup debug console with one method, if it’s text mode,
I should show the popup console in another way. That what I’m doing, have nothing to do with my job, only
for studing. I don’t familiar video/mini driver, so , can you tell me how to get the video mode in normal/other way.

Thank you. — You are currently subscribed to ntdev as: xxxxx@storagecraft.com To unsubscribe send a blank email to %%email.unsub%%

Thanks experts!

Actually, I do use IOCTL_VIDEO_QUERY_CURRENT_MODE to get some informations
of current Video Card.
but it seems only available under graphics mode:O(
For the full screen text mode application, it seems the system use
fsvga.sys, is there any one can tell me
how to hook the fsvag.sys?

Thanks again.