network boot

Has anyone successfully built an os image that is suitable for loading
over a network from a bootp/tftp server? I have been playing around
with ‘etherboot’ but can’t seem to get an os image built that
etherboot likes…any ideas?

btw…here is the url for the etherboot home page:
http://etherboot.sourceforge.net/

Thanks,
Carlton

“Carlton Haycock” <chaycock@bytewise.com> wrote in message
news:ExkzPGIVaKRmYc7mo8BYpDspeGri@4ax.com

Has anyone successfully built an os image that is suitable for loading
over a network from a bootp/tftp server? I have been playing around
with ‘etherboot’ but can’t seem to get an os image built that
etherboot likes…any ideas?

btw…here is the url for the etherboot home page:
http://etherboot.sourceforge.net/

Did you specify the location of the the image (in memory when the ROM code
loads the image) in the build file? Does the etherboot system download the
image from the bootp server? or does that step not succeed either?

-Adam

With PPC I use prepboot because the network loaders tend to jump to the base address
after loading the image into ram, prepboot will put a jump there that jumps to
the correct entry point for startup.

[image=0x1f0000]
[virtual=ppcbe/prepboot] .bootstrap = {
./ppc/be/startup-xxxx -D 8250.feff00c0.0 -v
PATH=/proc/boot procnto-600 -vvvv
}

Regards
Jason

Operating Systems Group <os@qnx.com> wrote:

“Carlton Haycock” <> chaycock@bytewise.com> > wrote in message
news:> ExkzPGIVaKRmYc7mo8BYpDspeGri@4ax.com> …
Has anyone successfully built an os image that is suitable for loading
over a network from a bootp/tftp server? I have been playing around
with ‘etherboot’ but can’t seem to get an os image built that
etherboot likes…any ideas?

btw…here is the url for the etherboot home page:
http://etherboot.sourceforge.net/

Did you specify the location of the the image (in memory when the ROM code
loads the image) in the build file? Does the etherboot system download the
image from the bootp server? or does that step not succeed either?

-Adam

“Carlton Haycock” <> chaycock@bytewise.com> > wrote in message
news:> ExkzPGIVaKRmYc7mo8BYpDspeGri@4ax.com> …
Has anyone successfully built an os image that is suitable for loading
over a network from a bootp/tftp server? I have been playing around
with ‘etherboot’ but can’t seem to get an os image built that
etherboot likes…any ideas?

btw…here is the url for the etherboot home page:
http://etherboot.sourceforge.net/

Did you specify the location of the the image (in memory when the ROM code
loads the image) in the build file? Does the etherboot system download the
image from the bootp server? or does that step not succeed either?

-Adam

Adam,

Etherboot downloaded successfully via bootp. Apparently etherboot is
expecting a file in ELF or Tagged format. I just used one of the .ifs
files that was already built in the /boot/fs dir…and Etherboot did
not like the format of the file…I know that is probably not what I
need to be doing…therefore if you can point
me in the right direction I would appreciate it.

Thanks,
Carlton

I’m not sure if that will help or not…I think that etherboot is
expecting an ELF formated file, from which it can determine the load
address and other info…

Jason Clarke <jclarke@qnx.com> wrote:

With PPC I use prepboot because the network loaders tend to jump to the base address
after loading the image into ram, prepboot will put a jump there that jumps to
the correct entry point for startup.

[image=0x1f0000]
[virtual=ppcbe/prepboot] .bootstrap = {
./ppc/be/startup-xxxx -D 8250.feff00c0.0 -v
PATH=/proc/boot procnto-600 -vvvv
}

Regards
Jason

Operating Systems Group <> os@qnx.com> > wrote:

“Carlton Haycock” <> chaycock@bytewise.com> > wrote in message
news:> ExkzPGIVaKRmYc7mo8BYpDspeGri@4ax.com> …
Has anyone successfully built an os image that is suitable for loading
over a network from a bootp/tftp server? I have been playing around
with ‘etherboot’ but can’t seem to get an os image built that
etherboot likes…any ideas?

btw…here is the url for the etherboot home page:
http://etherboot.sourceforge.net/

Did you specify the location of the the image (in memory when the ROM code
loads the image) in the build file? Does the etherboot system download the
image from the bootp server? or does that step not succeed either?

