[Haskell-cafe] Re: [Haskell] Top Level <-
lennart at augustsson.net
Wed Aug 27 04:32:58 EDT 2008
I've also written quite a few hosted and non-hosted device drivers (in C).
None of them have any global variables.
On Wed, Aug 27, 2008 at 9:07 AM, Adrian Hey <ahey at iee.org> wrote:
> Lennart Augustsson wrote:
>> I told you where to look at code. It's C code, mind you, but written
>> in a decent way.
>> No well written device driver ever accesses memory or IO ports
>> directly, doing so would seriously hamper portability.
> Well something must be accessing both. Dunno what you mean by "directly"
> I take it you must mean that the driver does not make use of global
> variables or "baked in" port addresses in it's source code.
>> Instead you use an abstraction layer to access to hardware, and the
>> driver gets passed a "bus" (whatever that might be) access token (akin
>> to a capability).
>> I know you're not going to be convinced, so I won't even try. :)
> I have actually spent the last 20 years or so writing both non-hosted
> and hosted device drivers for a few OS's. I'm perfectly convinced about
> the truth of what you say, but not at all convinced about the relevance.
> It's a red herring IMO as you've introduced a very complex and
> mysterious black box that itself cannot be implemented without making
> use of "global variables". You can find them easily enough in the Linux
> kernel source. I'm sure they'll be there in NetBSD too (never looked
> Adrian Hey
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe