DragonFly BSD
DragonFly kernel List (threaded) for 2006-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

i386_set_ioperm() problems


From: Sascha Wildner <saw@xxxxxxxxx>
Date: Tue, 28 Feb 2006 01:26:00 +0100

Hi,

I'm trying to write a little test utility to mess with VGA registers. Example:

-------------------------
#include <stdio.h>
#include <stdlib.h>

#include <machine/cpufunc.h>
#include <machine/sysarch.h>

#define SEQIDX	0x03c4
#define SEQREG	0x03c5

int
main(int argc, char *argv[])
{
	int i;

	i386_set_ioperm(SEQIDX, 1, 1);
	i386_set_ioperm(SEQREG, 1, 1);

	for (i = 0; i <= 4; i++) {
		outb(SEQIDX, i);
		printf("%d\n", inb(SEQREG));
	}

	i386_set_ioperm(SEQIDX, 1, 0);
	i386_set_ioperm(SEQREG, 1, 0);

	exit(EXIT_SUCCESS);
}
-------------------------

Problem is that the code dumps core in machine/cpufunc.h. On one of my machines, it will actually print the values every 5 or 6 times I run it. In all other cases I get the core dump (on my laptop it dumps core always and never prints anything).

Sascha



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]