I am using the following DJGPP package
You can get this C compiler at http://www.delorie.com/djgpp.
In include/signal.h
, add
#ifndef SIGCONT #define SIGCONT 18 /* CG */ #endifIn
include/mntent.h
, add
#ifndef MOUNTED #define MOUNTED "/etc/mtab" /* CG */ #endif #ifndef MNTOPT_RO #define MNTOPT_RO "ro" /* CG */ #endifIn
include/errno.h
, add
#ifndef EOPNOTSUPP #define EOPNOTSUPP 95 /* CGR */ #endif #ifndef ENOTSUPP #define ENOTSUPP 524 /* Operation is not supported CGR */ #endif #ifndef ENOTSUP #define ENOTSUP 524 /* CGR */ #endif #ifndef ECANCELED #define ECANCELED 125 /* CGR */ #endif #ifndef EILSEQ #define EILSEQ 84 /* CGR */ #endifIn
include/fcntl.h
, add
#define O_LARGEFILE 0100000 /* CG */Add the file
include/stdint.h
typedef unsigned char uint8_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; typedef unsigned long long int uint64_t; typedef char int8_t; typedef short int int16_t; typedef int int32_t; typedef long long int int64_t;Add in
include/sys/types.h
:
__DJ_loff_t // CG #undef __DJ_loff_t // CG #define __DJ_loff_t // CGAdd in
include/sys/djtypes.h
:
#define __DJ_loff_t typedef long long int loff_t; // CG
Get e2fsprogs-1.29.tgz at http://e2fsprogs.sourceforge.net or on TestDisk web page.
cd testdisk tar xvf e2fsprogs-1.29.tgz
If e2fsprogs-1.29.tgz, in lib/e2p/iod.c
,
comment len = dep->d_reclen;
We don't use this library, we only need the compilation doesn't block on this file.
Under Dos or Win9x, run
bash ./configure --with-cc=gcc && make libs
Get progsreiserfs-0.3.1-rc8.tar.gz at http://reiserfs.osdn.org.ua/
tar xzf progsreiserfs-*.tar.gz
bash ./configure --disable-nls && make
Get ntfsprogs-1.8.0.tar.gz from http://linux-ntfs.sf.net/
tar xzf ntfsprogs-1.8.0.tar.gz cd ntfsprogs-1.8.0
You can patch the patch with patch < ../src/ntfsprogs.patch
or manually.
Edit include/endians.h
#ifdef HAVE_ENDIAN_H #include <endian.h> #endif #ifdef HAVE_BYTE_SWAP_H #include <byteswap.h> #endif
Edit include/volume.h
#ifdef HAVE_SYS_MOUNT_H # include <sys/mount.h> #endif #ifdef HAVE_MNTENT_H # include <mntent.h> #endif /* Cygwin doesn't seem to have MS_RDONLY, so we define it here. */ #if !defined(MS_RDONLY) typedef enum { MS_RDONLY = 1, } MS_MOUNT; #endif
bash export CC=gcc ./configure && make
Source code is included in the TestDisk download (along with a DOS executable and DPMI server program) from
the CGSecurity Website's TestDisk Home page:
http://www.cgsecurity.org/testdisk.html.
To compile TestDisk, run cd src; make dos
.
If you need a small binary for binary distribution, run
strip testdisk.exe djp -s testdisk.exe
TestDisk is a true 32-bit program (compiled under DJGPP), so a DPMI server program (cwsdpmi.exe) is included in the download which allows TestDisk to run under 16-bit DOS. If you want to work under real (16-bit) DOS, you'll need to have a DPMI server running; to do that, get: csdpmi*b.zip and simply place the executable (cwsdpmi.exe) in your bin directory (which must be in the PATH).
TestDisk home: http://www.cgsecurity.org/testdisk.html.
Christophe GRENIER grenier@cgsecurity.org