Creating a New Subsystem

Hello Everyone :slight_smile: ,

If I wanted to create a new (custom) subsystem in QNX (e.g. a scheduling subsystem, even though it will be ristricted by the QNX scheduler), how would I go about it?

I am using QNX 6.2.1.

Thank you.

John Barnes X

There is no easy mean to do this. I beleive you will have to write your own subkernel and have all your thread/process run under the control of that subkernel.

Thanks for the reply.

How do I go about writing a sub-kernel?

Thank you.

John Barnes X

The question is, WHY do you want to do that? How would your scheduler be different from the QNX scheduler?

I believe that the QNX scheduler is not optimal for certain types of workloads, so a custom scheduler, even though limited by the QNX scheduler, could produce better performance.

This is for a research project.

Please help.

John Barnes X

Hello again, everyone, :slight_smile:

Just thought I would get a better response on a Monday.

I believe that the QNX scheduler is not optimal for certain types of workloads, so a custom scheduler, even though limited by the QNX scheduler, could produce better performance.

I would like to create a new subsystem/subkernel which would include a scheduler.

Could you kindly give me some advice on how to go about this.

This is for a research project.

Please help.

Thank you.

John Barnes X

Depending on the granularity you’re after, you could have a ‘scheduler’ thread that has a timer which unblocks it at the desired ‘tick’ interval.
Then you could mess with the threads under your schedulers control in a variety of ways.

Is the supposed to be multi-process and invisible to the client code or do you envisage a single process multi thread scheduling scenario?

What sort of workloads are you looking at?

Thanks for the response. :slight_smile:

By client code, do you mean user processes?

I was thinking of something invisible to user processes: They could be started by a “scheduler” process which would then set all of them to a low priority, e.g., then, as you say, the scheduler will wake up and reschedule them to a higher priority when it is time to run them, according to the algorithm implemented.

Does this sound okay? I thought there might be a better way to implement this; I thought the subkernel/subsystem idea could mean that the scheduler would be closely tied-in with the QNX kernel, to reduce the overhead.

Would having this work at the thread level be more difficult? How?

As far as the workload goes, at the moment this idea is a solution looking for a problem, so I do not know of any specific workload, but I will start off by using the AIM VII Benchmark Suite, which can be configured to generate a variety of workloads, and search for more workloads later on.

John Barnes X

Raising/lowering priority might be the simplest way to do it for now, I think. Of course, how are you going to handle system things like priority inheritance etc etc.
Are you going to be scheduling all the processes/threads in the system?
If a thread at high priority sends to a server, and is blocked when your scheduling thread runs? Are you going to bump down the server? What happens when he finally replies, the client will still be running at the higher priority?

Do you have the system profiler? I think you’re going to need it to understand what is going on. It comes only with the Momentics professional editiion. If this is an research project for a recognized educational institution you should be able to get an educational license - pester sales@qnx.com they should help you out.

Thanks a lot for the response.

Related to this, do you think it could be possible to get at least part of the source code for QNX?

John Barnes X

Very very unlikely unless you’re a big OEM with very deep pocket.

What he said… :smiley:

I don’t think you need to be an OEM, but the kernel source is only given out with a source license, which is costly, and not part of the educational
program to my knowledge.