From: Richard M Kreuter <kreuter@pr...> - 2005-05-07 00:55:25
Here's a pointless, little doodad. Does about the same as on Linux.
--- x86-vm.lisp.orig 2004-04-13 06:30:38.000000000 -0400
+++ x86-vm.lisp 2005-05-06 20:52:19.000000000 -0400
@@ -58,7 +58,25 @@
;; in the MACHINE-VERSION page of the ANSI spec.
when (eql (search "model name" line) 0)
return (string-trim " " (subseq line (1+ (position #\: line))))))
+ ;; NetBSD hosts with /kern mounted have a file that contains dmesg
+ ;; output.
+ (with-open-file (stream "/kern/msgbuf"
+ ;; Nothing really depends on kernfs being mounted, or
+ ;; being mounted in a well-known place, so degrade
+ ;; gracefully.
+ :if-does-not-exist nil)
+ (loop with line while (setf line (read-line stream nil))
+ ;; On both NetBSD/x86 hosts I have access to, the first
+ ;; line starting with "cpu0:" has some descriptive CPU
+ ;; information:
+ ;; AMD Athlon Model 4 (Thunderbird) (686-class), 1333.51 MHz, id 0x644
+ ;; Intel Pentium II (686-class), 300.71 MHz, id 0x652
+ when (eql (search "cpu0:" line) 0)
+ return (string-trim " " (subseq line
+ (1+ (position #\: line))
+ (position #\, line :from-end t)))))
+ #!-(or linux netbsd)
;;;; :CODE-OBJECT fixups