Gauging interest; new book

Hi folks,

I’m thinking about writing another book, tentatively titled “The QNX
Neutrino Cookbook – Recipes for Realtime Programmers”, and was wondering
if you could share your interest level with me for such a project.

Basically, the book would cover two major sections:
o Section 1 being a high-level kind of “philosophy” for how one
goes about architecting systems under QNX
o Section 2 would consist of the “recipes” part of the title,
consisting of a bunch of neat things that I’ve written over
the last 15 years or so, with fully functioning code and
discussions of how the code works, why it was written the
way it was, and so on.

The goal of the book is that someone could pick up not only a bunch
of “code”, but also the ideas and constraints that went into the
design of the code. I’m currently negotiating with a few places
where I’ve done contract work to see if they’ll let me borrow code
snippets, but I plan to write about the following things:

  • virtual filesystem for USENET news
  • automated testing for resource managers
  • thread fingerprint program for multi-threaded apps
  • universal control panel resource manager
  • self-starting service providers
  • resource manager managed symlinks (e.g., for things like webcams, HA, etc)
  • high availability monitoring / restarting programs
  • telephony CLID server
  • dll implementation guidelines and examples
  • security system example

I’m planning on this book being fairly big, about the same size as the
“Getting Started with QNX Neutrino 2” book (500 pages).

Any thoughts, ideas for topics, etc? Probably best to email me directly
instead of cluttering up the newsgroups :slight_smile:

Thanks in advance for your help. Of course, I’ll be looking for reviewers :slight_smile:

Cheers,
-RK

[crossposted to qdn.public.qnxrtp.os qdn.cafe comp.os.qnx]


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.

“Robert Krten” <nospam86@parse.com> wrote in message
news:ai7jf6$5qt$1@inn.qnx.com

Hi folks,

I’m thinking about writing another book, tentatively titled “The QNX
Neutrino Cookbook – Recipes for Realtime Programmers”, and was wondering
if you could share your interest level with me for such a project.

Basically, the book would cover two major sections:
o Section 1 being a high-level kind of “philosophy” for how one
goes about architecting systems under QNX

I would certainly welcome some guidance to help me understand the QNX6
philosophy as I don’t find it as intuative as QNX4.

Jim
[…]

Jim Douglas <jim@dramatec.co.uk> wrote:

“Robert Krten” <> nospam86@parse.com> > wrote in message
news:ai7jf6$5qt$> 1@inn.qnx.com> …
Hi folks,

I’m thinking about writing another book, tentatively titled “The QNX
Neutrino Cookbook – Recipes for Realtime Programmers”, and was wondering
if you could share your interest level with me for such a project.

Basically, the book would cover two major sections:
o Section 1 being a high-level kind of “philosophy” for how one
goes about architecting systems under QNX

I would certainly welcome some guidance to help me understand the QNX6
philosophy as I don’t find it as intuative as QNX4.

Ok, now I’m confused – I view the two OS’s as almost identical in that
respect (from a high level), except that QNX 6 “prefers” resource managers
whereas in QNX 4 you rolled your own. Is that the kind of thing that you
are talking about? What I meant by philosophy were things like “keep your
processes small”, “use message passing with resource managers”, “obey the
send-hierarchy”, that kind of stuff…

Please tell me more! (Now’s the time :slight_smile:)

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.

“Robert Krten” <nospam86@parse.com> wrote in message
news:ai9pfn$p9p$2@inn.qnx.com

Jim Douglas <> jim@dramatec.co.uk> > wrote:

I would certainly welcome some guidance to help me understand the QNX6
philosophy as I don’t find it as intuative as QNX4.

Ok, now I’m confused – I view the two OS’s as almost identical in that
respect (from a high level), except that QNX 6 “prefers” resource managers
whereas in QNX 4 you rolled your own. Is that the kind of thing that
you
are talking about? What I meant by philosophy were things like “keep your
processes small”, “use message passing with resource managers”, “obey the
send-hierarchy”, that kind of stuff…

Please tell me more! (Now’s the time > :slight_smile:> )

I disagree. I loved the “philosophy” that there was a Dev, Fsys and Net.

