diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2000-10-16 19:29:10 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2000-10-16 19:29:10 +0000 |
commit | 720a79541fde2753de166b3d47758f77395f3b32 (patch) | |
tree | 0fb08fc01c5a5743402d500ac007de40ce9b2c0d /sys/arch | |
parent | 4e8c9f15264624bec0ace30304437b7409755958 (diff) |
base the segment for a service returned by bios32 service
directory on absolute 0, w/ a length extending to a full
megabyte, 32bit descriptor of course.
this approach seems to be the most compatible.
10x to millert@ for a testbed.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/i386/i386/bios.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c index 1d47e8847c0..28b0471641f 100644 --- a/sys/arch/i386/i386/bios.c +++ b/sys/arch/i386/i386/bios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bios.c,v 1.34 2000/09/25 16:33:05 mickey Exp $ */ +/* $OpenBSD: bios.c,v 1.35 2000/10/16 19:29:09 mickey Exp $ */ /* * Copyright (c) 1997-2000 Michael Shalayeff @@ -43,6 +43,7 @@ #include <sys/reboot.h> #include <vm/vm.h> +#include <vm/vm_kern.h> #include <sys/sysctl.h> #include <dev/cons.h> @@ -311,6 +312,8 @@ bios32_service(service, e, ei) extern union descriptor *dynamic_gdt; extern int gdt_get_slot __P((void)); + u_long pa, endpa; + vm_offset_t va; u_int32_t base, count, off, ent; int slot; @@ -330,12 +333,28 @@ bios32_service(service, e, ei) if (ent <= BIOS32_START || ent >= BIOS32_END) return 0; + + endpa = i386_round_page(BIOS32_END); + +#if defined(UVM) + va = uvm_km_valloc(kernel_map, endpa); +#else + va = kmem_alloc_pageable(kernel_map, endpa); +#endif + if (va == 0) + return (0); + slot = gdt_get_slot(); - setsegment(&dynamic_gdt[slot].sd, ISA_HOLE_VADDR(base), - ((base + 0x10000) & ~0xffff) - 1, SDT_MEMERA, SEL_KPL, 1, 0); + setsegment(&dynamic_gdt[slot].sd, (caddr_t)va, BIOS32_END, + SDT_MEMERA, SEL_KPL, 1, 0); + + for (; pa < endpa; pa += NBPG, va += NBPG) + pmap_enter(pmap_kernel(), va, pa, + VM_PROT_READ | VM_PROT_WRITE, TRUE, + VM_PROT_READ | VM_PROT_WRITE); e->segment = GSEL(slot, SEL_KPL); - e->offset = (vaddr_t)(ent - base); + e->offset = (vaddr_t)ent; ei->bei_base = base; ei->bei_size = count; |