Re: Opening files in kernel mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Mar 28, 2007 at 06:12:26PM +0200, Andi Drebes wrote:
> A long time ago I got a parallel port scanner which only works under a 
> proprietary operating system because the manufacturer only develops drivers 
> for that os. I spent hours on searching a parallel port sniffer for that 
> operating system so that I can understand how the communication between the 
> device and the computer works. Unfortunately I didn't find a single parport 
> sniffer. Then I sent some emails to the manufacturer, but they never answered 
> my questions.

Parallel port sniffer would be hard, it would require OS support
because most of the time userland directly touches the parallel port
using iopl() and outb()/inb().

> Now I only see one chance to get the device work under linux: I want to write 
> a driver that simply logs the traffic on the parallel port (the scanner works 
> together with the computer via a virtual machine that uses the linux 
> parport).

You could give the virtual machine full access to the parallel port
hardware, but still ask it to log all access to that port. That's what
DOSemu allows and what was used to reverse engineer a couple of
parallel port protocols under DOS (IIRC ZIP disk parallel port driver,
among others).

> What I want to do is to write a driver that implements all the system calls 
> that the original parport driver implements. Each routine would only be a 
> redirect to the original parport driver. Besides it should write all the 
> traffic into a file.

There's a good chance the emulator wants to touch the bare metal
without using the Linux parallel port driver.

> As I'm totally new to kernel development (I only read some books about it a 
> year ago), I ask myself if it is possible to open a regular / device file in 
> kernel mode.

No, see the FAQ on the website. If it's lots of data, relayfs would be
a good choice.


Erik

- -- 
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGC63E/PlVHJtIto0RAsRrAJ9jqG+ljKx7l+hfn0V0BVy4Qd3CmgCeKLn+
51aH54x8LpWry16pDjGxr7s=
=vF7r
-----END PGP SIGNATURE-----

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux