From owner-freebsd-questions@FreeBSD.ORG Tue Sep 21 11:37:27 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D364D1065670 for ; Tue, 21 Sep 2010 11:37:27 +0000 (UTC) (envelope-from freebsd.user@seibercom.net) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 844048FC1B for ; Tue, 21 Sep 2010 11:37:27 +0000 (UTC) Received: by gxk8 with SMTP id 8so2001428gxk.13 for ; Tue, 21 Sep 2010 04:37:26 -0700 (PDT) Received: by 10.150.73.3 with SMTP id v3mr10600853yba.362.1285069046504; Tue, 21 Sep 2010 04:37:26 -0700 (PDT) Received: from scorpio.seibercom.net (cpe-071-077-039-064.nc.res.rr.com [71.77.39.64]) by mx.google.com with ESMTPS id q38sm4721486yba.18.2010.09.21.04.37.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 21 Sep 2010 04:37:25 -0700 (PDT) Received: from scorpio (zeus [192.168.1.1]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: FreeBSD.user@scorpio.seibercom.net) by scorpio.seibercom.net (Postfix) with ESMTPSA id 1A735E5480D for ; Tue, 21 Sep 2010 07:37:23 -0400 (EDT) Date: Tue, 21 Sep 2010 07:37:22 -0400 From: Jerry To: FreeBSD Message-ID: <20100921073722.49d49e98@scorpio> In-Reply-To: References: <201009201716.o8KHGpxf013791@mail.r-bonomi.com> Organization: seibercom.net X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd8.1) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAG1BMVEX3/uPVnZf2/v9ejGkqHB74++H///+cHCT3m6cgqYvfAAACbElEQVQ4jWXTQW/bIBQAYJLJuRMn8TVCss9zTdrrXJ6bHe1Ej/bossF9EpJ3nbapf3sP8JxOQ4qV8OU9HvjBROWcYNlKHtxlQ1/huBaOBiMwQtgHhbokMLIT76Acps5hvy61+6WsjkCZzNEW0+fcQ7Nl5uoPCegjjjhN5/MEABd89k9hXkQoX6cwPIDKCt8tYG5wpmdrxAyuolTPqpiVoEpVCWvl6e00RAD4JBJQnO4lvv0O4Cnd3WUGevYNFohxFYAy7jCCtW39LaQK8BgDAgiHVinVJlCiFKlcqgEHfwb1EuG+DwFGMO3oCIuJIEYoa8KJECBB+UBldgm0MQmEGz7GQr8XYRPKzYNO1zZ8mgdAu4BG5Ke/4KFboM8458UScViAAvYD93OAsu+Bc3zxCU7ZAjT74+dQv9K7oO0d1wuscop48Pc50O5bcVwgGzh/mXzaizJuAWERh8k3eaxKmxu4kV1p2XOEg3i3c8M+EKR93P0D1KATpC55vMHaGqFf5f/AwhlrhHgg8DTezopt6I3o3Qx4q4q6YaPxK8RxcClXeFGhTTS++QR6TS/oBs7l4WhzuNMubZG6hIBkF4qqZVdWczIqSrjKVF/i4o26IP2oElBGFy5CXKSnf6UWDTC6zKSqoAvzsakjjBvdzLKnmxdhY8eRsX7VSCUBdgD1hVJpx6y2OOS1DNDILYmqdWUJ+oHvd0rRvAqX5kpxQMR6yxHzPV6VlPFyWE7LKc36keNQI64gLP8Ybgtmg+zYuBl4fuI8VqW2RqDGE8Uzu7GxGa803whDdxx3bSZbRhfQUSxvmnpLZWpRFqHz7v8AvsBe0S1zv9UAAAAASUVORK5CYII= Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: The nightmarish problem of installing a printer X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: FreeBSD List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 11:37:27 -0000 On Tue, 21 Sep 2010 02:42:22 +0200 C. P. Ghost articulated: > On Mon, Sep 20, 2010 at 7:16 PM, Robert Bonomi > wrote: > > "Adapting"  MS-Windows print drivers is not 'practical' either.  A > > windows print driver is embedd in the O/S KERNEL,  with _system_ > > calls_ (not mere 'library' routines) that implement the > > 'device-dependant' rendering of layout/formating directions.  One > > then takes the 'opaque object' so produced and sends it (via > > _another_ set of system calls) to the 'output' function of that > > same driver. > > Is that really so? How about writing some emulation shim like ndis(4) > for winprinters? Please correct me if I'm wrong, as I'm not a Windows > systems programmer, but this is what I'm thinking about. > > As far as I understand Windows printing, there are two aspects to > resolve, given a vendor supplied windriver binary blob: > > 1/ the windriver gets some (opaque) data from the GDI+ -- maybe > a bitmap, with some meta data. > > 2/ the windriver interprets this data however it sees fit, and then > talks to the NT kernel (maybe via DLL calls) to send electrical > impulses to the printer. > > Now, the data formats of 1/ (GDI stuff) is probably well defined (and > therefore published) in gdiplus.dll or something similar and is the > same for all windriver blobs. The API/ABI needed to talk to the NT > kernel is probably defined in the Windows DDK (or whatever it is > called nowadays). > > So, in both cases, we have stable API/ABI interfaces on both sides > of the windriver binary blob: 1/, 2/ at the upper half, and 2/ at the > bottom half. > > So, if we wanted to use those windriver blobs just like in the ndis(4) > case, all we need is an emulation shim for both interfaces. Maybe 1/ > is already covered by Wine (?) so we could borrow some code from > there; and 2/ is basically a matter of mapping the subset of NT calls > needed to read from and write to Windows ports to Unix calls to read > and write to our Unix devices. > > Again, I'm no Windows programmer, and it is probably more involved > than this. But the basic idea remains: the interfaces on both sides > of the windriver binary blobs is pretty stable and (I think) not a > secret at all. > > > In the Unix world, printing is handled _externally_ to the kernel. > > The application must have =its=own=means= of deciding what > > formatting/layout commands to use -- it _can't_ query the O/S for > > this info; the O/S simply doesn't have it. > > Well, it doesn't matter if the windriver shims run as userland daemon > or (partially) inside the kernel. The point here is that the > windriver <-> NT, and windriver <-> GDI+ interface are both stable > and not difficult to understand, so both can be emulated. At least > theoretically. In practice, it takes some time and effort to get it > right, quite obviously. The bottom line is that installing and running a printer on a Window's machine is usually far easier than on a *nix variation. Even sharing a printer on a network in a Windows environment is simpler. On a separate note, I have friends who claim that the Ubuntu printer installation routine is similar to the Window's one and works quite well for most mainstream printers. I read something a few months ago that Ubuntu was working on using Window's printer drivers directly in Ubuntu. I cannot confirm that; however, it would certainly be a worthwhile avenue to explore. -- Jerry ✌ FreeBSD.user@seibercom.net Disclaimer: off-list followups get on-list replies or get ignored. Please do not ignore the Reply-To header. __________________________________________________________________