LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-21-2012, 12:42 AM   #1
aasha1000
LQ Newbie
 
Registered: Jan 2012
Posts: 1

Rep: Reputation: Disabled
ubuntu , dosbox does not print lpt1


i have installed ubuntu 11.0.i have installed dosbox. i need to execute foxpro program. it works fine for data entry. but it cannot print lpt printer.


kindly advise.
 
Old 02-21-2012, 06:06 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,850

Rep: Reputation: 736Reputation: 736Reputation: 736Reputation: 736Reputation: 736Reputation: 736Reputation: 736
Welcome to LinuxQuestions

DOSBox's primary goal is to run games so printing is not supported. There are unofficial versions that do have printing support but I do not know how well it works.

http://www.dosbox.com/wiki/SVN_Builds

I never played with foxpro but another option if available would be to print the report to file and then actually print from linux.
 
Old 08-16-2012, 01:02 AM   #3
paul1945
Member
 
Registered: Aug 2012
Posts: 54

Rep: Reputation: Disabled
Question DosBox does not print

I guess this is an old thread. I have tried the SVN Daum 01-07-2012 build of DosBox 0.74 on my Windows XP machine; I simply copied the files from this build over my existing DosBox files in the DosBox directory and the printing side of it works a treat.
I tried the same with the files provided in an archive on the same Site, which were supposed to be for Linux, but they do not work.
So the question is, has anyone compiled this particular DosBox SVN Daum build for any of the Linux versions (mine is Ubuntu 12.04)?
And if so, where is it available?
Or have I simply done something wrong (or incomplete) when I copied the files in the archive over the existing DosBox file in my Linux /etc/bin directory?
 
Old 08-16-2012, 05:51 PM   #4
jefro
Guru
 
Registered: Mar 2008
Posts: 11,323

Rep: Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386
You need to see if there is a linux megabuild. http://www.printfil.com/efaq32.htm
 
Old 08-17-2012, 01:39 AM   #5
paul1945
Member
 
Registered: Aug 2012
Posts: 54

Rep: Reputation: Disabled
DosBox Mega- and SVN Daum builds

Quote:
Originally Posted by jefro View Post
You need to see if there is a linux megabuild. http://www.printfil.com/efaq32.htm
Yes there is; the source code "dosbox-mb6.tar.gz".
But it needs to be compiled for (in my case) Ubuntu 12.04.
I am afraid that I am a Linux beginner and do not have the necessary skills to do this, so I need either some effective guidance, or have another - more advanced - Ubuntu user do this.

I also have a "DosBox 0.74 SVN Daum 01-07-2012 build" archive with three compiled files for Linux; I tried replacing my DosBox file with the one in the archive but it does not run. Maybe there is something I am doing wrong here?
 
Old 08-17-2012, 03:27 PM   #6
jefro
Guru
 
Registered: Mar 2008
Posts: 11,323

Rep: Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386
Would it be easier to run a VM like qemu and freedos or such?
 
Old 08-17-2012, 07:19 PM   #7
paul1945
Member
 
Registered: Aug 2012
Posts: 54

Rep: Reputation: Disabled
DosBox versus Dos VM

Quote:
Originally Posted by jefro View Post
Would it be easier to run a VM like qemu and freedos or such?
I have DosEmu installed on my machine, which is essentially a VM with FreeDos. It has more problems than DosBox, including gosh-awful and hard to read text and printing problems; it simply will not print to my network printer. It also seems to interfere with some of the normal background functions of Ubuntu with the result that even though you may set the print output to a printer file, the generated print files will not print while DosEmu is running nor print when you exit DosEmu. Print files generated under DosBox have no such problems, although in the Ubuntu DosBox version the file is initially written to memory and you have to exit both the program that runs in DosBox as well as DosBox itself before the file is written to disk and prints.
DosBox is simply a much better and more flexible package for running Dos programs under Linux than DosEmu; it has many more features and is vastly more configurable to suit the needs of individual programs. That it is only the print side of Linux DosBox that is a problem is proven by the fact that the Windows DosBox SVN Daum I run on another machine under Windows XP SP3 prints flawlessly to any printer I want, whether on the network or directly attached to the machine.
My aim here is to substitute Linux for Windows on my computers; but I cannot do so until I have the ability to fully run my legacy xBase interpreter based software that runs under Dos (Borland dBase 5). In an ideal world I would simply upgrade to a later package, but the actual fact is that this is not available and thus not an option.
 
Old 10-07-2012, 07:50 PM   #8
paul1945
Member
 
Registered: Aug 2012
Posts: 54

Rep: Reputation: Disabled
Cool Have compiled a Dosbox version that prints.

