9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] How to add djet500' driver to gs?
@ 2010-01-19  3:30 Frederik Caulier
  2010-01-19 15:14 ` Russ Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Frederik Caulier @ 2010-01-19  3:30 UTC (permalink / raw)
  To: 9fans

Hello 9fans

I'm currently trying to get my HP Deskjet 500 (/dev/lptr1data) working
in native Plan 9. Using 'lp -d hpdeskjet file' the printer works
basically; it takes in a sheet and starts printing.
But it prints only weird symbols and mishandles newlines etc..

I did a little research and found that there is a 'djet500' driver
(see /sys/src/cmd/gs/src/gdevdjet.c) available for gs but it is not
included in the stock gs binary according to the output of  'gs -?'. I
added the djet500 driver to /sys/src/cmd/gs/mkfile and run 'mk
fake-make' and then 'mk install' as described in the mkfile.

It builds with no error messages but the output of the freshly
compiled 'gs -?' still doesn't show the new djet500 driver.

What is the right/working procedure to add drivers to gs?

Suggestions on how to solve this are very welcome.

Best regards,
F. Caulier



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] How to add djet500' driver to gs?
  2010-01-19  3:30 [9fans] How to add djet500' driver to gs? Frederik Caulier
@ 2010-01-19 15:14 ` Russ Cox
  2010-01-20  2:20   ` Frederik Caulier
  0 siblings, 1 reply; 3+ messages in thread
From: Russ Cox @ 2010-01-19 15:14 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> I'm currently trying to get my HP Deskjet 500 (/dev/lptr1data) working
> in native Plan 9. Using 'lp -d hpdeskjet file' the printer works
> basically; it takes in a sheet and starts printing.
> But it prints only weird symbols and mishandles newlines etc..
>
> I did a little research and found that there is a 'djet500' driver
> (see /sys/src/cmd/gs/src/gdevdjet.c) available for gs but it is not
> included in the stock gs binary according to the output of  'gs -?'. I
> added the djet500 driver to /sys/src/cmd/gs/mkfile and run 'mk
> fake-make' and then 'mk install' as described in the mkfile.
>
> It builds with no error messages but the output of the freshly
> compiled 'gs -?' still doesn't show the new djet500 driver.
>
> What is the right/working procedure to add drivers to gs?

It looks like the mkfile has a small bug in that
src/plan9.mak, which fake-make works from,
doesn't depend on mkfile itself, so mk didn't regenerate
it after you changed the mkfile.  You can check this
theory by doing

    cd /sys/src/cmd/gs
    grep '^DEVICE_DEVS=' src/plan9.mak | grep djet500

I bet grep will not find anything.

Assuming that's the case, you should be able to
get the driver added by running

    cd /sys/src/cmd/gs
    rm src/plan9.mak   # works around bug
    mk fake-make
    mk install

Good luck.
Russ


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] How to add djet500' driver to gs?
  2010-01-19 15:14 ` Russ Cox
@ 2010-01-20  2:20   ` Frederik Caulier
  0 siblings, 0 replies; 3+ messages in thread
From: Frederik Caulier @ 2010-01-20  2:20 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

You were right.

I manually removed /sys/src/cmd/gs/src/plan9.mak, re-run 'mk
fake-make' which then created plan9.mak again but with the new djet500
driver included.

After running 'mk install'  the output of the new gs binary now shows
the djet500.

Printing works generally fine, but with the following caveats: (nothing serious)

The first time I run 'lp textfile' the printer will act as if I had
pushed its reset button and the following error will occur:

cat: write error copying /tmp/gsp227: i/o error

(Note that there is another number instead of '227' each time, e.g.
182 or 7021. )

After that, until the next reboot, the printer will work fine using
the 'lp textfile' command.
Though, it will first send out an empty sheet at the beginning of each
printing job; then it starts printing normally.

Here's the line I use in /sys/lib/lp/devices:

hpdeskjet500	- - /dev/lpt1data - gs!djet500+nohead generic nospool - - - -

I also have a 'LPDEST=hpdeskjet500' in my /usr/$user/lib/profile.

Thanks alot for your help, it is very nice to be able to print on my
Plan 9 desktop system!

Best regards,
F. Caulier



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-20  2:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-19  3:30 [9fans] How to add djet500' driver to gs? Frederik Caulier
2010-01-19 15:14 ` Russ Cox
2010-01-20  2:20   ` Frederik Caulier

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).