Now you can proceed with DJGPP install. -- I suggest you use the Zip File Picker, as I already mentioned in the previous post.
The Zip File Picker suggests you make the zip extracting from inside DOSEMU. But in my experience extracting from linux works ok and it's more comfortable. Do read the readme. But the first part of the installation can be as simple as this (you could pick a different target directory name, as long as it's not dev or dev/something):
get all the needed ZIP files in a directory
$ cd ~/.dosemu/drive_c $ mkdir djgpp $ for i in /path/to/*.zip; do unzip $i -d djgpp; done
Next step is setting the DJGPP environment variable and adding c:\djgpp\bin into the PATH. The easiest way to do this with dosemu is by editing autoexec.bat. A word of warning -- if the file is a symlink and you can't edit the file the symlink points to (as is the case with default Ubuntu install), you have to change the symlink into a (editable) copy first, e.g.:
$ cd ~/.dosemu/drive_c $ cp autoexec.bat autoexec.bat.copy; mv autoexec.bat.copy autoexec.bat
As the file uses DOS line end characters (CR LF), if might look odd in some linux text editors (like mcedit). The easiest way is to edit the file from within dosemu -- fire up DOSEMU, then type:
The default dosemu autoexec.bat file sets up some environment variables and then plays some DOSEMU-specific tricks. So before the unix and lredir tricks insert these two lines:
set DJGPP=C:\DJGPP\DJGPP.ENV set PATH=C:\DJGPP\BIN;%PATH%
The last step is adapting config.sys (use edit config.sys). Zip File Picker suggests config.sys is to contain these three lines:
files=40 fcbs=40,0 shell=c:\dos\command.com c:\dos /e:2048 /p
On my ubuntu install, the "files=40" line is already present. So just "fcbs=40,0" needs to be added. The file also contains:
shellhigh=z:\command.com /e:1024 /p
It worked ok for me if I left it at "shellhigh" and just enlarged the environment size from 1024 to DJGPP-suggested 2048:
shellhigh=z:\command.com /e:2048 /p
Restart DOSEMU (exitemu in dosemu, then fire up DOSEMU again). If everything worked ok you should be able to build and run C (and optionally other languages, if you installed those too) programs in DOSEMU:
C:\test>gcc test1.c -o test1.exe C:\test>test1 Hello World!
Note: On one of my boxes (running Ubuntu 9.10, DOSEMU 1.4.0+svn.1828-2ubuntu2) I was unable to get g++ versions 4.4.1 and 4.4.2 working. -- But 4.4.2 is working fine for me on Gentoo with dosemu-1.4.1_pre20091009. Here is the bug report.
It seems to be possible to work around the issue for the time being: Set $_cpu_emu = "vm86sim" in /etc/dosemu/dosemu.conf and use GCC version 4.3.2.