summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1997-10-25 06:58:01 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1997-10-25 06:58:01 +0000
commit1c3ac5f3f704f3ff3c13505f9824d787dc82b83a (patch)
tree317909a27c59d31f7e766d5330b2d747b9bd2883 /sys/arch
parent92c617b8c121ca38c1eb42227b62643fae008785 (diff)
Boot arguments are now at physmem 0x100
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/i386/i386/machdep.c34
-rw-r--r--sys/arch/i386/i386/pmap.c12
-rw-r--r--sys/arch/i386/i386/pmap.old.c12
3 files changed, 26 insertions, 32 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index 2557b904345..ed3e5ac2432 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.57 1997/10/24 22:15:06 mickey Exp $ */
+/* $OpenBSD: machdep.c,v 1.58 1997/10/25 06:58:00 niklas Exp $ */
/* $NetBSD: machdep.c,v 1.202 1996/05/18 15:54:59 christos Exp $ */
/*-
@@ -199,7 +199,7 @@ cpu_startup()
caddr_t v;
int sz;
int base, residual;
- vm_offset_t minaddr, maxaddr, va, pa;
+ vm_offset_t minaddr, maxaddr, pa;
vm_size_t size;
struct pcb *pcb;
int x;
@@ -215,23 +215,13 @@ cpu_startup()
pa, VM_PROT_ALL, TRUE);
msgbufmapped = 1;
- /*
- * The boot arguments can be anywhere in the low memory area, but
- * we want it more nicely aligned to not have troubles in the pmap.
- * So we have allocated an area right after msgbuf which we map now.
- * We also temporarily map the old area while copying the arguments.
- */
+ /* Boot arguments are in page 1 */
if (bootargv != NULL) {
- va = (vm_offset_t)bootargp;
- for (i = 0; i < btoc(bootargc); i++, va += NBPG, pa += NBPG)
- pmap_enter(pmap_kernel(), va, pa, VM_PROT_ALL, TRUE);
-
- minaddr = i386_trunc_page(bootargv);
- maxaddr = i386_round_page(bootargv + bootargc) + 1;
- for (i = 0; i < maxaddr - minaddr; i += NBPG)
- pmap_enter(pmap_kernel(), va + i * NBPG,
- minaddr + i, VM_PROT_READ, TRUE);
- bcopy((void*)(va + (bootargv - minaddr)), bootargp, bootargc);
+ pa = NBPG;
+ for (i = 0; i < btoc(bootargc); i++, pa += NBPG)
+ pmap_enter(pmap_kernel(),
+ (vm_offset_t)((caddr_t)bootargp + i * NBPG),
+ pa, VM_PROT_READ, TRUE);
} else
bootargp = NULL;
@@ -1280,8 +1270,12 @@ init386(first_avail)
biosbasemem &= -(NBPG / 1024);
biosextmem &= -(NBPG / 1024);
- avail_start = NBPG; /* BIOS leaves data in low memory */
- /* and VM system doesn't work with phys 0 */
+ /*
+ * BIOS leaves data in low memory and VM system doesn't work with
+ * phys 0, /boot leaves arguments at page 1.
+ */
+ avail_start = NBPG + btoc(bootargc);
+
avail_end = biosextmem ? IOM_END + biosextmem * 1024
: biosbasemem * 1024;
diff --git a/sys/arch/i386/i386/pmap.c b/sys/arch/i386/i386/pmap.c
index 5485a07b22b..890b6dbfdbf 100644
--- a/sys/arch/i386/i386/pmap.c
+++ b/sys/arch/i386/i386/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.21 1997/10/24 22:15:07 mickey Exp $ */
+/* $OpenBSD: pmap.c,v 1.22 1997/10/25 06:57:59 niklas Exp $ */
/* $NetBSD: pmap.c,v 1.36 1996/05/03 19:42:22 christos Exp $ */
/*
@@ -228,9 +228,8 @@ pmap_bootstrap(virtual_start)
pt_entry_t *pte;
#endif
- /* XXX: allow for msgbuf and bootargv */
- avail_end -= i386_round_page(sizeof(struct msgbuf)) +
- 2 * i386_round_page(bootargc);
+ /* XXX: allow for msgbuf */
+ avail_end -= i386_round_page(sizeof(struct msgbuf));
virtual_avail = virtual_start;
virtual_end = VM_MAX_KERNEL_ADDRESS;
@@ -277,8 +276,9 @@ pmap_bootstrap(virtual_start)
SYSMAP(caddr_t ,CMAP1 ,CADDR1 ,1 )
SYSMAP(caddr_t ,CMAP2 ,CADDR2 ,1 )
SYSMAP(caddr_t ,XXX_mmap ,vmmap ,1 )
- SYSMAP(struct msgbuf * ,msgbufmap ,msgbufp ,1 )
- SYSMAP(bootarg_t * ,bootargmap ,bootargp ,2 )
+ SYSMAP(struct msgbuf * ,msgbufmap ,msgbufp ,
+ btoc(sizeof(struct msgbuf)) )
+ SYSMAP(bootarg_t * ,bootargmap ,bootargp ,btoc(bootargc))
virtual_avail = va;
#endif
diff --git a/sys/arch/i386/i386/pmap.old.c b/sys/arch/i386/i386/pmap.old.c
index dade4699176..9ede2c1ca21 100644
--- a/sys/arch/i386/i386/pmap.old.c
+++ b/sys/arch/i386/i386/pmap.old.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.old.c,v 1.21 1997/10/24 22:15:07 mickey Exp $ */
+/* $OpenBSD: pmap.old.c,v 1.22 1997/10/25 06:57:59 niklas Exp $ */
/* $NetBSD: pmap.c,v 1.36 1996/05/03 19:42:22 christos Exp $ */
/*
@@ -228,9 +228,8 @@ pmap_bootstrap(virtual_start)
pt_entry_t *pte;
#endif
- /* XXX: allow for msgbuf and bootargv */
- avail_end -= i386_round_page(sizeof(struct msgbuf)) +
- 2 * i386_round_page(bootargc);
+ /* XXX: allow for msgbuf */
+ avail_end -= i386_round_page(sizeof(struct msgbuf));
virtual_avail = virtual_start;
virtual_end = VM_MAX_KERNEL_ADDRESS;
@@ -277,8 +276,9 @@ pmap_bootstrap(virtual_start)
SYSMAP(caddr_t ,CMAP1 ,CADDR1 ,1 )
SYSMAP(caddr_t ,CMAP2 ,CADDR2 ,1 )
SYSMAP(caddr_t ,XXX_mmap ,vmmap ,1 )
- SYSMAP(struct msgbuf * ,msgbufmap ,msgbufp ,1 )
- SYSMAP(bootarg_t * ,bootargmap ,bootargp ,2 )
+ SYSMAP(struct msgbuf * ,msgbufmap ,msgbufp ,
+ btoc(sizeof(struct msgbuf)) )
+ SYSMAP(bootarg_t * ,bootargmap ,bootargp ,btoc(bootargc))
virtual_avail = va;
#endif