|
Home > Archive > Unix Programming > April 2004 > Accessing the UART for serial communication in linux
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Accessing the UART for serial communication in linux
|
|
|
| hi all,
I have to write a UART driver for serial communication in linux
for my acadamic project, can anybody tell me how can i access the uart
registers.
--shri
| |
| Jem Berkes 2004-04-20, 2:34 am |
| > I have to write a UART driver for serial communication in linux
> for my acadamic project, can anybody tell me how can i access the uart
> registers.
I've done limited assembly programming under Linux (only with parallel
port) but my understanding is that if your code is running as root, all you
have to do is use ioperm() to give yourself permission to the required x86
ports. Then use I/O opcodes inb and outb to do the actual I/O.
There's all kinds of info out there for programming the UART; classic
stuff, just look up some old DOS manuals ;)
But Linux also gives you more elegant ways to deal with the serial ports.
Hard to tell what you're really looking for, given your question is so
broad.
--
Jem Berkes
http://www.sysdesign.ca/
| |
| Floyd L. Davidson 2004-04-20, 6:34 am |
| shri_gajare@yahoo.com (Shri) wrote:
>hi all,
>
> I have to write a UART driver for serial communication in linux
>for my acadamic project, can anybody tell me how can i access the uart
>registers.
>
>--shri
What do you mean by "UART driver"? A kernel device driver? Or
a user level program that diddles with the UART?
--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@barrow.com
| |
|
| > What do you mean by "UART driver"? A kernel device driver? Or
> a user level program that diddles with the UART?
yep its the KERNEL DEVICE DRIVER
--shri
| |
| Floyd L. Davidson 2004-04-21, 6:34 am |
| shri_gajare@yahoo.com (Shri) wrote:
>
>yep its the KERNEL DEVICE DRIVER
>
>--shri
You'll need to get the data sheet for the particular UART. Then the
best bet is to look over the existing device drivers supplied with
the Linux kernel, and go from there.
Another good source of information will be the O'reilly book,
"Linux Device Drivers", 2nd Edition. It is available online
too, at
http://www.xml.com/ldd/chapter/book/
--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@barrow.com
| |
|
| > You'll need to get the data sheet for the particular UART. Then the
> best bet is to look over the existing device drivers supplied with
> the Linux kernel, and go from there.
>
> Another good source of information will be the O'reilly book,
> "Linux Device Drivers", 2nd Edition. It is available online
> too, at
>
> http://www.xml.com/ldd/chapter/book/
Thanks Floyd 
Actually i am reading that book, and have a small prob, hope u will
help me this time also. I am not able to recompile my kernel without
the module support disabled and thats why i am not able to load my
module.
waiting for ur earliest reply
--shri
| |
| Floyd L. Davidson 2004-04-22, 8:38 am |
| shri_gajare@yahoo.com (Shri) wrote:
>
>Thanks Floyd 
>
> Actually i am reading that book, and have a small prob, hope u will
>help me this time also. I am not able to recompile my kernel without
>the module support disabled and thats why i am not able to load my
>module.
>
>waiting for ur earliest reply
Wellll... I'm probably not the right person to help with that,
unless you just happen to run a Slackware 8.0 distribution and
use a 2.6 kernel. :-)
Likewise this is probably not the best newsgroup either. Pick
one devoted to the particular distribution you use, or perhaps
comp.os.linux.development.system. There are distribution
specific alt.os.linux.* groups for redhat, suse, slackware,
mandrake and probably others.
--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@barrow.com
| |
|
| > Wellll... I'm probably not the right person to help with that,
> unless you just happen to run a Slackware 8.0 distribution and
> use a 2.6 kernel. :-)
>
> Likewise this is probably not the best newsgroup either. Pick
> one devoted to the particular distribution you use, or perhaps
> comp.os.linux.development.system. There are distribution
> specific alt.os.linux.* groups for redhat, suse, slackware,
> mandrake and probably others.
thanks again floyd for all ur help 
--shri
|
|
|
|
|