Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - running QNX with "qemu-minimal.build" problem: (6 Items)
   
running QNX with "qemu-minimal.build" problem  
Hi everyone,

I'm trying to run QNX (source code) on QEMU but either the compilation, 
or the image creation went wrong. I expect to end-up with a running 
console/shell.

What I did and what happened is detailed here:

$ ls
    image/       qconf-override.mk   stage/
    hide-gnu.sh  qemu-minimal.build  trunk/
$ sudo su
# ./hide-gnu.sh trunk
    Locating GNUmakefile's in trunk/
    Touching trunk/utils/t/tcpdump/win32/prj/Makefile.dnm
# cd trunk
# svn info
    URL: http://community.qnx.com/svn/repos/core_networking/trunk
    Repository Root: http://community.qnx.com/svn/repos/core_networking
    Repository UUID: 79cfb829-523c-0410-9886-d489a5a0dd87
    Revision: 764
    Node Kind: directory
    Schedule: normal
    Last Changed Author: seanb@qnx.com
    Last Changed Rev: 764
    Last Changed Date: 2009-01-27 21:47:03 +0100 (Tue, 27 Jan 2009)
# make OSLIST=nto CPULIST=x86 hinstall
    (... lot of output)
# ls ../stage
    usr
# ls ../stageetc
    openssl
# make OSLIST=nto CPULIST=x86 install
    (... lot of output)
# cd ..
# exit
$ ls stage
    etc  usr  x86
$ ls stageetc
    openssl
$ mkifs qemu-minimal.build image/qemu-minimal.ifs
    Warning: Host file 'npm-tcpip.so' missing.
    Warning: Host file 'io-net' missing.
$ dinit -H -R -f image/qemu-minimal.ifs image/qnx_on_qemu.img
    All existing files on image/qnx_on_qemu.img will be lost!  Are you 
sure (y or n) ? y
    Using loader /opt/qnx640/target/qnx6/x86/boot/sys/ipl-diskpc2-flop
    Disk 'image/qnx_on_qemu.img' contains 2097152 blocks (1048576K).
$ dinit -B pc2 image/qnx_on_qemu.img
    Using loader /opt/qnx640/target/qnx6/x86/boot/sys/ipl-diskpc2
$ qemu -hda image/qnx_on_qemu.img -k fr-ch

