Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Steps to get a bootable .ifs file?: (7 Items)
   
Steps to get a bootable .ifs file?  
Hi Everybody,

Just started exploring QNX. Installed Momentics 6.3.2 on Linux (Ubuntu 8.04).
I am using the QNX System Builder to generate a "bootable" .ifs file using the
provided bios.build file for x86 platform. 

On building the project (I did not change anything from the default values), I get
no errors, and I get a .ifs file. I intend to use dd to copy this to a floppy and boot
the system (any normal PC). But using the 'file' command on this .ifs file, I find that
'file' thinks this is a data file (instead of the expected 'x86 boot sector'... at least
that's what I expected).

Could you please explain what am I missing. I just want to build a small bootable
qnx image that I can boot using a floppy (and maybe later from a pendrive). At first
I just want to see it booting. Later I want to put my own 'hello world' executable in
it and see that message once the system boots.

Could you please give the complete steps involved for doing the above (either via
momentics or (preferably) via the command line), and attach a 'typescript' file for
the commands you gave to create it? Once I overcome this initial hurdle, I think 
I will be able to understand the manuals better.

I know I am asking for quite a bit of handholding. But I guess my experience with 
eCos is preventing me from seeing the actual way to create a bootable qnx image.

Thanks in advance for your help.

Regards,
Santanu Chatterjee
Re: Steps to get a bootable .ifs file?  
Try to dinit Your ifs to the floppy:

http://www.qnx.com/developers/docs/6.3.2/neutrino/utilities/d/dinit.html

dinit -f your.ifs /dev/fd0

Better ?

-Jeevan


> Hi Everybody,
> 
> Just started exploring QNX. Installed Momentics 6.3.2 on Linux (Ubuntu 8.04).
> I am using the QNX System Builder to generate a "bootable" .ifs file using the
> 
> provided bios.build file for x86 platform. 
> 
> On building the project (I did not change anything from the default values), I
>  get
> no errors, and I get a .ifs file. I intend to use dd to copy this to a floppy 
> and boot
> the system (any normal PC). But using the 'file' command on this .ifs file, I 
> find that
> 'file' thinks this is a data file (instead of the expected 'x86 boot sector'..
> . at least
> that's what I expected).
> 
> Could you please explain what am I missing. I just want to build a small 
> bootable
> qnx image that I can boot using a floppy (and maybe later from a pendrive). At
>  first
> I just want to see it booting. Later I want to put my own 'hello world' 
> executable in
> it and see that message once the system boots.
> 
> Could you please give the complete steps involved for doing the above (either 
> via
> momentics or (preferably) via the command line), and attach a 'typescript' 
> file for
> the commands you gave to create it? Once I overcome this initial hurdle, I 
> think 
> I will be able to understand the manuals better.
> 
> I know I am asking for quite a bit of handholding. But I guess my experience 
> with 
> eCos is preventing me from seeing the actual way to create a bootable qnx 
> image.
> 
> Thanks in advance for your help.
> 
> Regards,
> Santanu Chatterjee


Re: Steps to get a bootable .ifs file?  
Yes you are right. Once dinit is used to transfer the .ifs file to 
a floppy, it does boot (well, it starts to boot, but then stops
by giving some errors. But I will take some time to solve
this problem before asking again).

I was under the impression that 'dd' and 'dinit' are similar and
hence I did not explore dinit.

Thanks for the help.

Regards,
Santanu Chatterjee
Re: Steps to get a bootable .ifs file?  
> Yes you are right. Once dinit is used to transfer the .ifs file to 
> a floppy, it does boot (well, it starts to boot, but then stops
> by giving some errors. But I will take some time to solve
> this problem before asking again).
> 
> I was under the impression that 'dd' and 'dinit' are similar and
> hence I did not explore dinit.
> 
> Thanks for the help.
> 
> Regards,
> Santanu Chatterjee


No prb welcome. What kind of errors do You see ?

Jeevan
Re: Steps to get a bootable .ifs file?  
Well, I don't remember the exact error messages, but IIRC,
they were driver related. (I will recreate the error situation and
post the error message shortly)

So, the .build file had to be modified a bit (to 'reopen' the 
console driver). Also, a 'hello world' executable was inserted 
into /proc/boot directory.

Now, the image boots, and also displays the 'hello world' message :-)

Then I am sent to a shell (esh). And commands that have been 
included into the build file can be run from there.

Next, I tried to use the same dinit command to write the image to
a flash drive (pendrive). But that did not work out. I guess I have 
to look into the docs to see if I should be using a separate command
for that instead of dinit. So, my next goal is to get the same (hello world) 
effect by booting from a pendrive.

Regards,
Santanu Chatterjee
Re: Steps to get a bootable .ifs file?  
Here a way with using a QNX dev-host.... :


/root# uname -a
QNX QNXHost 6.3.2 2006/03/16-14:20:03EST x86pc x86

disabling usb-auto-enumeration and usb-massstorage driver

/root# slay umass-enum
/root# slay devb-umass

Just my HD is present:
/root# ls /dev/hd*
/dev/hd0       /dev/hd0t77    /dev/hd0t78    /dev/hd0t79

my usb stack is running:

/root# pidin -pio-usb arg
     pid Arguments
    4101 io-usb -duhci -dohci -dehci
/root#

plugged in a usbstick the usb util reports it correctly.

/root# usb
...
...
...
...

Device Address             : 3
Vendor                     : 0x1307 (USBest Technology)
Product                    : 0x0163 (USB Mass Storage Device)
Class                      : 0x00 (Independant per interface)

/root#

starting usb mass storage driver:

/root# devb-umass
/root# Path=0 - QNX USB Storage
 target=0 lun=0     Direct-Access(0) - TinyDisk 2007-01-23       Rev: 0.00

/root#

Ahhh I got /dev/hd1 :


/root# ls /dev/hd*
/dev/hd0       /dev/hd0t77    /dev/hd0t78    /dev/hd0t79    /dev/hd1
/root#

checking if that has some partition on it, with what QNX can deal with :

/root# mount -e /dev/dh1
/root# ls /dev/hd*
/dev/hd0       /dev/hd0t77    /dev/hd0t78    /dev/hd0t79    /dev/hd1
/root#

No, so creating a new QNX partition :

/root# fdisk /dev/hd1 add -t79 -b all
/root#

Above command results in this semigraphical out put :
-----------------------------------------------------------------------------
FDISK
Ignore Next Prev 1 2 3 4 Change Delete Boot Unboot Restore Loader Save Quit

        _____OS_____     Start      End     ______Number_____    Size    Boot
        name    type    Cylinder  Cylinder  Cylinders  Blocks

--> 1.  QNZ    ( 79)          0       125       126     2024127    988 MB  *
    2.  ______ (___)    _______   _______   _______   _________  _____

...
...
-----------------------------------------------------------------------------

/root# ls /dev/hd1*
/dev/hd1
/root#

Mounting the freshly generated partition:


/root# mount -e /dev/hd1
/root# ls /dev/hd1*
/dev/hd1       /dev/hd1t79
/root#

Initing the filesystem on it.

/root# dinit -h /dev/hd1t79
All existing files on /dev/hd1t79 will be lost!  Are you sure (y or n) ? y
Using loader /usr/qnx632/target/qnx6/x86/boot/sys/ipl-diskpc2-flop
Disk '/dev/hd1t79' contains 2024127 blocks (1012063K).
/root#

mounting the filesystem :

/root# mount /dev/hd1t79 /pendrive
/root# ls -l /pendrive/
total 527
drwxrwxr-x  3 root      root           4096 Nov 17 11:19 .
drwxrwxr-x  3 root      root           4096 Nov 17 11:19 ..
-rw-------  1 root      root              0 Nov 17 11:19 .altboot
-r--r--r--  1 root      root         253016 Nov 17 11:19 .bitmap
-rw-------  1 root      root              0 Nov 17 11:19 .boot
-r--r--r--  1 root      root           8192 Nov 17 11:19 .inodes
-r--r--r--  1 root      root              0 Nov 17 11:19 .longfilenames
/root#

Putting the appropriate x86-loaders into place....

/root# dloader /dev/hd1 pc1 /dev/hd1t79 pc2

That should it bee.

Now You only need to copy Your.ifs to /pendrive/.boot .

cp Your.ifs /pendrive/.boot

Configure Your BIOS to boot from Your pendrive and see what happens.

Jeevan
Re: Steps to get a bootable .ifs file?  
i tried to create abootable pendrive using the same steps mentioned. I changed the boot sequence of my PC to boot from 
USB but there is nothing happening. I am not able to boot QNX on my PC. Please help me out with this.