on i386, use VM_MAXUSER_ADDRESS for kernel_start, since the real

kernel start is much different that the start of KVM.  (VM_MAXUSER_ADDRESS
isn't correct, but seems to mostly work...)  (XXX -- there should be a
better way.)

if curproc == null, use address of proc0; code doesn't know how to deal
with null curproc.  (XXX: (1) should make it deal, or (2) should use address
of last proc run, but there's no real way to do that.)
This commit is contained in:
cgd 1995-07-08 01:55:54 +00:00
parent fd0f559215
commit 9b7ebcf785
1 changed files with 10 additions and 2 deletions

View File

@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id: kcorelow.c,v 1.3 1995/01/12 10:17:52 pk Exp $ $Id: kcorelow.c,v 1.4 1995/07/08 01:55:54 cgd Exp $
*/ */
#ifdef KERNEL_DEBUG #ifdef KERNEL_DEBUG
@ -89,6 +89,10 @@ curProc()
if (kvread(addr, &p)) if (kvread(addr, &p))
error("cannot read proc pointer at %x\n", addr); error("cannot read proc pointer at %x\n", addr);
if (p == NULL)
p = (struct proc *)ksym_lookup("proc0");
return p; return p;
} }
@ -154,7 +158,11 @@ kcore_open (filename, from_tty)
if (exec_bfd == NULL) if (exec_bfd == NULL)
error("No kernel image specified"); error("No kernel image specified");
kernel_start = bfd_get_start_address (exec_bfd); /* XXX */ #ifndef __i386__ /* XXX */
kernel_start = bfd_get_start_address (exec_bfd);
#else /* XXX */
kernel_start = VM_MAXUSER_ADDRESS; /* XXX */
#endif /* XXX */
target_preopen (from_tty); target_preopen (from_tty);
if (!filename) { if (!filename) {