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.
This commit is contained in:
Bruce Evans 2016-08-28 15:23:44 +00:00
parent 441ead70cd
commit be1ed810b1

View File

@ -2646,20 +2646,7 @@ init386(first)
PCPU_SET(common_tss.tss_ioopt, (sizeof (struct i386tss)) << 16); PCPU_SET(common_tss.tss_ioopt, (sizeof (struct i386tss)) << 16);
ltr(gsel_tss); ltr(gsel_tss);
vm86_initialize(); /* Initialize the PIC early for vm86 calls. */
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 DEV_ISA #ifdef DEV_ISA
#ifdef DEV_ATPIC #ifdef DEV_ATPIC
#ifndef PC98 #ifndef PC98
@ -2681,6 +2668,20 @@ init386(first)
#endif #endif
#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 #ifdef DDB
db_fetch_ksymtab(bootinfo.bi_symtab, bootinfo.bi_esymtab); db_fetch_ksymtab(bootinfo.bi_symtab, bootinfo.bi_esymtab);
#endif #endif