Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 May 2017 11:48:50 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 211204] loading sysutils/memtest86+ reboots the system
Message-ID:  <bug-211204-13-8hiusZQYYK@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-211204-13@https.bugs.freebsd.org/bugzilla/>
References:  <bug-211204-13@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211204

--- Comment #2 from Andriy Gapon <avg@FreeBSD.org> ---
Created attachment 182690
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D182690&action=
=3Dedit
attempt to fix loading via freebsd boot chain

I finally found some time to look into this and made a few interesting
discoveries.

Most importantly, the current version of memtest86+, unlike all previous
versions, does not relocate itself to the low memory at the very start.  Th=
at,
of course, causes a problem when it switches to the real mode needed for ma=
king
BIOS calls.  That's why it crashed in mem_size -> query_pcbios.
I've added a patch to add that early relocation (patch-main.c).
I've changed the initial load address to a higher value as well
(patch-memtest.lds).  That way there should be a smaller chance of interfer=
ing
with the loader.

Also, it seems that the stack size was too small, at least on my system, and
some global variables got corrupted after the BIOS calls.  I've added a pat=
ch
for that too (patch-test.h).

Additionally I've fixed the SMP detection code for systems with older ACPI
versions (patch-smp.c).

Finally, I have fixed a couple of problems in the code, so that it can be
compiled with newer GCC versions (4.9.x, 5.x) (patch-test.c, patch-lib.c,
patch-io.h).  Unfortunately, resulting binaries do not work correctly, so t=
he
compiler is still 4.8.  I suspect that the newer compilers do progressively
more
aggressive optimizations and that results in the bad code because of some q=
uite
sloppy inline assembly (incorrect constraints and clobber lists) in test.c.

Could you please test it and see if it works?
Thank you!

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-211204-13-8hiusZQYYK>