Date: Sun, 28 Aug 2016 15:23:44 +0000 (UTC) From: Bruce Evans <bde@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304958 - head/sys/i386/i386 Message-ID: <201608281523.u7SFNiMD033369@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608281523.u7SFNiMD033369>