Just an update on this one, I have with some considerable help from the Dosbox Forum community managed to compile a SVN version of Dosbox mb6 that prints nicely on Ubuntu 12.04.
It prints with Geoworks and even prints with dBase 5. It can also be made to print to a network printer.
 
Old 10-19-2012, 06:53 AM   #9
plaircpa
LQ Newbie
 
Registered: Oct 2005
Posts: 5

Rep: Reputation: 0
Can you post some details on how you got it to work, especially the printer section from your .conf file? I am trying to do the same thing in debian.
 
Old 10-24-2012, 01:28 AM   #10
paul1945
Member
 
Registered: Aug 2012
Posts: 54

Rep: Reputation: Disabled
Hello plaircpa, Here it is. But as I cannot find a way to attach the information, this is a pretty lengthy document. Anyhow, I hope it works for you, it did for me.

How to compile and install dosbox megabuild6 with dongle parallel support
(netmos chips pci and pciexpress - PCI 9815 Multi-I/O Controller)
http://www.asix.com.tw/products.php?...4;111&PLine=74
on Ubuntu (tested on 10.04, 11.10 and 12.04 only 32bit version).
Please note that at the moment netmoschip are not supported on ubuntu 64bit[*])
Also ensure to use a Linux text file editor as the Windows eol carriage return + linefeed does not compile.

check your lpt pci is supported in Ubuntu
lspci -v
you should obtain something like this
01:0a.0 Communication controller: NetMos Technology PCI 9815 Multi-I/O Controller (rev 01)
Subsystem: LSI Logic / Symbios Logic Device 0020
Flags: medium devsel, IRQ 18
I/O ports at bc00 [size=8]
I/O ports at b800 [size=8]
I/O ports at b400 [size=8]
I/O ports at b000 [size=8]
I/O ports at ac00 [size=8]
I/O ports at a800 [size=16]
Kernel driver in use: parport_pc
Kernel modules: parport_pc

