Is this a true statement?

Emile van Sebille emile at fenx.com
Sun Jun 24 13:42:39 EDT 2001


"David C. Ullrich" <ullrich at math.okstate.edu> wrote in message
news:3b3611b0.10735139 at nntp.sprynet.com...
> On Sun, 24 Jun 2001 08:28:25 -0700, "Emile van Sebille"
> <emile at fenx.com> wrote:
>
> >
> >"David C. Ullrich" <ullrich at math.okstate.edu> wrote in message
> >news:3b35ebc3.1024709 at nntp.sprynet.com...
<snip>
> >> Seriously. _Is_ a "device driver" something other than a file?
> >> If it _is_ something other than a file I wish someone would
> >> say so. If a device driver is just a file then I don't see
> >> how the OS can possibly know or care how that file was
> >> generated.
> >>
> >>
> >
> >Of course not.  And of course a file can be written by python that the os
> >can subsequently use as a device driver.  To do so, you will have written
> >both a compile-to-bytes program and a device-driver-source file intended
to
> >be consumed by the compiler piece.
>
> That's what I thought. Seems clear. Makes it hard to see how the
> statement "you cannot write a device driver in Python" can
> be correct.
>
> > When this result is invoked by the os,
> >it will not be a python program running within the interpreter.
>
> And if you write a device driver in C then when that driver
> is invoked by the OS it _is_ a C program being interpreted by
> the compiler? Or is it machine code being interpreted by the OS?
> (The second, of course. So what's the difference between Python
> and C in this regard?)

None, vis-a-vis a device driver.  The difference is the distinction of using
python to create a device driver vs a python program that _is_ a device
driver.  The former is doable and the latter not.  (Not at least in the
sense of the following paragraph.)


>
> Whether anyone belives it or not, I _did_ have actual questions
> at the start of this. It was said that you cannot write a device
> driver in Python because Python cannot access hardware interrupts
> (or whatever). I don't see how a program _writing_ a device
> driver needs to do that, so I don't see what it has to do with
> whether you can write a device driver in Python.
>

I think we agree that it is possible to create a device driver using python.
I suspect we also agree that a python program is not a suitable device
driver.

>From a similar perspective, I've reverse engineered all sorts of proprietary
data structures, then used python to revise and rewrite these files to
interface to applications that were reluctant to communicate more openly.

--

Emile van Sebille
emile at fenx.com

---------







More information about the Python-list mailing list