-Adam

“Carlton Haycock” <chaycock@bytewise.com> wrote in message
news:fWwzPE5Yl38lUqwEmIZfz1JPMPcz@4ax.com

Adam,

Etherboot downloaded successfully via bootp. Apparently etherboot is
expecting a file in ELF or Tagged format. I just used one of the .ifs
files that was already built in the /boot/fs dir…and Etherboot did
not like the format of the file…I know that is probably not what I
need to be doing…therefore if you can point
me in the right direction I would appreciate it.

You’re right - the OS image files are not in elf format, but I wouldn’t
expect the Network loader to expect that either. It should just clock the
image in at a certain well-known location, and simply jump to the start of
the image. I don’t see where in the docs for etherboot it says you must
have elf format for an image.

-Adam

“Core OS Product Group” <os@qnx.com> wrote:

“Carlton Haycock” <> chaycock@bytewise.com> > wrote in message
news:> fWwzPE5Yl38lUqwEmIZfz1JPMPcz@4ax.com> …

Adam,

Etherboot downloaded successfully via bootp. Apparently etherboot is
expecting a file in ELF or Tagged format. I just used one of the .ifs
files that was already built in the /boot/fs dir…and Etherboot did
not like the format of the file…I know that is probably not what I
need to be doing…therefore if you can point
me in the right direction I would appreciate it.

You’re right - the OS image files are not in elf format, but I wouldn’t
expect the Network loader to expect that either. It should just clock the
image in at a certain well-known location, and simply jump to the start of
the image.

that what I thought too…it would seem logical, but thats not the
way it is…

I don’t see where in the docs for etherboot it says you must
have elf format for an image.

see this link:
http://etherboot.sourceforge.net/doc/html/userman-4.html

section 4.1 “Making a tagged image”


I have also been playing around with trying to get an ifs image
to boot from floppy…not having much luck there…I am able
to build and ifs image, but when transfered to floppy and boot
it, it just hangs…I used the ‘finstall.build’ sample file in the
/boot directory to build the ifs…could you give me some
step-by-step on what to do once I get an ifs? I have looked at
the online docs and the sys-admin book, but they all stop short
of telling you exactly what you need to do…

Thanks,
Carlton

I have had no problem making a bootable floppy. Make sure:

  • the floppy is QNX formatted and mounted
  • copy the ifs to //.boot


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


“Carlton Haycock” <chaycock@bytewise.com> wrote in message
news:m4o0PK6MfxJqXx5LmBHbYzLt4Tpm@4ax.com

“Core OS Product Group” <> os@qnx.com> > wrote:


“Carlton Haycock” <> chaycock@bytewise.com> > wrote in message
news:> fWwzPE5Yl38lUqwEmIZfz1JPMPcz@4ax.com> …

Adam,

Etherboot downloaded successfully via bootp. Apparently etherboot is
expecting a file in ELF or Tagged format. I just used one of the .ifs
files that was already built in the /boot/fs dir…and Etherboot did
not like the format of the file…I know that is probably not what I
need to be doing…therefore if you can point
me in the right direction I would appreciate it.

You’re right - the OS image files are not in elf format, but I wouldn’t
expect the Network loader to expect that either. It should just clock
the
image in at a certain well-known location, and simply jump to the start
of
the image.

that what I thought too…it would seem logical, but thats not the
way it is…

I don’t see where in the docs for etherboot it says you must
have elf format for an image.

see this link:
http://etherboot.sourceforge.net/doc/html/userman-4.html

section 4.1 “Making a tagged image”


I have also been playing around with trying to get an ifs image
to boot from floppy…not having much luck there…I am able
to build and ifs image, but when transfered to floppy and boot
it, it just hangs…I used the ‘finstall.build’ sample file in the
/boot directory to build the ifs…could you give me some
step-by-step on what to do once I get an ifs? I have looked at
the online docs and the sys-admin book, but they all stop short
of telling you exactly what you need to do…

Thanks,
Carlton

Bill,

Perhaps that is the problem, I was just using dd to copy the .ifs file
to /dev/fd0.

I will try what you suggest.
Thanks,
Carlton

“Bill Caroselli” <qtps@earthlink.net> wrote:

