The patches did the trick for me...

        -mi

=On Tue, Mar 28, 2000 at 09:53:20AM -0500, Mikhail Teterin wrote:
=> Ruslan Ermilov once stated:
=>
=> =Do you use loader(8), or directly boot your kernel from boot blocks?
=>
=> Directly... Is that what it is?!?
=>
=Yes, starting from the following files/revisions:
=
=peter       1999/12/26 23:14:59 PST
=
=  Modified files:
=    lib/libkvm           kvm.c kvm_alpha.c kvm_file.c
=                         kvm_getloadavg.c kvm_getswapinfo.c
=                         kvm_i386.c kvm_nlist.3 kvm_private.h
=                         kvm_proc.c kvm_sparc.c
=  Log:
=  Use kldsym(2) to lookup symbol values.  This avoids the kvm_mkdb juggling
=  and is module aware.  Yes, this means that kvm_nlist(3) will find symbols
=  in loaded modules.  The emulation of the nlist struct is pretty crude but
=  seems to work well enough for all the users in the tree that I found.
=
=  Revision  Changes    Path
=  1.12      +22 -113   src/lib/libkvm/kvm.c
=  1.4       +1 -2      src/lib/libkvm/kvm_alpha.c
=  1.9       +5 -0      src/lib/libkvm/kvm_file.c
=  1.3       +5 -1      src/lib/libkvm/kvm_getloadavg.c
=  1.10      +1 -2      src/lib/libkvm/kvm_getswapinfo.c
=  1.11      +5 -1      src/lib/libkvm/kvm_i386.c
=  1.5       +7 -9      src/lib/libkvm/kvm_nlist.3
=  1.5       +1 -1      src/lib/libkvm/kvm_private.h
=  1.25      +7 -2      src/lib/libkvm/kvm_proc.c
=  1.3       +5 -1      src/lib/libkvm/kvm_sparc.c
=
=
=Could you please try the following two patches (kindly provided by
=Bruce Evans), and tell us whether they help you.
=
=There is a kern/17422 on this issue, please follow-up to it.
=
=
=
=Cheers,
=--
=Ruslan Ermilov         Sysadmin and DBA of the
[EMAIL PROTECTED]       United Commercial Bank,
[EMAIL PROTECTED]         FreeBSD committer,
=+380.652.247.647       Simferopol, Ukraine
=
=http://www.FreeBSD.org The Power To Serve
=http://www.oracle.com  Enabling The Information Age

-- Start of included mail From:  Bruce Evans <[EMAIL PROTECTED]>

=Date:  Tue, 14 Mar 2000 13:51:49 +1100 (EST)
=X-Sender:  [EMAIL PROTECTED]
=To:  Ruslan Ermilov <[EMAIL PROTECTED]>
=cc:  Jordan Hubbard <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
=Subject:  Re: [4.0-ERRATA candidate?] loader(8)/kvm(3) interoperability issue

=On Mon, 13 Mar 2000, Ruslan Ermilov wrote:
=
=> One thing that should IMHO be pointed out in the upcoming 4.0-RELEASE's
=> ERRATA (or some more appropriate place), is the fact that the loader(8)
=> is now a prerequisite for certain programs using kvm(3) interface.
=> Obvious examples are top(1) and swapinfo(8).
=> 
=> If you boot your kernel without loader(8), directly through bootblocks,
=> these programs will not work.
=
=I don't user loader(8), and finally got around to fixing this.  The
=problem is that the kernel linker wants module data for the kernel.
=It defaults to using incomplete data if none is present.  The following
=supplies slightly less incomplete data:
=
=diff -c2 machdep.c~ machdep.c
=*** machdep.c~ Tue Feb 29 19:18:29 2000
=--- machdep.c  Mon Mar  6 10:05:52 2000
=***************
=*** 1809,1812 ****
=--- 1799,1816 ----
=               preload_metadata = (caddr_t)bootinfo.bi_modulep + KERNBASE;
=               preload_bootstrap_relocate(KERNBASE);
=+      } else {
=+              static u_int32_t oldmoduledata[] = {
=+                      1, sizeof("kernel"), 0, 0,
=+                      2, sizeof("elf kernel"), 0, 0, 0,
=+                      0x8004, 4, 0,
=+                      0x8003, 4, 0,
=+                      0, 0,
=+              };
=+ 
=+              preload_metadata = (caddr_t)&oldmoduledata[0];
=+              strcpy((char *)&oldmoduledata[2], "kernel");
=+              strcpy((char *)&oldmoduledata[6], "elf kernel");
=+              oldmoduledata[11] = roundup2(bootinfo.bi_esymtab, 4);
=+              oldmoduledata[14] = bootinfo.bi_symtab;
=       }
=       if (bootinfo.bi_envp)
=
=Bruce
=
-- End of included mail.

-- Start of included mail From:  Bruce Evans <[EMAIL PROTECTED]>

=Date:  Thu, 23 Mar 2000 01:33:15 +1100 (EST)
=X-Sender:  [EMAIL PROTECTED]
=To:  Ruslan Ermilov <[EMAIL PROTECTED]>
=Subject:  Re: [4.0-ERRATA candidate?] loader(8)/kvm(3) interoperability issue

=> Hmm, the kernel with this patch panics with fatal trap 12 earlier,
=> right after it reports the amount of available memory, if I boot
=> without loader(8), but works perfectly, if I do use loader(8).
=
=The symbol addresses in struct bootinfo were garbage when the symbol
=table was loaded but DDB was not configured.
=
=diff -c2 locore.s~ locore.s
=*** locore.s~  Mon Dec  6 11:12:51 1999
=--- locore.s   Thu Mar 23 01:11:57 2000
=***************
=*** 45,51 ****
=  
=  #include "opt_bootp.h"
=- #include "opt_ddb.h"
=  #include "opt_nfsroot.h"
=- #include "opt_userconfig.h"
=  
=  #include <sys/syscall.h>
=--- 45,49 ----
=***************
=*** 751,756 ****
=       movl    $R(_end),%esi
=  
=! /* include symbols if loaded and useful */
=! #ifdef DDB
=       movl    R(_bootinfo+BI_ESYMTAB),%edi
=       testl   %edi,%edi
=--- 749,753 ----
=       movl    $R(_end),%esi
=  
=! /* Include symbols, if any. */
=       movl    R(_bootinfo+BI_ESYMTAB),%edi
=       testl   %edi,%edi
=***************
=*** 761,765 ****
=       addl    %edi,R(_bootinfo+BI_ESYMTAB)
=  over_symalloc:
=- #endif
=  
=  /* If we are told where the end of the kernel space is, believe it. */
=--- 758,761 ----
=
=Bruce
=
-- End of included mail.



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-stable" in the body of the message

Reply via email to