Assembly language and qnx for code performance measuring

Greetings,

i am pretty new to qnx (downloading the iso image, while i write this
lines.) and have a few questions:
So QNX is a RTOS?
Can i do assembly programming in qnx? ( which syntax AT&T or INTEL?)
Can i ‘lock’ the system to avoid that my programm could be desturbed?
Are the GNU-tools (gcc, make, gas…) available for QNX ?

I have to do some performance measuring in assembly language (using the
instruction rdtsc ) and wonder if i can do it with qnx.
(Windows and Linux seems to be unuseable, because i can’t make my programm
uninterruptable) The problem is that the taks/program should not be
desturbed during measuring.
Is it possible to make a funktion/task uninterruptable in QNX, and are there
any examples on how to do it?

Thanks in advance,
Mike

Thank you, Mario, for the quick reply.

I’ll try it out. Did’nt thougt its that easy (simple cli instruction). I
allready tried to set the task priority to realtime at a windows programm,
but without success. RTDSC returned up to 3 different values at 5 runs.
However, i’ll try QNX. (as soon as the download completes :slight_smile: )

Thx, again,
Mike




Mario Charest <mcharest@nowayzinformatic.com> schrieb in im Newsbeitrag:
9ng9ho$o4o$1@inn.qnx.com

“Mike” <> just.me@aon.at> > wrote in message news:9ng73o$mu4$> 1@inn.qnx.com> …
Greetings,

i am pretty new to qnx (downloading the iso image, while i write this
lines.) and have a few questions:
So QNX is a RTOS?

Yes

Can i do assembly programming in qnx? ( which syntax AT&T or INTEL?)

Yes, not sure which one though.

Can i ‘lock’ the system to avoid that my programm could be desturbed?

Yes but that’s generaly consider unfriendly > :wink:

Are the GNU-tools (gcc, make, gas…) available for QNX ?


Yes

I have to do some performance measuring in assembly language (using the
instruction rdtsc ) and wonder if i can do it with qnx.

Sure you can. As a matter of fact the function ClockPeriod() is a C cover
for rdtsc.

(Windows and Linux seems to be unuseable, because i can’t make my
programm
uninterruptable) The problem is that the taks/program should not be
desturbed during measuring.

Is it possible to make a funktion/task uninterruptable in QNX, and are
there
any examples on how to do it?


Yes, simply disable interrupts. Check doc for InterruptEnable(). Note
that
if you disable it for too long you could cause some problems. The other
method
is to set the process to high priority, but it would still be disturb by
interrupts.


Thanks in advance,
Mike



\

“Mario Charest” <mcharest@nowayzinformatic.com> wrote in message
news:9ng9ho$o4o$1@inn.qnx.com

Are the GNU-tools (gcc, make, gas…) available for QNX ?


Yes

I noticed the 6.1 ships with ‘nasm’.

  • igor

Mike <just.me@aon.at> wrote:

Thank you, Mario, for the quick reply.

I’ll try it out. Did’nt thougt its that easy (simple cli instruction). I
allready tried to set the task priority to realtime at a windows programm,
but without success. RTDSC returned up to 3 different values at 5 runs.
However, i’ll try QNX. (as soon as the download completes > :slight_smile: > )

You will find that after the first couple of runs (remember that there is
going to be changes in the first couple of runs due to caching) and that under
QNX the times of a high prioirty task will be pretty stable. You can just
leave the interrupts on normally too and the numbers will stay pretty
consistant (at least in my tests).

chris

\

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Hi Mike

The way I read your post, you want to write some asm code and then do a
performance test on it?

If you do successfully lock out interrupts, then you should see the exact
same cycle times regardless of what OS your running under.

The caviots being:

  1. the memory caching that was already mentioned AND is essentially OS
    independant
  2. weather or not you can actually lock out interrupts

However, RTP will yield the most satisfactory results without the need to
lock out interrupts. It will allow you to designate how important your
process is, by virtue of priority, and then respect that priority set for
the process as compared to every other process. Even though an interrupt
may still preempt your process, unless you do disable interrupts during very
small blocks of code, the RTP philosophy in most drivers is to do an
absolute minimum amount of work in an interrupt handler, turn off the
interrupt and schedue a regular process to do the rest of the driver work,
at whatever priority is appropriate for that driver.

Bill Caroselli


“Mike” <just.me@aon.at> wrote in message news:9ng73o$mu4$1@inn.qnx.com

Can i do assembly programming in qnx? ( which syntax AT&T or INTEL?)
Can i ‘lock’ the system to avoid that my programm could be desturbed?
Are the GNU-tools (gcc, make, gas…) available for QNX ?

I have to do some performance measuring in assembly language (using the
instruction rdtsc ) and wonder if i can do it with qnx.
(Windows and Linux seems to be unuseable, because i can’t make my programm
uninterruptable) The problem is that the taks/program should not be
desturbed during measuring.
Is it possible to make a funktion/task uninterruptable in QNX, and are
there
any examples on how to do it?

Thanks in advance,
Mike

\

Igor Kovalenko a écrit :

“Mario Charest” <> mcharest@nowayzinformatic.com> > wrote in message
news:9ng9ho$o4o$> 1@inn.qnx.com> …

Are the GNU-tools (gcc, make, gas…) available for QNX ?


Yes


I noticed the 6.1 ships with ‘nasm’.

  • igor

Sincerely, Is there a good reason to write asm code regarding to the
performance of compilers?
Even if an asm guru can write a better code ( how many time spent to
find a better optimization than gcc3.0?) What could be the gain of time
on actual CPUs?

Regards,
Alain.

“Mike” <just.me@aon.at> wrote in message news:9ng73o$mu4$1@inn.qnx.com

Greetings,

i am pretty new to qnx (downloading the iso image, while i write this
lines.) and have a few questions:
So QNX is a RTOS?

Yes

Can i do assembly programming in qnx? ( which syntax AT&T or INTEL?)

Yes, not sure which one though.

Can i ‘lock’ the system to avoid that my programm could be desturbed?

Yes but that’s generaly consider unfriendly :wink:

Are the GNU-tools (gcc, make, gas…) available for QNX ?

Yes

I have to do some performance measuring in assembly language (using the
instruction rdtsc ) and wonder if i can do it with qnx.

Sure you can. As a matter of fact the function ClockPeriod() is a C cover
for rdtsc.

(Windows and Linux seems to be unuseable, because i can’t make my programm
uninterruptable) The problem is that the taks/program should not be
desturbed during measuring.

Is it possible to make a funktion/task uninterruptable in QNX, and are
there
any examples on how to do it?

Yes, simply disable interrupts. Check doc for InterruptEnable(). Note that
if you disable it for too long you could cause some problems. The other
method
is to set the process to high priority, but it would still be disturb by
interrupts.


Thanks in advance,
Mike

\

Hi Mike,

Mike <just.me@aon.at> wrote in article <9ngaf8$om2$1@inn.qnx.com>…

Thank you, Mario, for the quick reply.

I’ll try it out. Did’nt thougt its that easy (simple cli instruction). I
allready tried to set the task priority to realtime at a windows programm,
but without success.

You said it! I know only one trick for win9X (not NT): write dos-16 application and cli there. The
one of my windows program execs 16-bit app in order to receive high-speed data. It’s not a good
solution. Try QNX :wink:

Regards,
Eduard.

Greetings,

thx for the tip, ( nasm is the magic word :slight_smile: ) i did not found it yet on the
iso image (also not on qnx.com) so i thought to compile it myself,
unfortunatly i have a few lesser problems with my network environment. ( i
have to RTFM a lot about QNX :slight_smile: ).
However,
Thank you for the hint!
Mike



Igor Kovalenko <kovalenko@home.com> schrieb in im Newsbeitrag:
9ngeo1$qso$1@inn.qnx.com

