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

Re: i386_set_ioperm() problems


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 28 Feb 2006 09:40:50 -0800 (PST)

: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

    I think the iomap support is broken in the kernel.   After adding a
    line to open("/dev/io", O_RDWR), the program ran the first time but
    then crashed my test system in the heavy weight task switching code
    the second time.

					-Matt
					Matthew Dillon 
					<dillon@xxxxxxxxxxxxx>



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