Developing printer driver ??

C and PASCAL (or any other high-level languages) in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12707
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Developing printer driver ??

Postby wongck » Thu Feb 13, 2014 12:39 pm

Any one got the Atari printer driver development kit?

I read somewhere on the web that there is one such SDK but I cannot find it anywhere on the web.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
shoggoth
Nature
Nature
Posts: 970
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: Developing printer driver ??

Postby shoggoth » Thu Feb 13, 2014 3:31 pm

Printer driver for what? NVDI?
Ain't no space like PeP-space.

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12707
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Developing printer driver ??

Postby wongck » Fri Feb 14, 2014 1:17 am

shoggoth wrote:Printer driver for what? NVDI?

Basically GDOS printer drivers, I guess.
I read about it here, under the title gdos printer driver.
It seems that Atari was sticky to release the SDK, so it's a shot in the dark as I found nothing via Google.

So I m guessing, may be GDOS drivers can also be used by NVDI ?
I may be very wrong here as I am no expert on NVDI other than a user.
All my printer drivers that I have comes from NVDI, so if standard GDOS is not compatible, then I would like to know how to make a NVDI printer driver.

I have no idea how to write nor compile a gdos/nvdi printer driver.
There seems nothing specific to Atari GDOS printer driver develpment on the web.
There're some on Intel GDOS, but the article says no one managed to re-compile anything new since DR left it.

But very likely Atari GDOS path went a different route from DR, so I am hoping that there may be some hidden information.

For what's it worth, I am looking into any possibility of making a PDF printer driver.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12707
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Developing printer driver ??

Postby wongck » Fri Feb 14, 2014 1:21 am

I was also hoping that may be Lonny may have something from Codehead that can shed some light into this topic.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 799
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: Developing printer driver ??

Postby mfro » Fri Feb 14, 2014 7:53 am

Essentially, a VDI/GDOS printer driver is just a piece of code that applies VDI functions to a specific memory region, a rasterizer (likely with some optimization - "banding" for example - to reduce memory usage). There is not much difference between a graphics card driver and a printer driver.

If you cannot find a printer driver example/skeleton (I'd be interested as well if you happen to find anything), it might be well be worth to look into FVDI sources instead (but be prepared to lose some hair on your way - it's not necessarily what I'd call good programming style, at least not to my personal taste, no offense intended).

It must do the same thing, basically.

SteveBagley
Captain Atari
Captain Atari
Posts: 176
Joined: Mon Jan 21, 2013 9:31 am

Re: Developing printer driver ??

Postby SteveBagley » Fri Feb 14, 2014 12:56 pm

wongck wrote:For what's it worth, I am looking into any possibility of making a PDF printer driver.


Let me know if you want any help on the PDF side of things since I've spent the past 15 years working with its internals…

Steve

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12707
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Developing printer driver ??

Postby wongck » Fri Feb 14, 2014 3:17 pm

SteveBagley wrote:Let me know if you want any help on the PDF side of things since I've spent the past 15 years working with its internals…

Thanks.
I guess the difficult part is the gdos printer structure which has very little information on the web.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
Zogging Hell
Atari Super Hero
Atari Super Hero
Posts: 882
Joined: Sat Apr 29, 2006 12:08 pm
Location: Bristol, UK
Contact:

Re: Developing printer driver ??

Postby Zogging Hell » Fri Feb 14, 2014 3:50 pm

The source for TTF GDOS is on the Orphaned projects homepage, I'm not sure whether that would be any help?
Firebee, Falcon CT60, Milan 040, Falcon MkI, TT, Mega STe, Mega ST + Lots of STs of various flavours

SteveBagley
Captain Atari
Captain Atari
Posts: 176
Joined: Mon Jan 21, 2013 9:31 am

Re: Developing printer driver ??

Postby SteveBagley » Fri Feb 14, 2014 4:04 pm

wongck wrote:
SteveBagley wrote:Let me know if you want any help on the PDF side of things since I've spent the past 15 years working with its internals…

Thanks.
I guess the difficult part is the gdos printer structure which has very little information on the web.


Something's just popped into my head that the ICTARI programming thing may have covered it at some point.

I suspect it varies between the various GDOS implementations too.

Steve

Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 757
Joined: Sat Oct 26, 2013 11:19 pm
Location: Brasil
Contact:

Re: Developing printer driver ??

Postby Faucon2001 » Fri Feb 14, 2014 4:05 pm

Hi,

You can find on some FTP server the source of a SpeedoGdos color driver for DJ550c developed by Thierry Rodolfo, together with the library. I have the archive at home, I will post it tonight when I come back. He has developed other drivers for Epson Stylus color but I have never found the sources on the net.
Indeed, I am also very interested in the development of printing capability, as all my attempts to use NVDI or SpeedoGdos together with FVDI on Aranym have been a failure. :(

I believe that the best solution would be to add a print to file function to FVDI (save raster to TIFF or PDF), as these files could be printed easily with Wongck PHERP or Ghostscript mint port, but I am not a developer.

Philippe
Philippe

Firebee, Falcon, STE, Aranym Box, Hatari Pi Box.
My music http://www.philippeworld.net/
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12707
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Developing printer driver ??

Postby wongck » Sat Feb 15, 2014 3:41 am

SteveBagley wrote:Something's just popped into my head that the ICTARI programming thing may have covered it at some point.

I suspect it varies between the various GDOS implementations too.

Steve

Thanks I will gave a look at the ICTARI magazines over the weekend.

I think the GDOS implementation, or at least the drivers section may be different. So I think I may want to stick to a particular version like NVDI as they are weel know and used by many.
But I do hope that they are at least backward compatible to some point. :roll:
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12707
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Developing printer driver ??

Postby wongck » Sat Feb 15, 2014 3:44 am

Faucon2001 wrote:You can find on some FTP server the source of a SpeedoGdos color driver for DJ550c developed by Thierry Rodolfo, together with the library. I have the archive at home, I will post it tonight when I come back. He has developed other drivers for Epson Stylus color but I have never found the sources on the net.
Indeed, I am also very interested in the development of printing capability, as all my attempts to use NVDI or SpeedoGdos together with FVDI on Aranym have been a failure. :(

I believe that the best solution would be to add a print to file function to FVDI (save raster to TIFF or PDF), as these files could be printed easily with Wongck PHERP or Ghostscript mint port, but I am not a developer.

Philippe


If you have the source that would be great :D

I am not sure about Aranym, but I think on the CT63, Didier used FVDI as part of the implementation for the build-in ATI drivers. You can use NVDI, at least the GDOS & printers, which I am doing. You have to disable the screen drivers as NVDI does not support the new resolutions.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12707
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Developing printer driver ??

Postby wongck » Sat Feb 15, 2014 3:45 am

Zogging Hell wrote:The source for TTF GDOS is on the Orphaned projects homepage, I'm not sure whether that would be any help?

Great, another lead.... I hope it have the driver portion as it is like the core gdos implementation.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 757
Joined: Sat Oct 26, 2013 11:19 pm
Location: Brasil
Contact:

Re: Developing printer driver ??

Postby Faucon2001 » Sat Feb 15, 2014 4:55 am

Hi Wongck,

Here is the link to Thierry Rodolfo DJ550c driver with the sources : http://www.philippeworld.net/ftp/gdosdrv.zip
ttfGDOS does not contain any source about drivers, but use genuine GDOS drivers ; I believe that NVDI use it's own drivers and no source have never been communicated.
I hope that it will be useful for you.

Regarding NVDI and FVDI, I know the procedure to deactivate the screen drivers of NVDI to use only the printing side of it ; the problem is that it does not work correctly with FVDI under Aranym. Well, let me explain the issue (the following are observations based on various tests and trials I have done recently, and done with Aranym 0.915, FVDI (version corrected by Elmut named fvdi_gnu), NVDI 5.03)
1 : In order for FVDI to to work correctly under Aranym you have to launch it in Mint.cnf and not in Auto. With that procedure, you have a rock solid and fast system. If you start FVDI from the auto folder, it will boot but from time to time will crash without any logic.
2 : On the other hand, NVDI will crash if launched from Mint.cnf.
3 : NVDI needs to be launched after FVDI otherwise it is deactivated.
Therefore the only option is to launch FVDI first and then NVDI without screen drivers both from the auto folder, but with that option the system that becomes very unstable, and crash without any reason. On top of that, printing to file from NVDI will save the file anywhere on your drives, depending of the last directory called by the system (could be C: , Xaaes dir, the app dir used ... but not where you asked to) .
Well, not usable at all as you have to launch a search on all your disk to locate the printout file, and anyway after 2 or 3 attempts it won't save the file anymore.
I have also tried to redirect the system prn output to file directly within Mint (setup in Mint.cnf) and it worked ... but only for one print, after no more file is saved and you need to reboot !
So yes, you are right, technically speaking the procedure is correct, but I have reached to the conclusion that it's not usable. I did the same tests with speedo GDOS, and it's not working neither. I will try with ttfgdos and NVDI 4 soon.
Sorry, for the off topic, but I have to admit that printing is really a big issue on Aranym, and a huge opportunity for Atari platform nowadays.
I will receive my Firebee in a few weeks and hope that at least I will be able to print something with it ;-)
As you can see, I am also very interested in printing capability, and have read and searched almost all the information available on the net, but unfortunately I am not a developer : Wongck you are our last hope : may the force be with you :mrgreen:
Philippe

Firebee, Falcon, STE, Aranym Box, Hatari Pi Box.
My music http://www.philippeworld.net/
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/

joska
Hardware Guru
Hardware Guru
Posts: 4377
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Developing printer driver ??

Postby joska » Sat Feb 15, 2014 7:11 am

The correct running order is first fVDI, then NVDI and finally MiNT. Running NVDI after MiNT is a certain recipe for disaster.
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12707
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Developing printer driver ??

Postby wongck » Sat Feb 15, 2014 9:44 am

Firstly thanks for the GDOS source.

Wow, you sure did a lot of testing in your Aranym & NVDI combinations.
I use mostly my CT63 so I do not have so much experience in the topic as you, even as I have a FB, I prefer the Falcon :angel:

And yes, I will need the FORCE for sure, the source is in assembler and so it will take a while for me to understand.

I am sure someone would have some clue for you.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

gstoll
Atari freak
Atari freak
Posts: 72
Joined: Sun Feb 17, 2008 4:29 pm

Re: Developing printer driver ??

Postby gstoll » Sat Feb 15, 2014 11:21 am

wongck wrote:
shoggoth wrote:Printer driver for what? NVDI?

Basically GDOS printer drivers

There is no difference between a graphics card driver and a printer driver. The first function in the driver.sys must be the dispatcher. In D1 you get the VDI parameter block.

http://toshyp.atari.org/en/VDI_fundamen ... _20drivers

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 799
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: Developing printer driver ??

Postby mfro » Sat Feb 15, 2014 1:36 pm

Faucon2001 wrote:Here is the link to Thierry Rodolfo DJ550c driver with the sources : http://www.philippeworld.net/ftp/gdosdrv.zip


Thank you - this is very much appreciated.

Unfortunately, the sources don't seem to be complete?

The .s files basically contain the HP printer specific stuff like ESC sequences only.
The "real thing" (VDI driver) seems to hide within color_x2.lib (which is only available in binary) and an (apparently missing) "styles" file?

Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 757
Joined: Sat Oct 26, 2013 11:19 pm
Location: Brasil
Contact:

Re: Developing printer driver ??

Postby Faucon2001 » Sat Feb 15, 2014 5:42 pm

Sorry that's just what I have found available on the net.

I have called the developer of this driver this morning, but he told me that he no longer has the documentation and sources :-(

Philippe
Philippe

Firebee, Falcon, STE, Aranym Box, Hatari Pi Box.
My music http://www.philippeworld.net/
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12707
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Developing printer driver ??

Postby wongck » Sun Feb 16, 2014 2:02 am

gstoll wrote:There is no difference between a graphics card driver and a printer driver. The first function in the driver.sys must be the dispatcher. In D1 you get the VDI parameter block.


Yes. I have that HYP and have read that part several times. 8O
But I cannot understand how to do that in gcc.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12707
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Developing printer driver ??

Postby wongck » Sun Feb 16, 2014 2:03 am

Faucon2001 wrote:I have called the developer of this driver this morning, but he told me that he no longer has the documentation and sources :-(


Thanks Philippe.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

gstoll
Atari freak
Atari freak
Posts: 72
Joined: Sun Feb 17, 2008 4:29 pm

Re: Developing printer driver ??

Postby gstoll » Mon Feb 17, 2014 7:00 pm

wongck wrote:
gstoll wrote:There is no difference between a graphics card driver and a printer driver. The first function in the driver.sys must be the dispatcher. In D1 you get the VDI parameter block.


Yes. I have that HYP and have read that part several times. 8O
But I cannot understand how to do that in gcc.


I have only an example for PureC:

Code: Select all

#include "pp_drive.h"
 
int errno;

long _FilSysVec;


/* Treibereinstellungen */

/* Funktionsdispatcher - Hauptfunktion */
/* !!!!! Dies muss die ERSTE FUNKTION sein !!!!! */

void dispatch(long dummy, long param2)
   {
   VDIPB *vdipb;
   DEV_PARMS *parameter;
   
   vdipb = (VDIPB *)param2;
   dummy=dummy; /* nur um Warnungen zu vermeiden */
   
   #ifdef _PPTEST
      PP_DebugVDIPB(vdipb);
   #endif
   
   if (vdipb->contrl[0]!=V_OPNWK) parameter=get_parms(vdipb->contrl[6]);
   if ((vdipb->contrl[0]!=V_OPNWK) && (parameter==NULL)) return;

   switch(vdipb->contrl[0])
      {
      case V_OPNWK:            vopnwk(vdipb);               /* Open Workstation */
                              break;
      case V_CLSWK:            vclswk(vdipb,parameter);   /* Close Workstation */
                              break;
                  
      case V_CLRWK:            vclrwk(vdipb,parameter);   /* Clear Workstation */
                              break;
      case V_UPDWK:            vupdwk(vdipb);               /* Update Workstation */
                              break;
      case V_PLINE:            vpline(vdipb,parameter);               /* Polyline / Output Bezier */
                              break;

...
      case ESCAPE:            switch (vdipb->contrl[5])
                                 {
                                 case VS_DOCUMENT_INFO   :   vsdocument_info(vdipb,parameter);   /* Set Document Info */
                                                            break;
                                 case V_COPIES            :   vcopies(vdipb);   /* Set Number Of Copies */
                                                            break;
                                 case V_ORIENT            :   vorient(vdipb,parameter);   /* Set Orientation */
                                                            break;
                                 case VQ_PRN_SCALING      :   vqprnscaling(vdipb,parameter);   /* Inquire Printer Scaling */
                                                            break;
                                 case V_BEZ_QUAL         :   vbezqual(vdipb);
                                                            break;
                                 default                  :   do_default(vdipb);
                                                            break;
                                 }
                              break;
      default:                  do_default(vdipb);
                              break;
      }

   return;
   }



The project file is

Code: Select all

C:\\GEMSYS\pdffile.sys

=
PP_DRIVE.C

PCFLTLIB.LIB
...


You see that in the project file is PP_DRIVE the first file and while there is no startup code "dispatch" is the first function in the binary. "dispatch" have two parameter because in PureC paramters are in register so "dummy" is D0 and "param2" is D1.

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 799
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: Developing printer driver ??

Postby mfro » Mon Feb 17, 2014 7:20 pm

wongck wrote:
gstoll wrote:There is no difference between a graphics card driver and a printer driver. The first function in the driver.sys must be the dispatcher. In D1 you get the VDI parameter block.


Yes. I have that HYP and have read that part several times. 8O
But I cannot understand how to do that in gcc.


Yo need to do a little asm workaround for gcc:

Code: Select all

struct vdi_paramblk;
void c_dispatch(struct vdi_paramblk *params);

void dispatch(void)
{
    __asm__ __volatile__ ( \
            "           move.l  d1,-(sp)\n\t"
            "           bsr     _c_dispatch\n\t"
            "           lea     4(sp),sp\n\t"
            : /* output */
            : /* input */
            : /* clobber */
    );     
}   

void c_dispatch(struct vdi_paramblk *params)
{
    /* here you can do the dispatching in C */
    ...
}


You'll probably need a linker script (since there is no main() function. I also didn't care if there are any registers that need to be saved.

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12707
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Developing printer driver ??

Postby wongck » Tue Feb 18, 2014 12:17 am

Thanks you very much.
I will take a look at these :D :D
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 3 guests