Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: how to start making windows drivers?  (Read 7856 times)

0 Members and 1 Guest are viewing this topic.

san_crazy

    Topic Starter


    Intermediate

    how to start making windows drivers?
    « on: October 03, 2008, 10:18:30 AM »
    I am about to develop drivers for windows as i have to make a project on that.

    I have gone through the resources available at msdn library, but I am still not getting how can I do practice on making those.
    what software I should install , is that WDK or anything else?
    and after installing where should i start from?

    regards
    san

    patio

    • Moderator


    • Genius
    • Maud' Dib
    • Thanked: 1769
      • Yes
    • Experience: Beginner
    • OS: Windows 7
    Re: how to start making windows drivers?
    « Reply #1 on: October 03, 2008, 05:07:12 PM »
    You are going to start writing device drivers for Windows ? ?
    What devices ?
    How much time do you have ? ?
    What programming languages are you fluent in ?
    Will you be paid for this work ? ?
    " Anyone who goes to a psychiatrist should have his head examined. "

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: how to start making windows drivers?
    « Reply #2 on: October 03, 2008, 05:46:39 PM »
    Windows DDK.
    I was trying to dereference Null Pointers before it was cool.

    san_crazy

      Topic Starter


      Intermediate

      Re: how to start making windows drivers?
      « Reply #3 on: October 04, 2008, 04:48:26 AM »
      You are going to start writing device drivers for Windows ? ?
      What devices ?
      How much time do you have ? ?
      What programming languages are you fluent in ?
      Will you be paid for this work ? ?

      yes, for windows

      any device like keyboard, mouse, adapters, video cards, sound cards, usb  ports, HDD ....etc. by the way, which device will be best to start from?

      I have enough time around 6 months.

      I want to make these in C and also C++ if required.

      no I will not be paid. I am making these as my major project

      Aegis



        Expert

        Thanked: 67
        • Yes
        • Yes
        • Brian's Mess Of A Web Page
      • Experience: Experienced
      • OS: Windows 10
      Re: how to start making windows drivers?
      « Reply #4 on: October 04, 2008, 04:56:57 AM »
      Your major project?  As in thesis work?  Have you discussed this with your thesis adviser?   :o

      I'd start by trying to find some open-source drivers, so you can see the kind of coding that goes into something like this.

      Be very careful not to "reverse engineer" your drivers from existing driver software.  It is not well liked, and could lead to legal problems for you.

      I would think that in order to write drivers for Windows, you'd need to be familiar with at least some aspects of the Windows kernel.

      Have you been in touch with, or spoken to, anyone who writes driver software?

      It seems like you know a couple of languages.  How many lines is the largest program you've written, so far?
      « Last Edit: October 04, 2008, 05:07:56 AM by Aegis »


      "For you, a thousand times over." - "The Kite Runner"

      san_crazy

        Topic Starter


        Intermediate

        Re: how to start making windows drivers?
        « Reply #5 on: October 04, 2008, 05:47:00 AM »
        well, I had written around 1000 lines of code to complete a project in C using structures and pointers.

        BC_Programmer


          Mastermind
        • Typing is no substitute for thinking.
        • Thanked: 1140
          • Yes
          • Yes
          • BC-Programming.com
        • Certifications: List
        • Computer: Specs
        • Experience: Beginner
        • OS: Windows 11
        Re: how to start making windows drivers?
        « Reply #6 on: October 04, 2008, 09:41:52 AM »
        well, I had written around 1000 lines of code to complete a project in C using structures and pointers.

        1000 lines is about the number of lines it takes to make a Windows Program that does nothing but show a window...

        alright- any experience with the Windows API? or IRPs or PTEs? Or IRQLs? Ring 0 and Ring 2? VTables? User Mode Vs Kernel Mode?


        Also, you won't be able to debug it- Drivers will Blue Screen if they cause an error.
        I was trying to dereference Null Pointers before it was cool.

        Aegis



          Expert

          Thanked: 67
          • Yes
          • Yes
          • Brian's Mess Of A Web Page
        • Experience: Experienced
        • OS: Windows 10
        Re: how to start making windows drivers?
        « Reply #7 on: October 04, 2008, 11:29:20 AM »
        Don't get me wrong, san -- I admire that you want to do this!  I, too, would like to write open-source drivers, and hardly know where to start, because I haven't programmed anything for about 25 years.

        It seems like BC Programmer knows more specifics about the Windows environment than me -- I just have general knowledge.

        I just don't want you to get two or three months into this thing, and find out you're in way too deep, with no real resources to help you out.


        "For you, a thousand times over." - "The Kite Runner"

        san_crazy

          Topic Starter


          Intermediate

          Re: how to start making windows drivers?
          « Reply #8 on: October 04, 2008, 11:59:57 AM »


          alright- any experience with the Windows API? or IRPs or PTEs? Or IRQLs? Ring 0 and Ring 2? VTables? User Mode Vs Kernel Mode?


          Also, you won't be able to debug it- Drivers will Blue Screen if they cause an error.

          i dont know either of this, well you better tell me what are the things in C i should give the emphasis on most to start off my work.  and after then what else I should go for?


          BC_Programmer


            Mastermind
          • Typing is no substitute for thinking.
          • Thanked: 1140
            • Yes
            • Yes
            • BC-Programming.com
          • Certifications: List
          • Computer: Specs
          • Experience: Beginner
          • OS: Windows 11
          Re: how to start making windows drivers?
          « Reply #9 on: October 04, 2008, 05:23:30 PM »
          The DDK. I've already said this. You'll need to download the DDK- and, if you don't have it, the SDK.

          You'll need to essentially learn the Windows API and the Driver Development Kit, both of which could take a VERY long time.

          There are a few technical articles on MSDN that discuss drivers, but they are fairly limited- most of the knowledge about developing drivers likely lies with the hardware vendors that have been doing it for years.

          Developing drivers for windows is probably one of the most difficult things you can do- you need an intimate understanding of the windows kernel and how drivers in Ring 0 communicate with User mode application and vice versa.


          which C compiler are you using?
          I was trying to dereference Null Pointers before it was cool.

          san_crazy

            Topic Starter


            Intermediate

            Re: how to start making windows drivers?
            « Reply #10 on: October 05, 2008, 01:44:30 PM »
            turbo c (tcc)

            would you suggest such forums where most of the vendors come online?

            BC_Programmer


              Mastermind
            • Typing is no substitute for thinking.
            • Thanked: 1140
              • Yes
              • Yes
              • BC-Programming.com
            • Certifications: List
            • Computer: Specs
            • Experience: Beginner
            • OS: Windows 11
            Re: how to start making windows drivers?
            « Reply #11 on: October 05, 2008, 06:51:41 PM »
            turbo c- NOT happening. You can't compile win32 programs with Turbo C, AFAIK.
            I was trying to dereference Null Pointers before it was cool.

            san_crazy

              Topic Starter


              Intermediate

              Re: how to start making windows drivers?
              « Reply #12 on: October 05, 2008, 11:35:03 PM »
              then which compiler I should use?

              well, by now   I have downloaded set up files of microsoft DDK SP1 and microsoft virtual PC to work upon but there is a problem installing DDK SP1.
              at the microsoft site where I downloaded the ISO file from, instruction is there to burn the ISO file to a CD or DVD and then install it. I am doing as i have been instructed but after burning the ISO file on CD when I try to install it, it is not getting run however I have been rather asked for the application on which it would be run.
              do you have some idea about this issue?

              and what about the help forums?
              « Last Edit: October 06, 2008, 12:19:22 AM by san_crazy »

              BC_Programmer


                Mastermind
              • Typing is no substitute for thinking.
              • Thanked: 1140
                • Yes
                • Yes
                • BC-Programming.com
              • Certifications: List
              • Computer: Specs
              • Experience: Beginner
              • OS: Windows 11
              Re: how to start making windows drivers?
              « Reply #13 on: October 06, 2008, 09:43:37 AM »
              Compiler to use would likely be the Microsoft compiler- for C/C++, it's really the only compiler that can generate code that will work for a driver...


              is the installer an MSI file?
              I was trying to dereference Null Pointers before it was cool.

              san_crazy

                Topic Starter


                Intermediate

                Re: how to start making windows drivers?
                « Reply #14 on: October 06, 2008, 12:41:34 PM »
                its not an MSI file.  its just an ISO file
                here it is

                http://www.microsoft.com/whdc/devtools/ddk/default.mspx

                BC_Programmer


                  Mastermind
                • Typing is no substitute for thinking.
                • Thanked: 1140
                  • Yes
                  • Yes
                  • BC-Programming.com
                • Certifications: List
                • Computer: Specs
                • Experience: Beginner
                • OS: Windows 11
                Re: how to start making windows drivers?
                « Reply #15 on: October 06, 2008, 05:41:33 PM »
                you need to burn the ISO file using a CD mastering program. I recommend IMGBurn- a google search should give you a download link for it.
                I was trying to dereference Null Pointers before it was cool.

                san_crazy

                  Topic Starter


                  Intermediate

                  Re: how to start making windows drivers?
                  « Reply #16 on: October 06, 2008, 10:09:10 PM »
                  ok, I will try it. I had burned it using nero express though.

                  well, would you please give the the exact link of microsoft C/++ compiler? 
                  I have searched it and got confused between few ones that which of them I should download?

                  BC_Programmer


                    Mastermind
                  • Typing is no substitute for thinking.
                  • Thanked: 1140
                    • Yes
                    • Yes
                    • BC-Programming.com
                  • Certifications: List
                  • Computer: Specs
                  • Experience: Beginner
                  • OS: Windows 11
                  Re: how to start making windows drivers?
                  « Reply #17 on: October 06, 2008, 11:59:05 PM »
                  Just pick the one that will work with your computer. Myself, I prefer the compiler from Visual Studio 6.

                  Bear in mind it is a compiler, as opposed to an IDE- you'll need to edit your source with another editor, and then use the command line to compile.
                  I was trying to dereference Null Pointers before it was cool.

                  san_crazy

                    Topic Starter


                    Intermediate

                    Re: how to start making windows drivers?
                    « Reply #18 on: October 07, 2008, 12:43:48 AM »
                    ok, I gonna download that

                    by the way, I have been working with compilers and editors(not with visual C/C++ though) far a little long time and hence familiar with these.

                    please dont be tired out of me as I keep asking you again and again.
                    well, after downloading this compiler where I should start from?

                    please let me know about some important sites of hardware manufacturers and driver makers.

                    thanks in advance

                    Aegis



                      Expert

                      Thanked: 67
                      • Yes
                      • Yes
                      • Brian's Mess Of A Web Page
                    • Experience: Experienced
                    • OS: Windows 10
                    Re: how to start making windows drivers?
                    « Reply #19 on: October 07, 2008, 12:48:06 AM »
                    You'll have to try Epson, HP, and Lexmark for printers; Nvidia and Radeon / ATI for video; and Creative Labs for sound.  I'm pretty sure all the manufacturers have forums.  How much the developers interact, I don't know.


                    "For you, a thousand times over." - "The Kite Runner"

                    san_crazy

                      Topic Starter


                      Intermediate

                      Re: how to start making windows drivers?
                      « Reply #20 on: October 07, 2008, 12:55:00 AM »
                      what will the most simple hardware device that I should make the driver for and its manufacturer?

                      keyboard?...mouse?....USB ports?,....HDD?......RAM.......?  or any thing else?

                      BC_Programmer


                        Mastermind
                      • Typing is no substitute for thinking.
                      • Thanked: 1140
                        • Yes
                        • Yes
                        • BC-Programming.com
                      • Certifications: List
                      • Computer: Specs
                      • Experience: Beginner
                      • OS: Windows 11
                      Re: how to start making windows drivers?
                      « Reply #21 on: October 07, 2008, 12:56:57 AM »
                      after downloading the compiler- I really don't know- I've never written drivers myself- all I know about them is information I read in my MSDN library collection. You might need to refer to the Device Driver Kit documentation- it might not get you started, but it will give you valuable information.


                      most simple- couldn't say, really.


                      It's possible to make a device driver that emulates a device- once you research the Driver Kit documentation and learn about the whole framework MS has setup- it might make more sense.
                      I was trying to dereference Null Pointers before it was cool.

                      san_crazy

                        Topic Starter


                        Intermediate

                        Re: how to start making windows drivers?
                        « Reply #22 on: October 07, 2008, 01:10:32 AM »
                        oh...there is whole package of visual studio which pobably is not what I want, it is too long to download and moreover, I dont need the whole
                        I just want compiler.   I not sure though I am saying rite here.

                        would you mind to give the exact link for compiler only?

                        ALAN_BR



                          Hopeful

                          Thanked: 5
                          • Computer: Specs
                          • Experience: Experienced
                          • OS: Windows 7
                          Re: how to start making windows drivers?
                          « Reply #23 on: October 09, 2008, 04:38:19 AM »
                          Hi

                          I worked with DOS before there was Windows, and saw some stupid mistakes in "tutorials" upon the writing of drivers.

                          I think Windows has probably made things worse and there are more pitfalls now.

                          I STRONGLY recommend that you do NOT choose the simplest hardware device.
                          Instead choose a device that is not essential, and preferably has the least interactions with the rest of Windows.
                          A keyboard is essential and should not be experimented with, unless you have an alternative way of booting into BIOS.
                          If you are not using serial ports, perhaps you could create a driver to use a serial port, e.g. reading a file from disc, and sending the data via your driver to an old fashioned printer.

                          I am only suggesting possibilities to consider, and warning you need to take care you do not irretrievably damage Windows.
                          There are people with more experience that may give much better guidance.

                          I respect your ambitions, and wish you well.

                          Regards
                          Alan

                          san_crazy

                            Topic Starter


                            Intermediate

                            Re: how to start making windows drivers?
                            « Reply #24 on: October 09, 2008, 05:13:39 AM »

                            I STRONGLY recommend that you do NOT choose the simplest hardware device.
                            Instead choose a device that is not essential, and preferably has the least interactions with the rest of Windows.

                            well, to get such an isolation from windows I have installed Microsoft virtual PC  where I could be able to work on a separate environment.

                            Quote

                            If you are not using serial ports, perhaps you could create a driver to use a serial port, e.g. reading a file from disc, and sending the data via your driver to an old fashioned printer.

                            if  I am not wrong, I think there hardly be such ports (possibly serial port for mouse, i am not sure though) being used.
                            well , tell me which are serial ports and which are parlell ports used in CPU?....I know few of them but i think you better tell me.
                            Quote
                            I am only suggesting possibilities to consider, and warning you need to take care you do not irretrievably damage Windows.
                            There are people with more experience that may give much better guidance.

                            your suggestions are welcomed!
                            Quote
                            I respect your ambitions, and wish you well.

                            thanks!!

                            ALAN_BR



                              Hopeful

                              Thanked: 5
                              • Computer: Specs
                              • Experience: Experienced
                              • OS: Windows 7
                              Re: how to start making windows drivers?
                              « Reply #25 on: October 09, 2008, 07:19:47 AM »
                              Hi

                              My laptop has no serial port, and as a result :-
                              I do not see a 9 pin connector at the back;
                              Device Manager knows nothing of COM serial ports,
                              but it tells me my Parallel Port LPT1 is working O.K., and I can see its 25 pin connector.

                              I suggest you look for a 9 pin connector,
                              and look at the Device manager on your P.C.

                              I suggest a Google for "serial port interface XP".
                              That gave me 324000 hits, some of which suggest you can still get a serial interface for use with Windows XP.
                              Many of these hits are for virtual emulators in software to simulate hardware, but some appear to indicate the availability of physical interfaces that can be plugged in, and of drivers that may be installed under Windows XP,
                              which should give a nice starter.
                              Alternatively, if you are working on a virtual P.C., then a virtual software emulator might be relevant.
                               
                              One of the Google hits which shows the layout of a 9 pin connector is
                              http://interface.centraltreasure.com/free_comport_software.html

                              I strongly recommend that if you add a physical COM port interface, you should not start developing and debugging your driver until you have first proven that the hardware is not broken.
                              If you have or can download a "professional" driver interface you can test whether the serial port actually works - if something is broken and the "professional" driver cannot succeed, then simply creating and debugging your driver on a "broken" system is a waste of time.

                              Regards
                              Alan

                              san_crazy

                                Topic Starter


                                Intermediate

                                Re: how to start making windows drivers?
                                « Reply #26 on: October 09, 2008, 08:33:57 AM »
                                Alternatively, if you are working on a virtual P.C., then a virtual software emulator might be relevant.
                                 

                                ???



                                ok, tell me one thing

                                whenever we plug-in/out the devices like USB to USB port then there is a detection like
                                   a new hardware found

                                when a CD ROM is inserted on CD drive then it is detected and its file are also being shown up automatically.

                                when an EitherNet network cable is plugged-in on its relevant port there is a detection like
                                 a network cable is plugged/unplugged.

                                I just wanna ask, whether all these detections are carried out by drivers for corresponding devices or there is any thing else?

                                ALAN_BR



                                  Hopeful

                                  Thanked: 5
                                  • Computer: Specs
                                  • Experience: Experienced
                                  • OS: Windows 7
                                  Re: how to start making windows drivers?
                                  « Reply #27 on: October 09, 2008, 10:41:23 AM »
                                  I do not know if similar hardware detection applies to a serial port.

                                  Other experts here will probably know.

                                  Alternatively, if you have a serial port, you could plug a serial device (e.g. mouse or keyboard) and see if it is announced.

                                  ALTERNATIVE SUGGESTION

                                  Do you really have to work on copyrighted proprietary Windows, with all the Giga Buck protection that M.$ and its army of lawyers could bring down on the heads of yourself and your college supervisors at the slightest hint that you might reverse engineer their intellectual property ?

                                  Could you instead develop drivers for Open source operating systems such as Linux, where you will find many people that are enthusiasts who are willing to help others with creating device drivers.

                                  NB This is the M.$. Windows forum.  Alternatives on Computer Hope site are "Drivers" and "BSD, Linux, and Unix"

                                  Regards
                                  Alan

                                  Aegis



                                    Expert

                                    Thanked: 67
                                    • Yes
                                    • Yes
                                    • Brian's Mess Of A Web Page
                                  • Experience: Experienced
                                  • OS: Windows 10
                                  Re: how to start making windows drivers?
                                  « Reply #28 on: October 10, 2008, 02:04:44 AM »
                                  Have a look at this VIDEO.  They concentrate more on Vista, especially toward the end of the video, but I think it's a good overview of what's going on when a device is plugged into the computer.


                                  "For you, a thousand times over." - "The Kite Runner"