Difference between revisions of "DOS"

From flashrom
Jump to: navigation, search
(Created page with "To cross-compile on Linux for DOS: # Get RPMs of the cross compiler from the DJGPP site and install them: *djcross-binutils-2.19.1-10ap.i386.rpm *djcross-gcc-4.3.2-8ap.i686.rpm ...")
 
(Remove Prebuilt-Binary section for now (there are no binaries atm))
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
= Compilation =
 +
 
To cross-compile on Linux for DOS:
 
To cross-compile on Linux for DOS:
  
# Get RPMs of the cross compiler from the DJGPP site and install them:
+
#: Get packages of the DJGPP cross compiler and install them:
*djcross-binutils-2.19.1-10ap.i386.rpm
+
#:* djgpp-filesystemdjgpp-gcc
*djcross-gcc-4.3.2-8ap.i686.rpm
+
#:* djgpp-cpp
*djcrx-2.04pre_20090725-13ap.i386.rpm
+
#:* djgpp-runtime
 
+
#:* djgpp-binutils
# Download pciutils 3.1.5 and apply http://assembler.cz/flashrom/pciutils.patch
+
#: As an alternative, the [http://www.delorie.com/djgpp/getting.html DJGPP web site] offers packages for download as well:
# Download and compile http://assembler.cz/flashrom/libgetopt/
+
#:* djcross-binutils-2.29.1-1ap.x86_64.rpm
# Compile pciutils, see README.DJGPP for instructions.
+
#:* djcross-gcc-7.2.0-1ap.x86_64.rpm
# Enter the flashrom directory.
+
#:* djcrx-2.05-5.x86_64.rpm
# ../libpci should contain pciutils source and binaries.
+
#: The cross toolchain packages for your distribution may have slightly different names (look for packages named '''djgpp''').
# ../libgetopt should contain getopt.a from libgetopt.
+
#: Alternatively, you could use a script to build it from scratch: https://github.com/andrewwutw/build-djgpp
# Run either (change settings where appropriate)
+
# You will need the libpci and libgetopt library source trees and their compiled static libraries and header files installed in some directory say libpci-libgetopt/, which will be later specified with LIBS_BASE parameter during flashrom compilation. Easiest way to handle it is to put pciutils, libgetopt and flashrom directories in one subdirectory. There will be an extra subdirectory libpci-libgetopt created, which will contain compiled libpci and libgetopt.
make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip OS_ARCH=DOS
+
# Download [https://www.kernel.org/pub/software/utils/pciutils/pciutils-3.5.6.tar.gz pciutils 3.5.6] and apply [[File:Pciutils-3.5.6.patch.gz]]
or (above settings hardcoded)
+
# Compile pciutils, using following command line:<br /><code>make ZLIB=no DNS=no HOST=i386-djgpp-djgpp CROSS_COMPILE=i586-pc-msdosdjgpp- \</code><br /><code>    PREFIX=/ DESTDIR=$PWD/../libpci-libgetopt  \</code><br /><code>    STRIP="--strip-program=i586-pc-msdosdjgpp-strip -s" install install-lib</code>
make djgpp-dos
+
# Download and compile with 'make' [[File:Libgetopt.tar.gz]]
You might have to add WARNERROR=no to the make command line.
+
# Copy the libgetopt.a to ../libpci-libgetopt/lib and getopt.h to ../libpci-libgetopt/include
#To run flashrom.exe, download and unpack
+
# Enter the flashrom directory.<br /><code>make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip LIBS_BASE=../libpci-libgetopt/ strip</code>
http://homer.rice.edu/~sandmann/cwsdpmi/csdpmi7b.zip and make sure CWSDPMI.EXE is in the current directory.
+
# If you like, you can compress the resulting executable with UPX:<br /><code>upx -9 flashrom.exe</code>
 +
# To run flashrom.exe, download [[File:Csdpmi7b.zip]] and unpack CWSDPMI.EXE into the current directory or one in PATH.

Latest revision as of 11:57, 12 February 2019

Compilation

To cross-compile on Linux for DOS:

  1. Get packages of the DJGPP cross compiler and install them:
    • djgpp-filesystemdjgpp-gcc
    • djgpp-cpp
    • djgpp-runtime
    • djgpp-binutils
    As an alternative, the DJGPP web site offers packages for download as well:
    • djcross-binutils-2.29.1-1ap.x86_64.rpm
    • djcross-gcc-7.2.0-1ap.x86_64.rpm
    • djcrx-2.05-5.x86_64.rpm
    The cross toolchain packages for your distribution may have slightly different names (look for packages named djgpp).
    Alternatively, you could use a script to build it from scratch: https://github.com/andrewwutw/build-djgpp
  2. You will need the libpci and libgetopt library source trees and their compiled static libraries and header files installed in some directory say libpci-libgetopt/, which will be later specified with LIBS_BASE parameter during flashrom compilation. Easiest way to handle it is to put pciutils, libgetopt and flashrom directories in one subdirectory. There will be an extra subdirectory libpci-libgetopt created, which will contain compiled libpci and libgetopt.
  3. Download pciutils 3.5.6 and apply File:Pciutils-3.5.6.patch.gz
  4. Compile pciutils, using following command line:
    make ZLIB=no DNS=no HOST=i386-djgpp-djgpp CROSS_COMPILE=i586-pc-msdosdjgpp- \
    PREFIX=/ DESTDIR=$PWD/../libpci-libgetopt \
    STRIP="--strip-program=i586-pc-msdosdjgpp-strip -s" install install-lib
  5. Download and compile with 'make' File:Libgetopt.tar.gz
  6. Copy the libgetopt.a to ../libpci-libgetopt/lib and getopt.h to ../libpci-libgetopt/include
  7. Enter the flashrom directory.
    make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip LIBS_BASE=../libpci-libgetopt/ strip
  8. If you like, you can compress the resulting executable with UPX:
    upx -9 flashrom.exe
  9. To run flashrom.exe, download File:Csdpmi7b.zip and unpack CWSDPMI.EXE into the current directory or one in PATH.