It was easy (to understand at least) that all client programs communicated
with these and these drivers could figure out what specific driver to relay
the request to based on exactly what the specific device was that needed to
handle the request.

I could type ‘sin -PNet’ and see that I was running Net.xyz. It was easy.
It made sense. In QNX6 everything is hidden.You can’t easily know what the
hell is running on your system or who/when it got loaded.

I liked the way when QNX4 was initializing it did exactly what I told it to
do (via config files), nothing more, nothing less. QNX6 has so many things
that are AUTO-configuring. I DON’T WANT MY SYSTEM TO AUTO CONFIGURE.
That’s why I don’t run Windows!

The autoconfiguring takes longer, is potentially destructive (by tickling
certain ports to autodetect) and I never know when, where, and why something
got initialized or why it chose the parameters it did. Also I don’t like
having to run graphical utilities to configure things. I want to edit my
own files so that I know what is happening and why. I can’t even use these
graphic utilities to edit files on some other host somewhere. But I can
always telnet into the other host and edit.

How many times have you seen in these newsgroups, “OK. Just slay io-net and
restart it.” Well, if that is necessary it just got started too soon. But
I have no control over when or where it gets started.

Then there’s the overhead. How many different routines does a simple
request have to pass through before it gets to the routine that actually
does the work. I like the QNX philosophy where the driver can run at it’s
own priority to do the actual work. But you don’t need to pass that same
request through so many library routines before it gets to where it needs to
be. This is why QNX6 is so dreadfully slow.

The QNX4 & QNX6 philosophies are completely different. I can understand
QNX4.

Quit right!!!
I worked on QNX4 for more than 1 year before switching to QNX6.0 until
now and for a long time!

Bill Caroselli (Q-TPS) wrote:

“Robert Krten” <> nospam86@parse.com> > wrote in message
news:ai9pfn$p9p$> 2@inn.qnx.com> …

Jim Douglas <> jim@dramatec.co.uk> > wrote:

I would certainly welcome some guidance to help me understand the QNX6
philosophy as I don’t find it as intuative as QNX4.

Ok, now I’m confused – I view the two OS’s as almost identical in that
respect (from a high level), except that QNX 6 “prefers” resource managers
whereas in QNX 4 you rolled your own. Is that the kind of thing that

you

are talking about? What I meant by philosophy were things like “keep your
processes small”, “use message passing with resource managers”, “obey the
send-hierarchy”, that kind of stuff…

Please tell me more! (Now’s the time > :slight_smile:> )

I disagree. I loved the “philosophy” that there was a Dev, Fsys and Net.
It was easy (to understand at least) that all client programs communicated
with these and these drivers could figure out what specific driver to relay
the request to based on exactly what the specific device was that needed to
handle the request.

I could type ‘sin -PNet’ and see that I was running Net.xyz. It was easy.
It made sense. In QNX6 everything is hidden.You can’t easily know what the
hell is running on your system or who/when it got loaded.

That’s right, but here is also the power of being able to dlls to

increase functionnalities. I widely use that possibility in a motors
control process, where we can have a simple motor that can be started
and stopped up to one with various speed regulation system, speed
modulation, reverse gear, positionning system, etc… BUT, I use the
resmgrs to declare (in /var for example) an image of the motor
configuration.

I liked the way when QNX4 was initializing it did exactly what I told it to
do (via config files), nothing more, nothing less. QNX6 has so many things
that are AUTO-configuring. I DON’T WANT MY SYSTEM TO AUTO CONFIGURE.
That’s why I don’t run Windows!

No really agree, how cool is it to get QNX6 running on every PC with

doing anything!!!
Then, You can edit the build file to only start what you want, how you
want. Not a so big constraint compare to some systems which you cannot
decide anything!

The autoconfiguring takes longer, is potentially destructive (by tickling
certain ports to autodetect) and I never know when, where, and why something
got initialized or why it chose the parameters it did. Also I don’t like
having to run graphical utilities to configure things. I want to edit my
own files so that I know what is happening and why. I can’t even use these
graphic utilities to edit files on some other host somewhere. But I can
always telnet into the other host and edit.

