
#include <sys/types.h>
#include <stdio.h>

static int kmem;
int swap, mem;

init_kmem(file)
    char *file;
{
    kmem = open(file, 0);
    if (kmem < 0){
	fprintf(stderr, "cannot open ");
	perror(file);
	exit(1);
    }
#ifdef ibm032
    mem = open("/dev/mem");    
    if (mem < 0){
	fprintf(stderr, "cannot open ");
	perror(file);
	exit(1);
    }
    swap = open("/dev/drum");
    if (swap < 0){
	fprintf(stderr, "cannot open ");
	perror(file);
	exit(1);
    }
#endif
}

/*
 * Seek into the kernel for a value.
 */
off_t
klseek(base)
	off_t base;
{
	return (lseek(kmem, base, 0));
}

klread(buf, buflen)
    char *buf;
    int buflen;
{
    read(kmem, buf, buflen);
}
