From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,db351aa38857baa2 X-Google-Attributes: gid103376,public From: mbates@ionet.net (Mike D Bates) Subject: Re: NT kernel-mode device drivers in Ada? Date: 1997/06/01 Message-ID: <5mt52b$58u@ion1.ionet.net>#1/1 X-Deja-AN: 245516020 References: <5mr324$8im@ion1.ionet.net> <1997Jun1.081747.1@eisner> Organization: Internet Oklahoma Newsgroups: comp.lang.ada Date: 1997-06-01T00:00:00+00:00 List-Id: In article <1997Jun1.081747.1@eisner>, Larry Kilgallen wrote: >In article <5mr324$8im@ion1.ionet.net>, mbates@ionet.net (Mike D Bates) writes: >> Could use some help in answering yet another objection to Ada. Has >> anyone here successfully implemented an NT kernel-mode device driver. >> A FAQ on the subject (http://www.cmkrnl.com/faq.html) says that using >> anything but C for this purpose would be like swimming upstream with a >> brick in each hand. Can anyone cite experience to the contrary? > >I know the proprietor of http://www.cmkrnl.com to be quite expert >in the area of NT kernel-mode device drivers, perhaps more so than >anyone who is not a Microsoft employee. > >It is possible you could solicit from him a short "what would it take" >list for reposting here so that we may get a better description of the >bricks. >Larry Kilgallen Here are the relevant paragraphs from the FAQ. 2.2.3 seems to spell out the "what would it take". Based on past experience writing device drivers in Ada (under VAXELN), it seems right. You have to present the OS with an interrupt handler with the right calling profile. I suspect the ability to do this is contained within the language interoperability features of an Ada compiler. I would also guess that you wouldn't need to translate all of \DDK\INC, just the bits that matter for your driver. 2.2.2 Can't I use someone else's 32-bit C compiler? Maybe. The technical answer is: As long as it generates essentially the same code, supports all of the MS extensions to C, and takes all of the same command line options, it should work fine. Same for the linker. Opinion: VC++ is part of the driver build environment supported by MS, and using anything else feels too much to me like swimming upstream with a brick in each hand, a practice I try to avoid. 2.2.3 What about other languages like Pascal? In theory, as long as you adhere to C calling conventions, don't use too much stack space, etc., you should be fine. In practice, there are several tens of thousands of lines of header files in \DDK\INC which you will have to translate to your language of choice. 2.3 What's this about C++ and drivers? Although we use the VC++ compiler to compile drivers, MS has stated many times that C++ language extensions should not be used in writing NT drivers. It is true that a few people have written about their successes in using C++. However, C++ language features tend to use large amounts of stack space, and large amounts of stack space are not available under WNT in kernel mode. Mike Bates -- Pursuant to US Code, Title 47, Chapter 5, Subchapter II, Section 227, any and all nonsolicited commercial E-mail sent to this address is subject to a download and archival fee in the amount of $500 US. E-mailing denotes acceptance of these terms.