Perfectly right!!! It’s not yet Unix, but not so far! I still don’t

know where to declare LD_LIBRARY_PATH to get it available in console
mode, in Photon, through telnet, in sh, in bash.
So I play with the config files, /etc/rc.d/rc.sysinit,
/etc/rc.d/rc.local, /etc/profile, /etc/profile.d/global.*,
/home/.profile, /home/.kshrc, /home/.bashrc.
Tell me if I forgot one, That’s the one I’m looking for!

How many times have you seen in these newsgroups, “OK. Just slay io-net and
restart it.” Well, if that is necessary it just got started too soon. But
I have no control over when or where it gets started.

Then there’s the overhead. How many different routines does a simple
request have to pass through before it gets to the routine that actually
does the work. I like the QNX philosophy where the driver can run at it’s
own priority to do the actual work. But you don’t need to pass that same
request through so many library routines before it gets to where it needs to
be. This is why QNX6 is so dreadfully slow.

The QNX4 & QNX6 philosophies are completely different. I can understand
QNX4.

Robert Krten <nospam86@parse.com> wrote in article <ai9pfn$p9p$2@inn.qnx.com>…

Jim Douglas <> jim@dramatec.co.uk> > wrote:

“Robert Krten” <> nospam86@parse.com> > wrote in message
news:ai7jf6$5qt$> 1@inn.qnx.com> …
Hi folks,

I’m thinking about writing another book, tentatively titled “The QNX
Neutrino Cookbook – Recipes for Realtime Programmers”, and was wondering
if you could share your interest level with me for such a project.

Basically, the book would cover two major sections:
o Section 1 being a high-level kind of “philosophy” for how one
goes about architecting systems under QNX

I would certainly welcome some guidance to help me understand the QNX6
philosophy as I don’t find it as intuative as QNX4.

Ok, now I’m confused – I view the two OS’s as almost identical in that
respect (from a high level), except that QNX 6 “prefers” resource managers
whereas in QNX 4 you rolled your own. Is that the kind of thing that you
are talking about? What I meant by philosophy were things like “keep your
processes small”, “use message passing with resource managers”, “obey the
send-hierarchy”, that kind of stuff…

Please tell me more! (Now’s the time > :slight_smile:> )

I didn’t work with QNX4. (It is funny to know now the company where I worked with bought QNX 4.2x
many years ago, but I worked at another department (the same floor, but doors across) and didn’t
know we have it:). So, I see only quite global differences: threads, memory protection, QNET over
tcp/ip…POSIX (sometimes things are different from expected:). Any enumerators/configurators are
common stuff for desktop system (this way of growing QNX is yet another difference, but mainly from
point of system administation) and all these things can be easily taken away in custom/embedded
system.
Cheers,

Eduard.
ed1k at ukr dot net

Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:

Perfectly right!!! It’s not yet Unix, but not so far! I still don’t
know where to declare LD_LIBRARY_PATH to get it available in console
mode, in Photon, through telnet, in sh, in bash.
So I play with the config files, /etc/rc.d/rc.sysinit,
/etc/rc.d/rc.local, /etc/profile, /etc/profile.d/global.*,
/home/.profile, /home/.kshrc, /home/.bashrc.
Tell me if I forgot one, That’s the one I’m looking for!

Yeah, PITA,

take a look at

getconf -a

[thomas@elmo] /home/thomas >getconf _CS_LIBPATH
/proc/boot:/lib:/usr/lib:/lib/dll
[thomas@elmo] /home/thomas >getconf _CS_HOSTNAME
elmo
[thomas@elmo] /home/thomas >getconf _CS_DOMAIN
softwareremodeling.com

and of course

setconf

and the C version is confstr(), sysconf()

regards,
Tom

In article <ai9r6q$r16$1@inn.qnx.com>
QTPS@EarthLink.net writes:

I liked the way when QNX4 was initializing it did exactly what I told it to
do (via config files), nothing more, nothing less. QNX6 has so many things
that are AUTO-configuring. I DON’T WANT MY SYSTEM TO AUTO CONFIGURE.
That’s why I don’t run Windows!

