26.02.2014 Views

Getting Started with QNX Neutrino - QNX Software Systems

Getting Started with QNX Neutrino - QNX Software Systems

Getting Started with QNX Neutrino - QNX Software Systems

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The client’s view<br />

© 2009, <strong>QNX</strong> <strong>Software</strong> <strong>Systems</strong> GmbH & Co. KG.<br />

Obviously, as hinted at in my choice of parameters for the open() call above, it may be<br />

a clever idea to allow some “traditional” drivers to be opened <strong>with</strong> additional<br />

parameters past the “usual” name. However, the rule of thumb here is, “If you can get<br />

away <strong>with</strong> it in a design review meeting, knock yourself out.” Some of my students,<br />

upon hearing me say that, pipe up <strong>with</strong> “But I am the design review committee!” To<br />

which I usually reply, “You are given a gun. Shoot yourself in the foot. :-)”<br />

Union’d filesystems<br />

Take a closer look at the diagram we’ve been using:<br />

Resource managers<br />

Pathname space<br />

(stored by the Process Manager)<br />

Resource managers<br />

(0,1,1,1) procnto / fsys-qnx4 (0,4965,1,1)<br />

(0,1,1,1) procnto<br />

proc dev<br />

procnto (0,1,1,1)<br />

(0,1,1,1)<br />

procnto<br />

boot ser1 devc-ser8250 (0,44,1,1)<br />

(0,1,1,1)<br />

procnto<br />

1 ser2 devc-ser8250 (0,44,1,2)<br />

(0,1,1,1)<br />

procnto<br />

4965 con devc-con (0,725,1,1)<br />

...<br />

...<br />

<strong>Neutrino</strong>’s namespace.<br />

Notice how both fs-qnx4 and the process manager have registered themselves as<br />

being responsible for “/”? This is fine, and nothing to worry about. In fact, there are<br />

times when it’s a very good idea. Let’s consider one such case.<br />

Suppose you have a very slow network connection and you’ve mounted a networked<br />

filesystem over it. You notice that you often use certain files and wish that they were<br />

somehow magically “cached” on your system, but alas, the designers of the network<br />

filesystem didn’t provide a way for you to do that. So, you write yourself a caching<br />

filesystem (called fs-cache) that sits on top of the network filesystem. Here’s how it<br />

looks from the client’s point of view:<br />

Resource managers<br />

Pathname space<br />

(stored by the Process Manager)<br />

/<br />

Resource managers<br />

(0,326,1,1) fs-cache<br />

nfs<br />

fs-nfs (0,77625,1,1)<br />

Overlaid filesystems.<br />

196 Chapter 5 • Resource Managers April 30, 2009

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!