Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


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

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


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?

Old 06-05-2008, 08:53 PM   #2
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,398
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, 04:33 PM   #3
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,683

Rep: Reputation: 219Reputation: 219Reputation: 219
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.


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 06:25 PM
udev not called to remove open USB serial device tm007 Programming 3 09-24-2007 08:46 AM
Verify login? ErrorBound Programming 12 08-07-2007 07:58 AM
DRIVERS verify khaleel5000 Linux - General 1 03-12-2006 04:43 AM
verify before continue - how to? babag Programming 8 05-05-2005 06:28 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:42 AM.

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