Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/amd64/amd64/locore.S,v rcsdiff: /ftp/cvs/cvsroot/src/sys/arch/amd64/amd64/locore.S,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.91 retrieving revision 1.92 diff -u -p -r1.91 -r1.92 --- src/sys/arch/amd64/amd64/locore.S 2016/05/15 07:01:36 1.91 +++ src/sys/arch/amd64/amd64/locore.S 2016/05/15 07:17:53 1.92 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.91 2016/05/15 07:01:36 maxv Exp $ */ +/* $NetBSD: locore.S,v 1.92 2016/05/15 07:17:53 maxv Exp $ */ /* * Copyright-o-rama! @@ -654,22 +654,21 @@ no_NOX: orl $(PG_V|PG_KW),%eax fillkpt_nox - /* - * We actually have to be careful here. The memory layout is as - * follows: - * +----------+---------------------+------------------+ - * | DATA+BSS < [PRELOADED MODULES] | BOOTSTRAP TABLES > - * +----------+---------------------+------------------+ - * We just map everything from < to > with RWX rights. - */ + /* Map [SYMS]+[PRELOADED MODULES] RWX. */ movl $RELOC(__kernel_end),%eax movl %esi,%ecx /* start of BOOTSTRAP TABLES */ - addl $TABLESIZE,%ecx /* end of BOOTSTRAP TABLES */ - subl %eax,%ecx /* subtract end of kernel image */ + subl %eax,%ecx shrl $PGSHIFT,%ecx orl $(PG_V|PG_KW),%eax fillkpt + /* Map the BOOTSTRAP TABLES RW. */ + movl %esi,%eax /* start of BOOTSTRAP TABLES */ + movl $TABLESIZE,%ecx /* length of BOOTSTRAP TABLES */ + shrl $PGSHIFT,%ecx + orl $(PG_V|PG_KW),%eax + fillkpt_nox + /* We are on (4). Map ISA I/O mem (later atdevbase) RWX. */ movl $(IOM_BEGIN|PG_V|PG_KW/*|PG_N*/),%eax movl $(IOM_SIZE>>PGSHIFT),%ecx