DOS: Difference between revisions
Jump to navigation
Jump to search
(add CWSDPMI.EXE) |
No edit summary |
||
Line 21: | Line 21: | ||
To cross-compile on Linux for DOS: | To cross-compile on Linux for DOS: | ||
# Get | #: Get packages of the DJGPP cross compiler and install them: | ||
#*djcross-binutils | #:* djgpp-filesystemdjgpp-gcc | ||
#*djcross-gcc | #:* djgpp-cpp | ||
#*djcrx | #:* djgpp-runtime | ||
# Download [https://www.kernel.org/pub/software/utils/pciutils/pciutils-3. | #:* djgpp-binutils | ||
# Download and compile [[File:Libgetopt.tar.gz]] | #: As an alternative, the [http://www.delorie.com/djgpp/getting.html 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 | ||
# 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/, hich 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. | |||
#: | # 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]] | ||
# 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> | |||
# To run flashrom.exe, download | # Download and compile with 'make' [[File:Libgetopt.tar.gz]] | ||
# Copy the libgetopt.a to ../libpci-libgetopt/lib and getopt.h to ../libpci-libgetopt/include | |||
# Enter the flashrom directory.<br /><code>make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip LIBS_BASE=../libpci-libgetopt/ strip</code> | |||
# 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. |
Revision as of 18:53, 30 December 2017
HOWTO: Using precompiled binaries
Howto use flashrom with FreeDOS instead of Linux (because of half broken bios or any other reasons):
- Get a USB memory drive with at least 1GB of memory available (or any other memory device you can boot from)
- Download FreeDOS Image form http://downloads.joelinoff.com/fdos11.tar.bz2 (more information here: http://joelinoff.com/blog/?p=431 )
- Extract the image
- Use dd to put the image on your prefered memory device (example: dd if=/extracted/image/fdos11.img of=/dev/sdX bs=4M)
- After it have been written to the usb device, remove it once and put it back again into your computer
- Download latest precompiled flashrom from here: http://buildbot.flashrom.org/buildresults/latest-build/dos/flashrom.exe
- Copy latest precompiled flashrom dos exe to the main directory of the usb device
- Download CWSDPMI.EXE from http://www.flashrom.org/File:Csdpmi7b.zip and extract it
- copy bin/CWSDPMI.EXE to your usb device
- Download your bios file you would like to flash and copy it to the main directory of the usb device
- Unmount the USB drive and you can now boot from it and use flashrom as described here:
Compilation
To cross-compile on Linux for DOS:
- 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
- Get packages of the DJGPP cross compiler and install them:
- 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/, hich 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.
- Download pciutils 3.5.6 and apply File:Pciutils-3.5.6.patch.gz
- 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
- Download and compile with 'make' File:Libgetopt.tar.gz
- Copy the libgetopt.a to ../libpci-libgetopt/lib and getopt.h to ../libpci-libgetopt/include
- Enter the flashrom directory.
make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip LIBS_BASE=../libpci-libgetopt/ strip
- If you like, you can compress the resulting executable with UPX:
upx -9 flashrom.exe
- To run flashrom.exe, download File:Csdpmi7b.zip and unpack CWSDPMI.EXE into the current directory or one in PATH.