I have had no problem making a bootable floppy. Make sure:

  • the floppy is QNX formatted and mounted
  • copy the ifs to //.boot

Also you could
#dinit -f filename.ifs /dev/fd0
It will creat qnx filesystem on floppy and copy image to .boot on floppy.
Best regards,
Eduard.

The number is the errno for that error, if you look in the errno.h file
you’ll see that 83 = “Can’t access shared library”. Looking at your build
file, you haven’t included the shared libc (ie. libc.so) which is required.

Reading over some of the Etherboot doc’s it looks like you may need to
port/modify the tool called mknbi . According to the docs each kernel (ie.
OS) requires their own port of the tool to create the network boot image
that etherboot expects.


Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>
“Carlton Haycock” <chaycock@bytewise.com> wrote in message
news:EMA1PJiZiFmAJ+1H+ju3mIAOEQSY@4ax.com

That is actually what I did…after reading Bill’s suggestion and
checking out the man page for fdformat, it pointed me to the dinit
section that describes that…it seemed to work, now however I am
getting errors starting the executables when the disk boots…stuff
like:

Unable to start “/proc/boot/seedres” (83)
Unable to start “/proc/boot/devc-con” (83)

…and so on for all the execs called by the startup script…
if anyone is interested, attached below is the build file I used to
generate the ifs image…

\


[virtual=x86,bios +compress] boot = {
startup-bios
PATH=/proc/boot LD_LIBRARY_PATH=/proc/boot procnto -v
}

[+script] startup-script = {
/proc/boot/seedres
/proc/boot/devc-con -e &
waitfor /dev/con1
reopen /dev/con1
[+session] PATH=/proc/boot esh &
devb-eide &
devb-fdc &
waitfor /dev/fd0
mount -t qnx4 /dev/fd0 /fd
}


libcam.so
io-blk.so
cam-disk.so
fs-qnx4.so

[data=copy]
seedres
devb-eide
devb-fdc
devc-con
dinit
/proc/boot/mount=/bin/mount
/proc/boot/esh=/bin/esh
/proc/boot/ls=/bin/ls

[type=link] /usr/lib/ldqnx.so.1=/proc/boot/libc.so.1
[type=link] /usr/lib/libcam.so.1=/proc/boot/libcam.so.1
[type=link] /dev/console=/dev/con1

\




“ed1k” <> ed1k@yahoo.com> > wrote:

Also you could
#dinit -f filename.ifs /dev/fd0
It will creat qnx filesystem on floppy and copy image to .boot on floppy.
Best regards,
Eduard.

That is actually what I did…after reading Bill’s suggestion and
checking out the man page for fdformat, it pointed me to the dinit
section that describes that…it seemed to work, now however I am
getting errors starting the executables when the disk boots…stuff
like:

Unable to start “/proc/boot/seedres” (83)
Unable to start “/proc/boot/devc-con” (83)

…and so on for all the execs called by the startup script…
if anyone is interested, attached below is the build file I used to
generate the ifs image…


[virtual=x86,bios +compress] boot = {
startup-bios
PATH=/proc/boot LD_LIBRARY_PATH=/proc/boot procnto -v
}

[+script] startup-script = {
/proc/boot/seedres
/proc/boot/devc-con -e &
waitfor /dev/con1
reopen /dev/con1
[+session] PATH=/proc/boot esh &
devb-eide &
devb-fdc &
waitfor /dev/fd0
mount -t qnx4 /dev/fd0 /fd
}


libcam.so
io-blk.so
cam-disk.so
fs-qnx4.so

[data=copy]
seedres
devb-eide
devb-fdc
devc-con
dinit
/proc/boot/mount=/bin/mount
/proc/boot/esh=/bin/esh
/proc/boot/ls=/bin/ls

[type=link] /usr/lib/ldqnx.so.1=/proc/boot/libc.so.1
[type=link] /usr/lib/libcam.so.1=/proc/boot/libcam.so.1
[type=link] /dev/console=/dev/con1




“ed1k” <ed1k@yahoo.com> wrote:

Also you could
#dinit -f filename.ifs /dev/fd0
It will creat qnx filesystem on floppy and copy image to .boot on floppy.
Best regards,
Eduard.

Adam Mallory <amallory@qnx.com> wrote:

