LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 12-30-2004, 03:29 AM   #1
bravetanveer
LQ Newbie
 
Registered: Nov 2004
Location: India
Posts: 1

Rep: Reputation: 0
experimenting with kernel module programming


while experimenting with developing kernel modules:

Instead of implementing a device driver using a kernel module, i have tried to implement a simple code as a module.
This code has the functionality as:
It reads data from a file and collects it in the data structures declared in ".h" file.
I also have data structures to store process id, process name and instances and then compare the data with data read from file.

I have not defined or used data structures used by a device driver such as struct file_operations, struct task_struct etc.

I have used system calls such as read, open to deal with files.
kmalloc - to allocate kernel memory, printk - to log messages.

my problem:
i inserted the module from one terminal.
i changed to some user(not superuser).
i was allowed to execute processes from the same terminal, i.e. to open xpdf , i had to type "xpdf abc.pdf" on terminal instead of using GUI.
problem-->
If i use GUI to open xpdf or
if i open another terminal, the computer hanged.

I was not able to figure out the problem.


Is it necessary to use the data structures and functions used in kernel code to avoid such a problem?
Is there a need to define structures as file_operations, if i perform file opearations?

Please help me and guide me in this new world of kernel modules.

Thanks in advance
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel module programming lokutas Programming 2 04-27-2004 02:26 AM
Kernel Module Programming in 2.6 KneeLess Programming 3 04-13-2004 02:27 PM
Kernel Module programming Config Programming 2 03-24-2004 04:48 PM
kernel module programming shellcode Programming 1 02-05-2004 11:43 PM
Kernel Module Programming Thomas.P Programming 1 11-10-2001 10:23 AM


All times are GMT -5. The time now is 11:14 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration