From owner-svn-src-head@freebsd.org Sun Aug 28 15:23:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93207BA6D1C; Sun, 28 Aug 2016 15:23:45 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 492A8B00; Sun, 28 Aug 2016 15:23:45 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7SFNiti033370; Sun, 28 Aug 2016 15:23:44 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7SFNiMD033369; Sun, 28 Aug 2016 15:23:44 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608281523.u7SFNiMD033369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 28 Aug 2016 15:23:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304958 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2016 15:23:45 -0000 Author: bde Date: Sun Aug 28 15:23:44 2016 New Revision: 304958 URL: https://svnweb.freebsd.org/changeset/base/304958 Log: Fix vm86 initialization, part 1 of 2 and a half. Early use of vm86 depends on the PIC being reset to mask interrupts, but r286667 moved PIC initialization to after where vm86 may be first used. Move the PIC initialization up to immdiately before vm86 initialization. All invocations of diff that I tried display this move poorly so that it looks like PIC and vm86 initialization was moved later. r286667 was to move console initialization later. The diffs are again unreadable -- they show a large move that doesn't seem to involve the console. The PIC initialization stayed just below the console initialization where it could still be debugged but no longer works. Later console initialization breaks mainly debugging vm86 initialization and memory sizing using ddb and printf(). There are several printf()s in the memory sizing that now go nowhere since message buffer initialization has always been too late. Memory sizing is done by loader for most users, but the lost messages for this case are even more interesting than for an auto-probe since they tell you what the loader found. Modified: head/sys/i386/i386/machdep.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sun Aug 28 14:03:25 2016 (r304957) +++ head/sys/i386/i386/machdep.c Sun Aug 28 15:23:44 2016 (r304958) @@ -2646,20 +2646,7 @@ init386(first) PCPU_SET(common_tss.tss_ioopt, (sizeof (struct i386tss)) << 16); ltr(gsel_tss); - vm86_initialize(); - getmemsize(first); - init_param2(physmem); - - /* now running on new page tables, configured,and u/iom is accessible */ - - /* - * Initialize the console before we print anything out. - */ - cninit(); - - if (metadata_missing) - printf("WARNING: loader(8) metadata is missing!\n"); - + /* Initialize the PIC early for vm86 calls. */ #ifdef DEV_ISA #ifdef DEV_ATPIC #ifndef PC98 @@ -2681,6 +2668,20 @@ init386(first) #endif #endif + vm86_initialize(); + getmemsize(first); + init_param2(physmem); + + /* now running on new page tables, configured,and u/iom is accessible */ + + /* + * Initialize the console before we print anything out. + */ + cninit(); + + if (metadata_missing) + printf("WARNING: loader(8) metadata is missing!\n"); + #ifdef DDB db_fetch_ksymtab(bootinfo.bi_symtab, bootinfo.bi_esymtab); #endif