Commit 00bd3d3a authored by Mike Hibler's avatar Mike Hibler

First actual working version for SHD

parent 58ae4e74
......@@ -445,8 +445,6 @@ main(int argc, char *argv[])
if (chkpointdev) {
#ifdef WITH_SHD
u_int32_t ssect = 0;
rval = 0;
if (dorelocs) {
fprintf(stderr, "WARNING: no relocation info "
......@@ -463,12 +461,16 @@ main(int argc, char *argv[])
struct doslabel doslabel;
rval = read_doslabel(infd, DOSBBSECTOR, 0, &doslabel);
if (rval == 0)
ssect = doslabel.parts[slice-1].dp_start;
if (rval == 0) {
inputminsec = doslabel.parts[slice-1].dp_start;
inputmaxsec = inputminsec +
doslabel.parts[slice-1].dp_size;
}
}
if (rval == 0) {
rval = read_shd(chkpointdev, infilename, infd, ssect);
rval = read_shd(chkpointdev, infilename, infd,
inputminsec);
if (rval == 0)
sortrange(ranges, 1, 0);
}
......
......@@ -25,7 +25,6 @@
#include "imagehdr.h"
#define ENTRIESPERCALL 1024
#define FAKEIT
#ifdef FAKEIT
#define SHDIOCTL fake_ioctl
......@@ -79,8 +78,8 @@ read_shd(char *shddev, char *infile, int infd, u_int32_t ssect)
for (sr = sm.buf; sm.retsiz > 0; sr++, sm.retsiz--) {
if (debug > 2)
fprintf(stderr, " %12d %9d\n",
sr->start, sr->size);
addvalid(sr->start + ssect, sr->size);
sr->start, (sr->end-sr->start));
addvalid(sr->start + ssect, (sr->end-sr->start));
}
sm.command = 2;
......
......@@ -3,11 +3,11 @@
* here to get everything to compile.
*/
#define SHDGETMODIFIEDRANGES 1 /* the ioctl */
#include <sys/ioctl.h>
struct shd_range {
u_int32_t start;
u_int32_t size;
u_int32_t end;
};
struct shd_modinfo {
......@@ -16,3 +16,5 @@ struct shd_modinfo {
long bufsiz; /* buffer size (in entries) */
long retsiz; /* size of returned data (in entries) */
};
#define SHDGETMODIFIEDRANGES _IOWR('S', 29, struct shd_modinfo)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment