Re: Suggestion for prekern: warning messages

Robert Swindells <[email protected]>
Newsgroups gmane.os.netbsd.ports.x86-64
Message-ID <[email protected]>
Martin Husemann <[email protected]> wrote:
>But I have a (maybe off topic) question (that I did ask Maxime back then
>but he evaded answering): why do we have a three phase bootstrap for this
>at all? What is it that prekern can do that /boot couldn't? IMHO prekern
>should go away and all its functionality moved to the regular bootloader
>(or where that does not work the kernel).

Going even further off topic, I have been using the following diff for
a while to avoid needing entropy when booting a non ASLR kernel.


Index: pmap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/x86/pmap.c,v
retrieving revision 1.409
diff -u -r1.409 pmap.c
--- pmap.c      6 Feb 2021 21:24:19 -0000       1.409
+++ pmap.c      15 Apr 2021 12:55:02 -0000
@@ -1646,8 +1646,13 @@
                panic("pmap_init_directmap: lastpa incorrect");
        }
 
+#ifdef NO_X86_ASLR
+       randhole = 0;
+       randva = 0;
+#else
        entropy_extract(&randhole, sizeof randhole, 0);
        entropy_extract(&randva, sizeof randva, 0);
+#endif
        startva = slotspace_rand(SLAREA_DMAP, lastpa, NBPD_L2,
            randhole, randva);
        endva = startva + lastpa;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.