MGR installation

Rob Robertson rob at violet.berkeley.edu
Sat Jan 28 11:12:29 AEST 1989


In article <3647 at uoregon.uoregon.edu> markv at drizzle.UUCP (Mark VandeWettering) writes:
>	
>	MGR also coredumps on me, with a similar system (SUN 3/60 with
>	SUNOS4).  The coredump appears in mem_rop, in the blitlib
>	library.  I managed to build the version that uses pixrect, but
>	it too has problems (doesn't notice font changes)
>

The fix is that SUN changed the mmap() call between 3.X and 4.0.
Besides the new semantics, it now gives you exactly what you ask of
it.  Under 3.X when one specified PROT_WRITE (ie I wanna write on
these pages), the kernel also gave you read access.  Under 4.0 it
don't, and any attempt to read core dumps.  

A coworker found the problem (thanks Bob!).  The patch below fixes the
problem, along with several others.  They should at least get the
system up under 4.0.

All in all I think that MGR (or MunGeR as it has been affectionately
dubbed) is pretty nifty.  Nice, small, and easy to work in.  Next best
thing to a Blit.

Maybe it'll make SunOS 4.0 bearable on a 3/50.

rob
				william robertson
				rob at violet.berkeley.edu

diff -c kbd.c.orig kbd.c
*** kbd.c.orig  Tue Jan 24 12:12:35 1989
--- kbd.c       Fri Jan 27 16:52:21 1989
***************
*** 20,26 ****
  # include <sys/types.h>
  # include <sundev/kbio.h>
  # ifndef TIOCCONS                                     /* definiton moved in rel. 4.0 */
! #   include "<sys/termios.h>"
  # endif
  #endif KBD
  #endif
--- 20,26 ----
  # include <sys/types.h>
  # include <sundev/kbio.h>
  # ifndef TIOCCONS                                     /* definiton moved in rel. 4.0 */
! #   include <sys/termios.h>
  # endif
  #endif KBD
  #endif

diff -c blit/bitmap.c.orig blit/bitmap.c
*** blit/bitmap.c.orig  Thu Jan 26 22:18:10 1989
--- blit/bitmap.c       Thu Jan 26 22:22:48 1989
***************
*** 66,76 ****

  #ifdef _MAP_NEW               /* New semantics for mmap in Sun release 4.0 */
     addr = (DATA) mmap(addr, _s_len=buff.fb_size,
!                                                PROT_WRITE, _MAP_NEW|MAP_SHARED, fd, 0);
     if ((int)addr == -1)
        return (BIT_NULL);
  #else
!    if (mmap(addr, _s_len = buff.fb_size, PROT_WRITE, MAP_SHARED, fd, 0) < 0)
        return (BIT_NULL);
  #endif

--- 66,76 ----

  #ifdef _MAP_NEW               /* New semantics for mmap in Sun release 4.0 */
     addr = (DATA) mmap(addr, _s_len=buff.fb_size,
!                                                PROT_WRITE|PROT_READ, _MAP_NEW|MAP_SHARED,
fd, 0);
     if ((int)addr == -1)
        return (BIT_NULL);
  #else
!    if (mmap(addr, _s_len = buff.fb_size, PROT_WRITE|PROT_READ, MAP_SHARED, fd, 0) < 0)
        return (BIT_NULL);
  #endif

diff -c blit/sym.c.orig blit/sym.c
*** blit/sym.c.orig     Fri Jan 27 16:53:38 1989
--- blit/sym.c  Fri Jan 27 16:54:02 1989
***************
*** 158,163 ****
  is_reg(name)
  char *name;
     {
!    return( (name[0]=='d' || name[1] == 'a') &&
             (name[1] >= '0' && name[1] <= '7'));
     }
--- 158,163 ----
  is_reg(name)
  char *name;
     {
!    return( (name[0]=='d' || name[0] == 'a') &&
             (name[1] >= '0' && name[1] <= '7'));
     }
				william robertson
				rob at violet.berkeley.edu



More information about the Comp.sources.bugs mailing list