Skip navigation.
Home
The QNX Community Portal

View topic - QNX sample driver

QNX sample driver

anything that doesn't fit to other groups.

QNX sample driver

Postby umamahesh » Fri Feb 20, 2015 8:13 am

Hi
I am new to QNX, like to understand how to add and build an application and driver.
Please suggest with examples. Right now I have ported i.MX6 QNX BSP on sabresd
board, need to develop applications and drivers.

Thanks
umamahesh
Active Member
 
Posts: 39
Joined: Thu Feb 19, 2015 6:12 am

Re: QNX sample driver

Postby maschoen » Fri Feb 20, 2015 6:50 pm

Unlike most OS's, code that talks directly to hardware (drivers) in QNX does not have to run as part of the kernel. That's part of why it is called a microkernel.

The most common model for a driver is to build it into a resource manager. Resource manager's can appear to the system as /dev/ devices which can be opened, read and written to etc.

Another model is for the QNX to provide a resource manager that itself can mount driver code. An example would be the USB manager. In this case, the interface is defined by the resource manager. Other examples would be the file system, or PCMCIA.

A third model is to create a library that accesses the hardware. This is appropriate if only one process will access the hardware.

When writing code you need to check out how ThreadCtl() can you give you I/O privileges.
maschoen
QNX Master
 
Posts: 2644
Joined: Wed Jun 25, 2003 5:18 pm

Re: QNX sample driver

Postby umamahesh » Wed Feb 25, 2015 7:02 am

Thanks for the reply. If I want to create a driver outside the BSP tree, should I create it as static/shared library. SInce in linux terms driver would be a module or built-in. So in these way how do I create a driver inside the BSP tree and outside the BSP. Looking for suggestions
umamahesh
Active Member
 
Posts: 39
Joined: Thu Feb 19, 2015 6:12 am

Re: QNX sample driver

Postby maschoen » Mon Mar 02, 2015 7:53 pm

umamahesh wrote:Thanks for the reply. If I want to create a driver outside the BSP tree,


So go ahead and create it outside your BSP tree.

should I create it as static/shared library.


Probably not. In QNX, drivers are usually separate processes.

SInce in linux terms driver would be a module or built-in.


The internal structure of QNX is completely different. You should read the System Architecture manual for QNX. It's not long but it will give you some insight. Drivers for QNX are not part of the kernel the way they are for Linux.

So in these way how do I create a driver inside the BSP tree and outside the BSP. Looking for suggestions


The BSP tree is a file system construct. Create your new program inside or outside of that part of the file system as you like.
maschoen
QNX Master
 
Posts: 2644
Joined: Wed Jun 25, 2003 5:18 pm


Return to General Programming

Who is online

Users browsing this forum: Bing [Bot] and 3 guests