The autoconfiguring takes longer, is potentially destructive (by tickling
certain ports to autodetect) and I never know when, where, and why something
got initialized or why it chose the parameters it did. Also I don’t like
having to run graphical utilities to configure things. I want to edit my
own files so that I know what is happening and why. I can’t even use these
graphic utilities to edit files on some other host somewhere. But I can
always telnet into the other host and edit.

I’ve never worked with QNX4, but

Current RTP/Momentics have

  • bare-bone Neutrino philosophy/architecture, which I believe simple and
    not differing much from QNX4 era, which includes
    microkernel, realtime, /proc/boot, resmgr, Message/Pulse, … and
  • RTP/Momentics things, which tries to resemble UNIX thingies and
    autoconfiguration, which includes diskboot, /etc/system/sysinit,
    rc.sysinit, enum-devices, tinit, fs-pkg, netmanager, ~/.ph, …

After tinkering awhile with RTP (especially from console, not photon)
I felt these two were quite different – but the former is “under the hood”
and latter is rather obscure in getting the whole picture.

(Momentics NC lacks mkifs, so IMHO a large portion of Neutrino spirit
has devrived from it – tho I could understand the reason for omission)

kabe

“Robert Krten” <nospam86@parse.com> wrote in message
news:ai9pfn$p9p$2@inn.qnx.com

Jim Douglas <> jim@dramatec.co.uk> > wrote:

“Robert Krten” <> nospam86@parse.com> > wrote in message
news:ai7jf6$5qt$> 1@inn.qnx.com> …
[…]
I would certainly welcome some guidance to help me understand the QNX6
philosophy as I don’t find it as intuative as QNX4.

Ok, now I’m confused

Confused? You will be by the time the QNX4 vs QNX6 debate has died
down…:sunglasses:

– I view the two OS’s as almost identical in that
respect (from a high level)

It all depends on your perspective. I guess that for a Unix programmer QNX4
must seem like a toy as it represents a simplification and hides a lot of
the complicated stuff. I sense a lot of people rubbing their hands with glee
over QNX6 which is much more like the ‘real thing’.

Me, well I was born and raised in Gatesville. QNX4 was a revelation, but I
could get my head around it as it worked the way I had often dreamed that
computers should work. The sheer complexity of QNX6 is staggering, there
seem to be (too) many ways of doing the same thing, and what we lack is
guidance as to what is relevant and irrelevant in certain circumstances. The
docs are devoid of any serious tutorial material and that, Robert is where
you excel. Help us narrow down the options and make informed choices. Give
us (practical) examples of ‘how to do XYZ’ (and why you did it that way)
that can form the foundation of our development.

For example, there are now so many video related routines that are only
scantily documented, that this topic alone could fill a book. I’m sure there
must be some very powerful functions there, but I can’t access them because
I don’t have enough hardware knowledge to decipher the cryptic notes
associated with each function.

… except that QNX 6 “prefers” resource managers
whereas in QNX 4 you rolled your own.

And above all cut the generalisation when it comes to resource managers -
let’s have some really useful examples from real life. Convince me that they
will make my life easier and that they are not just some theoretical
construct dreamed up by Dan Dodge on a wet Sunday afternoon.

Does that help? :sunglasses:

Jim

“Jim Douglas” <jim@dramatec.co.uk> wrote in message
news:aicea3$qf6$1@inn.qnx.com

… except that QNX 6 “prefers” resource managers
whereas in QNX 4 you rolled your own.

And above all cut the generalisation when it comes to resource managers -
let’s have some really useful examples from real life. Convince me that
they
will make my life easier and that they are not just some theoretical
construct dreamed up by Dan Dodge on a wet Sunday afternoon.

OK. I’m the 4 is better than 6 guy. But I will admit I love the ‘idea’ of a

resource manager. BTW, I loved it in QNX4 too.

I love the idea that instead of having to maintain a phonebook of pid
(nameloc in QNX4) you can just open() a file. That’s gives you a file
descriptor that you can use to communicate through. BUT, it seems to only
make sense to me for 1) establishing the connection, and 2) streamed I/O.
The technique really falls on it’s face in a transaction based client/server
application.

To me it makes much more sense to fill in a struct that contains a request,
necessary data to perform the request and then just send the request. When
the send returns you have your reply. Using functions like ioctl() and
devctl() just seem like trying to shoehorn a fire engine into bottle cap.

The resource manager DOES have it’s place. It’s just not the end all to
IPC. I liked QNX4 because of it’s IPC. I think QNX6 is trying to make
everything look like a stream so that this open()/read()/write()/close()
will work from anywhere to anywhere. And I think it’s a mistake.

I look at it this way. There are low level function and high level
functions. The high level functions use the low level functions to
accomplish work for a client(caller). They provide an easier to use
interface then the many lower level functions at the cost of a little extra
overhead. But when the lower level functions are easier to use than the
higher level function, then that is the way to go.

Sure read()/write() are easy to use. But only if a streaming IO model fits
your applications.

Jim Douglas <jim@dramatec.co.uk> wrote:

“Robert Krten” <> nospam86@parse.com> > wrote in message
news:ai9pfn$p9p$> 2@inn.qnx.com> …
Jim Douglas <> jim@dramatec.co.uk> > wrote:

“Robert Krten” <> nospam86@parse.com> > wrote in message
news:ai7jf6$5qt$> 1@inn.qnx.com> …
[…]
I would certainly welcome some guidance to help me understand the QNX6
philosophy as I don’t find it as intuative as QNX4.

Ok, now I’m confused

Confused? You will be by the time the QNX4 vs QNX6 debate has died
down…> :sunglasses:

– I view the two OS’s as almost identical in that
respect (from a high level)

It all depends on your perspective. I guess that for a Unix programmer QNX4
must seem like a toy as it represents a simplification and hides a lot of
the complicated stuff. I sense a lot of people rubbing their hands with glee
over QNX6 which is much more like the ‘real thing’.

