Q: wouldn't that need to be protected mode to trap those IO port accesses? 
unless there's an interrupt involved. those are port and interrupt accesses. 
maybe I am wrong. somebody correct me. interrups apparently can be enabled (and 
thus intercepted easily, easy to write an interrupt routing, just stick a jmp 
instruction at that interrupt address to your interrupt vector handler address, 
it's just a few bytes, like a pointer, you could write this in C, but assembler 
might be better for interrupt handler since high speed is usually necessary) 
and then would not require protected mode if they are not disabled in hardware 
like for print-only LPT cards. the Interrupt Vector Table is at 
http://wiki.osdev.org/Interrupt_Vector_Table#Default_Hardware_Interrupt_Layout


also see delorie's description of what's in the IVT (segment:offset) at 
http://www.delorie.com/djgpp/doc/ug/interrupts/inthandlers1.html 


it's not entirely true that that a software interrupt is the only way to 
generate an interrupt interrups exist primarily because of the 8259 PIC 
(Programmable Interrupt Controller) chip. this chip has interrupt lines driven 
by hardware can cause the proc to jmp to the segment:offset adress (in real 
mode) given in the Interrupt Vector Table (IVT).  


seg:ofs=(seg*16)+ofs=(seg<<4)+ofs (note that it is not bit or, it is addition). 
translation of such an address is I think requires some macros or functions in 
DJGPP C/C++
compiler which uses protected mode (or other dos extenders) because of the 
32bit flat addressing. C/C++ could b fast enough, I have not tried. I haven't 
done IVT's since the 8086 in college 20 years ago.



make sure you return from the function/proc with IRET or IRETD (both CFh) 
mentioned in vol2a of the i7 manual not RET. you may have to write your proc 
using GAS in ASM {} I think it is in the C compiler using AT&T assembler 
syntax. Intel® Core™ i7 processor Extreme - Technical Documents 

but this is if you are trying to capture anything going through the parallel 
ports.

HOWEVER, a differently named PRINT program could be made... hpprint epprint
one for EPSON/CANON, one for HP? and 2 TSRs (HP, Epson) for print screen key.

hopefully the program can work with DHCP printers as well as static IP-based 
ones as well as umm... USB? hmmm. well, that's going to be interesting, usb 
protocol changed in usb 3.1 from 8b/10b to 128b/132b and it's gotten more 
efficient (no more 20% overhead from 8b/10b). usb is actually available from 
extended int13h bios calls, which you can find in the phoenix 1998 EDD spec 
pdf: int13h BIOS Enhanced Disk Drive Specification March 12, 1998 Phoenix ... 

EDD-4 BIOS int13h T13.org standard (later) $60 
http://www.techstreet.com/products/1816587

EDD-3 BIOS int13h T13.org standard (earlier, started 1998, corrects phoenix 
1998 spec, phoenix implementation differs? see 
https://lkml.org/lkml/2012/5/16/115
 )
http://www.techstreet.com/products/1217605
  

usb.org I think has the various specs documents for usb or at least the 
document reference numbers you can google. usb is a packet-driven protocol.
http://www.usb.org/developers/docs/usb20_docs/#usb20adopters

http://www.usb.org/developers/docs/usb20_docs/#usb20spec

http://www.usb.org/developers/docs/

the printer should still work through a series of hubs. hubs might be usb 
devices themselves that happen to provide device trees or maybe they are a 
device and provide several port numbers on the tree, there can be up to 127 
devices on the tree. 10Mbps usb 3.1 hubs and devices are probably soon to come 
out, and they will likely use a new connector. usb devices can programmatically 
supply power, not just 5v, pretty good jolt actually, varying amounts of 
current, and usb 3.1 can supply 100W. hope you have a beefy PSU and the right 
cable if you plug in your coffee warmer... 



however, a printer is likely to supply its own power and not require any from 
the USB. well, with 100W USB, this may change the landscape of mobile printers? 
maybe. maybe not. my big HP officejet takes only 16W max.



while this would be a fun project for me to do, DJGPP is unavalable to me as of 
yet because the windows version is still under development. and I would not 
know how to submit this project to the FreeDOS FTP area. I have tried before 
and failed.


I hope those more up-to-date int13h spec links help everyone.

