Problems with output to console

Tito farmatito at tiscali.it
Sat Dec 10 12:58:07 UTC 2005


On Saturday 10 December 2005 11:41, Steven Scholz wrote:
> Hi all,
> 
> I have two different ARM based boards (different CPUs, both Linux
> 2.6.14) running BusyBox v1.00.
> 
> I want a little application (started by a script that is started by
> inittab) to output stuff using printf() on my serial console.
> 
> foobar.c is
> int main (void)
> {
>         printf("Hello World (printf)!\n");
>         return 0;
> }
Hi, Just my 0.02 €.
Maybe something like:

int main(void)
{
	FILE *out;

	if((out = fopen(" /dev/ttyS0", "r+")) == NULL)
		return 1;
	fprintf(out, "test\n");
	fclose(out);
	return 0;
} 

could be a workaround.
But sure there is a better way.....

Ciao,
Tito 

> My /etc/inittab has
> 
> ::sysinit:/opt/imc/start_imc
> ::askfirst:-/bin/sh
> 
> On one board I see the output. This one has /dev/ttySMX0 (204,41) as
> serial console. On the other board I do _not_ see the output. This has
> /dev/ttyS0 (4,64) as serial console.
> 
> When I start foobar directly in inittab it works on both.
> 
> When I create a link "ln -s /dev/ttySMX0 /dev/ttyS0" on the first board,
> then I cant see the output there anymore.
> 
> Could someone please explain to me what's going on here.
> 
> Cheers,
> 
> Steven
> 
> 
> 
> 
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://busybox.net/cgi-bin/mailman/listinfo/busybox
> 



More information about the busybox mailing list