comp.lang.ada
 help / color / mirror / Atom feed
From: mbates@ionet.net (Mike D Bates)
Subject: Re: NT kernel-mode device drivers in Ada?
Date: 1997/06/01
Date: 1997-06-01T00:00:00+00:00	[thread overview]
Message-ID: <5mt52b$58u@ion1.ionet.net> (raw)
In-Reply-To: 1997Jun1.081747.1@eisner


In article <1997Jun1.081747.1@eisner>,
Larry Kilgallen <kilgallen@eisner.decus.org> 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.




  reply	other threads:[~1997-06-01  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-01  0:00 NT kernel-mode device drivers in Ada? Mike D Bates
1997-06-01  0:00 ` Larry Kilgallen
1997-06-01  0:00   ` Mike D Bates [this message]
1997-06-01  0:00 ` Dale Stanbrough
1997-06-02  0:00 ` Simon Wright
1997-06-02  0:00 ` Steve O'Neill
1997-06-05  0:00   ` Ed Falis
1997-06-05  0:00     ` Matthew S. Whiting
1997-06-05  0:00 ` Adam Beneschan
1997-06-07  0:00 ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox