Subject: problem with X11 on 486 laptop
To: NetBSD/i386 Discussion List <port-i386@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: port-i386
Date: 04/14/2001 02:30:57
I'm getting the following error when I try to start X11 on this 486
laptop I've been playing with:

	xf86MapVidMem: Could not mmap /dev/vga (Invalid Argument)

After finally finding the source of this rather misleading error message
in the code I can only assume that the first free /dev/ttyE* console was
successfully opened (and indeed the screen has been switched and
cleared).

/usr/xsrc/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_video.c:

	/* else, mmap /dev/vga */
#ifndef PC98
	if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
#else
	if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xE8000)
#endif
	{
		FatalError("%s: Address 0x%x outside allowable range\n",
			   "xf86MapVidMem", Base);
	base = (pointer)mmap(0, Size, PROT_READ|PROT_WRITE, MAP_FLAGS,
			     xf86Info.screenFd,
#ifdef __mips__
			     (unsigned long)Base);
#else
			     (unsigned long)Base - 0xA0000);
#endif
	if (base == (pointer)-1)
	{
	    FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n",
		       strerror(errno));


Unfortunately the value of "Size" isn't in the error output, but if we
assume for a moment that it's not less than zero then it wouldn't appear
that there's any useful explanation in the mmap() manual for the EINVAL.

Any idea what I might have broken now?  (kernel is 2001/03/24, X is from
2000/12/10 -- do I have to update my xsrc too?)

Right at the moment the laptop and I are on the far end of a 28.8kbps
link (I'm up at a friend's cottage for the weekend), but I'll verify the
"Size" theory next week (and maybe take a crack at updrading xsrc too,
though I've got more pressing things to do first...).


(BTW, after trying a couple more different types of Megahertz PCMCIA
cards in this laptop, includig a combo card, with no better success than
I've already reported, I finally tried my friend's "Synergy 21 S21810+
NE2000 Compatible Card Ethernet", and it shows up as ne2 and works just
fine all on its own.)


-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>     <woods@robohack.ca>
Planix, Inc. <woods@planix.com>;   Secrets of the Weird <woods@weird.com>