Discussion:
[9fans] For first ONLY a laser printer in this resource meaning
(too old to reply)
V-CA ! Christoph Paschke
2012-03-13 18:14:49 UTC
Permalink
@Nemo

Ok, I just want start with a very easy constellation:

1.) I installed octopus on top of my MacMini (newest version) at my televison in living room, he running also Mac-Server
2.) I got the terminal started at an older MacBook
3.) I have a HP Envy 100 WLAN Inkjet printer / Scanner integrated in WLAN, working at all my Macs
4.) Now I want to write a limbo program to print a page at that printer

As I understand you, I cannot nativly run it by the P9 idea of device = file ... because the HP printer itself has no firmware to support such file based streaming, right?

Therefore I need root through to mac a Mac sytem call to can adress the printer.

As I understand, this is NOT the idea of a good Plan 9 / Limbo program? In my understanding: If I now write a small program that prints out for example a list of addresses, I need communicate with my printer in a streaming way and not by system calls, right?

If I'm wrong, could you explain me, how I get my printer working.

And, if it is to difficult with this HP printer and the system only can support old Epson ESC/P code for needle printer, just exlain me how I get that ESC/P printer working in the "Plan 9 ressource way"?

For me it is most important that I can realize what is promised from that operting system according "all resources, also devices are a file" and that this idea is more than a theory!

You understand what I ask?

- Chris
Lyndon Nerenberg
2012-03-13 18:18:26 UTC
Permalink
Post by V-CA ! Christoph Paschke
For me it is most important that I can realize what is promised from that operting system according "all resources, also devices are a file" and that this idea is more than a theory!
This only applies if you're running native Plan 9.
Nemo
2012-03-13 18:55:51 UTC
Permalink
I think in the octopus we have a print device that used the underlying default printer.
It should be in /mnt/print or /mnt/terms/yourmachinename/print

Take a look to the start scripts to see if print is starting or printing some diagnostics.

So, cp afile.pdf /mnt/print
should print it there.

Ah, if you don't see
/mnt/print/ndb

then you don't have a printer running and mounted at /mnt/print.


What Lyndon said is also true, btw. I'm not saying it's not.
Only that you can also wrap non-native devices with little
file servers, as in this case.
erik quanstrom
2012-03-13 19:03:58 UTC
Permalink
It's just very confusing knowing how P9 concepts apply in an emulated environment. It's frustrating even for those of us (okay, me) who have been tooling around with P9P (and the like) for years. Every day a new surprise ... :-|
p9p's raison is to get along with the local environment, rather than
importing plan 9 concepts that don't fit. this naturally puts it somewhat
at odds with itself.

- erik
Lyndon Nerenberg
2012-03-13 19:07:27 UTC
Permalink
Post by erik quanstrom
this naturally puts it somewhat
at odds with itself.
Sadly, I think that's what turns people away from Plan 9: they only get to see a pale shadow of its worth :-(
erik quanstrom
2012-03-13 19:10:41 UTC
Permalink
Post by Lyndon Nerenberg
Post by erik quanstrom
this naturally puts it somewhat
at odds with itself.
Sadly, I think that's what turns people away from Plan 9: they only get to see a pale shadow of its worth :-(
its a plan 9 wraith.

- erik
Lyndon Nerenberg
2012-03-13 19:00:29 UTC
Permalink
Post by Nemo
What Lyndon said is also true, btw. I'm not saying it's not.
Only that you can also wrap non-native devices with little
file servers, as in this case.
It's just very confusing knowing how P9 concepts apply in an emulated environment. It's frustrating even for those of us (okay, me) who have been tooling around with P9P (and the like) for years. Every day a new surprise ... :-|
John Floren
2012-03-13 19:56:22 UTC
Permalink
On Tue, Mar 13, 2012 at 11:14 AM, V-CA ! Christoph Paschke
@Nemo
1.) I installed octopus on top of my MacMini (newest version) at my
televison in living room, he running also Mac-Server
2.) I got the terminal started at an older MacBook
3.) I have a HP Envy 100 WLAN Inkjet printer / Scanner integrated in WLAN,
working at all my Macs
4.) Now I want to write a limbo program to print a page at that printer
As I understand you, I cannot nativly run it by the P9 idea of device = file
... because the HP printer itself has no firmware to support such file based
streaming, right?
Therefore I need root through to mac a Mac sytem call to can adress the
printer.
As I understand, this is NOT the idea of a good Plan 9 / Limbo program? In
my understanding: If I now write a small program that prints out for example
a list of addresses, I need communicate with my printer in a streaming way
and not by system calls, right?
If I'm wrong, could you explain me, how I get my printer working.
And, if it is to difficult with this HP printer and the system only can
support old Epson ESC/P code for needle printer, just exlain me how I get
that ESC/P printer working in the "Plan 9 ressource way"?
For me it is most important that I can realize what is promised from that
operting system according "all resources, also devices are a file"
and that this idea is more than a theory!
You understand what I ask?
- Chris
So, here's what we did when we wanted to make Android
hardware/services accessible to Inferno--and this should work for you
too.

All of your Macs can print to the printer, presumably by using a
command something like "lp -d<printername> <filenames>". That's nice,
because you now have a reasonably simple abstracted interface to the
printer, which allows you to submit print jobs, check the queue, etc.

Now, write a device in Inferno which presents files like /dev/print or
whatever you want to call them, and executes commands on the Mac side
to actually do the work. Thus, if you write a file into /dev/print,
your driver should do something like run "lp" and feed it the file on
standard input.

You can take a look at
https://bitbucket.org/floren/inferno/src/75008e7031e1/emu/Android/devwifi.c,
specifically the wifiinit function, to see one crude example. The idea
there was to initialize Android's wifi device when the Inferno devwifi
device is initialized. Another example of translating actions in
Inferno into actions on the host system is
https://bitbucket.org/floren/inferno/src/75008e7031e1/emu/Android/devphone.c,
where we took commands written to the device files and translated them
into appropriate RIL (Android's radio daemon) commands to send out
over a socket on the Android side.

Once you figure out how the devices work in Inferno, it should be
pretty easy to write code that will link your file operations in
Inferno to the printing framework on the Macs.


John

Continue reading on narkive:
Loading...