From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: From: Daniel Lyons To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-Reply-To: Content-Type: text/plain; charset=WINDOWS-1252; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v935.3) Date: Sun, 2 Aug 2009 13:14:08 -0600 References: Subject: Re: [9fans] Parallels Vesa driver question Topicbox-Message-UUID: 35b69262-ead5-11e9-9d60-3106f5b1d025 Erik, Thanks for your speedy assistance! I think the two things are closely =20= interrrelated via the global variable hardscreen. Reverting this file =20= solved the problem. I wouldn't be surprised if there were something =20 weird about Parallels' MTRR support, and since this isn't the current =20= version it's not likely to get any better. If anyone's using Parallels =20= 4 and not running into this issue, I'd love to know. Also, are the old sources available online somewhere so I can do this =20= kind of diff in the future on my own? Thanks again, On Aug 2, 2009, at 11:06 AM, erik quanstrom wrote: > On Sun Aug 2 05:39:10 EDT 2009, fusion@storytotell.org wrote: >> Hi, >> >> I installed Plan 9 under Parallels 3 back in November of last year =20= >> and >> it worked without a hitch. I tried to install another copy tonight =20= >> and >> the bitmapped display isn't working in the new one, I just get a pure >> black screen after any aux/vga command that it thinks will succeed. I >> found I can reproduce that behavior by building and running a new >> kernel in the old install. Any ideas what has happened since November >> in the kernel with respect to Vesa and Parallels? I'd be more than >> happy to debug this issue if I could get a little guidance. I didn't >> see anything in the archives about this problem. Alternatively, does >> anyone know if Parallels 4 works with a current kernel? If so I'll >> probably just upgrade to that; I've been holding off for a good =20 >> reason >> to. > > two things: mtrr and adding a vesaflush command. it doesn't quite =20 > make > sense to me that this would break parallels, unless there is something > funky about > - mtrr ranges with parallels. > - parallels vesa > - plan 9 vesa support > > the easiest thing to do would be to comment out vesaflush and > see what happens. without pawing through the standard, it may > be that vesaflush is optionally supported and parallels doesn't =20 > support it. > > - erik > > ; diff -c vgavesa.c /n/sourcesdump/2008/1101/plan9/sys/src/9/pc/=20 > vgavesa.c > vgavesa.c:13,21 - /n/sourcesdump/2008/1101/plan9/sys/src/9/pc/=20 > vgavesa.c:13,18 > #include > #include "screen.h" > > - > - static void *hardscreen; > - > #define WORD(p) ((p)[0] | ((p)[1]<<8)) > #define LONG(p) ((p)[0] | ((p)[1]<<8) | ((p)[2]<<16) | ((p)[3]<<24)) > #define PWORD(p, v) (p)[0] =3D (v); (p)[1] =3D (v)>>8 > vgavesa.c:83,89 - /n/sourcesdump/2008/1101/plan9/sys/src/9/pc/=20 > vgavesa.c:80,86 > } > > static void > - vesalinear(VGAscr *, int, int) > + vesalinear(VGAscr* scr, int, int) > { > int i, mode, size; > uchar *p; > vgavesa.c:130,169 - /n/sourcesdump/2008/1101/plan9/sys/src/9/pc/=20 > vgavesa.c:127,135 > size =3D ROUND(size, 1024*1024); > > havesize: > - if(size > 16*1024*1024) /* probably arbitrary; could = increase */ > - size =3D 16*1024*1024; > - hardscreen =3D vmap(paddr, size); > - mtrr(paddr, size, "wc"); > - // vgalinearaddr(scr, paddr, size); > + vgalinearaddr(scr, paddr, size); > } > > - static void > - vesaflush(VGAscr *scr, Rectangle r) > - { > - int t, w, wid, off; > - ulong *hp, *sp, *esp; > - > - if(rectclip(&r, scr->gscreen->r) =3D=3D 0) > - return; > - > - hp =3D hardscreen; > - sp =3D (ulong*)(scr->gscreendata->bdata + scr->gscreen->zero); > - t =3D (r.max.x * scr->gscreen->depth + 2*BI2WD-1) / BI2WD; > - w =3D (r.min.x * scr->gscreen->depth) / BI2WD; > - w =3D (t - w) * BY2WD; > - wid =3D scr->gscreen->width; > - off =3D r.min.y * wid + (r.min.x * scr->gscreen->depth) / BI2WD; > - > - hp +=3D off; > - sp +=3D off; > - esp =3D sp + Dy(r) * wid; > - while(sp < esp){ > - memmove(hp, sp, w); > - hp +=3D wid; > - sp +=3D wid; > - } > - } > - > VGAdev vgavesadev =3D { > "vesa", > 0, > vgavesa.c:174,178 - /n/sourcesdump/2008/1101/plan9/sys/src/9/pc/=20 > vgavesa.c:140,145 > 0, > 0, > 0, > - vesaflush, > + 0, > }; > =97 Daniel Lyons