public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Interrupt/Ctrl-C problem....
@ 2000-11-09 18:55 Fabrice Gautier
  0 siblings, 0 replies; 2+ messages in thread
From: Fabrice Gautier @ 2000-11-09 18:55 UTC (permalink / raw)
  To: Ecos-List (E-mail)

Hi,

I almost have a i386 eCos and RedBoot that works perfectly, except for a
tiny thing.

The problem can be reproduced with one of my test program joined her.

The program consist of a main thread and two other threads. Each thread
printf some string then do a cyg_thread_delay and loop forever.

I can interrupt the program with ctrl-C a first time, but then I have to
wait the next output to be able to ctrl-C again. But I don't really know if
this is the end of a delay or the diag_printf that allows me to interrupt
again.

If someone with other archs could test the following test program thank you.
If this work ok with other arch that would means there is problem left in my
i386 modifications.

/*====== hello.c =======*/
#include <cyg/kernel/kapi.h>

static char stack1[4096];
static char stack2[4096];
static cyg_thread t1;
static cyg_thread t2;

void thread1(void *arg)
{
	while(1){
		printf("1111_A thread1 here\n");
		cyg_thread_delay(777);
		printf("1111_B thread1 there\n");
		cyg_thread_delay(598);
		}	
}

void thread2(void *arg)
{
	while(1){
		printf("2222_A thread2 here\n");
		cyg_thread_delay(547);
		printf("2222_B thread2 there\n");
		cyg_thread_delay(958);
		}			
}

void main()
{ 
	cyg_handle_t h1,h2;

	printf("Hello, world\n");
	
	cyg_thread_create(10,&thread1,0,"thread1",&stack1,4096,&h1,&t1);
	cyg_thread_resume(h1);
	cyg_thread_create(10,&thread2,0,"thread2",&stack2,4096,&h2,&t2);
	cyg_thread_resume(h2);
	
	while(1)
	{
		printf("AA main thread here\n");
		cyg_thread_delay(333);
		printf("BB main thread there\n");
		cyg_thread_delay(1179);
	}
			
} //end main
/*=================*/

Thank You

-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [ECOS] Interrupt/Ctrl-C problem....
@ 2000-11-10 11:24 Fabrice Gautier
  0 siblings, 0 replies; 2+ messages in thread
From: Fabrice Gautier @ 2000-11-10 11:24 UTC (permalink / raw)
  To: Fabrice Gautier, Ecos-List (E-mail)

To be more precise, i only have the problem when debugging through ethernet.
Serial seems to work fine.

Any idea what could be going on ?

Thanks
-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 

> -----Original Message-----
> From: Fabrice Gautier [ mailto:Fabrice_Gautier@sdesigns.com ]
> Sent: Thursday, November 09, 2000 6:54 PM
> To: Ecos-List (E-mail)
> Subject: [ECOS] Interrupt/Ctrl-C problem....
> 
> 
> Hi,
> 
> I almost have a i386 eCos and RedBoot that works perfectly, 
> except for a
> tiny thing.
> 
> The problem can be reproduced with one of my test program joined her.
> 
> The program consist of a main thread and two other threads. 
> Each thread
> printf some string then do a cyg_thread_delay and loop forever.
> 
> I can interrupt the program with ctrl-C a first time, but 
> then I have to
> wait the next output to be able to ctrl-C again. But I don't 
> really know if
> this is the end of a delay or the diag_printf that allows me 
> to interrupt
> again.
> 
> If someone with other archs could test the following test 
> program thank you.
> If this work ok with other arch that would means there is 
> problem left in my
> i386 modifications.
> 
> /*====== hello.c =======*/
> #include <cyg/kernel/kapi.h>
> 
> static char stack1[4096];
> static char stack2[4096];
> static cyg_thread t1;
> static cyg_thread t2;
> 
> void thread1(void *arg)
> {
> 	while(1){
> 		printf("1111_A thread1 here\n");
> 		cyg_thread_delay(777);
> 		printf("1111_B thread1 there\n");
> 		cyg_thread_delay(598);
> 		}	
> }
> 
> void thread2(void *arg)
> {
> 	while(1){
> 		printf("2222_A thread2 here\n");
> 		cyg_thread_delay(547);
> 		printf("2222_B thread2 there\n");
> 		cyg_thread_delay(958);
> 		}			
> }
> 
> void main()
> { 
> 	cyg_handle_t h1,h2;
> 
> 	printf("Hello, world\n");
> 	
> 	cyg_thread_create(10,&thread1,0,"thread1",&stack1,4096,&h1,&t1);
> 	cyg_thread_resume(h1);
> 	cyg_thread_create(10,&thread2,0,"thread2",&stack2,4096,&h2,&t2);
> 	cyg_thread_resume(h2);
> 	
> 	while(1)
> 	{
> 		printf("AA main thread here\n");
> 		cyg_thread_delay(333);
> 		printf("BB main thread there\n");
> 		cyg_thread_delay(1179);
> 	}
> 			
> } //end main
> /*=================*/
> 
> Thank You
> 
> -- 
> Fabrice Gautier
> fabrice_gautier@sdesigns.com 
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-11-10 11:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-09 18:55 [ECOS] Interrupt/Ctrl-C problem Fabrice Gautier
2000-11-10 11:24 Fabrice Gautier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).