delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/19/20:14:25

Message-Id: <200508200014.j7K0EOls011589@delorie.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Gary R. Van Sickle" <g DOT r DOT vansickle AT worldnet DOT att DOT net>
To: <cygwin AT cygwin DOT com>
Subject: RE: building device drivers
Date: Fri, 19 Aug 2005 19:14:14 -0500
MIME-Version: 1.0
In-Reply-To: <Pine.LNX.4.62.0508191251460.31247@ns.pyerotechnics.com>
X-IsSubscribed: yes

> From: Jason Pyeron
> Sent: Friday, August 19, 2005 12:00 PM
> To: cygwin AT cygwin DOT com
> Subject: Re: building device drivers
> 
> On Fri, 19 Aug 2005, Brian Dessent wrote:
> 
> >
> > I don't think that's really going to work.  Cygwin cannot be linked 
> > statically and even if it could, it was not designed to run 
> in kernel 
> > space at all.  Cygwin does not try to emulate the linux 
> kernel, just a 
> > POSIX api.  So low level things like device drivers are not 
> going to 
> > just port over.  What you need to do is get the Windows DDK 
> and write 
> > a true windows driver for your device.  Then you can port 
> the userland 
> > tools using Cygwin and interface with the windows driver.
> 
> 
> I am using the DDK. But that being said, inside I would like 
> to use some POSIX code.
> 

Abandon that idea.  Windows device drivers barely resemble C code.  They are
about as far away from POSIX as it is possible to get.  I am not
exaggerating.

> The problem I am running into, is what Linux considers user 
> space, windows does not.
> 
> So to port the code, with minimal changes, I have to move it 
> into kernel space on windows. IGNORING RED FLAGS THERE.
> 

You are in for a world of hurt the magnitude of which you can not possibly
imagine.

The short form is that it is nonsensical to talk of "moving code into kernal
space" on Windows.  From the very start, you have to design the code to
cleave to Windows' notions of how a device driver must operate.  And large
chunks of that notion are undocumented.  Still larger chunks are erroneously
documented.  The rare portion that is clearly and correctly documented is
certain to change with the release of the next service pack.

Do one of the following:

- Contract the job out to an experienced shop that does drivers and drivers
only.
- Look into one of these "Write your drivers in C++ in 10 minutes!" packages
that are around.  I have no experience with them, and frankly would expect
them to cause more problems than they solved, but who knows, you might get
lucky.

> So that being said, why can't the cygwin libraries be linked 
> statically?
> 

An entirely separate issue, and completely unrelated to writing Windows
drivers.  It would do you no good even if it could be statically linked.

-- 
Gary R. Van Sickle
 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019