From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 27538 invoked from network); 7 Apr 2021 07:53:56 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 7 Apr 2021 07:53:56 -0000 Received: from pb-smtp20.pobox.com ([173.228.157.52]) by 1ess; Wed Apr 7 03:48:56 -0400 2021 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 4EA97121E98 for <9front@9front.org>; Wed, 7 Apr 2021 03:39:08 -0400 (EDT) (envelope-from unobe@cpan.org) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=message-id :from:to:subject:date:mime-version:content-type; s=sasl; bh=h7R9 N9hmQ0Bg9Fxlp9MCZGmXGag=; b=K+0ECDUVaU9NUf4iob+8i0GoHC01ADqBzxX8 g3eiJ8ym4HR4KD/OYlICBaMi7nW/ukgAxjA/oLb5FPC90F2FVXyRseTbPSd/kmnE 6klrYRqKWef33sI5tX1lLy3jaEvejmvrSGzJEzh5NF93HJfLTmVMuODyEfVBPmSe tL9wsXc= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 4761A121E97 for <9front@9front.org>; Wed, 7 Apr 2021 03:39:08 -0400 (EDT) (envelope-from unobe@cpan.org) Received: from samwise (unknown [47.34.135.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 8069A121E96 for <9front@9front.org>; Wed, 7 Apr 2021 03:39:05 -0400 (EDT) (envelope-from unobe@cpan.org) Message-ID: <38C54C2EF6F8D7F5DBCA4AF7E8A2AA63@smtp.pobox.com> From: Romano To: 9front@9front.org Date: Wed, 07 Apr 2021 00:39:03 -0700 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-devdroidofvppzdezqkhjqfblt" X-Pobox-Relay-ID: 5491D6B8-9774-11EB-9849-E43E2BB96649-09620299!pb-smtp20.pobox.com List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: flexible virtual pipelining framework ORM high-performance core locator Subject: [9front] [patch] Improved Apple laptop support and miscellaneous typo fixes Reply-To: 9front@9front.org Precedence: bulk This is a multi-part message in MIME format. --upas-devdroidofvppzdezqkhjqfblt Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit See attached. These changes provide better support for early-2011 Apple Macbook Pro laptops: native resolution by specifying the vid & did in /lib/vgadb, as well as providing an 'appletouch' mouse option, which stops i8042 calls for the internal trackpad. See https://blog.fallglow.com/misc/mbpro/cs8390.kmesg for an example of what is generated when the vgadb entry is lacking and the i8042 calls occur. I hope to implement rudimentary multi-touch for the internal trackpad so that an external 3-button mouse is not required. There is still an error thrown when initializing the keyboard early on ('i8042: kbd init failed'), but I haven't tracked down what is calling the i8042 reset whence the error message is generated. Additionally,, there is an issue with amlmapio. --upas-devdroidofvppzdezqkhjqfblt Content-Disposition: attachment; filename=apple-laptop.patch Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit diff -r 18e1e1c3aaf1 lib/vgadb --- a/lib/vgadb Tue Apr 06 14:43:38 2021 +0200 +++ b/lib/vgadb Wed Apr 07 00:21:47 2021 -0700 @@ -433,6 +433,7 @@ vid=0x8086 did=0x0046 # Intel Ironlake Arrandale vid=0x8086 did=0x0102 # Intel 2nd Gen Core (HD 2000) vid=0x8086 did=0x0126 # Intel 2nd Gen Core (HD 3000) + vid=0x8086 did=0x1c3a # Intel 2nd Gen Core (HD 3000) Apple MBP vid=0x8086 did=0x0166 # Intel 3rd Gen Core vid=0x8086 did=0x2a42 # Intel 4 Series Mobile vid=0x8086 did=0x0a16 # Intel 4th Gen Core (HD 4400) diff -r 18e1e1c3aaf1 rc/bin/screenrc --- a/rc/bin/screenrc Tue Apr 06 14:43:38 2021 +0200 +++ b/rc/bin/screenrc Wed Apr 07 00:21:47 2021 -0700 @@ -42,9 +42,9 @@ bind -a '#m' /dev if(test -f /dev/mousectl && test -f /dev/winname){ - ask mouseport ' is (ps2, ps2intellimouse, 0, 1, 2)' ps2 + ask mouseport ' is (ps2, ps2intellimouse, appletouch, 0, 1, 2)' ps2 switch($mouseport){ - case ps2 ps2intellimouse 0 1 2 + case ps2 ps2intellimouse appletouch 0 1 2 aux/mouse $mouseport if(~ $accupoint 1) pipefile -dr /bin/aux/accupoint /dev/mouse diff -r 18e1e1c3aaf1 sys/man/2/auth --- a/sys/man/2/auth Tue Apr 06 14:43:38 2021 +0200 +++ b/sys/man/2/auth Wed Apr 07 00:21:47 2021 -0700 @@ -269,7 +269,7 @@ .IR getkey , to invoke should .I factotum -not posess a key for the authentication. If +not possess a key for the authentication. If .I getkey is nil, the authentication fails. .I Getkey diff -r 18e1e1c3aaf1 sys/man/3/arch --- a/sys/man/3/arch Tue Apr 06 14:43:38 2021 +0200 +++ b/sys/man/3/arch Wed Apr 07 00:21:47 2021 -0700 @@ -144,7 +144,7 @@ .I acpitbls return a concatenation of system ACPI tables. Each table is prefixed with a fixed size header that gives the name -sigature and size of the table (see section +signature and size of the table (see section .IR "5.2.6 System Description Table Header" in the ACPI specification). .SH EXAMPLE diff -r 18e1e1c3aaf1 sys/man/3/mouse --- a/sys/man/3/mouse Tue Apr 06 14:43:38 2021 +0200 +++ b/sys/man/3/mouse Wed Apr 07 00:21:47 2021 -0700 @@ -100,6 +100,9 @@ followed by a write of .BR intellimouse . .TP +.B appletouch +uses the trackpad on Apple laptops. +.TP .B "accelerated\fI [n]\fP" turns on mouse acceleration. .I N diff -r 18e1e1c3aaf1 sys/man/8/mouse --- a/sys/man/8/mouse Tue Apr 06 14:43:38 2021 +0200 +++ b/sys/man/8/mouse Wed Apr 07 00:21:47 2021 -0700 @@ -17,7 +17,7 @@ .B aux/accupoint .SH DESCRIPTION .B Mouse -queries a mouse on a serial or PS2 port for +queries a mouse on a serial, PS2 port, or USB endpoint for its type and then configures the port and the mouse to be used to control the cursor. .PP @@ -27,9 +27,10 @@ or .BR 1 ) or the string -.B ps2 +.BR ps2 , +.BR ps2intellimouse , or -.BR ps2intellimouse . +.BR appletouch . The initialization can be automated by setting .BR mouseport in diff -r 18e1e1c3aaf1 sys/man/8/plan9.ini --- a/sys/man/8/plan9.ini Tue Apr 06 14:43:38 2021 +0200 +++ b/sys/man/8/plan9.ini Wed Apr 07 00:21:47 2021 -0700 @@ -595,6 +595,9 @@ .B ps2intellimouse an Intellimouse on the PS2 port. .TP +.B appletouch +the built-in apple touch trackpad (multi-touch not yet supported) on Apple laptops. +.TP .B 0 for COM1 .TP diff -r 18e1e1c3aaf1 sys/src/9/pc/mouse.c --- a/sys/src/9/pc/mouse.c Tue Apr 06 14:43:38 2021 +0200 +++ b/sys/src/9/pc/mouse.c Wed Apr 07 00:21:47 2021 -0700 @@ -20,6 +20,7 @@ Mouseother= 0, Mouseserial= 1, MousePS2= 2, + AppleTouch= 3, }; static QLock mousectlqlock; @@ -42,6 +43,7 @@ CMres, CMreset, CMserial, + CMappletouch }; static Cmdtab mousectlmsg[] = @@ -55,6 +57,7 @@ CMres, "res", 0, CMreset, "reset", 1, CMserial, "serial", 0, + CMappletouch, "appletouch", 0, }; /* @@ -155,6 +158,22 @@ } /* + * set up an internal trackpad (non-ps2) for mac. This is not complete + * but better than being spammed by failed i8042 commands, since Apple + * products do not have i8042. + */ +static void +appletouch(void) +{ + if(mousetype == AppleTouch) + return; + + mousetype = AppleTouch; + packetsize = 3; + mousehwaccel = 0; +} + +/* * set up a ps2 mouse */ static void @@ -314,6 +333,10 @@ setintellimouse(); setstream(1); break; + case CMappletouch: + intellimouse = 0; + appletouch(); + break; case CMres: setstream(0); if(cb->nf >= 2) diff -r 18e1e1c3aaf1 sys/src/cmd/aux/mouse.c --- a/sys/src/cmd/aux/mouse.c Tue Apr 06 14:43:38 2021 +0200 +++ b/sys/src/cmd/aux/mouse.c Wed Apr 07 00:21:47 2021 -0700 @@ -321,7 +321,7 @@ exits("open /dev/mousectl"); } - if(strncmp(p, "ps2", 3) == 0){ + if(strncmp(p, "ps2", 3) == 0 || strncmp(p, "appletouch", 10)){ if(write(conf, p, strlen(p)) < 0){ fprint(2, "%s: error setting mouse type - %r\n", argv0); exits("write conf"); --upas-devdroidofvppzdezqkhjqfblt--