This is the mail archive of the cygwin-xfree@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: FW: XFree86 Port (Message from XFree86/OS2 developer)



Just guessing at this; but, is the /dev/iopl supported in the device emulation
by cygwin?  If not, you'll have to add it to the device emulation routines in
the code in the winsup directory for cygwin.

Earnie.
--- "Suhaib M. Siddiqi" <ssiddiqi@inspirepharm.com> wrote:
> 
> > > > To explain what they do:
> > > > pmap allows to map arbitrary physical memory into the X
> > server's address
> > > > space. I don't know cygwin enough to know whether there is a working
> > > > mmap/munmap Unix call available, if so, it must be capable of
> > accessing
> >
> > Both of these call are supported by the cygwin library.
> >
> 
> Hi Ernie,
> 
> Thanks.  Actually below is my code, which i named cygwin_mmap.c in
> xfree86/os-support/cygwin. The Server returns
> an IOPL I/O error.  Obviously I am doing something wrong; that how do we
> handle
> the issue of /dev/iopl, which is hard-coded at several places in XFree86
> source code.
> Any advice, please?
> Thanks
> Suhaib
> --------------------
> #include "X.h"
> #include "misc.h"
> 
> #define DevicePtr int
> #include "xf86_OSlib.h"
> 
> #define BIOS_SIZE 0x20000
> #define KERN_SUCCESS 0
> 
> int xf86ReadBIOS(Base, Offset, Buf, Len)
> unsigned long Base;
> unsigned long Offset;
> unsigned char *Buf;
> int Len;
> {
> 	int fd;
> 	int screen_addr;
> 	int ret;
> 
> 	if ((fd = open("/dev/iopl", O_RDWR, 0)) < 0)
> 	{
> 		ErrorF("xf86ReadBIOS: Failed to open /dev/iopl\n");
> 		return(-1);
> 	}
> 	if (KERN_SUCCESS != vm_allocate(task_self(), &screen_addr,
> 					BIOS_SIZE, TRUE))
> 	{
> 		ErrorF("xf86ReadBIOS: Failed vmallocate %x\n", BIOS_SIZE);
> 		close(fd);
> 		return(-1);
> 	}
> 	if (mmap(screen_addr, BIOS_SIZE, 3, 1, fd, Base) < 0)
> 	{
> 		ErrorF("xf86ReadBIOS: Failed to mmap %x at %x\n",
> 		       BIOS_SIZE, Base);
> 		vm_deallocate(task_self(), screen_addr, BIOS_SIZE);
> 		close(fd);
> 		return(-1);
> 	}
> 	memcpy(Buf, (unsigned char *)(screen_addr + Offset), Len);
> 	if (KERN_SUCCESS != vm_deallocate(task_self(), screen_addr, BIOS_SIZE))
> 	{
> 		ErrorF("xf86ReadBIOS: Failed vmdeallocate %x\n", BIOS_SIZE);
> 		close(fd);
> 		return(-1);
> 	}
> 	close(fd);
> 	return(Len);
> }
> 
> 

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]