To address that point, and Bill C’s point about the confusion with /etc/rc.d/*
hierarchy, I think that the simplifying factor is just to ignore it. Build a
small system that has all the stuff you want to do in the startup script, and
let 'er rip :slight_smile:

It’s a push-pull kind of thing – if you want and like the UNIX style /etc/rc.d/*
stuff, then by all means use it; but keep in mind that it’s not mandatory.

I’ll see if I can address some “startup” issues in the new book :slight_smile:

Me, well I was born and raised in Gatesville. QNX4 was a revelation, but I
could get my head around it as it worked the way I had often dreamed that
computers should work. The sheer complexity of QNX6 is staggering, there
seem to be (too) many ways of doing the same thing, and what we lack is
guidance as to what is relevant and irrelevant in certain circumstances. The
docs are devoid of any serious tutorial material and that, Robert is where
you excel. Help us narrow down the options and make informed choices. Give
us (practical) examples of ‘how to do XYZ’ (and why you did it that way)
that can form the foundation of our development.

Ok, I’ll try :slight_smile:

For example, there are now so many video related routines that are only
scantily documented, that this topic alone could fill a book. I’m sure there
must be some very powerful functions there, but I can’t access them because
I don’t have enough hardware knowledge to decipher the cryptic notes
associated with each function.

Video and Photon in general are not my strong points, so I’ll (unfortunately)
leave those to another author – anyone care to step up to the plate? I’d
certainly be willing to help write, debug, market, etc. such a book :slight_smile:

… except that QNX 6 “prefers” resource managers
whereas in QNX 4 you rolled your own.

And above all cut the generalisation when it comes to resource managers -
let’s have some really useful examples from real life. Convince me that they
will make my life easier and that they are not just some theoretical
construct dreamed up by Dan Dodge on a wet Sunday afternoon.

Resource managers will be featured in the book. Resource managers are a really
neat abstraction, IMHO, that make your life simpler. I will certainly try to get
that point across :slight_smile:

Does that help? > :sunglasses:

Sure, thanks!

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.

“Bill Caroselli (Q-TPS)” <QTPS@earthlink.net> wrote:

“Jim Douglas” <> jim@dramatec.co.uk> > wrote in message
news:aicea3$qf6$> 1@inn.qnx.com> …

… except that QNX 6 “prefers” resource managers
whereas in QNX 4 you rolled your own.

And above all cut the generalisation when it comes to resource managers -
let’s have some really useful examples from real life. Convince me that
they
will make my life easier and that they are not just some theoretical
construct dreamed up by Dan Dodge on a wet Sunday afternoon.

OK. I’m the 4 is better than 6 guy. But I will admit I love the ‘idea’ of a
resource manager. BTW, I loved it in QNX4 too.

I love the idea that instead of having to maintain a phonebook of pid
(nameloc in QNX4) you can just open() a file. That’s gives you a file
descriptor that you can use to communicate through. BUT, it seems to only
make sense to me for 1) establishing the connection, and 2) streamed I/O.
The technique really falls on it’s face in a transaction based client/server
application.

Why does it fall in it’s [sic] face?
What don’t you like about it?

To me it makes much more sense to fill in a struct that contains a request,
necessary data to perform the request and then just send the request. When
the send returns you have your reply. Using functions like ioctl() and
devctl() just seem like trying to shoehorn a fire engine into bottle cap.

devctl() is a very thin layer on top of MsgSend(); you still fill in a struct
that contains your request and the necessary data, and then when devctl()
returns you have your reply (he said, paraphrasing). What it buys you is
portability – I’ve ported 60k lines of Windoze drivers, which abstracted all
their IPC to the “driver” via DeviceIOControl(), and boy was it easy to make
that fit into devctl()! Yes, it would have been almost as easy to make it
fit into MsgSend(), but then I’d be shoehorning it into a QNX 6-ism…

The resource manager DOES have it’s place. It’s just not the end all to
IPC. I liked QNX4 because of it’s IPC. I think QNX6 is trying to make
everything look like a stream so that this open()/read()/write()/close()
will work from anywhere to anywhere. And I think it’s a mistake.

I’m going to have to disagree with you there, Bill. I think having two address
spaces (the QNX 4 PID space and the namespace) just makes things less, if you’ll
pardon the OO $10 word, “orthogonal”. An open() returns a fd, which is
your connection ID – do with it as you please. If you want to be POSIX
source code compatible, by all means use read()/write()/devctl() et al., but
if you want to be QNX 6 compatible, use MsgSend and _IO_MSG…

The main advantage, as I see it, of doing the whole read()/write() thing is that
you can now test, control, and exercise your resmgr from a shell script using
such tools as “cat” and “grep” – if you and QSSL will excuse a parody here,
but “QNX 6 is what QNX 2 was meant to be” :slight_smile: [it’s a long story]

I look at it this way. There are low level function and high level
functions. The high level functions use the low level functions to
accomplish work for a client(caller). They provide an easier to use
interface then the many lower level functions at the cost of a little extra
overhead. But when the lower level functions are easier to use than the
higher level function, then that is the way to go.

Certainly. However, I’m sure you’d agree that for maximum portability, and
maintainability, testability, and other such desirables, you’d still want a small,
thin, layer on top of the low-level or (native) high-level calls.
Rarely, in a properly constructed (more than 1k line) program, would you depend
on the raw OS calls to achieve your functionality directly. You’d want to
provide a high-level API, which, if you’re using QNX 6, happens to map almost
directly onto MsgSend with _IO_MSG, or if you’re using Windoze maps almost
directly onto DeviceIOControl, or if you’re using UNIX maps almost directly
onto devctl(), etc… If your application is big, say > 10k lines, then the
high level calls would map to low level calls within the API, which would
then map to OS calls in an OS-abstraction layer.

Sure read()/write() are easy to use. But only if a streaming IO model fits
your applications.

Ahhh… that’s the problem, is it? I’m not advocating read()/write() as
the be-all and end-all to every problem. I’m advocating #1) abstraction,
abstraction, abstraction, and #2) applicable API calls. If you want to
transfer bulk data, then by all means write your own API calls to do this – you
may end up using shared memory, TCP/IP, RPC, or some other thing underneath
the calls, but that’s fine, you’re still achieving the same end result – you
have a shippable, testable product at the end.

And, to sum it up, whatever happened to the UNIX 1970’s concept of “everything
is a stream of bytes”? :slight_smile: I personally think it’s a beautiful, clean concept.
But then I just returned from the QNX Users Group meeting :slight_smile:

Cheers,
-RK

\

Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.

“Robert Krten” <nospam86@parse.com> wrote in message
news:aicm07$2kh$1@inn.qnx.com

I’m going to have to disagree with you there, Bill. I think having two
address
spaces (the QNX 4 PID space and the namespace) just makes things less, if
you’ll
pardon the OO $10 word, “orthogonal”. An open() returns a fd, which is
your connection ID – do with it as you please. If you want to be POSIX
source code compatible, by all means use read()/write()/devctl() et al.,
but
if you want to be QNX 6 compatible, use MsgSend and _IO_MSG…

True. I was kind of mixing analogies.



Certainly. However, I’m sure you’d agree that for maximum portability,
and
maintainability, testability, and other such desirables, you’d still want
a small,
thin, layer on top of the low-level or (native) high-level calls.

Ah! There’s the rub. Portability has never been an issue for me. I use a
tool the way I believe it should be used. If it isn’t right for the job I
get a different tool. I don’t care that my hammer has one sharp narrow edge
so that I can tighten screws with it. I’ll buy a screw driver.

“Bill Caroselli (Q-TPS)” <QTPS@earthlink.net> wrote:

(nameloc in QNX4) you can just open() a file. That’s gives you a file
descriptor that you can use to communicate through. BUT, it seems to only
make sense to me for 1) establishing the connection, and 2) streamed I/O.
The technique really falls on it’s face in a transaction based client/server
application.

You are falling into the trap of thinking that just because the resmgr model
CAN support the read/write model that it MUST. That isn’t the case. You
can use it for nothing more than establishing the connection and then do your
code in EXACTLY the same way you did in QNX4. You can have the same nice
big switch/case with a reply at the end. I’ve done it in QNX6, it’s EASY.

Don’t fall into the trap of thinking that all resmgr’s have to do something
useful with read and write. For many of them just acting like /dev/null is
all you want and raw IPC can be used.

To me it makes much more sense to fill in a struct that contains a request,
necessary data to perform the request and then just send the request. When
the send returns you have your reply. Using functions like ioctl() and
devctl() just seem like trying to shoehorn a fire engine into bottle cap.

Actually, you CAN do that, as I have said before (so has cdm, and others).
The devctl() seems silly at first until you realize that it’s actually
something that non-qnx people understand. It IS IPC and is near identical
to the S/R/R stuff, except you can talk about devctl()'s and other *nix
programmers will understand you too.
There is even a chance that some things like NFS might be able to actually
transport devctl() from other *nix systems to QNX, which could open up some
pretty HUGE advantages for QNX6.(I would love to have someone @QSS verify if
NFS can do this?)

The resource manager DOES have it’s place. It’s just not the end all to
IPC. I liked QNX4 because of it’s IPC. I think QNX6 is trying to make
everything look like a stream so that this open()/read()/write()/close()
will work from anywhere to anywhere. And I think it’s a mistake.

I’ll repeat, you don’t have to. You are in a rut with that, you’ve convinced
yourself that:

IF( I_use_resmgr ) THEN I_must_use_open,read,write,close

It’s wrong. Stop thinking that way, learn the truth.

Cheers,
Camz.

Robert Krten <nospam86@parse.com> wrote:

To address that point, and Bill C’s point about the confusion with /etc/rc.d/*
hierarchy, I think that the simplifying factor is just to ignore it. Build a
small system that has all the stuff you want to do in the startup script, and
let 'er rip > :slight_smile:

It’s a push-pull kind of thing – if you want and like the UNIX style /etc/rc.d/*
stuff, then by all means use it; but keep in mind that it’s not mandatory.

Actually, this is an interesting case. All that rc.d stuff is scripted, it’s
a hack, and more importantly, it ONLY exists in the self-hosted version of
QNX6. The real guts are the same, the .boot file runs ONE script, same as
it does in QNX4. The problem is that in the self-hosted version, QSS made
that script call other scripts, and enumerators, and stuff, and didn’t write
down in the RTP docs what the sequence was. The also hid some things in the
diskboot binary that the shoved in the .boot which made some thing magically
“appear” by the time the actual scripts ran.

If you build an embedded system, you don’t have (or need) all that kruft.
You can build it more or less exactly like you did in QNX4, with all your
non-.boot startup stuff in one (and only one) script.

Resource managers will be featured in the book. Resource managers are a really
neat abstraction, IMHO, that make your life simpler. I will certainly try to get
that point across > :slight_smile:

One interesting aspect of the resmgr model, even when you don’t use the stream
model and use the IPC model instead is in the arena of XML.
The read/write stream model that the resmgr framework provides makes it almost
TRIVAL to add on to an existing resmgr that isn’t using the stream stuff.

WRITE: 2
READ: Bill Caroselli

Makes it pretty easy to add “web services” functionality to a resmgr

Cheers,
Camz.

camz@passageway.com wrote:

“Bill Caroselli (Q-TPS)” <> QTPS@earthlink.net> > wrote:
(nameloc in QNX4) you can just open() a file. That’s gives you a file
descriptor that you can use to communicate through. BUT, it seems to only
make sense to me for 1) establishing the connection, and 2) streamed I/O.
The technique really falls on it’s face in a transaction based client/server
application.

You are falling into the trap of thinking that just because the resmgr model
CAN support the read/write model that it MUST. That isn’t the case. You
can use it for nothing more than establishing the connection and then do your
code in EXACTLY the same way you did in QNX4. You can have the same nice
big switch/case with a reply at the end. I’ve done it in QNX6, it’s EASY.

Don’t fall into the trap of thinking that all resmgr’s have to do something
useful with read and write. For many of them just acting like /dev/null is
all you want and raw IPC can be used.

Hey, you’re pulling a Dave Gibbs and quoting basically what I just said, except later! :slight_smile:

Cheers,
-RK

To me it makes much more sense to fill in a struct that contains a request,
necessary data to perform the request and then just send the request. When
the send returns you have your reply. Using functions like ioctl() and
devctl() just seem like trying to shoehorn a fire engine into bottle cap.

Actually, you CAN do that, as I have said before (so has cdm, and others).
The devctl() seems silly at first until you realize that it’s actually
something that non-qnx people understand. It IS IPC and is near identical
to the S/R/R stuff, except you can talk about devctl()'s and other *nix
programmers will understand you too.
There is even a chance that some things like NFS might be able to actually
transport devctl() from other *nix systems to QNX, which could open up some
pretty HUGE advantages for QNX6.(I would love to have someone @QSS verify if
NFS can do this?)

The resource manager DOES have it’s place. It’s just not the end all to
IPC. I liked QNX4 because of it’s IPC. I think QNX6 is trying to make
everything look like a stream so that this open()/read()/write()/close()
will work from anywhere to anywhere. And I think it’s a mistake.

I’ll repeat, you don’t have to. You are in a rut with that, you’ve convinced
yourself that:

IF( I_use_resmgr ) THEN I_must_use_open,read,write,close

It’s wrong. Stop thinking that way, learn the truth.

Cheers,
Camz.


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.

Robert Krten <nospam86@parse.com> wrote:

Hey, you’re pulling a Dave Gibbs and quoting basically what I
just said, except later! > :slight_smile:

If I say what you said, it is usually because I started posting before
I saw your article, but got interrupted in the middle and finished it
later.

And, usually, we’re both right.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

David Gibbs <dagibbs@qnx.com> wrote:

Robert Krten <> nospam86@parse.com> > wrote:
Hey, you’re pulling a Dave Gibbs and quoting basically what I
just said, except later! > :slight_smile:

If I say what you said, it is usually because I started posting before
I saw your article, but got interrupted in the middle and finished it
later.

And, usually, we’re both right.

Just a friendly dig, Dave :slight_smile:

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.