From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14097 invoked by alias); 29 Jul 2005 12:22:56 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 14063 invoked by uid 22791); 29 Jul 2005 12:22:48 -0000 Received: from sta-206-168-96-204.rockynet.com (HELO hermes.chez-thomas.org) (206.168.96.204) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 29 Jul 2005 12:22:48 +0000 Received: by hermes.chez-thomas.org (Postfix, from userid 2000) id 24E9D100011; Fri, 29 Jul 2005 06:22:46 -0600 (MDT) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hermes.chez-thomas.org (Postfix) with ESMTP id 564FB100006; Fri, 29 Jul 2005 06:22:43 -0600 (MDT) From: Gary Thomas To: Indra Antonius Simalango Cc: eCos Discussion In-Reply-To: References: Content-Type: text/plain Date: Fri, 29 Jul 2005 12:22:00 -0000 Message-Id: <1122639762.27647.282.camel@hermes> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [ECOS] Re: a question about porting a linux program on ecos X-SW-Source: 2005-07/txt/msg00316.txt.bz2 On Fri, 2005-07-29 at 14:29 +0700, Indra Antonius Simalango wrote: > Dear Mr Thomas, > > First, let me introduce myself. I am Indra, a final year student in > Bandung, Institute of Technology. I'm currently doing my final project > using eCos. Please send such questions to the eCos mailing list so that all may benefit. Private support is only available with a support contract. I'm happy to help whenever possible, but only in the public forum. > > I've built my eCos for target pci386. I've adopted a program that open a > pc serial port, then trying to set it up for fax - modem communication. > > I've also read your question about porting a linux program on eCos on > http://sources.redhat.com/ml/ecos-discuss/2004-01/msg00182.html > and also read > http://www.easysw.com/~mike/serial/ > > Just like you've said, a couple of things to note about using this with > eCos : > * You need to enable the serial I/O drivers as this is not > done automatically. > * The actual device names vary from target platform to platform. > * You also need to "wire" the termio device to a corresponding > serial I/O device. > > I've tried to enable the serial I/O drivers, as shown below. > > > It's my quote snippet : > ----------------------------------------------------------------------- > #include > #include > #include > #include > #include > #include > > #define FAXDEV "/dev/termios1" > > int main() > { > int fd,rc; > struct termios termios; > > if((fd = open(FAXDEV ,O_NONBLOCK | O_RDWR | O_NOCTTY)) < 0) { > fprintf(stderr, "error opening '%s'\n", FAXDEV); > exit(-1); > } > ... > --------------------------------------------------------------------------- > > I've found it given an error message, error opening /dev/termios1. But if > I change /dev/termios1 to /dev/ser1, it could run sucessfully. > > I've also made some configurations on my file ecos.ecc in order to use > posix termios facilities: > --------------------------------------------------------------------------- > cdl_option CYGOPT_IO_SERIAL_SUPPORT_NONBLOCKING { > user_value 1 > }; > cdl_component CYGPKG_IO_SERIAL_FLOW_CONTROL { > user_value 1 > }; > cdl_component CYGOPT_IO_SERIAL_FLOW_CONTROL_SOFTWARE { > user_value 1 > }; > cdl_component CYGPKG_IO_SERIAL_TERMIOS { > user_value 1 > }; > cdl_component CYGPKG_IO_SERIAL_TERMIOS_TERMIOS1 { > user_value 1 > }; > cdl_option CYGDAT_IO_SERIAL_TERMIOS_TERMIOS1_DEV { > user_value 1 This should read: user_value "\"/dev/ser1\"" > }; > cdl_option CYGSEM_IO_SERIAL_TERMIOS_USE_SIGNALS { > user_value 1 > }; > cdl_component CYGPKG_IO_SERIAL_DEVICES { > user_value 1 > }; > --------------------------------------------------------------------------- > > Did I miss anything here? Or maybe, more basically, how can I use termios > on posix ecos? > > Thank you. > -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------ -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss