summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2015-03-12 15:08:23 +0000
committerjhb <jhb@FreeBSD.org>2015-03-12 15:08:23 +0000
commitfa9df7fb76eb762793140e602461c32bb66ddabd (patch)
tree5e510af7dfa0d2de7d6e5755d78a174c41cfacd6 /sys/amd64
parent24b691f7111d3c0dcbe192f203a94b883de680de (diff)
downloadFreeBSD-src-fa9df7fb76eb762793140e602461c32bb66ddabd.zip
FreeBSD-src-fa9df7fb76eb762793140e602461c32bb66ddabd.tar.gz
MFC 277713:
If the boot-time memory test is enabled, output a dot ('.') for each GB of RAM tested so people watching the console can see that the machine is making progress and not hung. PR: 196650
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/machdep.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index b2d30ff..fc97187 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1521,6 +1521,8 @@ static char bootmethod[16] = "";
SYSCTL_STRING(_machdep, OID_AUTO, bootmethod, CTLFLAG_RD, bootmethod, 0,
"System firmware boot method");
+#define PAGES_PER_GB (1024 * 1024 * 1024 / PAGE_SIZE)
+
/*
* Populate the (physmap) array with base/bound pairs describing the
* available physical memory in the system, then test this memory and
@@ -1541,6 +1543,7 @@ getmemsize(caddr_t kmdp, u_int64_t first)
struct bios_smap *smapbase;
struct efi_map_header *efihdr;
quad_t dcons_addr, dcons_size;
+ int page_counter;
bzero(physmap, sizeof(physmap));
basemem = 0;
@@ -1651,6 +1654,9 @@ getmemsize(caddr_t kmdp, u_int64_t first)
* physmap is in bytes, so when converting to page boundaries,
* round up the start address and round down the end address.
*/
+ page_counter = 0;
+ if (memtest != 0)
+ printf("Testing system memory");
for (i = 0; i <= physmap_idx; i += 2) {
vm_paddr_t end;
@@ -1681,6 +1687,14 @@ getmemsize(caddr_t kmdp, u_int64_t first)
goto skip_memtest;
/*
+ * Print a "." every GB to show we're making
+ * progress.
+ */
+ page_counter++;
+ if ((page_counter % PAGES_PER_GB) == 0)
+ printf(".");
+
+ /*
* map page into kernel: valid, read/write,non-cacheable
*/
*pte = pa | PG_V | PG_RW | PG_NC_PWT | PG_NC_PCD;
@@ -1767,6 +1781,8 @@ do_next:
}
*pte = 0;
invltlb();
+ if (memtest != 0)
+ printf("\n");
/*
* XXX
OpenPOWER on IntegriCloud