aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/conf.h
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2002-03-31 22:37:00 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2002-03-31 22:37:00 +0000
commit81661c94b6a5a0b3b13048741a7e219300df81a9 (patch)
tree0962f06e2a2c422d89af486eb66e8e726fea13b7 /sys/sys/conf.h
parent67cd130e592c3937634403d105c7c72ed20bd7f9 (diff)
downloadsrc-81661c94b6a5a0b3b13048741a7e219300df81a9.tar.gz
src-81661c94b6a5a0b3b13048741a7e219300df81a9.zip
Here follows the new kernel dumping infrastructure.
Caveats: The new savecore program is not complete in the sense that it emulates enough of the old savecores features to do the job, but implements none of the options yet. I would appreciate if a userland hacker could help me out getting savecore to do what we want it to do from a users point of view, compression, email-notification, space reservation etc etc. (send me email if you are interested). Currently, savecore will scan all devices marked as "swap" or "dump" in /etc/fstab _or_ any devices specified on the command-line. All architectures but i386 lack an implementation of dumpsys(), but looking at the i386 version it should be trivial for anybody familiar with the platform(s) to provide this function. Documentation is quite sparse at this time, more to come. Details: ATA and SCSI drivers should work as the dump formatting code has been removed. The IDA, TWE and AAC have not yet been converted. Dumpon now opens the device and uses ioctl(DIOCGKERNELDUMP) to set the device as dumpdev. To implement the "off" argument, /dev/null is used as the device. Savecore will fail if handed any options since they are not (yet) implemented. All devices marked "dump" or "swap" in /etc/fstab will be scanned and dumps found will be saved to diskfiles named from the MD5 hash of the header record. The header record is dumped in readable format in the .info file. The kernel is not saved. Only complete dumps will be saved. All maintainer rights for this code are disclaimed: feel free to improve and extend. Sponsored by: DARPA, NAI Labs
Notes
Notes: svn path=/head/; revision=93496
Diffstat (limited to 'sys/sys/conf.h')
-rw-r--r--sys/sys/conf.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index c4a2a86b4df8..fc3b586e4bcb 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -139,7 +139,7 @@ typedef int d_close_t(dev_t dev, int fflag, int devtype, struct thread *td);
typedef void d_strategy_t(struct bio *bp);
typedef int d_ioctl_t(dev_t dev, u_long cmd, caddr_t data,
int fflag, struct thread *td);
-typedef int d_dump_t(dev_t dev);
+typedef int d_dump_t(dev_t dev,void *virtual, vm_offset_t physical, off_t offset, size_t length);
typedef int d_psize_t(dev_t dev);
typedef int d_read_t(dev_t dev, struct uio *uio, int ioflag);
@@ -354,6 +354,25 @@ typedef void (*dev_clone_fn)(void *arg, char *name, int namelen, dev_t *result);
int dev_stdclone(char *name, char **namep, const char *stem, int *unit);
EVENTHANDLER_DECLARE(dev_clone, dev_clone_fn);
+/* Stuff relating to kernel-dump */
+
+typedef int dumper_t(
+ void *priv, /* Private to the driver. */
+ void *virtual, /* Virtual (mapped) address. */
+ vm_offset_t physical, /* Physical address of virtual. */
+ off_t offset, /* Byte-offset to write at. */
+ size_t length); /* Number of bytes to dump. */
+
+struct dumperinfo {
+ dumper_t *dumper; /* Dumping function. */
+ void *priv; /* Private parts. */
+ u_int blocksize; /* Size of block in bytes. */
+ off_t mediaoffset; /* Initial offset in bytes. */
+ off_t mediasize; /* Space available in bytes. */
+};
+
+int set_dumper(struct dumperinfo *);
+void dumpsys(struct dumperinfo *);
extern int dumping; /* system is dumping */
#endif /* _KERNEL */