RTP IPL/Startup source code

Hi

Any idea when the source for the IPL and startup-bios will be available for
the RTP?

Cheers

Jim

Do you have the IPL and startup code that is distributed with
Neutrino 2.0? I’d guess it is very similar if not exactly the
same.

Previously, Jim Atkins wrote in qdn.public.qnxrtp.os:

Hi

Any idea when the source for the IPL and startup-bios will be available for
the RTP?

Cheers

Jim

I tried copying it across and tweaking to correct paths for *.mk files but
it won’t build and I don’t have the time to faff around with it
unfortunately :frowning:

All I want to do is add 2 lines in main.c and remake to generate a new
startup-bios file…

Jim Atkins <jamesa@tsd.serco.com> wrote:
: I tried copying it across and tweaking to correct paths for *.mk files but
: it won’t build and I don’t have the time to faff around with it
: unfortunately :frowning:

: All I want to do is add 2 lines in main.c and remake to generate a new
: startup-bios file…

If you create the following directory structure

/usr/nto/src/nto and then extract your startup source under
here (keeping the original directory structure intact) does
it build for you? What are the errors you are seeing? Are you
using the nto2.0 release code?


Peter Martin

I tried moving /usr/nto/src/nto/startup and all of its sub-dirs over to RtP,
but Make choked on qconfig.mk with something about too many words or some such.
Not being willing to learn what the hell is going on in qconfig.mk, I gave up.

-Warren “it made my brain hurt” Peece


“Peter Martin” <peterm@qnx.com> wrote in message
news:90p457$m63$1@nntp.qnx.com
| Jim Atkins <jamesa@tsd.serco.com> wrote:
| : I tried copying it across and tweaking to correct paths for *.mk files but
| : it won’t build and I don’t have the time to faff around with it
| : unfortunately :frowning:
|
| : All I want to do is add 2 lines in main.c and remake to generate a new
| : startup-bios file…
|
| If you create the following directory structure
|
| /usr/nto/src/nto and then extract your startup source under
| here (keeping the original directory structure intact) does
| it build for you? What are the errors you are seeing? Are you
| using the nto2.0 release code?

Peter Martin

Thats the stage I got to after sorting out the paths so that make could find
the relevant *.mk files. Same error about too many words… I really need
this quite urgently.

Trouble is I’m not a make expert and there are soooo many levels of *.mk
files included that I stopped just b4 I lost the will to live.

Jim ‘Blown Stack’ Atkins

Oh and yes I’m using the Nto 2.0 code…

Jim Atkins <jamesa@tsd.serco.com> wrote:

Thats the stage I got to after sorting out the paths so that make could find
the relevant *.mk files. Same error about too many words… I really need
this quite urgently.

Trouble is I’m not a make expert and there are soooo many levels of *.mk
files included that I stopped just b4 I lost the will to live.

Tsk. You must become one with the makefiles… the tao of the makefiles
is joyful and complete :slight_smile:.

What exactly is the error message that you’re seeing? What is the full
path of the directory that you’re typing “make” in? Let me guess that you’re
seeing:

