Re: programming the serial port

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 06, 2002 at 08:29:18PM +0200, Bart Vandewoestyne wrote:
> Greg KH wrote:
> > 
> > You do not need to write any kernel module, this can all be done from
> > userspace.  Please see one of the many Linux Serial Programming HOWTOs
> > that are available.
> 
> I've beel looking in this HOWTO (not *that* thoroughly, just took a
> quick look and watched the programming examples) and as far as I can
> see, all these examples *do* use a _file descriptor_ and 'interact'
> with the serial port by sending and writing data to that _file
> descriptor_... and that's *not* what I have to do: i have to program
> the UART directly, that is 'set individual bits on the UART' up until
> i manage to send something out and receive something...

Um, that's the only way to talk to a serial port from Linux (open(),
read(), and write() on the /dev node, and then use tcgetattr() and
friends to set and get line settings.)

> I guess I will be needing the inb, outb or ioctl system calls, right?

If you have to talk directly to the serial port hardware, then you will
have to write a kernel driver.  But since there already is a kernel
driver written for the serial port, I would suggest looking at how it
works.

And I would also not suggest asking world-wide mailing lists for help
with homework :)

Good luck,

greg k-h
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux