mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-17 16:10:46 +01:00
f2b46629be
This is not quite finished yet, and therefore I have not added it to the usr.sbin/Makefile yet. I collected a bunch of Andrews small programs into one: pccardc /phk Reviewed by: phk Submitted by: Andrew McRae <andrew@mega.com.au>
38 lines
585 B
C
38 lines
585 B
C
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <pccard/card.h>
|
|
#include <pccard/cis.h>
|
|
|
|
|
|
main(argc, argv)
|
|
int argc;
|
|
char *argv[];
|
|
{
|
|
struct drv_desc drv;
|
|
int fd, err;
|
|
|
|
fd = open("/dev/card0", 0);
|
|
if (fd < 0)
|
|
{
|
|
perror("/dev/card0");
|
|
exit(1);
|
|
}
|
|
strcpy(drv.name, "skel");
|
|
if (argc == 2)
|
|
drv.unit = atoi(argv[1]);
|
|
else
|
|
drv.unit = 0;
|
|
drv.iobase = 0x300;
|
|
drv.mem = 0xD4000;
|
|
drv.memsize = 16*1024;
|
|
drv.irq = 0xFFFF;
|
|
drv.flags = 0x1234;
|
|
if (ioctl(fd, PIOCSDRV, &drv))
|
|
perror("set driver");
|
|
close(fd);
|
|
}
|