Jump to main content
Index
Advanced search
  1. Home
  2. QNX Software Development Platform

    QNX SDP is a cross-compiling and debugging environment, including an IDE and command-line tools, for building binary images and programs for target boards running QNX Neutrino 7.1.

  3. Programming

  4. Getting Started with QNX Neutrino

    Getting Started with QNX Neutrino: A Guide for Realtime Programmers is intended to introduce you to the QNX Neutrino RTOS and help you develop applications and resource managers for it.

  5. Resource Managers

    In this chapter, we'll take a look at what you need to understand in order to write a resource manager. Resource managers are another distintive feature of QNX Neutrino that allow you to access services through standard POSIX calls.

  6. Writing a resource manager

    Now that we've introduced the basics—how the client looks at the world, how the resource manager looks at the world, and an overview of the two cooperating layers in the library, it's time to focus on the details.

  7. Resource manager structure

    Now that we've seen the data structures, we can discuss interactions between the parts that you'd supply to actually make your resource manager do something.

  • QNX Momentics IDE User's Guide

    This User's Guide describes version 7.1 of the Integrated Development Environment (IDE) that's part of the QNX Momentics tool suite.

  • QNX Software Development Platform

    QNX SDP is a cross-compiling and debugging environment, including an IDE and command-line tools, for building binary images and programs for target boards running QNX Neutrino 7.1.

    • Quickstart Guide

    • OS Components & Operations

    • Audio & Graphics API

    • Multimedia

    • Networking Middleware

    • Programming

      • Getting Started with QNX Neutrino

        Getting Started with QNX Neutrino: A Guide for Realtime Programmers is intended to introduce you to the QNX Neutrino RTOS and help you develop applications and resource managers for it.

        • Processes and Threads

        • Message Passing

          In this chapter, we'll look at the most distinctive feature of QNX Neutrino, message passing. Message passing lies at the heart of the operating system's microkernel architecture, giving the OS its modularity.

        • Clocks, Timers, and Getting a Kick Every So Often

          It's time to take a look at everything related to time in the QNX Neutrino RTOS. We'll see how and why you'd use timers and the theory behind them. Then we'll take a look at getting and setting the realtime clock.

        • Interrupts

          In this chapter, we'll take a look at interrupts, how we deal with them under QNX Neutrino, their impact on scheduling and realtime, and some interrupt-management strategies.

        • Resource Managers

          In this chapter, we'll take a look at what you need to understand in order to write a resource manager. Resource managers are another distintive feature of QNX Neutrino that allow you to access services through standard POSIX calls.

          • What is a resource manager?

            A resource manager is simply a program with some well-defined characteristics.

          • The client's view

            We've already seen a hint of what the client expects. It expects a file-descriptor-based interface, using standard POSIX functions.

          • The resource manager's view

            Let's look at things from the resource manager's perspective.

          • The resource manager library

            Before we get too far into all the issues surrounding resource managers, we have to get acquainted with the QNX Neutrino resource manager library.

          • Writing a resource manager

            Now that we've introduced the basics—how the client looks at the world, how the resource manager looks at the world, and an overview of the two cooperating layers in the library, it's time to focus on the details.

            • Data structures

              The first thing we need to understand is the data structures used to control the operation of the library.

            • Resource manager structure

              Now that we've seen the data structures, we can discuss interactions between the parts that you'd supply to actually make your resource manager do something.

              • The resmgr_attach() function and its parameters

                As you saw in the /dev/null example above, the first thing you'll want to do is register your chosen mountpoint with the process manager. This is done via resmgr_attach().

              • Putting in your own functions

                When designing your very first resource manager, you'll most likely want to take an incremental design approach. It can be very frustrating to write thousands of lines of code only to run into a fundamental misunderstanding and then having to make the ugly decision of whether to try to kludge (er, I mean fix) all that code, or scrap it and start from scratch.

              • The general flow of a resource manager

                As we alluded to in the overview sections above, the general flow of a resource manager begins on the client side with the open(). This gets translated into a connect message and ends up being received by the resource manager's open connect function handler.

              • Messages that should be connect messages but aren't

                Here's an interesting point you may have noticed. Consider the client's prototype for chown() shown below.

              • Combine messages

                As it turns out, this concept of combine messages isn't useful just for saving bandwidth (as in the chown() case, above). It's also critical for ensuring atomic completion of operations.

            • POSIX-layer data structures

              There are three data structures that relate to the POSIX-layer support routines. As far as the base layer is concerned, you can use any data structures you want; it's the POSIX layer that requires you to conform to a certain content and layout. The benefits delivered by the POSIX layer are well worth this tiny constraint. As we'll see later, you can add your own content to the structures as well.

          • Handler routines

            Not all outcalls correspond to client messages—some are synthesized by the kernel, and some by the library.

          • Alphabetical listing of connect and I/O functions

            This section gives an alphabetical listing of the connect and I/O function entry points that you can fill in (the two tables passed to resmgr_attach()). Remember that if you simply call iofunc_func_init(), all these entries will be filled in with the appropriate defaults; you'd want to modify a particular entry only if you wish to handle that particular message. In the Examples section, below, you'll see some examples of the common functions.

          • Examples

            I'm now going to show you a number of cookbook examples you can cut and paste into your code, to use as a basis for your projects. These aren't complete resource managers—you'll need to add the thread pool and dispatch skeleton shown immediately below, and ensure that your versions of the I/O functions are placed into the I/O functions table after you've done the iofunc_func_init(), in order to override the defaults!

          • Advanced topics

            Now that we've covered the basics of resource managers, it's time to look at some more complicated aspects.

          • Summary

            Writing a resource manager is by far the most complicated task that we've discussed in this book.

        • Sample Programs

          This appendix contains the complete versions of some of the sample programs discussed in this book.

        • Glossary

      • Programmer's Guide

        The QNX Neutrino Programmer's Guide covers a variety of topics that might interest developers who are building applications that will run under the QNX Neutrino RTOS.

      • The QNX Neutrino Cookbook: Recipes for Programmers
      • Writing a Resource Manager
    • Sensor Framework

    • System Security Guide

      The QNX System Security Guide is intended for both system integrators who are responsible for the security of a QNX Neutrino RTOS system and developers who want to create a QNX Neutrino resource manager free from vulnerabilities.

    • Utilities & Libraries

  • QNX Hypervisor

    The QNX Hypervisor allows you to run multiple OSs on a target system so you can separate critical and non-critical functions, support a wide variety of applications, and reduce hardware costs.

  • QNX Software in the Cloud

    QNX Software in the Cloud enables developers to use the QNX software in Amazon Web Services (AWS) and Microsoft Azure (Azure).

  • QNX Advanced Virtualization Frameworks User's Guide

    This User's Guide is aimed at all systems integrators and developers who want to design and build embedded systems using the QNX Advanced Virtualization Frameworks.

  • Typographical Conventions, Support, and Licensing

    This section describes the typographical conventions used throughout the documentation and explains how to obtain technical support.

Resource manager structure

Now that we've seen the data structures, we can discuss interactions between the parts that you'd supply to actually make your resource manager do something.

We'll look at:

  • The resmgr_attach() function and its parameters
  • Putting in your own functions
  • The general flow of a resource manager
  • Messages that should be connect messages but aren't
  • Combine messages
Page updated: March 12, 2026
Related information
  • Resource Managers (System Architecture)
  • Writing a Resource Manager