“Mario Charest” <> mcharest@nowayzinformatic.com> > wrote in message
news:9ng9ho$o4o$> 1@inn.qnx.com> …

Are the GNU-tools (gcc, make, gas…) available for QNX ?


Yes


I noticed the 6.1 ships with ‘nasm’.

  • igor

Greetings again,

i just like to write code in assembly language, and whenever i do it i like
to produce the best possible code. By the way, if somebody can confirm that
there’s a QNX port of NASM is available, please let me know. :slight_smile: (I prefer
NASM’s intel style syntax rather than GAS’s AT&T style syntax… )

Thank you all for your great support,
Mike


Mario Charest <mcharest@nowayzinformatic.com> schrieb in im Newsbeitrag:
9nj1q6$n5t$1@inn.qnx.com

“Alain Bonnefoy” <> alain.bonnefoy@icbt.com> > wrote in message
news:> 3B9C5EC9.456FC741@icbt.com> …
Igor Kovalenko a écrit :

“Mario Charest” <> mcharest@nowayzinformatic.com> > wrote in message
news:9ng9ho$o4o$> 1@inn.qnx.com> …

Are the GNU-tools (gcc, make, gas…) available for QNX ?


Yes


I noticed the 6.1 ships with ‘nasm’.

  • igor

Sincerely, Is there a good reason to write asm code regarding to the
performance of compilers?
Even if an asm guru can write a better code ( how many time spent to
find a better optimization than gcc3.0?) What could be the gain of time
on actual CPUs?


I think that today because CPU are highly complex, it’s much
better to live that to the compiler. This is expecially true for RISC
cpu or a P4.



Regards,
Alain.
\

“Alain Bonnefoy” <alain.bonnefoy@icbt.com> wrote in message
news:3B9C5EC9.456FC741@icbt.com

Igor Kovalenko a écrit :

“Mario Charest” <> mcharest@nowayzinformatic.com> > wrote in message
news:9ng9ho$o4o$> 1@inn.qnx.com> …

Are the GNU-tools (gcc, make, gas…) available for QNX ?


Yes


I noticed the 6.1 ships with ‘nasm’.

  • igor

Sincerely, Is there a good reason to write asm code regarding to the
performance of compilers?
Even if an asm guru can write a better code ( how many time spent to
find a better optimization than gcc3.0?) What could be the gain of time
on actual CPUs?

I think that today because CPU are highly complex, it’s much
better to live that to the compiler. This is expecially true for RISC
cpu or a P4.



Regards,
Alain.

We use nasm. I believe it compiled more or less “out of the box”.

Mike wrote:

Greetings again,

i just like to write code in assembly language, and whenever i do it i like
to produce the best possible code. By the way, if somebody can confirm that
there’s a QNX port of NASM is available, please let me know. > :slight_smile: > (I prefer
NASM’s intel style syntax rather than GAS’s AT&T style syntax… )

Thank you all for your great support,
Mike

Mario Charest <> mcharest@nowayzinformatic.com> > schrieb in im Newsbeitrag:
9nj1q6$n5t$> 1@inn.qnx.com> …

“Alain Bonnefoy” <> alain.bonnefoy@icbt.com> > wrote in message
news:> 3B9C5EC9.456FC741@icbt.com> …
Igor Kovalenko a écrit :

“Mario Charest” <> mcharest@nowayzinformatic.com> > wrote in message
news:9ng9ho$o4o$> 1@inn.qnx.com> …

Are the GNU-tools (gcc, make, gas…) available for QNX ?


Yes


I noticed the 6.1 ships with ‘nasm’.

  • igor

Sincerely, Is there a good reason to write asm code regarding to the
performance of compilers?
Even if an asm guru can write a better code ( how many time spent to
find a better optimization than gcc3.0?) What could be the gain of time
on actual CPUs?


I think that today because CPU are highly complex, it’s much
better to live that to the compiler. This is expecially true for RISC
cpu or a P4.



Regards,
Alain.
\