• OK, it's on.
  • Please note that many, many Email Addresses used for spam, are not accepted at registration. Select a respectable Free email.
  • Done now. Domine miserere nobis.

Question about serial ports on linux

walfin

Democrazy
Local time
Today 9:44 AM
Joined
Mar 3, 2008
Messages
2,436
---
Location
/dev/null
I cannot seem to get /dev/ttyS0 to work in linux.

When I run a program that open()s it, lsof /dev/ttyS0 doesn't display anything. Is that normal? I have a feeling something is wrong.

It is on 0x3f8 IRQ 4. I have tested that it was working by changing it to 0x3e8, and the BIOS change was duly detected by linux (as reflected in dmesg).

My code generates no response from my device at all. Am i doing something wrong? I use libserial, had tried the normal termios way before which didn't work so I figured I would try using a library since I might be doing something wrong. Nope, didn't work either.

If nobody knows/cares then never mind. I have already read the serial programming guide for linux. Nothing seems to help.

How can I determine whether the serial port is working in linux at all? (It is working in windows)
 

Attachments

  • code.zip
    3 KB · Views: 143

pjoa09

dopaminergic
Local time
Today 8:44 AM
Joined
Feb 9, 2010
Messages
1,857
---
Location
th
lshw
lsusb

maybe?

obvious but really just linuxquestions . org ubuntu's official forum... those they never go wrong.
 

walfin

Democrazy
Local time
Today 9:44 AM
Joined
Mar 3, 2008
Messages
2,436
---
Location
/dev/null
OK I have verified that there is something wrong, it couldn't detect a serial mouse.

Sigh nvm I won't ask here and will go to the linux based forums then, unless someone here has an answer.

EDIT: Nope it must be my code. My code doesn't work in windows either though the test program works.

Please help, anyone with embedded systems knowledge.
 

Wisp

The Soft Rational
Local time
Yesterday 8:44 PM
Joined
Jan 4, 2008
Messages
1,291
---
Location
East Coast of USA
Serial ports lie well beynod my area of expertise. Sorry mate.
 
Top Bottom