LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-02-2008, 03:19 AM   #1
archieval
Member
 
Registered: Apr 2007
Location: Philippines
Distribution: Kubuntu, Ubuntu, CentOS
Posts: 289

Rep: Reputation: 41
how to verify if open() has been called?


Hi,

I have been writing a low level driver to be registered with serial_core.c. Right now I have mapped the corresponding uart_ops, but I cant verify if my corresponding open function is being called. In serial_core.c, there is also a DPRINTK line at the start of the uart_open function, but it is not being printed when I try to open my module in user space. How can I verify it? I tried to use minicom but I cant see anything useful as I only have the open ang set functions, I still dont have any functions that would correspond to write. Also when I tried to close(), it says "illegal seek". What is the simplest way to open a serial device driver, or know if it is properly configure using a C program?

Regards.
 
Old 06-05-2008, 07:53 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Don't know if this really what you are asking, but the output from printk() can normally viewed with dmesg (driver messages).
--- rod.
 
Old 06-08-2008, 03:33 PM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,644

Rep: Reputation: 209Reputation: 209Reputation: 209
You simply open the corresponding file, like /dev/ttyS0 or so. If the prontk doesn't show up, however, put some more debug lines and check carefully your initialization code.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to verify signature ? visu Linux - Newbie 5 05-07-2009 05:25 PM
udev not called to remove open USB serial device tm007 Programming 3 09-24-2007 07:46 AM
Verify login? ErrorBound Programming 12 08-07-2007 06:58 AM
DRIVERS verify khaleel5000 Linux - General 1 03-12-2006 03:43 AM
verify before continue - how to? babag Programming 8 05-05-2005 05:28 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:02 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration