[pc386 BSP] ticker.exe issue (CVS head)

Karel Gardas kgardas at objectsecurity.com
Mon Jan 30 07:58:21 UTC 2006


Hello,

I was not able to find out which toolchain combination I used in August 
2005, nor which exact version of RTEMS I used that days. I've tried to get 
back in CVS history, but also w/o success.

Anyway, I tried to debug this issue, and I started with hacking ticker.exe 
test. I've added some printfs and/or a bit waiting before creating next 
task and now I see at least TA3 is running as expected. The issue is while 
others are not running/ticking?

See patch below. If you uncomment added printfs, TA3 should run well. If I 
keep it as it is, tasks are just started and after short period of time I 
get a lot of messages to the console -- I cannot read them, since it 
scrolls too fast and its VGA. I've tried the same in Qemu and got:
silence:/images$ ~/usr/local/qemu-2005-12-18/bin/qemu -fda 
/images/grub-boot.flp
Trying to execute code outside RAM or ROM at 0xef57f000

EAX=ef57f000 EBX=0000000a ECX=001275a0 EDX=00000001
ESI=0012d130 EDI=00000000 EBP=0012c624 ESP=0012c5f8
EIP=ef57f000 EFL=00003002 [-------] CPL=0 II=0 A20=1 HLT=0
ES =0010 00000000 ffffffff 00cf9300
CS =0008 00000000 ffffffff 00cf9e00
SS =0010 00000000 ffffffff 00cf9300
DS =0010 00000000 ffffffff 00cf9300
FS =0010 00000000 ffffffff 00cf9300
GS =0010 00000000 ffffffff 00cf9300
LDT=0000 00000000 0000ffff 00008000
TR =0000 00000000 0000ffff 00008000
GDT=     00123620 00000017
IDT=     00123640 000007ff
CR0=00050033 CR2=00000000 CR3=00000000 CR4=00000000
CCS=0000000c CCD=0012c600 CCO=SUBL
FCW=037f FSW=0000 [ST=0] FTW=00 MXCSR=00001f80
FPR0=0000000000000000 0000 FPR1=0000000000000000 0000
FPR2=0000000000000000 0000 FPR3=0000000000000000 0000
FPR4=0000000000000000 0000 FPR5=0000000000000000 0000
FPR6=0000000000000000 0000 FPR7=0000000000000000 0000
XMM00=00000000000000000000000000000000 
XMM01=00000000000000000000000000000000
XMM02=00000000000000000000000000000000 
XMM03=00000000000000000000000000000000
XMM04=00000000000000000000000000000000 
XMM05=00000000000000000000000000000000
XMM06=00000000000000000000000000000000 
XMM07=00000000000000000000000000000000
Aborted
silence:/images$


Any idea what's going wrong here?

Thanks,
Karel

PS: patch to ticker looks like:

Index: init.c
===================================================================
RCS file: /usr1/CVS/rtems/testsuites/samples/ticker/init.c,v
retrieving revision 1.12
diff -u -r1.12 init.c
--- init.c	4 Sep 2003 18:53:41 -0000	1.12
+++ init.c	30 Jan 2006 07:48:58 -0000
@@ -38,7 +38,7 @@
    rtems_status_code status;
    rtems_time_of_day time;

-  puts( "\n\n*** CLOCK TICK TEST ***" );
+  puts( "\n\n*** CLOCK TICK TEST (HACKED!) ***" );

    time.year   = 1988;
    time.month  = 12;
@@ -68,7 +68,9 @@
    );

    status = rtems_task_start( Task_id[ 1 ], Test_task, 1 );
+  status = rtems_task_wake_after( get_ticks_per_second() );
    status = rtems_task_start( Task_id[ 2 ], Test_task, 2 );
+  status = rtems_task_wake_after( get_ticks_per_second() );
    status = rtems_task_start( Task_id[ 3 ], Test_task, 3 );

    status = rtems_task_delete( RTEMS_SELF );
Index: tasks.c
===================================================================
RCS file: /usr1/CVS/rtems/testsuites/samples/ticker/tasks.c,v
retrieving revision 1.11
diff -u -r1.11 tasks.c
--- tasks.c	30 Mar 2004 11:12:01 -0000	1.11
+++ tasks.c	30 Jan 2006 07:48:58 -0000
@@ -32,6 +32,8 @@

    status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
    task_index = task_number( tid );
+  put_name( Task_name[ task_index ], FALSE);
+/*   printf(": ticks per second: %d\n", get_ticks_per_second() ); */
    for ( ; ; ) {
      status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
      if ( time.second >= 35 ) {
@@ -40,6 +42,7 @@
      }
      put_name( Task_name[ task_index ], FALSE );
      print_time( " - rtems_clock_get - ", &time, "\n" );
+/*     printf("...wake after %d ticks\n", task_index * 5 * get_ticks_per_second()); */
      status = rtems_task_wake_after( task_index * 5 * get_ticks_per_second() );
    }
  }

On Sat, 28 Jan 2006, Karel Gardas wrote:

>
> Hello,
>
> short followup. I've tested also these configurations with today CVS head, 
> but all were broken:
>
> vanilla gcc3.4.5 + vanilla newlib1.14.0
> patched gcc4.0.0 + patched newlib1.13.0 (gcc-4.0.0-rtems-20050502.diff, 
> newlib-1.13.0-rtems-20050512.diff)
> vanilla gcc3.4.3 + patched newlib1.13.0 (newlib-1.13.0-rtems-20050512.diff)
> patched gcc3.4.0 + patched newlib1.13.0 (gcc-3.4.0-rtems-20040510.diff, 
> newlib-1.13.0-rtems-20050512.diff)
>
> everything with patched binutils 2.16.1 (binutils-2.16.1-rtems-20050816.diff)
>
> Is there anybody here running some kind of older CVS head where ticker runs 
> fine? I'm asking, since I know it was running fine at least a bit before 
> August 23 2005, when I submited patch for pc386 automatic timer functionality 
> detection.
>
> Thanks,
> Karel
>
> On Sat, 28 Jan 2006, Karel Gardas wrote:
>
>> 
>> Joel,
>> 
>> IIRC you've had some issues with ticker test for pc386 BSP on CVS head with 
>> latest tool-chain. I remember you've been talking about miscompilation. 
>> Now, I've used vanilla gcc4.0.2, vanilla newlib1.14.0 and binutils 2.16.1 + 
>> binutils-2.16.1-rtems-20050816.diff patch. I've compiled pc386 BSP from 
>> today sources and while testing I've found that ticker.exe prints first 
>> four lines:
>> 
>> *** CLOCK TICK TEST ***
>> TA1 - tm_get - 09:00:00   12/31/1988
>> TA2 - tm_get - 09:00:00   12/31/1988
>> TA3 - tm_get - 09:00:00   12/31/1988
>> 
>> 
>> then "blocks", but it seems processor is strangely "working" since
>> after some time I see it is corrupting content of the console (VGA)
>> RAM. i.e. I see few random chars with few random colors spread over
>> the screen.
>> 
>> My question is: have you already solved this your "ticker miscompilation" 
>> issue or is it still unsolved and I'm hitting exactly this issue?
>> 
>> Thanks,
>> Karel
>> --
>> Karel Gardas                  kgardas at objectsecurity.com
>> ObjectSecurity Ltd.           http://www.objectsecurity.com
>> 
>
> --
> Karel Gardas                  kgardas at objectsecurity.com
> ObjectSecurity Ltd.           http://www.objectsecurity.com
>

--
Karel Gardas                  kgardas at objectsecurity.com
ObjectSecurity Ltd.           http://www.objectsecurity.com



More information about the users mailing list