/usr/include/qconfig.mk:6: *** the `word’ function takes a
one-origin index argument. Stop.

And that you’re in a directory that doesn’t have “src”, “cvs” or “qssl”
as the component on top of the “nto” directory. The makefiles need to know
where the top of the source tree is, and determines that by looking for
a path name component of “src”, “cvs”, or “qssl”.

Brian “Nobody better make fun of my makefiles” Stecher


Brian Stecher (bstecher@qnx.com) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8

ah - ta muchly - i’ll give that a go then…

Warren Peece <warren@nospam.com> wrote:
: I tried moving /usr/nto/src/nto/startup and all of its sub-dirs over to RtP,
: but Make choked on qconfig.mk with something about too many words or some such.
: Not being willing to learn what the hell is going on in qconfig.mk, I gave up.

Can you post the error? That might help me in looking at this.

Peter

: -Warren “it made my brain hurt” Peece


: “Peter Martin” <peterm@qnx.com> wrote in message
: news:90p457$m63$1@nntp.qnx.com
: | Jim Atkins <jamesa@tsd.serco.com> wrote:
: | : I tried copying it across and tweaking to correct paths for *.mk files but
: | : it won’t build and I don’t have the time to faff around with it
: | : unfortunately :frowning:
: |
: | : All I want to do is add 2 lines in main.c and remake to generate a new
: | : startup-bios file…
: |
: | If you create the following directory structure
: |
: | /usr/nto/src/nto and then extract your startup source under
: | here (keeping the original directory structure intact) does
: | it build for you? What are the errors you are seeing? Are you
: | using the nto2.0 release code?
: |
: | –
: | Peter Martin

“Brian Stecher” <bstecher@qnx.com> wrote in message
news:90quc8$nji$3@nntp.qnx.com
|
| Tsk. You must become one with the makefiles… the tao of the makefiles
| is joyful and complete :slight_smile:.
|
| What exactly is the error message that you’re seeing? What is the full
| path of the directory that you’re typing “make” in? Let me guess that you’re
| seeing:
|
| /usr/include/qconfig.mk:6: *** the `word’ function takes a
| one-origin index argument. Stop.
|
| And that you’re in a directory that doesn’t have “src”, “cvs” or “qssl”
| as the component on top of the “nto” directory. The makefiles need to know
| where the top of the source tree is, and determines that by looking for
| a path name component of “src”, “cvs”, or “qssl”.
|
| Brian “Nobody better make fun of my makefiles” Stecher

Forgive me master, for I know not what the hell I do. I installed everything
under /u/src/nto/… and lo and behold, the joyful and complete tao of the
makefile was one with me. And there was much rejoicing, and Brave Sir Robin
ate his minstrels! Oh wait, wrong reality. Anywho, thanks for enlightening me
with your divine and infinite wisdom.

-Warren “I never woulda thought of that” Peece

Anybody that want to learn about the true power of make should
have a look at Brian’s makefile. I never though make could do
that much!!!

“Brian Stecher” <bstecher@qnx.com> wrote in message
news:90quc8$nji$3@nntp.qnx.com

Jim Atkins <> jamesa@tsd.serco.com> > wrote:
Thats the stage I got to after sorting out the paths so that make could
find
the relevant *.mk files. Same error about too many words… I really
need
this quite urgently.

Trouble is I’m not a make expert and there are soooo many levels of *.mk
files included that I stopped just b4 I lost the will to live.

Tsk. You must become one with the makefiles… the tao of the makefiles
is joyful and complete > :slight_smile:> .

What exactly is the error message that you’re seeing? What is the full
path of the directory that you’re typing “make” in? Let me guess that
you’re
seeing:

