Subject: Re: top?
To: Jorgen Pehrson <jp@spektr.ludvika.se>
From: Johnny Billquist <bqt@Update.UU.SE>
List: port-vax
Date: 12/29/1997 17:33:34
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
--0-384248001-883413214=:1395
Content-Type: TEXT/PLAIN; charset=US-ASCII
> Hi,
> is there a version of top for NetBSD/vax 1.3? I tried to compile
> top3.5beta6, but there was only versions for NetBSD 0.8 and 1.0. And when
> I tried to run it, it failed to run, and said this:
>
> top: cannot read nswap: kvm_read: Bad address
> top: cannot read nswdev: kvm_read: Bad address
> top: cannot read nswapmap: kvm_read: Bad address
> top: malloc: Undefined error: 0
>
> I guess the VM system has been rewritten since 1.0?
> Anyone have a new NetBSD 1.3 module for top?
I wrote one on the fly when the new swap system came along. There might be
an official fix too, but here is mine.
Johnny
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt@update.uu.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
--0-384248001-883413214=:1395
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="machine.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.VUL.3.93.971229173333.1395G@Zeke.Update.UU.SE>
Content-Description:
LyoNCiAqIHRvcCAtIGEgdG9wIHVzZXJzIGRpc3BsYXkgZm9yIFVuaXgNCiAq
DQogKiBTWU5PUFNJUzogIEZvciBhIE5ldEJTRC0xLjMgKDQuNEJTRCkgc3lz
dGVtDQogKgkgICAgICBOb3RlIHByb2Nlc3MgcmVzaWRlbnQgc2l6ZXMgY291
bGQgYmUgd3JvbmcsIGJ1dCBwcyBzaG93cw0KICoJICAgICAgemVybyBmb3Ig
dGhlbSB0b28uLg0KICoNCiAqIERFU0NSSVBUSU9OOg0KICogT3JpZ2luYWxs
eSB3cml0dGVuIGZvciBCU0Q0LjQgc3lzdGVtIGJ5IENocmlzdG9zIFpvdWxh
cy4NCiAqIEJhc2VkIG9uIHRo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