From owner-freebsd-current Tue Mar 24 08:27:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA16600 for freebsd-current-outgoing; Tue, 24 Mar 1998 08:27:33 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from gneiss.eps.nagoya-u.ac.jp (gneiss.eps.nagoya-u.ac.jp [133.6.124.148]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA16581 for ; Tue, 24 Mar 1998 08:27:13 -0800 (PST) (envelope-from kato@migmatite.eps.nagoya-u.ac.jp) Received: from localhost (localhost [127.0.0.1]) by gneiss.eps.nagoya-u.ac.jp (8.8.8/3.6Wbeta7) with ESMTP id BAA21450 for ; Wed, 25 Mar 1998 01:27:09 +0900 (JST) To: current@FreeBSD.ORG Subject: Re: VM86 does not work on pre-Pentium CPU From: KATO Takenori In-Reply-To: Your message of "Tue, 24 Mar 1998 15:25:00 +0900" <19980324152500H.kato@gneiss.eps.nagoya-u.ac.jp> References: <19980324152500H.kato@gneiss.eps.nagoya-u.ac.jp> X-Mailer: Mew version 1.92.4 on Emacs 19.28 / Mule 2.3 (SUETSUMUHANA) X-PGP-Fingerprint: 03 72 85 36 62 46 23 03 52 B1 10 22 44 10 0D 9E Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <19980325012708O.kato@gneiss.eps.nagoya-u.ac.jp> Date: Wed, 25 Mar 1998 01:27:08 +0900 X-Dispatcher: imput version 971024 Lines: 42 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG KATO Takenori wrote: > Because vm86_initialize() always accesses CR4, it generates fault on > pre-Pentium CPU machine. Before accessing CR4, bit 1 of cpu_feature should be tested as following patch: ---------- BEGIN ---------- *** vm86.c.ORIG Wed Mar 25 01:22:57 1998 --- vm86.c Wed Mar 25 01:23:05 1998 *************** *** 418,424 **** ext->ext_iomap = (caddr_t)(offset + ((u_int)&ext->ext_tss & PG_FRAME)); ext->ext_vm86.vm86_intmap = ext->ext_iomap - 32; ! ext->ext_vm86.vm86_has_vme = (rcr4() & CR4_VME ? 1 : 0); addr = (u_long *)ext->ext_vm86.vm86_intmap; for (i = 0; i < (ctob(IOPAGES) + 32 + 16) / sizeof(u_long); i++) --- 418,427 ---- ext->ext_iomap = (caddr_t)(offset + ((u_int)&ext->ext_tss & PG_FRAME)); ext->ext_vm86.vm86_intmap = ext->ext_iomap - 32; ! if (cpu_feature & CPUID_VME) ! ext->ext_vm86.vm86_has_vme = (rcr4() & CR4_VME ? 1 : 0); ! else ! ext->ext_vm86.vm86_has_vme = 0; addr = (u_long *)ext->ext_vm86.vm86_intmap; for (i = 0; i < (ctob(IOPAGES) + 32 + 16) / sizeof(u_long); i++) ---------- END ---------- If a CPU has the virtual mode extensions, the CPU has the CR4 register. ---- KATO Takenori Dept. Earth Planet. Sci., Nagoya Univ., Nagoya, 464-01, Japan PGP public key: finger kato@eclogite.eps.nagoya-u.ac.jp ------------------- Powered by FreeBSD(98) ------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message