kernel driver, beep

Hi ,

i was wondering if that was possible to make a system “bip” like the win32
beep() function , but in some kernel code .
i think there is a \Device\Beep , and i was thinking about sending a
MJ_WRITE to the device maybe but i found no doc so i’m not sure .
with the DeviceTree , it seems it supports DEVICE_CONTROL ?

Any help appreciated
thanks ,

RL .

First, why in the world would you want to do this? Remember a lot of
servers are run lights out, so no one will hear your beep. Also, nowadays
you can run headless or terminal server from a remote location and no one
will hear your beep.

But if you want to do this, for experimentation, look up HalMakeBeep on
Google. But please don’t use it in a production driver.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

“Launay Ronan” wrote in message news:xxxxx@ntdev…
> Hi ,
>
> i was wondering if that was possible to make a system “bip” like the win32
> beep() function , but in some kernel code .
> i think there is a \Device\Beep , and i was thinking about sending a
> MJ_WRITE to the device maybe but i found no doc so i’m not sure .
> with the DeviceTree , it seems it supports DEVICE_CONTROL ?
>
> Any help appreciated
> thanks ,
>
> RL .
>
>
>

Launay Ronan wrote:

Hi ,

i was wondering if that was possible to make a system “bip” like the win32
beep() function , but in some kernel code .
i think there is a \Device\Beep , and i was thinking about sending a
MJ_WRITE to the device maybe but i found no doc so i’m not sure .
with the DeviceTree , it seems it supports DEVICE_CONTROL ?

A “beep” is usually used to draw attention to some important user
interface. Since drivers don’t have user interface, I’m wondering what
you hope to accomplish with your beep.

Is this supposed to be, maybe, a debug progress indicator? You might
consider KdPrint and dbgview as an alternative.

For a quick-and-dirty visual progress indicator, you can embed the
virtual address of your frame buffer in the driver, and write a stream
of pixel values, as long as you remember to delete it before anyone
looks at your code.

Tim Roberts wrote:

For a quick-and-dirty visual progress indicator, you can embed the
virtual address of your frame buffer in the driver, and write a stream
of pixel values, as long as you remember to delete it before anyone
looks at your code.

LOL… That is one of THE most twisted ideas I’ve heard in a long time.
I love it. I can’t believe that it never occurred to me to do that :slight_smile:

Perhaps we should start a series of awards here on NTDEV: Best question
of the week, best answer of the week, sickest suggestion, etc.

Gosh, I like that idea, Tim… Sick, but just the ticket when you
really, really, need it.

P

ntddbeep.h
IOCTL_BEEP_SET

You need an actual speaker connected to your motherboard.

“Launay Ronan” wrote in message news:xxxxx@ntdev…
> Hi ,
>
> i was wondering if that was possible to make a system “bip” like the win32
> beep() function , but in some kernel code .
> i think there is a \Device\Beep , and i was thinking about sending a
> MJ_WRITE to the device maybe but i found no doc so i’m not sure .
> with the DeviceTree , it seems it supports DEVICE_CONTROL ?
>
> Any help appreciated
> thanks ,
>
> RL .
>
>
>

Peter Viscarola (OSR) wrote:

Tim Roberts wrote:

>
> For a quick-and-dirty visual progress indicator, you can embed the
> virtual address of your frame buffer in the driver, and write a
> stream of pixel values, as long as you remember to delete it before
> anyone looks at your code.
>

LOL… That is one of THE most twisted ideas I’ve heard in a long
time. I love it. I can’t believe that it never occurred to me to do
that :slight_smile:

Perhaps we should start a series of awards here on NTDEV: Best
question of the week, best answer of the week, sickest suggestion, etc.

Gosh, I like that idea, Tim… Sick, but just the ticket when you
really, really, need it.

(Sniff) That may be the nicest thing anyone has ever said to me.

Thank You !

RL.
“cristalink” a écrit dans le message de
news:xxxxx@ntdev…
> ntddbeep.h
> IOCTL_BEEP_SET
>
> You need an actual speaker connected to your motherboard.
>
> –
>
> “Launay Ronan” wrote in message news:xxxxx@ntdev…
> > Hi ,
> >
> > i was wondering if that was possible to make a system “bip” like the
win32
> > beep() function , but in some kernel code .
> > i think there is a \Device\Beep , and i was thinking about sending a
> > MJ_WRITE to the device maybe but i found no doc so i’m not sure .
> > with the DeviceTree , it seems it supports DEVICE_CONTROL ?
> >
> > Any help appreciated
> > thanks ,
> >
> > RL .
> >
> >
> >
>
>
>

