Need help getting DOS program to print from Boxer

Discussion in 'Mac Programming' started by pmworden, Jul 6, 2009.

  1. pmworden macrumors newbie

    Sep 9, 2007
    Hello! I AM NOT a programmer but have tried to get this to work with no luck so far. I want to avoid doing this within Parallels/Vista although I've gotten that to work. Situation is that I have an old DOS estimating program still used here and someone wants to use it on a new 13-inch MacBookPro. This person is very technically challenged so jumping between Parallels and OS X would be an invitation to lots and lots of frustration. The program works except printing. I've tried editing the config file changing the "serial1=" (many variations), putting a redirect line in the config file, all to no avail. I'm thinking that "serialx" is "COMx" in the DOS program and that perhaps an Applescript that would change "cu.modem" or "Internal Modem" to a USB printer would work. As you can see, one of the problems I've had is that I really don't know the verbage that either the DOS program uses or the Mac uses to specify a device. Any takers?

    More detail
    Following is a snippet of the config file for Boxer (DOSBOX) where the serial port is used. From my understanding so far, DOS doesn't use Parallel (LPT) but rather Serial (COM) for printing.


    # Set the type of device connected to serial port:
    # disabled, dummy, modem, nullmodem, directserial.
    # Additional parameters are supplied on the same line as
    # parameter:value pairs. All types use the irq parameter.

    # For directserial: realport (required), rxdelay (optional)
    # For modem: listenport (optional)
    # For nullmodem: server, rxdelay, txdelay, telnet, usedtr,
    # transparent, port, inhsocket (all optional)

    # Example: serial1=modem listenport:5000

    # Any DOS commands you put under this heading will be executed
    # when DOSBox emulation starts.

    I've tried substituting the serial entries like this:
    serial1=directserial realportap://*/Accel-a-Writer%204N/LaserWriter
    serial2=directserial realportap://*/Accel-a-Writer%204N/LaserWriter
    serial3=directserial realportap://*/Accel-a-Writer%204N/LaserWriter
    serial4=directserial realportap://*/Accel-a-Writer%204N/LaserWriter
    ... where the "pap://..." is taken from the name of a printer as it is listed on the Mac in System Preferences, Print & Fax, Options & Supplies..., General tab, URL: (this printer is a networked printer, but I've tried the same method with a USB printer without success)

    I've tried substuting the serial entries like this:
    serial1=directserial realport:tty.Patti-1
    serial2=directserial realport:tty.Patti-1
    serial3=directserial realport:tty.Patti-1
    serial4=directserial realport:tty.Patti-1
    where the USB printer was showing up as tty.Patti-1 through a terminal device search (/dev/tty) - I read that "cu." is incoming and "tty" is the corresponding outgoing - when I typed a unique and simple name for the printer and the location in the Print & Fax menu, the default tty of "tty.modem" was replaced by "tty.Patti-1". I had already tried the default "tty.modem" and also cu.modem.

    I realize all of this is not Mac programming and I think if I could use LPT1 or even COM1 in this config file anywhere and if I knew the device name the Mac had for LPT1's destination out of this, then an Applescript could redirect it to any printer. Problem is, this config file lists only "serial..." not "COM..." and no LPT whatsoever. Thanks for any input.
  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    You can't just use a USB port like it was a serial port. That won't work.
  3. pmworden thread starter macrumors newbie

    Sep 9, 2007
    Thank you. FYI, I started with this information:

    where the final resolution for this user was a line in the config file as:
    serial1-directserial realport:tty.usbserial

    ...where his usb serial adaptor was /dev/tty.usbserial

    sounds then like I would need an adaptor then identify the name given to the adaptor by the Mac OS by using /dev/tty in terminal, yes?

    Also, the DOS program does list LPT1 as an option for printing which was the selection that worked through Parallels/Vista, but I have no idea how to tell the DOS program what port to use - what it's called by the Mac - and how to put that in a config file for the DOS program in order to get a printout when choosing LPT1.
  4. robbieduncan Moderator emeritus


    Jul 24, 2002
    That will work as the USBSeriel driver that goes with the adaptor will accept the standard old-school seriel commands, pump them over the USB bus and the adaptor converts them back.

    LPT1 is the parallel port normally?
  5. pmworden thread starter macrumors newbie

    Sep 9, 2007
    Yes. LPT 1 and 2 are both available and are parallel ports.
  6. robbieduncan Moderator emeritus


    Jul 24, 2002
    Yes, but unless you are on an ancient Mac you don't have any real parallel ports. So again you'd need some sort of adaptor. I've seen (and have somewhere) a USB->Seriel adaptor. I've never seen a USB->Parallel one.
  7. pmworden thread starter macrumors newbie

    Sep 9, 2007
    I took so long to answer it logged me out. I found a USB to serial adaptor and that looks like the answer. But I still think it's strange. Does plugging in the adaptor change the way the Mac uses the USB or does the "translation" to serial happen after the output hits the adaptor? Here's why I ask: It seems odd that I would type in a line in the config file that in effect redirects the serial output from the DOS program to the USB port in the Mac but then have to use the cable to "translate" it back to serial and then also be sure that the USB printer has a serial connector, which might be tough to find one that has serial. Also seems odd since within Windows, I can use a program that makes serial output work to USB. Weird. So should I assume that if serial is going out from the DOS program the USB would only be able to pass it through as something intelligible if it "translates" it (or keeps it as-is) via a serial adaptor?
  8. pmworden thread starter macrumors newbie

    Sep 9, 2007
    I found a Keyspan USB to 2-port serial adaptor and the driver for it, unfortunately a USB printer that I've been using to test is USB only. I'll look through some old stuff and see if I can locate a desktop serial printer. Thanks so much for the help!
  9. idelovski macrumors regular

    Sep 11, 2008
    I have some experience with Keyspan adapters. My software uses them to print on POS (Receipt) printers.

    You can try with this name: "/dev/tty.USA19QW5b14P1.1", but I think they are changing this from version to version. My software uses some code to search for available serial ports, but you said you're not a programmer. Maybe there's some utility that can help you.
  10. pmworden thread starter macrumors newbie

    Sep 9, 2007
    I'll hookup the Keyspan that I found, "USA-28" and install the driver, then check terminal to see what "tty" listing it is, then I'll put that in the config file - maybe it will work. Thanks for the information - every bit helps!

    Also, I downloaded the current driver today and believe I have an old printer that's still serial at home; enough for a smoke test.

Share This Page