(https://help.ubuntu.com/community/CompilingSoftware)
to get necessary files to compile, go to the terminal and enter:

sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install automake
sudo apt-get install checkinstall

Also install libsdl1.2dev either through the software center or as follows:
sudo apt-get install libsdl-net1.2-dev libsdl-sound1.2-dev libfreetype6 libfreetype6-dev

download dosbox-mb6 for linux from:
http://source.dosbox.com/mb6/dosbox-mb6.tar.gz
extract files (eg in /home/user/Downloads/dosbox-mb6)

download parport_2nd_attempt.tar.gz (2.58kB) from:
http://vogons.zetafleet.com/viewtopi...=252009#252009
extract the 2 files and substitute the older in
/home/user/Downloads/dosbox-mb6/src/hardware

Edit the following file:
/home/user/Downloads/dosbox-mb6/include/dos_inc.h
after the following lines (around line 30) in the file:
#ifndef dosbox_dos_system_h
#include “dos_system.h”
#endif
#ifndef dossbox_mem_h
#include “mem.h”
#endif
add the line:
#include <stddef.h>

To enable dBase printing, do the following:
In home/user/Downloads/dosbox-mb6/include/parport.h, find these lines:
class CParallel {
public:
#if PARALLEL_DEBUG
FILE * debugfp;
bool dbg_data;
bool dbg_putchar;
bool dbg_cregs;
bool dbg_plainputchar;
bool dbg_plaindr;
void log_par(bool active, char const* format,...);
#endif
and add these lines immediately below them:
// Toggle with reporteof as an option in the conf file for the port in question.
bool bReportIOStatusAsEOF;

Next, in src/hardware/parport/parport.cpp, find the lines that read:
// Initialisation
CParallel::CParallel(CommandLine* cmd, Bitu portnr, Bit8u initirq) {
and replace them with these:
// Initialisation
CParallel::CParallel(CommandLine* cmd, Bitu portnr, Bit8u initirq) {
this->bReportIOStatusAsEOF = cmd->FindExist("reporteof", false);
Then, in the same file, find the lines:
Bit16u device_LPT::GetInformation(void) {
return 0x80A0;
};
and replace them with these:
Bit16u device_LPT::GetInformation(void) {
Bit16u status = 0x80A0;
if (this->pportclass->bReportIOStatusAsEOF)
status |= 0x40;
return status;
};

Next in /home/user/Downloads/dosbox-mb6 do the following:
enable autogen.sh as 'executable' (properties):
chmod +x autogen.sh

You are now ready to compile:
sudo ./autogen.sh
./configure
make

add parallel support by editing the config file:
gedit /home/user/.dosbox/dosbox-SVN.conf
at the [parallel] section:
parallel1=reallpt realport:/dev/parport0
parallel2=reallpt realport:/dev/parport1
or for network printers:
parallel1=file append:/home/paul/dosdrive/dosbox00.PRN
parallel2=file append:/home/paul/dosdrive/dosbox00.PRT
(for dBase 5 printing support add a space and “reporteof” to the end of the line.)
and save it

to run dosbox with LPT support just type on terminal
sudo /home/user/Downloads/dosbox-mb6/src/.dosbox

many THANKS again to h-a-l-9000 and others

enjoy!!!
[*]
to compile MB6 for 64-bit.
commenting out a part in decoder_basic.h:
if (handler->flags & PFLAG_NOCODE) {
/* if (PAGING_ForcePageInit(lin_addr)) {
handler=get_tlb_readhandler(lin_addr);
if (handler->flags & PFLAG_HASCODE) {
cph=(CodePageHandlerDynRec *)handler;
return false;
}
}*/
if (handler->flags & PFLAG_NOCODE) {
LOG_MSG("DYNREC:Can't run code in this page");
cph=0;
return false;
}
}

Last edited by paul1945; 10-24-2012 at 01:34 AM.
 
Old 10-24-2012, 01:49 PM   #11
plaircpa
LQ Newbie
 
Registered: Oct 2005
Posts: 5

Rep: Reputation: 0
Thanks for posting Paul1945,

It's quite a bit to chew on!

I was wondering about the following in your .conf file.

Quote:
or for network printers:
parallel1=file append:/home/paul/dosdrive/dosbox00.PRN
parallel2=file append:/home/paul/dosdrive/dosbox00.PRT
Is the dosbox00.PRN simply a file that gets saved and you manually print later or is it a connection to a printer on your network?

thanks much
 
Old 10-24-2012, 07:16 PM   #12
paul1945
Member
 
Registered: Aug 2012
Posts: 54

Rep: Reputation: Disabled
Hello plaircpa
One method of automating the sending of a print file to a network printer is to use inotify to monitor the directory where the prn and prt files are located (I have used two different suffixes so that these files get sent to different network printers).
First install this package, then a script using inotifywait or inotifywatch can be run to detect when a prn file is created and then print it.
Ensure that you use a Linux editor such as gedit for all your modifications.

Add a line to the /etc/rc.local and it will start at boot up. i.e.
/path/to/prndosfiles_script & (The & puts the script in the background; the # and exit lines already exist); ensure to change the directory “/user” here and further on and all the other directories in the codes to suit your own system:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/home/user/bin/print_prn.sh &
exit 0

Then write and save the following shell script called "print_prn.sh” (you can call it what you like as long as it has a ".sh" suffix but be sure to change the above line to suit).
If you only have one network printer do not include the 4 last lines before "done" from and including "if" to "fi". Also ensure you check your directories and printer names and substitute each one to suit your system; using my code "as is" won't work.
Code:

#!/bin/bash
/usr/bin/inotifywait -e close_write -mrq /home/user/dosdrive | while read line; do
set -- "$line"
IFS=" "; declare -a Array=($*)
FILE="${Array[2]}"
FILENAME=${FILE%.*}
FILEEXT=${FILE##*.}
IFS=""
if [ "$FILEEXT" == "PRN" ];
then
lpr -P HP-LaserJet-m2727-MFP -l -r -o raw /home/user/dosdrive/$FILE
fi
if [ "$FILEEXT" == "PRT" ];
then
lpr -P Deskjet-930c -l -r -o raw /home/user/dosdrive/$FILE
fi
done

Last edited by paul1945; 10-24-2012 at 07:18 PM.
 
Old 10-25-2012, 06:20 AM   #13
plaircpa
LQ Newbie
 
Registered: Oct 2005
Posts: 5

Rep: Reputation: 0
Excellent, works great.

thank you
 
Old 10-25-2012, 08:06 AM   #14
paul1945
Member
 
Registered: Aug 2012
Posts: 54

Rep: Reputation: Disabled
All credit to those who have with great patience shown me how to do this.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How 2 run DOSBOX or TurboC3 in Ubuntu 10.04 LTS Abhishek Rockzzz Ubuntu 1 10-04-2011 04:19 PM
How to permanantly install or mount the turboc from Dosbox in ubuntu amritpalpathak Linux - Software 3 06-04-2010 05:13 PM
Cannot print in Fedora 9 to HP network printer or LPT1 clakelly Linux - Newbie 5 07-07-2008 06:20 PM
Dosbox - trapped focus in dosbox window. hamster Linux - Software 7 11-11-2007 05:56 PM
Linux box won't print across LAN to XP box LPT1 whynotlinux Linux - Networking 1 08-28-2006 10:36 AM


All times are GMT -5. The time now is 09:45 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration