Subject: Re: X won't run on current kernel
To: Ken Nakata <kenn@remus.rutgers.edu>
From: Allen Briggs <briggs@puma.bevd.blacksburg.va.us>
List: macbsd-development
Date: 07/05/1995 20:27:13
> I've tried dt (1.0 with my small patches) on the kernel, and it failed
> with a message "GRFIOCMAP: Invalid argument" (though I'm not 100%
> positive that the last word was "argument").  Something goes wrong
> inside grfmap() in grf.c...

Not exactly...  Here's the patch to get it to work.  It'll be up for
the next supdate.  ;-)

Sorry for the inconvenience.

Pax,
-allen

Index: grf.c
===================================================================
RCS file: /a/cvsroot/src/sys/arch/mac68k/dev/grf.c,v
retrieving revision 1.25
diff -c -r1.25 grf.c
*** grf.c	1995/07/02 05:26:27	1.25
--- grf.c	1995/07/06 00:24:05
***************
*** 346,352 ****
  	register struct grfmode *gm = &gp->curr_mode;
  	u_long	addr;
  
! 	if (off < gm->fbsize) {
  		addr = NUBUS_VIRT_TO_PHYS((u_int) gm->fbbase) + off;
  		return mac68k_btop(addr);
  	}
--- 346,352 ----
  	register struct grfmode *gm = &gp->curr_mode;
  	u_long	addr;
  
! 	if (off < mac68k_round_page(gm->fbsize + gm->fboff) ) {
  		addr = NUBUS_VIRT_TO_PHYS((u_int) gm->fbbase) + off;
  		return mac68k_btop(addr);
  	}
***************
*** 371,380 ****
  	if (grfdebug & GDB_MMAP)
  		printf("grfmap(%d): addr %x\n", p->p_pid, *addrp);
  #endif
! 	len = gp->curr_mode.fbsize + gp->curr_mode.fboff;
  	flags = MAP_SHARED | MAP_FIXED;
  
! 	*addrp = NUBUS_VIRT_TO_PHYS((u_int) gp->curr_mode.fbbase);
  
  	vn.v_type = VCHR;	/* XXX */
  	vn.v_specinfo = &si;	/* XXX */
--- 371,381 ----
  	if (grfdebug & GDB_MMAP)
  		printf("grfmap(%d): addr %x\n", p->p_pid, *addrp);
  #endif
! 	len = mac68k_round_page(gp->curr_mode.fbsize + gp->curr_mode.fboff);
  	flags = MAP_SHARED | MAP_FIXED;
  
! 	*addrp = mac68k_trunc_page(
! 			NUBUS_VIRT_TO_PHYS((u_int) gp->curr_mode.fbbase));
  
  	vn.v_type = VCHR;	/* XXX */
  	vn.v_specinfo = &si;	/* XXX */