This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: a question about porting a linux program on ecos


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 <stdio.h>   
> #include <string.h>  
> #include <unistd.h>  
> #include <fcntl.h>   
> #include <errno.h>   
> #include <termios.h> 
> 
> #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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]