🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

6 total messages Started by Xah Tue, 17 Nov 1998 00:00
finding the OS type and machine
#18
Author: Xah
Date: Tue, 17 Nov 1998 00:00
18 lines
1136 bytes
Is there a general method of finding out which unix variant is running and the hardware?

In bash, I can do
 $env
and I'll get
 MACHTYPE=i386-pc-freebsd2.2.6
 OSTYPE=freebsd2.2.6

among others, but this is obviously not a general solution. If there's no general method, I'd be interested to know how to find out in other shells, esp. ksh, csh, and tcsh.

Also, how to find out other hardware specs, such as size of physical ram?

Thanks.

 Xah, xah@best.com
 http://www.best.com/~xah/PageTwo_dir/more.html
 Mountain View, CA, USA
 "Petty penguins make way: GNU HURD is coming! <www.gnu.org>"
Re: finding the OS type and machine
#19
Author: Jeff Gostin
Date: Wed, 18 Nov 1998 00:00
18 lines
1375 bytes
Xah <xah@best.com> wrote:
: Is there a general method of finding out which unix variant is running and
: the hardware?
'uname -a' will tell you what you want to know, if you can decipher it. The
output changes radically depending on the type of machine and OS you're
using (as well as the age of the OS), but here's what it shows for shell2:

shell2:~% uname -a
FreeBSD shell2.ba.best.com 2.2.7-STABLE FreeBSD 2.2.7-STABLE #91: Fri Nov 13
02:00:55 PST 1998     dima@tick.best.net:/src/src/sys/compile/BEST  i386

This tells you. amongst other things, that we're running FreeBSD
2.2.7-STABLE on shell2.ba.best.com, which is an i386-family-based machine.

: Also, how to find out other hardware specs, such as size of physical ram?
Depends on the OS. Sometimes, You Just Can't (or at least Not Easily).

				--J
Re: finding the OS type and machine
#21
Author: Kim DeVaughn
Date: Wed, 18 Nov 1998 00:00
18 lines
1233 bytes
In article <3652729f$0$12762@nntp1.ba.best.com>, Xah <xah@best.com> wrote:
|
| Also, how to find out other hardware specs, such as size of physical ram?

On the shell (and commerce ?) machines here at Best, take a look at the

 /var/run/dmesg.boot

file.  It's a snap of the first few system generated messages from the most
recent reboot, which include messages on the h/w configuration.

Other flavors of UNIX may or may not provide h/w information.  Those that
do, most likely do so in a completely different, non-portable way.

/kim

=======================================================
"Sometimes even a blind pig finds an acorn."  --Unknown
Re: finding the OS type and machine
#24
Author: Dima Ruban
Date: Wed, 18 Nov 1998 00:00
16 lines
1045 bytes
Kim DeVaughn <kimdv@best.com> wrote:
> In article <3652729f$0$12762@nntp1.ba.best.com>, Xah <xah@best.com> wrote:
> |
> | Also, how to find out other hardware specs, such as size of physical ram?
> 
> On the shell (and commerce ?) machines here at Best, take a look at the
> 
>  /var/run/dmesg.boot

I'd rather suggest ``sysctl'' stuff. At least you can find it on _most_
of the 4.4bsd-based un*xes.

> /kim


-- dima
Re: finding the OS type and machine
#26
Author: Kim DeVaughn
Date: Wed, 18 Nov 1998 00:00
31 lines
1780 bytes
In article <36529682$0$12756@nntp1.ba.best.com>,
	Dima Ruban <dima@best.net> wrote:
|
| Kim DeVaughn <kimdv@best.com> wrote:
| >
| > On the shell (and commerce ?) machines here at Best, take a look at the
| >
| >  /var/run/dmesg.boot
|
| I'd rather suggest ``sysctl'' stuff. At least you can find it on _most_
| of the 4.4bsd-based un*xes.

Yeah, that's a good suggestion, though I don't think you can get all the
info on peripherals from sysctl, that you can by reading the dmesg.boot
record.

Such info can be useful (or at least interesting) when trying to figure
out what something like iostat is *really* telling you.


Then there are all the various CPU features, etc. that dmesg.boot tells you
about.  Probably of little real value to know, but interesting nonetheless,
to a h/w geek.

Anyway, it's good to know about both sources of information, I think.

/kim

==========================================================================
"Downloaded it, tried to use it, didn't know what the hell to do with it."
                                      --Tara W.
Re: finding the OS type and machine
#28
Author: Philip Brown
Date: Wed, 18 Nov 1998 00:00
23 lines
1501 bytes
On 18 Nov 1998 07:26:49 GMT, jgostin@shell2.ba.best.com wrote:
>Xah <xah@best.com> wrote:
>: Is there a general method of finding out which unix variant is running and
>: the hardware?

>'uname -a' will tell you what you want to know, if you can decipher it. The
>output changes radically depending on the type of machine and OS you're
>using


If you want to do something from a C program,you can use the
[POSIX?] function sysconf() to find some parameters about the OS

Unfortunately, what you REALLY want in this case, is sysinfo() .. which
freebsd doesn't seem to implement.

sysinfo is apparently defined by "UNIX International" (previously known as
  X/Open?)

-- 
[trim the no-bots from my address to reply to me by email!]
 --------------------------------------------------
"initiating.. 'getting the hell out of here' maneouver" - Lennier, babylon5
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads