Trying to print in FreeDOS

Discussions related to using VirtualBox on Windows hosts.
Post Reply
tawnytim
Posts: 1
Joined: 10. Jan 2024, 22:57

Trying to print in FreeDOS

Post by tawnytim »

Oh man... where do I start? I have a customer who insists on using DOS and WordPerfect 5.1. His legacy PC died, and I set him up with a modern machine with Windows 10. I'm using Virtualbox(amazing btw) and have a FreeDOS VM. I've got a USB 3.5" floppy drive passed through and working. Last little bit is the printer. It is an HP Laserjet 2300n, and while it does work using USB connection to the Windows, it was my understanding that USB printers on the Windows host don't play well with DOS environments due to the absence of DOS USB drivers - fine. So I got a PCIe -->> Parallel card and installed it into the PC. I was able to get the printer installed in Windows AND operational via a parallel cable connection, LPT1 - good so far. How to pass this printer through to the VM? Well, my research led me to Virtual Box settings of the VM, under the Serial port section. I set it up using COM1 in raw mode and for the file, I entered "MODE LPT1:=COM1" without quotes. The VM spins up fine, but I don't get any output to the printer if entering "echo hello > com1" or "echo hello > lpt1".

So, while I regard myself as highly experienced in computer repair and while I did grow up working with DOS prior to the invention of Windows, I am, officially out of my pay grade.

Send help.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Trying to print in FreeDOS

Post by scottgus1 »

I don't know how well LPT through serial would work. Try viewtopic.php?t=54187
AndyCot
Posts: 299
Joined: 29. Feb 2020, 03:04

Re: Trying to print in FreeDOS

Post by AndyCot »

Old DOS apps will directly use the LPT IO memory address to directly read/write data to the printer. Unfortunately when you get to PCI express cards they do NOT map to the low IO addresses used by DOS.

I have a DOS app that uses the LPT port to bit bash a JTAG interface and it only works on a real LPT port that is either built into a motherboard or a few PCI LPT cards (not PCIe). Some PCI cards did not work. But the biggest clinker is that I had to use DOSBOX to get the LPT to work even though Virtualbox v4.? had LPT pass through.

I would suggest trying DOSBOX-X or DOSBOX Staging, but you may I do not know if you will succeed.
AndyCot
Posts: 299
Joined: 29. Feb 2020, 03:04

Re: Trying to print in FreeDOS

Post by AndyCot »

Have a look at https://mendelson.org/wpdos/ to see if this can help.
javispedro
Posts: 59
Joined: 29. Jan 2022, 15:31
Primary OS: openSUSE
VBox Version: OSE other
Guest OSses: Old & New Windows, Linux

Re: Trying to print in FreeDOS

Post by javispedro »

AndyCot wrote: 11. Jan 2024, 11:18 Old DOS apps will directly use the LPT IO memory address to directly read/write data to the printer. Unfortunately when you get to PCI express cards they do NOT map to the low IO addresses used by DOS.
This is true and all but it really doesn't matter since you are never going to expose the PCI express card directly to the guest. So it will not matter if you use a LPT PCIe card, a USB<->LPT converter, or the real embedded parallel port. As per the quoted thread, when you do the --lpt1 trick, VirtualBox should expose a LPT port on the normal PC IO ports.

(Note however that connecting the printer directly to USB will not work in this fashion as most printers use a different protocol in such case).
klaus
Oracle Corporation
Posts: 1139
Joined: 10. May 2007, 14:57

Re: Trying to print in FreeDOS

Post by klaus »

Forget it. The parallel port passthrough code on Windows host was disabled with VirtualBox 7.0.0. It was never officially supported...
Post Reply