Skip navigation.
Home
The QNX Community Portal

View topic - building boot image with custom device drivers

building boot image with custom device drivers

All topics.

building boot image with custom device drivers

Postby apwest » Tue May 12, 2009 12:57 pm

Hi all,

I've been running QNX 6.3 on a system to do my developmental testing. The system includes an 8 port serial IO card which I needed to install drivers for in the /sbin and /etc/system/enum/devices folders. Now I'd like to build an image containing my application and the serial card drivers (along with some standard utilities). What do I need to do to the build file to get these drivers in the right locations?

FYI, I'm rather new to the QNX/Linux world, and very new to the building boot images process... Any help is much appreciated though!

Thanks,
Andy
apwest
New Member
 
Posts: 9
Joined: Mon Apr 13, 2009 6:55 pm

RE: building boot image with custom device drivers

Postby mario » Tue May 12, 2009 3:37 pm

There is a nice section in the documentation that explain it all.

QNX Neutrino RTOS/Building Embedded System
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: building boot image with custom device drivers

Postby mario » Tue May 12, 2009 4:00 pm

There is a nice section in the documentation that explain it all.

QNX Neutrino RTOS/Building Embedded System
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby apwest » Wed May 13, 2009 6:57 pm

Thanks for the info mario. I looked over the document and there seems to be some good info in there, but I haven't found anything that seems to be directly related to what I want to do (or I'm just too naive to recognize it - which is probably the case).

There were two files that I copied to QNX for the serial card to work:
1. /etc/system/enum/devices/PCISERIAL
Code: Select all
device(pci, ven=135e, dev=7804)
    uniq(sernum, devc-ser, 1)
    driver(8PTPCISER, $(sernum $(ioport1) $(irq) )


2. /sbin/8PTPCISER
Code: Select all
#!/bin/sh
unit=$1
ioport1=$2
ioport2=`echo "obase=16; ibase=16; $ioport1 + 8;" | bc`
ioport3=`echo "obase=16; ibase=16; $ioport2 + 8;" | bc`
ioport4=`echo "obase=16; ibase=16; $ioport3 + 8;" | bc`
ioport5=`echo "obase=16; ibase=16; $ioport4 + 8;" | bc`
ioport6=`echo "obase=16; ibase=16; $ioport5 + 8;" | bc`
ioport7=`echo "obase=16; ibase=16; $ioport6 + 8;" | bc`
ioport8=`echo "obase=16; ibase=16; $ioport7 + 8;" | bc`
irq=$3

devc-ser8250 -u$unit $ioport1,$irq $ioport2,$irq $ioport3,$irq $ioport4,$irq $ioport5,$irq $ioport6,$irq $ioport7,$irq $ioport8,$irq


I know when I'm running a full installation of QNX, the first file (PCISERIAL) gets parsed by the device enumerator, which in turn calls the second file (8PTPCISER) which invokes the serial driver with the correct info.

I could be wrong, but I dont think device enumeration happens in a custom build image. So how do I manually do this in my build file?

Thanks again.
apwest
New Member
 
Posts: 9
Joined: Mon Apr 13, 2009 6:55 pm

Postby mario » Wed May 13, 2009 7:37 pm

You don't need all that stuff if you know about the hardware and it's stable. You can just start the serial driver. The enum happens when the program enum-devices is launches by the script /etc/rc.d/rc.devices.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby apwest » Wed May 27, 2009 12:38 pm

Just thought I'd follow up with my findings. I did what you said: just start the serial driver. I just had to determine what the right settings were for the card which I figured out by adding some echo statements to the device enumerator script to see what values it was coming up with (this was done using my full install of QNX). Once I did this, I just had to copy the devc-ser8250 ... line to my build file and voila!

Thanks for the advice mario.
apwest
New Member
 
Posts: 9
Joined: Mon Apr 13, 2009 6:55 pm

Postby lisa66 » Thu Oct 01, 2009 9:56 am

If you are running Linux on a system with hardware or wish to use features not supported in the stock kernels, or perhaps you wish to reduce the kernel memory footprint to make better use of your system memory, you may find it necessary to build your own custom kernel.

___________________________________
mcp | mcsa | mcdba exams
lisa66
New Member
 
Posts: 4
Joined: Thu Oct 01, 2009 9:35 am


Return to Cafe

Who is online

Users browsing this forum: No registered users and 1 guest