: The number is the errno for that error, if you look in the errno.h file
: you’ll see that 83 = “Can’t access shared library”. Looking at your build
: file, you haven’t included the shared libc (ie. libc.so) which is required.

Here’s how to determine which shared libraries you need. This is now in
the Building Embedded Systems guide:

Shared libraries

The first thing you’ll need to do is to ensure that the shared objects
required by the various drivers you’ll be running are present. All drivers
require at least the standard C library shared object (libc.so). Since
the shared object search order looks in /proc/boot, you don’t have
to do anything special, except include the shared library into the image.
This is done by simply specifying the name of the shared library on a
line by itself, meaning “include this file.”

The following buildfile snippet applies:

include the C shared library

libc.so

create a symlink called ldqnx.so.2 to it

[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so

How do you determine which shared objects you need in the image?
You can use the objdump utility to display information about the
executables you’re including in the image; look for the objects marked
as NEEDED For example, suppose you’re including ping in your image:

$ objdump -x which ping | grep NEEDED
objdump: /usr/bin/ping: no symbols
NEEDED libsocket.so.2
NEEDED libc.so.2

The ping executable needs libsocket.so.2 and libc.so.2.
You need to use objdump recursively to see what these shared
objects need:

$ objdump -x /lib/libsocket.so.2 | grep NEEDED
NEEDED libc.so.2
$ objdump -x /lib/libc.so.2 | grep NEEDED
$

The libsocket.so.2 shared object needs only libc.so.2, which,
in turn, needs nothing. So, if you’re including ping in your image, you
also need to include these two shared objects.


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems

Adam,

Thanks for the quick reply. I appreciate the pointer on where to look
up error numbers…I did not know if that error number was the same
as the ones listed in errno.h…apparently it is.
I can’t believe I left out the shared lib…I did go back and put it
in and tried the procedure again…unfortunately I still must be
doing something wrong…here is what I tried:

first, I tried putting in the line libc.so, still got the same
results, then I tried libc.so.1, still got the same results…I did a
‘dumpifs’ and it shows the library and corresponding link that mkifs
created to the library…but I still get the error 83

I was also wondering about something, I did a search on the system
and noticed that there is also a libc.so.2…how do I know which one
to use…and what is the difference between the libc.so.1 and
libc.so.2?

Thanks,
Carlton


“Adam Mallory” <amallory@qnx.com> wrote:

The number is the errno for that error, if you look in the errno.h file
you’ll see that 83 = “Can’t access shared library”. Looking at your build
file, you haven’t included the shared libc (ie. libc.so) which is required.

Reading over some of the Etherboot doc’s it looks like you may need to
port/modify the tool called mknbi . According to the docs each kernel (ie.
OS) requires their own port of the tool to create the network boot image
that etherboot expects.

“Carlton Haycock” <chaycock@bytewise.com> wrote in message
news:fto1PJNKptZ5gpMt3txzLhL+XWCL@4ax.com

first, I tried putting in the line libc.so, still got the same
results, then I tried libc.so.1, still got the same results…I did a
‘dumpifs’ and it shows the library and corresponding link that mkifs
created to the library…but I still get the error 83

change the following lines:

[type=link] /usr/lib/ldqnx.so.1=/proc/boot/libc.so.1
[type=link] /usr/lib/libcam.so.1=/proc/boot/libcam.so.1

to

[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so
[type=link] /usr/lib/libcam.so.2=/proc/boot/libcam.so

and just include the libs as libc.so and libcam.so

I was also wondering about something, I did a search on the system
and noticed that there is also a libc.so.2…how do I know which one
to use…and what is the difference between the libc.so.1 and
libc.so.2?

The so.1 series is build against GNU libs and is there for backwards
compatability from 6.0. The so.2 series is build against the Dinkum
libraries and/or a change in compatability (to the so.1) was made. In the
end you should use the so.2 series most of the time - unless a program
requires the so.1 (objdump -x | grep “NEEDED” ), in which case you
should keep everything the same (see above) but include libc.so.1 and
libc.so.2


Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>

Thanks for your input Steve. I have done what you suggested
and the modules that I included all needed libc.so.2, which I
included and still get the same error. I did a dumpifs to verify
that they were indeed included and they are. I’m sure it is something
small that I am overlooking, but have no idea what it is.

Thanks,
Carlton


Steve Reid <stever@qnx.com> wrote:

Adam Mallory <> amallory@qnx.com> > wrote:

: The number is the errno for that error, if you look in the errno.h file
: you’ll see that 83 = “Can’t access shared library”. Looking at your build
: file, you haven’t included the shared libc (ie. libc.so) which is required.

Here’s how to determine which shared libraries you need. This is now in
the Building Embedded Systems guide:

Shared libraries

The first thing you’ll need to do is to ensure that the shared objects
required by the various drivers you’ll be running are present. All drivers
require at least the standard C library shared object (libc.so). Since
the shared object search order looks in /proc/boot, you don’t have
to do anything special, except include the shared library into the image.
This is done by simply specifying the name of the shared library on a
line by itself, meaning “include this file.”

The following buildfile snippet applies:

include the C shared library

libc.so

create a symlink called ldqnx.so.2 to it

[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so

How do you determine which shared objects you need in the image?
You can use the objdump utility to display information about the
executables you’re including in the image; look for the objects marked
as NEEDED For example, suppose you’re including ping in your image:

$ objdump -x which ping | grep NEEDED
objdump: /usr/bin/ping: no symbols
NEEDED libsocket.so.2
NEEDED libc.so.2

The ping executable needs libsocket.so.2 and libc.so.2.
You need to use objdump recursively to see what these shared
objects need:

$ objdump -x /lib/libsocket.so.2 | grep NEEDED
NEEDED libc.so.2
$ objdump -x /lib/libc.so.2 | grep NEEDED
$

The libsocket.so.2 shared object needs only libc.so.2, which,
in turn, needs nothing. So, if you’re including ping in your image, you
also need to include these two shared objects.


Steve Reid > stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems

Thanks again for your help. I will try this and keep my fingers
crossed. :slight_smile:

Carlton

“Adam Mallory” <amallory@qnx.com> wrote:

“Carlton Haycock” <> chaycock@bytewise.com> > wrote in message
news:> fto1PJNKptZ5gpMt3txzLhL+XWCL@4ax.com> …

first, I tried putting in the line libc.so, still got the same
results, then I tried libc.so.1, still got the same results…I did a
‘dumpifs’ and it shows the library and corresponding link that mkifs
created to the library…but I still get the error 83

change the following lines:

[type=link] /usr/lib/ldqnx.so.1=/proc/boot/libc.so.1
[type=link] /usr/lib/libcam.so.1=/proc/boot/libcam.so.1

to

[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so
[type=link] /usr/lib/libcam.so.2=/proc/boot/libcam.so

and just include the libs as libc.so and libcam.so

I was also wondering about something, I did a search on the system
and noticed that there is also a libc.so.2…how do I know which one
to use…and what is the difference between the libc.so.1 and
libc.so.2?

The so.1 series is build against GNU libs and is there for backwards
compatability from 6.0. The so.2 series is build against the Dinkum
libraries and/or a change in compatability (to the so.1) was made. In the
end you should use the so.2 series most of the time - unless a program
requires the so.1 (objdump -x | grep “NEEDED” ), in which case you
should keep everything the same (see above) but include libc.so.1 and
libc.so.2

Hi,

Has anyone successfully built an os image that is suitable for loading
over a network from a bootp/tftp server? I have been playing around
with ‘etherboot’ but can’t seem to get an os image built that
etherboot likes…any ideas?

btw…here is the url for the etherboot home page:
http://etherboot.sourceforge.net/

I saw this posting and that’s why I wanna ask you the one little question. Did
you get any valuable results with this stuff?

As for me I got something - there is a Anders Larsen’s mkQNXnbi program which
produce the network boot image (tagged image) from the QNX boot image. Program’s
documentation mentions about QNX 4.2x only, but it works with QNX 6.x images too,
at least for me :slight_smile: The only one bad thing I saw - OS boot image size has limit in
512K (it looks like QNX 4.2x heritage). I haven’t enough time to catch this problem
now. But… At least, it works at all.

You can find mkQNXnbi program in the contrib directory, see in the Etherboot source
tree.

Bye for now,
Igor Mazanov,
SWD Software Ltd.,
Technical Support Team.