Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to ask is suppose I have one device which operates on serial port. I want to read/ write into this device using linux. How should I start with it? And where can I see the data coming from this device? Like in windows you have hyperterminal to view data transaction from and in serial port of PC. As I am new to write device driver I have asked such a basic question. I think this would be a smiplest device driver to start with. Can anyone help me out with this please?
If you plan to write your own serial port driver, you will need to actually write the driver for your special needs. If you just need to use the port, you can stay in the user space. Of course, you can write it as driver, too. Your program will look differently as module an as user-space program.
To access serial port you can use a tool like minicom. The port is just a file, so you can read/write to it. Serial ports are /dev/ttyS0, /dev/ttyS1 and so on.
Thanks Mara. One more thing that I want to ask is if I write a code for device driver and later on insert its module then do I need to recompile the kernel to use this device driver?
Thanks Mara. One more thing that I want to ask is if I write a code for device driver and later on insert its module then do I need to recompile the kernel to use this device driver?
I want to ask is suppose I have one device which operates on serial port. I want to read/ write into this device using linux. How should I start with it? And where can I see the data coming from this device? Like in windows you have hyperterminal to view data transaction from and in serial port of PC. As I am new to write device driver I have asked such a basic question. I think this would be a smiplest device driver to start with. Can anyone help me out with this please?
I think that Greg Kroah-Hartman deals with this in his book
When a device attaches to a serial port, you should consider carefully how the intended clients will view the device ... and whether the purpose of the device is truly "generic" or "application specific."
If this device provides a generic service to the system, then you can build a kernel-level driver for it.
If, on the other hand, the device is application specific, maybe what you want is a simple library... a set of functions and procedures that can be called by the program, all in user-land.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.