xxxxx@lists.osr.com wrote on 02/21/2005 07:16:03 PM:

Tim Roberts wrote:
>
> For a quick-and-dirty visual progress indicator, you can embed the
> virtual address of your frame buffer in the driver, and write a stream
> of pixel values, as long as you remember to delete it before anyone
> looks at your code.
>

LOL… That is one of THE most twisted ideas I’ve heard in a long time.
I love it. I can’t believe that it never occurred to me to do that :slight_smile:

Perhaps we should start a series of awards here on NTDEV: Best question
of the week, best answer of the week, sickest suggestion, etc.

Gosh, I like that idea, Tim… Sick, but just the ticket when you
really, really, need it.

Just beware that the screen may not be represented in a linear pixel-format
if you have a fancy graphics card.


Mats

P

xxxxx@lists.osr.com wrote on 02/21/2005 07:16:03 PM:

Mats PETERSSON wrote:

Just beware that the screen may not be represented in a linear
pixel-format if you have a fancy graphics card.

In the bad old days, I wrote networked TSRs (well, DECnet anyway :-))
that wrote to video memory at b800(b8000?) to communicate messages to
the user. I have not done anything with video since then (and if you
know what a TSR is, you realize how long ago that was). Are you saying
that (writing to b8000) won’t work any more? I know it won’t be visible
if Windows is running, but this is while a driver is loading, no? I
think I missed the Original.

Just trying to find out how out-of-date my knowledge is,
Thanks,
ScottR

Well, I will point out on some systems you will crash! There doesn’t have
to be a video card at all these days in Windows with headless systems, but
unfortunately people seem to forget this.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

“Robins, Scott” wrote in message
news:xxxxx@ntdev…
xxxxx@lists.osr.com wrote on 02/21/2005 07:16:03 PM:

Mats PETERSSON wrote:
> Just beware that the screen may not be represented in a linear
pixel-format if you have a fancy graphics card.

In the bad old days, I wrote networked TSRs (well, DECnet anyway :-))
that wrote to video memory at b800(b8000?) to communicate messages to
the user. I have not done anything with video since then (and if you
know what a TSR is, you realize how long ago that was). Are you saying
that (writing to b8000) won’t work any more? I know it won’t be visible
if Windows is running, but this is while a driver is loading, no? I
think I missed the Original.

Just trying to find out how out-of-date my knowledge is,
Thanks,
ScottR

> xxxxx@lists.osr.com wrote on 02/21/2005 07:16:03 PM:

Mats PETERSSON wrote:
> Just beware that the screen may not be represented in a linear
pixel-format if you have a fancy graphics card.

In the bad old days, I wrote networked TSRs (well, DECnet anyway :-))
that wrote to video memory at b800(b8000?) to communicate messages to
the user. I have not done anything with video since then (and if you
know what a TSR is, you realize how long ago that was). Are you saying
that (writing to b8000) won’t work any more? I know it won’t be visible
if Windows is running, but this is while a driver is loading, no? I
think I missed the Original.

Yes, that would work, as long as the card is in VGA-text mode.

I was more commenting on the case where the graphics driver is active (the
previous post was talking about “drawing pixels”, so I took it to mean that
the driver was actually running in parallel with the display driver, rather
than BEFORE.

Our graphics cards do not necessarily store pixels in a linear format, even
on the display (it normally does, but it is possible that it DOESN’T), so
if you poke a byte/dword into a memory location at the beginning of the
screen, and just continue incrementing the address, it’s not necessarily
going to draw a line of pixels at the top edge of the screen.

Because graphics processors often work on “lumps of pixels”, it’s not
necessarily the best idea to address them in a straight linear fashion, and
we’ve got other ways to address the “lumps”.

[Oh and forget the idea that a 1200 pixel wide screen actually has a stride
of 1200 * pixel-size, it may be quite different].

But as long as it’s using the VGA driver, it will of course work like a VGA
card in backwards compatible mode.


Mats

Just trying to find out how out-of-date my knowledge is,
Thanks,
ScottR


Questions? First check the Kernel Driver FAQ at http://www.
osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

ForwardSourceID:NT0000D6FA