The screen shot (qemu) is attached to this mail (basically says "unable 
to start ..." and "unable to access dev/...").

- Does the problem come from the missing files ('npm-tcpip.so' and 
'io-net': I only found trunk/sys/dev_qnx/shim/x86/dll/io-net.o) ? (I 
don't think so, but that's the only clue I get)
- Is it the 'qemu-minimal.build' from 
[NeutrinoAsGuestInQEMU/qemu-minimal.build] that needs to be fixed?
- Or is there anything above that looks strange to you?
- I found no information about that 'stageetc' directory that was 
created by 'make hinstall' , I tried to link it inside 'stage/etc' but I 
got no better results.

Thanks for any help.
Pietro
Attachment: Image qnx_on_qemu1+2.png 23.91 KB
RE: running QNX with "qemu-minimal.build" problem  
Pietro - the errors you see can be translated in errno.h
 
It looks like you have 6.3.2 installed.   The libc.so version changed from 2 to 3
in 6.4.0, and this is used as the ldqnx.so.2 dynamic linker, hence 83 (ESHLIBACC)
 
The following errors are as a result of the core servers failing to start.
 
For running 6.3.2 binaries on 6.4.0 we do supply a compat version of libc.so.2
 
Colin

________________________________

From: Pietro Descombes [mailto:community-noreply@qnx.com]
Sent: Thu 1/29/2009 7:31 AM
To: general-qemu
Subject: running QNX with "qemu-minimal.build" problem



Hi everyone,

I'm trying to run QNX (source code) on QEMU but either the compilation,
or the image creation went wrong. I expect to end-up with a running
console/shell.

What I did and what happened is detailed here:

$ ls
    image/       qconf-override.mk   stage/
    hide-gnu.sh  qemu-minimal.build  trunk/
$ sudo su
# ./hide-gnu.sh trunk
    Locating GNUmakefile's in trunk/
    Touching trunk/utils/t/tcpdump/win32/prj/Makefile.dnm
# cd trunk
# svn info
    URL: http://community.qnx.com/svn/repos/core_networking/trunk
    Repository Root: http://community.qnx.com/svn/repos/core_networking
    Repository UUID: 79cfb829-523c-0410-9886-d489a5a0dd87
    Revision: 764
    Node Kind: directory
    Schedule: normal
    Last Changed Author: seanb@qnx.com
    Last Changed Rev: 764
    Last Changed Date: 2009-01-27 21:47:03 +0100 (Tue, 27 Jan 2009)
# make OSLIST=nto CPULIST=x86 hinstall
    (... lot of output)
# ls ../stage
    usr
# ls ../stageetc
    openssl
# make OSLIST=nto CPULIST=x86 install
    (... lot of output)
# cd ..
# exit
$ ls stage
    etc  usr  x86
$ ls stageetc
    openssl
$ mkifs qemu-minimal.build image/qemu-minimal.ifs
    Warning: Host file 'npm-tcpip.so' missing.
    Warning: Host file 'io-net' missing.
$ dinit -H -R -f image/qemu-minimal.ifs image/qnx_on_qemu.img
    All existing files on image/qnx_on_qemu.img will be lost!  Are you
sure (y or n) ? y
    Using loader /opt/qnx640/target/qnx6/x86/boot/sys/ipl-diskpc2-flop
    Disk 'image/qnx_on_qemu.img' contains 2097152 blocks (1048576K).
$ dinit -B pc2 image/qnx_on_qemu.img
    Using loader /opt/qnx640/target/qnx6/x86/boot/sys/ipl-diskpc2
$ qemu -hda image/qnx_on_qemu.img -k fr-ch

The screen shot (qemu) is attached to this mail (basically says "unable
to start ..." and "unable to access dev/...").

- Does the problem come from the missing files ('npm-tcpip.so' and
'io-net': I only found trunk/sys/dev_qnx/shim/x86/dll/io-net.o) ? (I
don't think so, but that's the only clue I get)
- Is it the 'qemu-minimal.build' from
[NeutrinoAsGuestInQEMU/qemu-minimal.build] that needs to be fixed?
- Or is there anything above that looks strange to you?
- I found no information about that 'stageetc' directory that was
created by 'make hinstall' , I tried to link it inside 'stage/etc' but I
got no better results.

Thanks for any help.
Pietro


_______________________________________________
General
http://community.qnx.com/sf/go/post20977


Attachment: Text winmail.dat 6.49 KB
Re: RE: running QNX with "qemu-minimal.build" problem  
Hi Colin,

thanks for replying!
So,

1) yes! the ./trunk/utils/t/tcpdump/win32/Include/errno.h file reveals the natures of errors
	#define	ELIBEXEC	83	/* Cannot exec a shared library directly */
	#define	ENOENT		 2	/* No such file or directory */
This shows not surprisingly components are missing from the image (2) and not executed (83).
(no ESHLIBACC in this file)


2) versions: You're write to point out that I might be confused: I've got Momentics 6.4.0 (qnxsdp-6.4.0-x86-200810211530
-linux.bin) which installed itself in '/opt/qnx640'.
Regarding the QNX source, as I downloaded it a few days ago with svn, and updated it just before sending my post, so I 
have the latest build (or almost if changed since then). That's why I THINK I have source 6.4.0. 
The only thing I changed in the version number in the 'qemu-minimal.build' welcome message.
There are many files named 'version*' but they don't help much.


3) libc.so
I think that's the trick! I do have several files called that way in $QNX_TARGET (but none in the source):
	/opt/qnx640/target/qnx6/x86/lib/libc.so.3
	/opt/qnx640/target/qnx6/x86/lib/libc.so.1
	/opt/qnx640/target/qnx6/x86/lib/libc.so
	/opt/qnx640/target/qnx6/x86/lib/libc.so.2

In 'qemu-minimal.build' replacing, the line "libc.so" by "libc.so.2" avoids all the (83) errors :-)) . "Mounting 
Filesystems" and "Starting esh" don't show error messages anymore, but I still can't type anything in the (esh) console.


I've tried several other unsuccessful tweaks in 'qemu-minimal.build'.  and other ".build" files found in 'opt/target/
qnx6/x86/boot/build/': different behaviour, still nothing usable.


4) I still wonder what why I get those:
	<<	Warning: Host file 'npm-tcpip.so' missing.
		Warning: Host file 'io-net' missing.			>>
which I can't find anywhere. I can disable them by removing the components in 'qemu-minimal.build', but that message 
shows that there is a problem somewhere. 

