How can I call the BIOS interrupt in WDM?

From: Alcone Wu

Hi, Experts,

There some functions can do it in VXD.
Exec_VxD_Int or Exec_Int
But how can I call a bios interrupt in my new WDM driver?
INT 10H, or INT 13H and other interrupt.

Thanks very much!


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Video drivers can use the video bios support. See the ddk under ‘video’.
Otherwise the use of legacy bios interfaces is hugely discouraged.

-----Original Message-----
From: xxxxx@knotes.kodak.com [mailto:xxxxx@knotes.kodak.com]
Sent: Friday, October 26, 2001 12:29 AM
To: NT Developers Interest List
Subject: [ntdev] How can I call the BIOS interrupt in WDM?

From: Alcone Wu

Hi, Experts,

There some functions can do it in VXD.
Exec_VxD_Int or Exec_Int
But how can I call a bios interrupt in my new WDM driver?
INT 10H, or INT 13H and other interrupt.

Thanks very much!


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Alcone,

Why would you want to access Bios code from a display driver ? In fact, why
would you need a wdm driver in graphicsland ? Are you trying to migrate VDD
functionality into a display driver ? If you give more information, I may be
able to give a suggestion or two.

Alberto.

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Friday, October 26, 2001 8:22 AM
To: NT Developers Interest List
Subject: [ntdev] RE: How can I call the BIOS interrupt in WDM?

Video drivers can use the video bios support. See the ddk under ‘video’.
Otherwise the use of legacy bios interfaces is hugely discouraged.

-----Original Message-----
From: xxxxx@knotes.kodak.com [mailto:xxxxx@knotes.kodak.com]
Sent: Friday, October 26, 2001 12:29 AM
To: NT Developers Interest List
Subject: [ntdev] How can I call the BIOS interrupt in WDM?

From: Alcone Wu

Hi, Experts,

There some functions can do it in VXD.
Exec_VxD_Int or Exec_Int
But how can I call a bios interrupt in my new WDM driver?
INT 10H, or INT 13H and other interrupt.

Thanks very much!


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> But how can I call a bios interrupt in my new WDM driver?

INT 10H, or INT 13H and other interrupt.

Forget about int13 forever. No int13 in NT OSes. Use the OS’s disk stack instead.
As about int10h - you can do this from your videocard driver, use VideoPortInt10.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> Why would you want to access Bios code from a display driver ?

For switching modes or power management purposes.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

From: Alcone Wu

Thanks all,

What really I want to do is(Win2K):
I my driver’s initialization (“i.e DriverEntry”), I want to display some
information on the screen(text mode or graph mode),
just like soft-ice(“press ESC to escape load softice…”), and I also want
to wait the user’s input, if the user press “ESC” key,
I will not load the driver.
So, I want to use INT10 to show some information, but I can’t use it, maybe
because it’s in real-mode. So I can change to write the
screen buffer, it work fine, but how can I get the key-press information, I
also can’t use INT16, Is it means I should read information
form some ports or get from some keyboard buffer?
Now, why i want to use INT13;
Because I want to write some physical-sectors directly, then mark these
sectors to error-sector,
at next time, I will want to read information from these “error sectors”.

So question is:
1.Is these other method to display text on the screen?
2 .how to get key-press at WDM driver?
3. how to read/write/mark physical-sectors at WDM driver?

That’s all,

Thanks everybody!

“Moreira, Alberto” @lists.osr.com on
2001-10-26 21:14:28

Please respond to “NT Developers Interest List”

Sent by: xxxxx@lists.osr.com

To: “NT Developers Interest List”
cc:
Subject: [ntdev] RE: How can I call the BIOS interrupt in WDM?

Alcone,

Why would you want to access Bios code from a display driver ? In fact, why
would you need a wdm driver in graphicsland ? Are you trying to migrate VDD
functionality into a display driver ? If you give more information, I may
be
able to give a suggestion or two.

Alberto.

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Friday, October 26, 2001 8:22 AM
To: NT Developers Interest List
Subject: [ntdev] RE: How can I call the BIOS interrupt in WDM?

Video drivers can use the video bios support. See the ddk under ‘video’.
Otherwise the use of legacy bios interfaces is hugely discouraged.

-----Original Message-----
From: xxxxx@knotes.kodak.com [mailto:xxxxx@knotes.kodak.com]
Sent: Friday, October 26, 2001 12:29 AM
To: NT Developers Interest List
Subject: [ntdev] How can I call the BIOS interrupt in WDM?

From: Alcone Wu

Hi, Experts,

There some functions can do it in VXD.
Exec_VxD_Int or Exec_Int
But how can I call a bios interrupt in my new WDM driver?
INT 10H, or INT 13H and other interrupt.

Thanks very much!


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@knotes.kodak.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> So, I want to use INT10 to show some information, but I can’t use it, maybe

because it’s in real-mode.

Forget about this, use HalDisplayString or ZwDisplayString.

int10 can be used only by your video miniport (.SYS) to switch modes and do power management. Use VideoPortInt10 for this.

also can’t use INT16, Is it means I should read information

Forget about int16 at all. It cannot be used after NT was loaded.
Use ZwCreateFile on keyboard and then ZwReadFile for it. Note that you can do this only before the Windows GUI is loaded.

Now, why i want to use INT13;

You just cannot use int13 from NT kernel mode. You can use int10 with lots of limitations, but not int13 for sure due to lots of
reasons.
Forget about this.

Because I want to write some physical-sectors directly

Open \Device\Harddisk%d\Partition0 and write there.

, then mark these
sectors to error-sector,

This is done in filesystem-dependent-way.

1.Is these other method to display text on the screen?

ZwDisplayString/HalDisplayString.

2 .how to get key-press at WDM driver?

ZwCreateFile on keyboard and then ZwReadFile. You can do this only BEFORE the Windows GUI is loaded.

  1. how to read/write/mark physical-sectors at WDM driver?

What do you mean by “mark”? “Mark as a bad” is a filesystem notion and not the disk stack notion.
As about read/write - open \Device\Harddisk%d\Partition0 and do this.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

From: Alcone Wu

Thanks Max!

  1. Are you sure HalDisplayString or ZwDisplayString can display a string
    before GUI loaded under Win2000?
    I have tested it, I found it only can show on blue screen under NT4.X
    before GUI initialized, and nothing under Win2000.
    2.>>Note that you can do this only before the Windows GUI is loaded.
    Thanks very much! I will try it, but why can’t do this after GUI
    loaded?
    3.If I opened \Device\Harddisk%d\Partition0 with ZwCreateFile, Is it means
    I can use ZwReadFile(…) to read the physical-sector?
    How to mark the sector as bad-sector, so other programs will not use the
    sector and will not overwrite the data, but i can still read datas from
    this “bad-sector”?

BRs,
Alcone.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

>>How to mark the sector as bad-sector, so other programs will not use
the sector and will not overwrite the data, but i can still read datas
from this “bad-sector”?<<

Requires extensive knowledge of the file systems.

BRs,
Alcone.


You are currently subscribed to ntdev as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> I have tested it, I found it only can show on blue screen under NT4.X

before GUI initialized, and nothing under Win2000.

Maybe in w2k there are no ways of doing this.

3.If I opened \Device\Harddisk%d\Partition0 with ZwCreateFile, Is it means
I can use ZwReadFile(…) to read the physical-sector?

Yes.

How to mark the sector as bad-sector

Will ATA or SCSI interface provide this functionality?
If not - then sorry, it is impossible, the filesystem will not provide it either.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com