kenwilsonii said:
and can you still print to LPT1? Most of the latest printers do not work under DOS.
Executive Summary:
The question raised is -- Can one still use LPT1 under Windows 7 from DOS (or more precisely the command line processor CMD)?
The simple answer is YES.
Detailed rationale, to be skipped immediately for those who don't care about the nitty-gritty details of how and why.
~~~~~~~~~~
Disclaimer: Warning, detailed answer follows, please skip if of no interest to you. Please. Don't read, and then complain what is this. Nobody is forcing you to read.
~~~~~~~~~~
As a dinosaur wintarded Windows/Unix systems programmer, I can talk to LPT1 write bytes and even read bytes via the quickly disappearing parallel port DB-25 pin connector. As for most of the latest printers do not work under DOS, it depends on the application used. For instance, take the ubiquitous Notepad. You can invoke that from DOS. It can print, but it isn't a DOS program. So if some developer wants to develop a contemporary DOS only program, but entirely utilize the OS API to talk to the LPT1, be my guest. Similar issues exist under Unix. One can stream bytes out the printer port, but at what point is the page going to start printing, now that almost all, if not all printers nowadays are block devices, requiring a page of data at a time before they print something?
As a proof, nowadays, to do cross-platform microcontroller software design under Eclipse, you can use LPT1 at the parallel port level, it is used in things like OCdemon to do single-stepping and in-circuit-emulation ICE to ARM type RISC processors. That process is controlled via the 8-bit bi-directional parallel LPT1 port. Alas, none of Eclipse is pure DOS either, but works from the command line in CMD. So now we're talking much more sophisticated things than simply streaming bytes to a typical printer over LPT1...
Anyone interested in learning something new and interesting is encouraged to google the term 'Using Open Source Tools for AT91SAM7 Cross Development' : Results 1 - 10 of about 811 for Using Open Source Tools for AT91SAM7 Cross Development.
Here's the PDF.
http://www2.amontec....al-20061124.pdf
or if you want it in HTML
http://74.125.95.132...al-20061124.pdfUsingOpenSourceToolsforAT91SAM7CrossDevelopment&hl=en&ct=clnk&cd=1
All this open-source development environment using Eclipse, Java, and the full suite of GNU tools including ICE and GCC compiler, yes all under Windows... I bet many didn't think Windows is a perfect development platform? Most anything available in FOSS is also available for Windows. In addition, don't understimate the powerful arsenal of Microsoft closed-source development tools like Visual Studio. Just check out http://msdn.microsoft.com for a peek.
Alas gone are the days of a full-screen of 25 lines x 80 characters. Spectacular in a full screen DOS single session? Like what? All you had access to was block characters. Color? Oh you mean FANSI.sys with blinking colors? Now all command line shells are virtualized into windows. Thankfully, also gone are the days of dot-matrix and Diablo 630 daisy-wheel printers. I cannot test your assertion at the moment, but could probably quickly write a simple program following the DOS/WIN API that would work but only for a specific printer, and specific I/O card.
Back in the DOS days, I used two beautiful programs:
1) 4PRINT which compressed onto standard HP LaserJet printers, four pages, onto one.
2) A nice cross-reference / indexer / pretty-printer for assembly and C programs from Aldebaran Laboratories. This utility generated a cross-reference of all variables, routines, subroutines, an index and pagination of your source-code. And it did it quick! All routines were indented (beautified) with braces delineating the structure of calls, subroutines, and the like. No we're not talking about CB only (C Beautifier). This worked for many programming languages, including assembler, basic, pascal and the like, even simple ASCII text.
And no they don't run under Windows 7 x64 beta 7000, sadly. But I haven't used these programs since Win98, which back then was merely a windowing GUI running on top of DOS... And neither did they run under Windows XP. Or Windows 2000 or NT 3.51 for that matter...
Thus I reiterate and I stand by my statement that I have not found a single well-behaved (API following) program that won't run under Windows 7 yet.
Now technically, the problem with DOS printing routines, (I know, I wrote the bi-directional drivers to make that Diablo 630 daisy-wheel printer more efficiently, {with less useless optimized head movement} than provided by the manufacturer) is back in these days was in the 1980's (almost 29 years ago!) each program talked to the hardware directly to the LPT1 .. LPTn ports directly to the parallel port chip, bypassing the DOS provided API. DOS itself, was going through the BIOS as it should, but in order to obtain finer granularity than could be provided by the BIOS, most software developers had to talk to the hardware directly, such as polling I/O ports, in a looping fashion, to detect the position of the print-head and stuff like that. And since they were already talking to the hardware directly, might as well perform the input output by yourself, by latching the byte to send out into a register, strobing the port, subsequently synchronizing with various quirky timing loops, polling the status register, and proceeding byte per byte. Stuff that in the days, couldn't be done within DOS itself. Because DOS depended on the individual manufacturer's BIOS (BASIC Input Output System) to talk to the hardware devices. There were just too many varieties and variances between them and no open-standards yet. And the BIOS just didn't implement such functions. The chicken and egg situation.
Yours was a loaded trick question, and inappropriate to the topic of this thread. All functionality for printing is there in today's versions of Windows, even over the Ethernet, wireless including Wi-Fi and others, USB, USB-2, IEEE-1394 (firewire) interfaces, Bluetooth, infrared, except for talking directly to an 8-bit parallel port chip. Functionality that DOS couldn't and never did in the first place. But that was reality since NT 3.51 came along eons ago. So don't ask for pointless, redundant and rhetorical questions. Unless your motive is to disrupt this discussion? Be careful about perception, you might be labeled a troller by the PCWorld Community members...
An ill-behaved program is anything that attempts to talk to the hardware directly, bypassing the operating system. Just can't do that nowadays and expect a deviant program from being compatible with a further release of any operating system. Thus the necessity to update drivers too. The root cause to archaic pure DOS programs inability to use recent printers is they (the DOS program) don't know how to talk to the newer printers, and has nothing to do with LPT1 .. LPTn access from DOS itself, via the DOS API provided as a subset of the WIN API, thus the backwards compatibility is there should anyone require it. As a further proof, I put it to you that using an old dot-matrix, or Diablo 630 printer, would still work with pure DOS programs under Windows 7. It is just the newer printers that don't work from DOS under any NT based Windows.
Also remember anyone can still boot DOS 3.3 natively should they need to. But why? As an alternative, with Windows 2008 Server and Hyper-V virtualization, booting DOS 3.3 would work I suppose since that level of virtualization allows hardware access in a virtual sandbox. However I cannot comment since I have not tried that specific scenario...
As a footnote, my apologies to the average PCWorld Community member, as we're not at Dr.Dobb's or a programmer oriented forums community I suppose; I just forget where I am, and perhaps the typical audience considers all of this mumbo-jumbo just useless nerd stuff, and maybe it is. But I suspect some might appreciate the discovery aspects and resulting understanding of the underlying issues. For those who can, please enjoy.
~~~~~~~~~~
Letting go of the past is necessary in order to move forward.
~ Annie Heese
All the carnal beauty of my wife is but skin deep.
~ Sir Thomas Overbury's, 1613
Everything has its beauty but not everyone sees it.
~ Confucius
Sign In
Register
Help



MultiQuote


