avrdude-dev
[Top][All Lists]
Advanced

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

Re: [avrdude-dev] USB-to-serial-converter on OS X


From: Joerg Wunsch
Subject: Re: [avrdude-dev] USB-to-serial-converter on OS X
Date: Sun, 13 Feb 2005 17:04:27 +0100
User-agent: Mutt/1.4.2.1i

As Jan-Hinnerk Reichert wrote:

> We were able to track the problems to the open() call in
> "ser_posix.c"! It simply doesn't return. Uncommenting the
> "O_NOBLOCK" there solves his problems.

s/solves/works around/

;-)

Does OS X support the paradigm to separate between callin and callout
tty devices?  BSD does, and as OS X is close to BSD from a kernel
point of view, it could perhaps do, too.

The idea is to supplement software in sharing a line between incoming
and outgoing calls.  The callin device (typically /dev/tty*) is used
for incoming traffic.  Any process trying to open it blocks within the
open() call as long as DCD is not asserted by hardware (i.e. as long
as the modem doesn't have a carrier).  During this, the callout device
(typically /dev/cu* -- cu stands for "calling unit") can be freely
used.  Opening /dev/cu* doesn't require DCD to be asserted and
succeeds immediately.  Once succeeded, the blocked open() on the
callin device will be suspended, and cannot even complete when DCD is
raised, until the cu device is closed again.

That way, you can have a getty listening on /dev/tty*, and can still
use /dev/cu* without restrictions.

So the normal way would be to use the cu device for avrdude.

Alternatively, on the callin device, you can force the open to
complete by opening with O_NONBLOCK, where you'll get a valid file
descriptor immediately but you cannot use that fd for actual traffic
(normally), unless you ioctl the device appropriately.  That's why it
somehow works around your problem.  On systems that don't have callout
devices (SysV UNIX), that's the only way to get access to a tty that
doesn't have DCD asserted though.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]