And why are there so many missing files in '/dev/' (see qemu's running outputs), files not included properly?


I have a sneaking suspicion that the compilation isn't doing all it's job. All the elements stated in  'qemu-minimal.
build' come from Momentics rather than 'stage' or 'trunk'. Even 'procnto' doesn't come from my compilation. How come?


Yes, that's a long post... I hope you have the patience to read that.
You did help me already, but things still don't work on.

Pietro
Re: running QNX with "qemu-minimal.build" problem  
Hi Pietro,

Ok, it sounds like you are using 6.4.0

In that case, you change your qemu-minimal.build to use libc.so.3

Change the libc.so.2 back to libc.so (or libc.so.3)

if you are going to run any 6.3.2 binaries then also add libc.so.2 (it's fairly small)

You should then change the /usr/lib/ldqnx.so.2 link to point to libc.so.3

io-net is no longer shipped with 6.4.0 - now it's io-pkt, and npm-tcpip.so is included directly
in that binary.  You should probably check to see if the driver has been updated to the devnp-*.so version.

WRT mkifs not getting the components from your build, mkxfs will normally look in $QNX_TARGET, which is the
momentics install.  You should try adding -r <yourbuilddir> as an option to mkifs

Regards,

Colin

Pietro Descombes wrote:
> Hi Colin,
> 
> thanks for replying!
> So,
> 
> 1) yes! the ./trunk/utils/t/tcpdump/win32/Include/errno.h file reveals the natures of errors
> 	#define	ELIBEXEC	83	/* Cannot exec a shared library directly */
> 	#define	ENOENT		 2	/* No such file or directory */
> This shows not surprisingly components are missing from the image (2) and not executed (83).
> (no ESHLIBACC in this file)
> 
> 
> 2) versions: You're write to point out that I might be confused: I've got Momentics 6.4.0 (qnxsdp-6.4.0-x86-
200810211530-linux.bin) which installed itself in '/opt/qnx640'.
> Regarding the QNX source, as I downloaded it a few days ago with svn, and updated it just before sending my post, so I
 have the latest build (or almost if changed since then). That's why I THINK I have source 6.4.0. 
> The only thing I changed in the version number in the 'qemu-minimal.build' welcome message.
> There are many files named 'version*' but they don't help much.
> 
> 
> 3) libc.so
> I think that's the trick! I do have several files called that way in $QNX_TARGET (but none in the source):
> 	/opt/qnx640/target/qnx6/x86/lib/libc.so.3
> 	/opt/qnx640/target/qnx6/x86/lib/libc.so.1
> 	/opt/qnx640/target/qnx6/x86/lib/libc.so
> 	/opt/qnx640/target/qnx6/x86/lib/libc.so.2
> 
> In 'qemu-minimal.build' replacing, the line "libc.so" by "libc.so.2" avoids all the (83) errors :-)) . "Mounting 
Filesystems" and "Starting esh" don't show error messages anymore, but I still can't type anything in the (esh) console.

> 
> I've tried several other unsuccessful tweaks in 'qemu-minimal.build'.  and other ".build" files found in 'opt/target/
qnx6/x86/boot/build/': different behaviour, still nothing usable.
> 
> 
> 4) I still wonder what why I get those:
> 	<<	Warning: Host file 'npm-tcpip.so' missing.
> 		Warning: Host file 'io-net' missing.			>>
> which I can't find anywhere. I can disable them by removing the components in 'qemu-minimal.build', but that message 
shows that there is a problem somewhere. 
> 
> And why are there so many missing files in '/dev/' (see qemu's running outputs), files not included properly?
> 
> 
> I have a sneaking suspicion that the compilation isn't doing all it's job. All the elements stated in  'qemu-minimal.
build' come from Momentics rather than 'stage' or 'trunk'. Even 'procnto' doesn't come from my compilation. How come?
> 
> 
> Yes, that's a long post... I hope you have the patience to read that.
> You did help me already, but things still don't work on.
> 
> Pietro
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post21096
> 

-- 
cburgess@qnx.com
Re: running QNX with "qemu-minimal.build" problem  
Hi Colin,

I'm back! So,

Shame on me! I took the wrong project source (core_networking instead of coreos_pub). I didn't even have a procnto!! 
Once rectified, I still had the same problems though (83 and 2). But following your instructions, that is,
     - changing the build file as you told to, and
     - adding "-r stage" to mkifs command
solved the problems :-))

Thanks a lot for your helpful replies !!!
Pietro



For those whom it might help, here is la little detail on changes that made it work for me:

In "qemu-minimal.build" (to match later versions)
- change the link code-line to match "procmgr_symlink ../../proc/boot/libc.so.3 /usr/lib/ldqnx.so.2"
- change all the "io.net" into "io-pkt-v4" and replace "waitfor /dev/io-net/en0" by "waitfor /proc/boot/io-pkt-v4"
- comment or remove "npm-tcpip.so"
Then make image using "mkifs -r stage -v qemu-minimal.build qemu-minimal.ifs" (the verbose mode has helped me finding 
out and fixing what was being done).
Re: running QNX with "qemu-minimal.build" problem  
I have a similar problem.
# uname -a
QNX localhost 6.5.0 2010/03/12-01: 55:55 EST x86pc x86
then start qemu
# qemu-hda hd.raw -vga std -m 128
qemu is written in the following
Booting from Hard Disk ...
Hit Esc for. Altboot .................................D
is exactly the letter D - in the end. Then nothing happens.
All this runs under vmware (vmware -> QNX 6.5.0 -> qemu -> qnx6).
How do I fix this?
Attachment: Image 1.jpg 73.87 KB