Re: parport and char driver

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

 



hi there,
            i think u shud read the src code for sys_open() in /usr/src/linux/fs/open.c (  i guess.. ). it would show
you how the struct file* and struct inode* arguments are populated before the ->open operation on the file is called
(from sys_open). So i sujggest you go thru sys_open and simulate it out there in your module. 
HTH.

cheers,
Amith

> Claudio Fiorini wrote:
> 
> Hi,
> I'm new to kernel hacking, I'm trying to devel a kernel module to use
> parallel port with simple led because i do in user-space, but now
> i want to do that in kernel-space.
> I start to read the linux device driver 2nd edition and I'm
> ok where i register a char device, but the book show
> me the file_operations struct that has many pointers functions
> this is what i do:
> 
> struct file_operations *f_pport;
> pport = register_chrdev(PPORT_MAJOR_NUMBER, PPORT_CONST_NAME, f_pport);
> 
> now if i want to open i have to do something like this?
>             f_pport->open(struct inode *, struct file *);
> 
> and in the book i don't understand which information i have
> to give to struct inode and struct file.
> 
> Thanks
> 
> Claudio

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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