Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
If you're talking about a USB-to-serial converter (or even a serial-like interface to a USB modem), then just open /dev/ttyUSB* and treat it like any ordinary serial port. Some defective hardware doesn't support things like hardware handshaking and modem control lines though.
If you want to learn how to write a USB driver, have a look at the kernel source. The core USB driver handles all of the USB protocol, so all you have to do with your own driver is implement the various required function calls to do registration, initialization, r/w, and hardware-specific controls.
If you want to learn how to write a USB driver, have a look at the kernel source
That is an idea...I was looking for some basic example code that would read and write to the USB port, and some documentation too. The kernel code is more complex, but is a good idea to think about. Thanks.
device nodes are created on a per-device basis
Is any of this under user or user-level code control, or is all within kernel space? And, are there any naming conventions that are adhered to, or does that change from kernel to kernel and distro to distro?
The kernel code is more complex, but is a good idea to think about.
The kernel code for the USB core is complex because the USB protocol specification is extremely complex. Fortunately the USB core takes care of all the horrible stuff; the rest is fairly straightforward. Have a look at the kernel code for, say, 'usbserial' (although even this simple driver may be complicated by the need to interact with the tty layer).
The beauty of Unix/Linux is ... "a device is a file." The various entries in /dev can (with permission...) be opened, read, and written-to as "a file."
ioctl() is a generic system-call that devices provide "to do 'everything else'," which of course may be somewhat device-specific.
When you plug-in a USB device, a system daemon that watches for such things goes through a process of recognizing the device and determining how to set it up. A single device may appear more-than-once in the /dev structure. As an application writer, though, you should not have to have any concerns with that.