How to work with serial port
nasim khalaj
nasim_khalaj at hotmail.com
Sat Aug 12 13:56:03 UTC 2006
Hi All
I'm new member of rtems. i have build and install rtems for pc386 and then
write a simple program to working with serial port:
#include <rtems.h>
#include <clockdrv.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <console.h>
#include <memory.h>
#include <tty_drv.h>
#include <termios.h>
rtems_driver_address_table Device_drivers[] = {
TTY1_DRIVER_TABLE_ENTRY,
CLOCK_DRIVER_TABLE_ENTRY
};
rtems_task Init(rtems_task_argument a)
{
int fd;
printf("Serial port test\n");
if((fd = open("/dev/tty1", O_RDWR)) < 0)
{
printf("Can't open .\n");
return;
}
close(fd);
printf("Done.\n");
rtems_task_delete(RTEMS_SELF);
}
#define CONFIGURE_INIT
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
#define CONFIGURE_MAXIMUM_TIMERS 10
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 10
#define CONFIGURE_MAXIMUM_DEVICES 50
#define CONFIGURE_MAXIMUM_TASKS 1
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 10
#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
#include <confdefs.h>
but when booting the rtems, i see the following message and nothing else
Device: /dev/ttyS1 initialized
-
anyone can help me to finding this problem?
Thanks
Nasim
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
More information about the users
mailing list