/dev/cuad0: Device busy

Jeremy Chadwick koitsu at FreeBSD.org
Mon Feb 4 06:51:23 UTC 2008


On Mon, Feb 04, 2008 at 02:37:31PM +0800, Ganbold wrote:
> Jeremy Chadwick wrote:
>> On Mon, Feb 04, 2008 at 12:53:58PM +0800, Ganbold wrote:
>>   
>>> Hi,
>>>
>>> I'm trying to use serial port but the system says device busy.
>>>
>>> daemon# cu -l /dev/cuad0 -s 9600
>>> /dev/cuad0: Device busy
>>> link down
>>>     
>>
>> Does the same happen if you do `cu -l ttyd0 -s 9600`?
>>   
>
> It works and fstat shows:
>
> daemon# fstat /dev/cuad0
> USER     CMD          PID   FD MOUNT      INUM MODE         SZ|DV R/W NAME
> daemon# fstat /dev/ttyd0
> USER     CMD          PID   FD MOUNT      INUM MODE         SZ|DV R/W NAME
> root     cu          5574    3 /dev         41 crw-------   ttyd0 rw  
> /dev/ttyd0
> root     cu          5573    3 /dev         41 crw-------   ttyd0 rw  
> /dev/ttyd0
> daemon#
>
> Is it expected behaviour?

As far as I know, yes.  On all of our machines which utilise getty(8) on
ttyd0 (as listed in /etc/ttys):

$ grep ttyd0 /etc/ttys
ttyd0   "/usr/libexec/getty std.115200" xterm   on secure
$ fstat /dev/ttyd0
USER     CMD          PID   FD MOUNT      INUM MODE         SZ|DV R/W NAME
root     getty      37376    0 /dev         36 crw-------   ttyd0 rw  /dev/ttyd0
root     getty      37376    1 /dev         36 crw-------   ttyd0 rw  /dev/ttyd0
root     getty      37376    2 /dev         36 crw-------   ttyd0 rw  /dev/ttyd0

Additionally, see Section 23.2.5 of the below document:

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/serial.html

Personally, I never understood the concept of "dial-in" and "call-out"
devices on FreeBSD.  I ran BBS software for years on both Apple II
hardware and PC hardware; there was no distinction between such devices.
A serial port is a serial port.  Chances are I'm not understanding why
there's a distinction, but there doesn't appear to be any explanation of
why there's a distinction within manpages or the handbook...

-- 
| Jeremy Chadwick                                    jdc at parodius.com |
| Parodius Networking                           http://www.parodius.com/ |
| UNIX Systems Administrator                      Mountain View, CA, USA |
| Making life hard for others since 1977.                  PGP: 4BD6C0CB |



More information about the freebsd-stable mailing list