diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s index 2579ba76e57..9818bb54e4a 100644 --- a/sys/i386/i386/locore.s +++ b/sys/i386/i386/locore.s @@ -786,8 +786,14 @@ no_kernend: movl %esi, R(SMPpt) /* relocated to KVM space */ #endif /* SMP */ -/* Map read-only from zero to the beginning of the kernel text section */ +/* Map page zero read-write so bios32 calls can use it */ xorl %eax, %eax + movl $PG_RW,%edx + movl $PAGE_SIZE,%ecx + fillkptphys(%edx) + +/* Map read-only from page 1 to the beginning of the kernel text section */ + movl $PAGE_MASK, %eax xorl %edx,%edx movl $R(btext),%ecx addl $PAGE_MASK,%ecx diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index f253c971f11..a0ff4a24624 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -1504,13 +1504,6 @@ getmemsize(int first) char *cp; struct bios_smap *smap; - /* - * Change the mapping of the page at address zero from r/o to r/w - * so that vm86 can scribble on this page. Note that this page is - * not in the general free page pool. - */ - pmap_kenter(KERNBASE, 0); - hasbrokenint12 = 0; TUNABLE_INT_FETCH("hw.hasbrokenint12", &hasbrokenint12); bzero(&vmf, sizeof(vmf));