/usr/include/qconfig.mk:6: *** the `word’ function takes a
one-origin index argument. Stop.

And that you’re in a directory that doesn’t have “src”, “cvs” or “qssl”
as the component on top of the “nto” directory. The makefiles need to know
where the top of the source tree is, and determines that by looking for
a path name component of “src”, “cvs”, or “qssl”.

Brian “Nobody better make fun of my makefiles” Stecher


Brian Stecher (> bstecher@qnx.com> ) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M
1W8

So it built for you then Warren?

I copied from /startup (metrowerks flavour) down to /usr/ntox86/src and did
a textto -l on all the files to get rid of the cursed ^M 's.

What directory did you kick make off from ?

I’m ,kicking it off from /usr/ntox86/src/nto/startup and it appears to be
trying to make (after I copied over the Metrowerks flavour startup.h) but
goes bang when trying to compile hw_cpuid_string.c with ‘Invalid asm
statement’ line:107 ‘fixed or forbidden register 0 (ax) was spilled for
class AREG’

Hmmmm. Did this happen to you?

Another thing was that I thought you could start make from
startup/boards/bios - If I try this I get 'No rule to make target ‘startup’,
nedded by ‘/startup-’. Stop.

Any ideas?

“Jim Atkins” <jamesa@tsd.serco.com> wrote in message
news:912e0n$13g$1@inn.qnx.com

So it built for you then Warren?

There were a couple of include files, related to the uncompress stuff, which
I had to copy across and stick in the lib subdirectory. Other than that, it
all compiled and assembled fine.

I copied from /startup (metrowerks flavour) down to /usr/ntox86/src and
did
a textto -l on all the files to get rid of the cursed ^M 's.

What directory did you kick make off from ?

I copied everything to /u/src/nto/startup, and kicked off Make from there
too (the startup directory). You oughta be able to kick it off from any
lower directory as well (startup/lib or startup/lib/x86 for example).

I’m ,kicking it off from /usr/ntox86/src/nto/startup and it appears to be
trying to make (after I copied over the Metrowerks flavour startup.h) but
goes bang when trying to compile hw_cpuid_string.c with ‘Invalid asm
statement’ line:107 ‘fixed or forbidden register 0 (ax) was spilled for
class AREG’

Hmmmm. Did this happen to you?

Nope, it did not happen to me.

Another thing was that I thought you could start make from
startup/boards/bios - If I try this I get 'No rule to make target
‘startup’,
nedded by ‘/startup-’. Stop.

Any ideas?

I didn’t specifically try making from that point. In fact, since I realized
that the environment still required a little tweaking (copying over .h
files, and a library- I forget which one) I decided that there was no way to
make a “full and permanent” RtP development environment yet as there would
have to be an official RtP release. So I nuked all of the startup/boards
stuff that I didn’t need (I have a nobios custom board thingie). But I did
manage to compile all of it, including those other boards directories,
before I “cleaned house”. There must be some subtle differences between the
QNX4 and Metrodoesntwerks stuff?

-Warren

Jim Atkins <jamesa@tsd.serco.com> wrote:

I’m ,kicking it off from /usr/ntox86/src/nto/startup and it appears to be
trying to make (after I copied over the Metrowerks flavour startup.h) but
goes bang when trying to compile hw_cpuid_string.c with ‘Invalid asm
statement’ line:107 ‘fixed or forbidden register 0 (ax) was spilled for
class AREG’

Versionitis. The QNX 4 hosted Nto 2.0 release was compiled with gcc 2.8.1
and it didn’t mind that code. RTP is distributed with gcc 2.95.2 and it
complains. I believe the following replacement should make it happy:


static unsigned long
hw_cpuid(int v, void *p) {
unsigned long ret;

asm volatile(
“pushfl;”
“popl %%ebx;”
“movl %%ebx, %%ecx;”
“xorl $0x00200000,%%ecx;”
“pushl %%ecx;”
“popfl;”
“pushfl;”
“popl %%ebx;”
“cmpl %%ebx, %%ecx;”
“je 1f;”
“xorl %%eax, %%eax;”
“jmp 2f;”
“1:;”
“cpuid;”
“orl %%esi, %%esi;”
“jz 2f;”
“movl %%ebx, 0(%%esi);”
“movl %%edx, 4(%%esi);”
“movl %%ecx, 8(%%esi);”
“2:”
: “=a” (ret)
:“a” (v), “S” (p)
: “ebx”, “ecx”, “edx”, “memory”);

return ret;
}

Another thing was that I thought you could start make from
startup/boards/bios - If I try this I get 'No rule to make target ‘startup’,
nedded by ‘/startup-’. Stop.

The boards/… subtree assumes that libstartup.a is built already. You
need to go into the lib/x86/a directory and (once you’ve fixed the above
problem) type “make” there first.

\

Brian Stecher (bstecher@qnx.com) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8

I’m using the 2.11 beta thingie for QNX4. Was that file “fixed” there because
I didn’t see it complain. I guess I could have missed it but I thought make
bailed out if something went awry.


“Brian Stecher” <bstecher@qnx.com> wrote in message
news:912r95$c5p$2@nntp.qnx.com
| Jim Atkins <jamesa@tsd.serco.com> wrote:
| > I’m ,kicking it off from /usr/ntox86/src/nto/startup and it appears to be
| > trying to make (after I copied over the Metrowerks flavour startup.h) but
| > goes bang when trying to compile hw_cpuid_string.c with ‘Invalid asm
| > statement’ line:107 ‘fixed or forbidden register 0 (ax) was spilled for
| > class AREG’
|
| Versionitis. The QNX 4 hosted Nto 2.0 release was compiled with gcc 2.8.1
| and it didn’t mind that code. RTP is distributed with gcc 2.95.2 and it
| complains. I believe the following replacement should make it happy:
|
|
| static unsigned long
| hw_cpuid(int v, void *p) {
| unsigned long ret;
|
| asm volatile(
| “pushfl;”
| “popl %%ebx;”
| “movl %%ebx, %%ecx;”
| “xorl $0x00200000,%%ecx;”
| “pushl %%ecx;”
| “popfl;”
| “pushfl;”
| “popl %%ebx;”
| “cmpl %%ebx, %%ecx;”
| “je 1f;”
| “xorl %%eax, %%eax;”
| “jmp 2f;”
| “1:;”
| “cpuid;”
| “orl %%esi, %%esi;”
| “jz 2f;”
| “movl %%ebx, 0(%%esi);”
| “movl %%edx, 4(%%esi);”
| “movl %%ecx, 8(%%esi);”
| “2:”
| : “=a” (ret)
| :“a” (v), “S” (p)
| : “ebx”, “ecx”, “edx”, “memory”);
|
| return ret;
| }
|
| > Another thing was that I thought you could start make from
| > startup/boards/bios - If I try this I get 'No rule to make target
‘startup’,
| > nedded by ‘/startup-’. Stop.
|
| The boards/… subtree assumes that libstartup.a is built already. You
| need to go into the lib/x86/a directory and (once you’ve fixed the above
| problem) type “make” there first.
|

Brian Stecher (bstecher@qnx.com) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8

Warren Peece <warren@nospam.com> wrote:

I’m using the 2.11 beta thingie for QNX4. Was that file “fixed” there because
I didn’t see it complain. I guess I could have missed it but I thought make
bailed out if something went awry.

Yeah, it was fixed in-house last March. Actually, that does point out
a problem with using the 2.0 sources - the compression algorithm changed
back in July and the old source won’t understand how to decompress new
images (ones marked with “[+compress]” in the build script).

\

Brian Stecher (bstecher@qnx.com) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8

I’m still unable to build it (still get the no targets for startup- error
even though libstartup.a is present in lib) and it sounds as though it may
not be worth continuing with. The last thing I want is a mismatch of
different flavour libraries…

Sounds like I’d better hang on then for the RTP version. Any idea when the
startup stuff will be available for RTP?

I’ll restate though that I’m gonna need this very soon as my customer wants
a demo early in the new year…

Why not just trade-in the MetroDoesntWerks version for the QNX4 version? I
bet you could sweet-talk them into that one with little difficulty…


“Jim Atkins” <jamesa@tsd.serco.com> wrote in message
news:9159j8$nni$1@inn.qnx.com

I’m still unable to build it (still get the no targets for startup- error
even though libstartup.a is present in lib) and it sounds as though it may
not be worth continuing with. The last thing I want is a mismatch of
different flavour libraries…

Sounds like I’d better hang on then for the RTP version. Any idea when the
startup stuff will be available for RTP?

I’ll restate though that I’m gonna need this very soon as my customer
wants
a demo early in the new year…

Jim Atkins <jamesa@tsd.serco.com> wrote:

Sounds like I’d better hang on then for the RTP version. Any idea when the
startup stuff will be available for RTP?

It’s a packaging issue rather than a technical one - I don’t know
when they have it scheduled to do. They may be waiting for when we make
all the source available that we said that we going to.

If you do get the Neutrino 2.1 package, that has the same startup source
that RTP uses.


Brian Stecher (bstecher@qnx.com) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8