problem I has with permission is the legal beagles (or maybe it's support 
that's giving me the runaround?) at HP, they are hard to get permission from 
because one lady required me to get a lawyer the last time I tried (maybe I am 
just going thru a phase), maybe someone else will get better success than me - 
lately for me getting permission is like pulling hen's teeth. HP PCL 5+6 spec 
is available on a cdrom as PDF's. the spec is
pretty much NIH syndrome.

EPSON probably has their FX spec available eveeywhere on their site, probably 
best to get permission to use. but once you have it, you can do all sorts of 
things, including a TSR for print screen key, you could even have it support 
graphics modes if you work at it enough and the program doesn't trap the print 
screen key. it's part of the printer documentation. (yay!)

it's going to take some real digging to actually find these specs, they are not 
in easy to find places on the mfr's sites and there's a ton of junk to wade 
through.

the first 2 links below are only to save you the time of digging.

HP PCL5 Printer Language Technical Reference Manual - ENWW - 
http://h20566.www2.hp.com/portal/site/hpsc/template.BINARYPORTLET/public/kb/docDisplay/resource.process/?javax.portlet.begCacheTok=com.vignette.cachetoken&javax.portlet.endCacheTok=com.vignette.cachetoken&javax.portlet.rid_ba847bafb2a2d782fcbb0710b053ce01=docDisplayResURL&javax.portlet.rst_ba847bafb2a2d782fcbb0710b053ce01=wsrp-resourceState%3DdocId%253Demr_na-bpl13210-1%257CdocLocale%253D&javax.portlet.tpst=ba847bafb2a2d782fcbb0710b053ce01_ws_BI&ac.admitted=1390276770962.876444892.199480143
 
hp pcl 5 spec


https://www.google.com/search?q=epson+fx+control+code+spec&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&channel=sb

epson fx control codes



http://logix4u.net/parallel-port/43-how-to-read-parallel-serial-port-address-from-bios



Interfacing the Standard Parallel Port


well, that's enough food for thought for whoever is getting started. that's 
enough info to get the project rolling. I wish I had my DOS dev environment 
working!



Jim Michaels



>________________________________
> From: Mateusz Viste 
>To: freedos-devel@lists.sourceforge.net 
>Sent: Monday, July 7, 2014 11:37 PM
>Subject: Re: [Freedos-devel] FreeDOS JetDirect driver (was: Getting tarted)
> 
>
>Hi,
>
>I feel this belongs more to freedos-user and not that much to -devel, as 
>you are having a typical end-user problem, with no development involved 
>on your part...
>
>About your "network printer under dos" problem, you might want to take a 
>look into the archive. It is a subject I played with in 2007, and found 
>a semi-solution that, while not perfect, provided quite good results at 
>the end of the day.
>
>http://sourceforge.net/p/freedos/mailman/freedos-user/thread/7705c9030712260747i328f25d3y9c8cf9a590eec...@mail.gmail.com/
>
>Since you seem eager to contribute to the DOS community with some 
>low-level programming,
feel free to develop a 'network driver' for DOS 
>that would intercept LPT calls and send them via JetDirect to a 
>configurable printer using the Wattcp or mtcp stack. Your problem will 
>be solved then :)
>
>cheers,
>Mateusz
>
>
>
>
>
>On 07/08/2014 03:56 AM, Jim Michaels wrote:
>> my hp because it is HP PCL 5/6 you can dump text and formfeeds straight
>> into it, though because font sizes etc have not been set, text size is
>> rather large and duplexer
is not taken advantage of.
>>
>> also, my officejet printer is a network printer and uses HP SLP or HPLIP
>> or the port 9100 thing, it has a jetdirect. so I am not sure how I am
>> going to print, with usb cable or via network... ? not sure what to do
>> with canon, epson, brother, etc. maybe they use HP PCL5 also?
>>
>> I suppose if you could telnet the text from stdin or something into the
>> printer? :-)
>>
>>     ------------------------------------------------------------------------
>>     *To:* Technical discussion and questions for FreeDOS developers.
>>     *Sent:* Saturday, July 5, 2014 7:49 AM
>>     *Subject:* Re: [Freedos-devel] Getting started
>>
>>
>>     Hi Andy :-)
>>
>>      > I've been a FreeDOS user on and off for > 10 years and am
>>     interested in
>>      > contributing but don't really know where to get started.
>>
>>     That largely depends on what you would like to improve.
>>
>>      > I currently work developing and testing printer firmware and
>>     software but
>>      > expect that this will be quite a learning curve from the QNX/Python
>>      > environments that I spend a lot of time in.
>>
>>     I expect most printers to accept plain text to print,
>>     but there also is a DOS port of ghostscript for those
>>     printers who first need translation of input data...
>>
>>      > Are there docs that describe the DOS programming API that I
>>     should start
>>      > with?  Or bugs that I should poke at to get a more in-depth view
>>     of how
>>      > everything fits together.
>>
>>     Yes, you can read the "RBIL", but again, it really does
>>     depend on what you want to do. If you want to write
DOS
>>     software in C, or maybe port existing Linux software by
>>     using DJGPP, you do not have to know much about how DOS
>>     works internally. You will notice differences, of course.
>>
>>     Regards, Eric
>>
>
>------------------------------------------------------------------------------
>_______________________________________________
>Freedos-devel mailing list
>Freedos-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/freedos-devel

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to