Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Which EntryPoint to use ?

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Hello,

To test my Win2K Bus Driver, I need my dummy Function Driver (based on the
DDK Toaster Function Driver sample) to continuously write some known values
to the memory-mapped Register Space of each of the "toaster" devices
periodically (maybe after a few milli-seconds interval or so). I want the
Function Driver to keep doing this indefinitely i.e. until it is
unloaded.

Which entry-point or routine can I do this in, since there is nothing to
trigger this (i.e. no user application or anything) ?

Any ideas how things like these are accomplished ?

Thanks much in advance!

Puja

Comments

  • OSR_Community_User-35OSR_Community_User-35 Member Posts: 154
    When the function driver loads (DriverEntry()), start your own system
    thread and return. In the new thread, run your test code as long as
    you like.

    -----------------------------------------------------------------------
    Dave Cox
    Hewlett-Packard Co.
    HPSO/SSMO (Santa Barbara)
    https://ecardfile.com/id/Dave+Cox


    -----Original Message-----
    From: [email protected] [mailto:[email protected]]
    Sent: Thursday, May 11, 2000 6:19 AM
    To: NT Developers Interest List
    Subject: [ntdev] Which EntryPoint to use ?


    Hello,

    To test my Win2K Bus Driver, I need my dummy Function Driver (based on the
    DDK Toaster Function Driver sample) to continuously write some known values
    to the memory-mapped Register Space of each of the "toaster" devices
    periodically (maybe after a few milli-seconds interval or so). I want the
    Function Driver to keep doing this indefinitely i.e. until it is
    unloaded.

    Which entry-point or routine can I do this in, since there is nothing to
    trigger this (i.e. no user application or anything) ?

    Any ideas how things like these are accomplished ?

    Thanks much in advance!

    Puja

    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Maybe use a system thread.

    > -----Original Message-----
    > From: [email protected]
    > [mailto:[email protected]]On Behalf Of [email protected]
    > Sent: Thursday, May 11, 2000 1:19 PM
    > To: NT Developers Interest List
    > Subject: [ntdev] Which EntryPoint to use ?
    >
    >
    > Hello,
    >
    > To test my Win2K Bus Driver, I need my dummy Function Driver
    > (based on the
    > DDK Toaster Function Driver sample) to continuously write some
    > known values
    > to the memory-mapped Register Space of each of the "toaster" devices
    > periodically (maybe after a few milli-seconds interval or so). I
    > want the
    > Function Driver to keep doing this indefinitely i.e. until it is
    > unloaded.
    >
    > Which entry-point or routine can I do this in, since there is nothing to
    > trigger this (i.e. no user application or anything) ?
    >
    > Any ideas how things like these are accomplished ?
    >
    > Thanks much in advance!
    >
    > Puja
    >
    > ---
    > You are currently subscribed to ntdev as: [email protected]
    > To unsubscribe send a blank email to $subst('Email.Unsub')
    >
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    May be I do not understand exactly what you need, and also have never worked
    on W2K, but here is my idea. I would start a driver thread
    PsCreateSystemThread(), and let it do all the stuff. Now there is no need to
    "trigger" any thing. You may also consider creating more than one thread,
    and blah blah...

    Shweta.

    Hello,

    To test my Win2K Bus Driver, I need my dummy Function Driver (based on the
    DDK Toaster Function Driver sample) to continuously write some known values
    to the memory-mapped Register Space of each of the "toaster" devices
    periodically (maybe after a few milli-seconds interval or so). I want the
    Function Driver to keep doing this indefinitely i.e. until it is
    unloaded.

    Which entry-point or routine can I do this in, since there is nothing to
    trigger this (i.e. no user application or anything) ?

    Any ideas how things like these are accomplished ?

    Thanks much in advance!

    Puja

    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')

    ______________________________________________
    FREE Personalized Email at Mail.com
    Sign up at http://www.mail.com/?sr=signup
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    1. Do I need to have one thread PER device (Max # devices on Bus = 8) ?

    Or

    Can I have just a SINGLE thread in my Function Driver which writes to
    the Register Spaces of all the Devices ? [Please see #3 below, as I'm not
    sure how this is possible]

    2. Which is better and why i.e. is it bad to have so many threads ??

    3. How can I pass the FDO of each device (as and when it appears in the
    system) to my thread (if I use the SINGLE thread approach) ?

    [Assuming I create a thread in my DriverEntry() routine, this thread would
    need to access the FDO of EACH device in order to write into its Register
    Space (because the BaseAddress of the device obtained from MmMapIoSpace()
    is stored in the FDO, when my driver gets IRP_MN_START_DEVICE)]

    Please advise.

    Thank you so much!
    Puja


    On 05/11/00, ""COX,DAVID (HP-Roseville,ex1)" " wrote:
    > When the function driver loads (DriverEntry()), start your own system
    > thread and return. In the new thread, run your test code as long as
    > you like.
    >
    > -----------------------------------------------------------------------
    > Dave Cox
    > Hewlett-Packard Co.
    > HPSO/SSMO (Santa Barbara)
    > https://ecardfile.com/id/Dave+Cox
    >
    >
    > -----Original Message-----
    > From: [email protected] [mailto:[email protected]]
    > Sent: Thursday, May 11, 2000 6:19 AM
    > To: NT Developers Interest List
    > Subject: [ntdev] Which EntryPoint to use ?
    >
    >
    > Hello,
    >
    > To test my Win2K Bus Driver, I need my dummy Function Driver (based on the
    > DDK Toaster Function Driver sample) to continuously write some known values
    > to the memory-mapped Register Space of each of the "toaster" devices
    > periodically (maybe after a few milli-seconds interval or so). I want the
    > Function Driver to keep doing this indefinitely i.e. until it is
    > unloaded.
    >
    > Which entry-point or routine can I do this in, since there is nothing to
    > trigger this (i.e. no user application or anything) ?
    >
    > Any ideas how things like these are accomplished ?
    >
    > Thanks much in advance!
    >
    > Puja
    >
    > ---
    > You are currently subscribed to ntdev as: [email protected]
    > To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_User-35OSR_Community_User-35 Member Posts: 154
    > Can I have just a SINGLE thread in my Function Driver which
    > writes to the Register Spaces of all the Devices ?

    System address space is shared by all threads (when they're running in
    kernel-mode), so you have lots of options. Simplest might be to have
    an array of 8 FDO pointers, initialized with NULLs. When your device
    "appears" put it in the next empty slot in the array. As your single
    thread loops, if a pointer in the array is non-NULL, it's a valid device
    to test.

    -----------------------------------------------------------------------
    Dave Cox
    Hewlett-Packard Co.
    HPSO/SSMO (Santa Barbara)
    https://ecardfile.com/id/Dave+Cox


    -----Original Message-----
    From: [email protected] [mailto:[email protected]]
    Sent: Thursday, May 11, 2000 7:37 AM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Which EntryPoint to use ?


    1. Do I need to have one thread PER device (Max # devices on Bus = 8) ?

    Or

    Can I have just a SINGLE thread in my Function Driver which writes to
    the Register Spaces of all the Devices ? [Please see #3 below, as I'm not
    sure how this is possible]

    2. Which is better and why i.e. is it bad to have so many threads ??

    3. How can I pass the FDO of each device (as and when it appears in the
    system) to my thread (if I use the SINGLE thread approach) ?

    [Assuming I create a thread in my DriverEntry() routine, this thread would
    need to access the FDO of EACH device in order to write into its Register
    Space (because the BaseAddress of the device obtained from MmMapIoSpace()
    is stored in the FDO, when my driver gets IRP_MN_START_DEVICE)]

    Please advise.

    Thank you so much!
    Puja


    On 05/11/00, ""COX,DAVID (HP-Roseville,ex1)" <[email protected]>" wrote:
    > When the function driver loads (DriverEntry()), start your own system
    > thread and return. In the new thread, run your test code as long as
    > you like.
    >
    > -----------------------------------------------------------------------
    > Dave Cox
    > Hewlett-Packard Co.
    > HPSO/SSMO (Santa Barbara)
    > https://ecardfile.com/id/Dave+Cox
    >
    >
    > -----Original Message-----
    > From: [email protected] [mailto:[email protected]]
    > Sent: Thursday, May 11, 2000 6:19 AM
    > To: NT Developers Interest List
    > Subject: [ntdev] Which EntryPoint to use ?
    >
    >
    > Hello,
    >
    > To test my Win2K Bus Driver, I need my dummy Function Driver (based on the
    > DDK Toaster Function Driver sample) to continuously write some known
    values
    > to the memory-mapped Register Space of each of the "toaster" devices
    > periodically (maybe after a few milli-seconds interval or so). I want the
    > Function Driver to keep doing this indefinitely i.e. until it is
    > unloaded.
    >
    > Which entry-point or routine can I do this in, since there is nothing to
    > trigger this (i.e. no user application or anything) ?
    >
    > Any ideas how things like these are accomplished ?
    >
    > Thanks much in advance!
    >
    > Puja
    >
    > ---
    > You are currently subscribed to ntdev as: [email protected]
    > To unsubscribe send a blank email to $subst('Email.Unsub')

    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 13-17 May 2024 Live, Online
Developing Minifilters 1-5 Apr 2024 Live, Online
Internals & Software Drivers 11-15 Mar 2024 Live, Online
Writing WDF Drivers 20-24 May 2024 Live, Online