9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: John Floren <john@jfloren.net>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] For first ONLY a laser printer in this resource meaning
Date: Tue, 13 Mar 2012 12:56:22 -0700	[thread overview]
Message-ID: <CAL4LZyhu6NDDftrAzMTLaqepNWg0fQrn9_pe4bErJPTnzJnzsQ@mail.gmail.com> (raw)
In-Reply-To: <7f04f2be-b0de-6d02-ea00-ec856c58fb7c@me.com>

On Tue, Mar 13, 2012 at 11:14 AM, V-CA ! Christoph Paschke
<c.paschke@me.com> wrote:
> @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

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



      parent reply	other threads:[~2012-03-13 19:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13 18:14 V-CA ! Christoph Paschke
2012-03-13 18:18 ` Lyndon Nerenberg
2012-03-13 18:55 ` Nemo
2012-03-13 19:00   ` Lyndon Nerenberg
2012-03-13 19:03     ` erik quanstrom
2012-03-13 19:07       ` Lyndon Nerenberg
2012-03-13 19:10         ` erik quanstrom
2012-03-13 19:56 ` John Floren [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAL4LZyhu6NDDftrAzMTLaqepNWg0fQrn9_pe4bErJPTnzJnzsQ@mail.gmail.com \
    --to=john@jfloren.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).