Booting from a CF on a PC104

Hi.

I’ve read many articles from this forum about my problem, but I’m completely unable to boot a SanDisk CF 256 MB with an embedded image. I’m using a PC PCM5896, with an IDE onboard controller, and a CF PC-104 module.

In the BIOS, The main hard disk is configured in LBA mode as master. The CF card is configured as slave, in LBA mode with 248:32:63 Cylinders:Heads:Sectors parameters.

If I install the QNX 6.3.0 distribution on the CF, it boots and works perfectly. But, I want to do my own embedded version.

I do the following steps:

  1. umount /dev/hd1t77 (when I boot QNX from the HDD, it is already mounted)
  2. fdisk /dev/hd1 delete all
  3. fdisk /dev/hd1 add -s1 -t77 -p100
  4. fdisk /dev/hd1 boot -s1
  5. fdisk /dev/hd1 loader

If I do fdisk /dev/hd1, it sees the 248:32:63 LBA parameters.

  1. mount -e /dev/hd1
  2. dinit -hb /dev/hd1t77 (it applies ipl-diskpc2-flop by default)
8) dinit -f image.ifs -h /dev/hd1t77

If I mount it now, the .boot is the same as the image.ifs, so ok.

I reboot. I choose to boot from Drive 2, Partition 1 and it says:

Hit Esc for .altboot …S

Since my own image didn’t work, I tried the simplest: /boot/build/bios.build


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

[+script] startup-script = {
# Programs require the runtime linker (ldqnx.so) to be at a fixed location
        procmgr_symlink ../../proc/boot/libc.so.2 /usr/lib/ldqnx.so.2

# Start up some consoles
        devc-con -n4 &
        reopen /dev/con1

        display_msg Welcome to QNX Neutrino on an PC compatible BIOS system

        slogger &

# Start the pci server
        seedres
        pci-bios &
        waitfor /dev/pci

# Some common servers
        pipe &
        mqueue &
        devc-ser8250 -e &
        devc-pty &

# Start a debug server for debugging programs
        waitfor /dev/ser1
        [+session] pdebug /dev/ser1 &

# These env variables inherited by all the programs which follow
    SYSNAME=nto
    TERM=qansi

# Start some extra shells on other consoles
        reopen /dev/con2
        [+session] sh &
        reopen /dev/con3
        [+session] sh &

# Start a high priority shell just in case....
        reopen /dev/con4
        [pri=25 +session] sh &

# Start the main shell
        reopen /dev/con1
        [+session] sh
#       [+session] login -p
}

# Cheat and make the /temp point to the shared memory area...
[type=link] /tmp=/dev/shmem

# Redirect console messages for syslog
# [type=link] /dev/console=/dev/con1

# We use the "c" shared lib (which also contains the runtime linker)
libc.so

# Just incase someone needs floating point...
fpemu.so.2

# The files above this line can be shared by mutiple processes
[data=c]
# Executables must currently be below this line

# Include a console driver
devc-con

# Include pci server
pci-bios
seedres

# Use the "public domain korn shell" as the default shell "sh"
sh=ksh
# or use the smaller non-posix "Fat Embedded Shell" as the default shell "sh"
#sh=fesh

# Other executables
pdebug
pipe
mqueue
devc-ser8250
devc-pty
ls
cat
pidin
uname
slogger
sloginfo

but, still it does not boot. The mkifs -v does not give any error

I’m desperated :cry:

I’ve realized that the CF does not even boot up with a QNX 6.3.0 installation… I was booting from the hard disk (master) and mounting then the CF as / (When you have two installations (one in each disk), it asks you which one to mount as /).

I read in the forum that Sandisk CFs are not recommendable… I’ll buy a Kingston just in case. Any opinion about this brand? ;)

Meanwhile, any advice will be quite appreciated. Thanks

Dar

Dar,

I’ve not used the exact brand of PC-104 board that you have but I have done the same thing you are doing (hard disk and CF in same machine creating an image on the CF then later booting from the CF without the harddrive present) without any problems.

In fact I’ve never encountered even the slightest problem at all and I have used Sandisk’s (tho I recommend the Ultra II)

From what you describe your doing everything correctly. The …S indicates the real problem (no O/S signature found) which means the PC-104 didn’t find the QNX boot image for some reason.

My initial guess is that in the Bios you have the CF as a slave. Can you change the CF to be a Master on IDE channel 2 (or a Master on IDE1 if the hard drive is removed) and try again.

Tim

Thanks, Tim for your advice.

In fact, it seems that there are too many factors (most not very clear) to make a CF boot… I found many, many ways scattered in this forum.

For my case, for this PCM-5896 motherboard, with an IDE onboard controller, and a CF PC-104 module, using a SandDisk CF 256 MB and QNX 6.3.0, the way I’ve found to make a CF bootable is the following:

  1. Make sure the CF is configured as LBA in BIOS. In my case was as slave, so it will be /dev/hd1 in qnx.

Booting from the QNX 6.3.0 from the master harddisk, I do:

  1. fdisk /dev/hd1 info

Be sure that the C:H:S parameters are the same as the BIOS sees. In my case, even being exactly the same, fdisk was giving a warning…

  1. fdisk /dev/hd1

Delete all partitions using the menu.

  1. fdisk /dev/hd1 delete all
  2. fdisk /dev/hd1 add -s1 -t77 -p100
  3. mount -e /dev/hd1
  4. dinit -h /dev/hd1
    8 ) mount /dev/hd1t77 /fs/cf
  5. cp image.ifs /fs/cf/.boot
  6. fdisk /dev/hd1 loader
  7. fdisk /dev/hd1 boot -t77
  8. mount -e /dev/hd1
  9. dloader /dev/hd1 /boot/sys/ipl-diskpc1
  10. dloader /dev/hd1t77 /boot/sys/ipl-diskpc2

I reboot, I choose booting from Disk 2 (the CF) and partition 1. It works!!! :slight_smile: :slight_smile:

So, after this, you can change your image as much as you like, compile it with mkifs and copy it as .boot without touching fdisk or similiar (it’s already bootable).

I hope this is useful for other people. I spent a whole day try&error…

Regards,

Dar