Wednesday, 12 May 2021

UNIX System Information - Apple MacOS X

Apple MacOS X

While most users are familiar with the desktop environment, the underlying operating system for Apple MacOS X (Wikipedia) is the Darwin UNIX variant (Wikipedia). As such there is a wealth of information that can be obtained about the system from the command prompt.

OS Version

On MaxOS X the version information obtained using uname is difficult to interpret since it describes Darwin, the underlying operating system layer, rather than MacOS X:

$ uname -a
Darwin pyrus.local 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-17.12.7.obj~1/RELEASE_PPC  Power Macintosh powerpc

That is a "Darwin" kernel, release "7.9.0", version "Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-17.12.7.obj~1/RELEASE_PPC", on machine "Power Macintosh" of architecture "powerpc" on a system named "pyrus.local"

For version details of MacOS X use sw_vers instead:

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.3.9
BuildVersion:   7W98

Machine Type & Architecture

Since it is often useful to be able to determine the machine type and system architecture when developing scripts two simple command line tools are provided for scripting:

$ machine
ppc750

Which indicates this machine is of the PowerPC 750 (aka. G3) family

$ arch
ppc

Which lets us know this is the PowerPC architecture.

Processor Information

There doesn't seem to be a nice way to do this on older MacOS X versions, but 'sysctl' does give some hints:

$ sysctl -a | grep '^hw'
hw.ncpu: 1
hw.byteorder: 4321
hw.memsize: 671088640
hw.activecpu: 1
hw.cputype: 18
hw.cpusubtype: 9
hw.pagesize: 4096
hw.busfrequency: 99840000
hw.busfrequency_min: 99840000
hw.busfrequency_max: 99840000
hw.cpufrequency: 600000000
hw.cpufrequency_min: 600000000
hw.cpufrequency_max: 600000000
hw.cachelinesize: 32
hw.l1icachesize: 32768
hw.l1dcachesize: 32768
hw.l2cachesize: 262144
hw.tbfrequency: 24959365
hw.optional.floatingpoint: 1
hw.optional.graphicsops: 1
hw.optional.stfiwx: 1

The 'cputype' and 'cpusubtype' numbers are defined in Mach kernel header file machine.h. Apparently "hw.cputype: 18" means PowerPC and "hw.cpusubtype: 9" means G3 (aka. PowerPC 750).

For newer versions of MacOS there is an additional 'machdep' class available in 'sysctl' that contains more specific details (see Get CPU Info via Command Line in Mac OS X and Get Extended CPU Information from the Command Line).

System Overview

The GUI application "System Profiler" (in "Applications", "Utilities") provides information about the operating system version, hardware platform, installed applications and libraries, system logs, etc. There is also a command-line interface to this information (system_profiler).

For example for a iBook G3:

$ system_profiler --detailLevel -1
Hardware:

    Hardware Overview:
    
      Machine Model: iBook
      CPU Type: PowerPC 750  (33.11)
      Number Of CPUs: 1
      CPU Speed: 600 MHz
      L2 Cache (per CPU): 256 KB
      Memory: 640 MB
      Bus Speed: 100 MHz
      Boot ROM Version: 4.2.7f1
      Serial Number: UV1432KFLPY
      Sales Order Number: M8598B/A
    
    




Software:

    System Software Overview:
    
      System Version: Mac OS X 10.3.9 (7W98)
      Kernel Version: Darwin 7.9.0
      Boot Volume: System
      Computer Name: pyrus
      User Name: joe
    
    




Network:

    Internal Modem:
    
      Interface: modem
      Type: PPP (PPPSerial)
    
    Built-in Ethernet:
    
      Interface: en0
      Type: Ethernet
      IP Address: ("192.168.1.90")
      Subnet Mask: ("255.255.255.0")
      Broadcast Address: ("192.168.1.255")
      Router Address: 192.168.1.254
      DNS Servers: ("192.168.1.254")
      Domain: home
      Ethernet Address: 00:03:93:62:b0:5e
    
    AirPort:
    
      Interface: en1
      Type: AirPort
      Ethernet Address: 00:30:65:0b:4a:ef
    
    




Memory:

    DIMM0/BUILT-IN:
    
      Size: 128 MB
      Type: Built-in
      Speed: Built-in
    
    DIMM1/J12:
    
      Size: 512 MB
      Type: SDRAM
      Speed: PC133-333
    
    




PCI/AGP Cards:

    ATY,RageM3:
    
      Type: display
      Bus: AGP
      Display Type: LCD
      Slot: ATI
      VRAM (Total): 8 MB
      Vendor: ATI (0x1002)
      Device ID: 0x4c46
      Revision ID: 0x0002
      ROM Revision: 113-XXXXX-130
    
    




ATA:

    ATA-4 Bus:
    
        TOSHIBA MK1517GAP:
        
          Capacity: 14.07 GB
          Model: TOSHIBA MK1517GAP
          Revision: A1.14 B
          Serial Number: X1F51178T
          Removable Media: No
          Detachable Drive: No
          BSD Name: disk0
          Protocol: ATA
          Unit Number: 0
          Socket Type: Internal
          OS9 Drivers: Yes
        
            System:
            
              Capacity: 14.06 GB
              Available: 10.22 GB
              Writable: Yes
              File System: Journaled HFS+
              BSD Name: disk0s9
              Mount Point: /
            
        MATSHITADVD-ROM SR-8176:
        
          Model: MATSHITADVD-ROM SR-8176
          Revision: MA26
          Serial Number: 
          Drive Type: CD-ROM/DVD-ROM
          Removable Media: Yes
          Detachable Drive: No
          Protocol: ATAPI
          Unit Number: 1
          Socket Type: Internal
        
        




SCSI:






USB:

    USB Bus:
    
      Vendor Name: Apple Computer, Inc.
      Speed: Up to 12 Mb/sec
      Product ID: 32773 ($8005)
      Bus Power (mA): 500
    
    USB Bus:
    
      Vendor Name: Apple Computer, Inc.
      Speed: Up to 12 Mb/sec
      Product ID: 32773 ($8005)
      Bus Power (mA): 500
    
    




FireWire:

    FireWire Bus:
    
      Speed: 400 Mb/sec Speed
    
    




AirPort Card:

    AirPort Card Information:
    
      Wireless Card Type: AirPort
      Wireless Card Locale: Worldwide
      Wireless Card Firmware Version: 9.52
      Current Wireless Network: AirPort is currently turned off
    
    




Modems:

    Modem Information:
    
      Modem Model: MicroDash
      Firmware Version: APPLE VERSION 2.6.3
      Country: B4 (United Kingdom)
      Driver: InternalUSBModem.kext (v2.6.3)
      Interface Type: USB
      SKU Name: Euro
      Modulation: V.92
      Hardware Version: 1.0F
    

Note that at higher detail levels (including the default of 0), information about installed software and libraries is also included in the report.

dmesg

System message buffer.

$ dmesg
standard timeslicing quantum is 10000 us
vm_page_bootstrap: 156766 free pages
mig_table_max_displ = 68
IOKit Component Version 7.9:
Wed Mar 30 20:07:52 PST 2005; root(rcbuilder):RELEASE_PPC/iokit/RELEASE
66 prelinked modules
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California. All rights reserved.

using 1638 buffer headers and 1638 cluster IO buffer headers
Local FireWire GUID = 0x393ff:0xfe62b05e
ADB present:8c
Security auditing service present
BSM auditing present
From path: "/pci@f2000000/mac-io@17/ata-4@1f000/@0:9,\\mach_kernel", Waiting on <dict ID="0"><key>IOPathMatch</key><string ID="1">IODeviceTree:/pci@f2000000/mac-io@17/ata-4@1f000/@0:9</string></dict>
Got boot device = IOService:/MacRISC2PE/pci@f2000000/AppleMacRiscPCI/mac-io@17/AppleKeyLargo/ata-4@1f000/KeyLargoATA/ATADeviceNub@0/IOATABlockStorageDriver/IOATABlockStorageDevice/IOBlockStorageDriver/TOSHIBA MK1517GAP Media/IOApplePartitionScheme/untitled@9
BSD root: disk0s9, major 14, minor 9
Jettisoning kernel linker.
Resetting IOCatalogue.
Matching service count = 0
AppleRS232Serial:        0        0 AppleRS232Serial::start - returning false early, Connector or machine incorrect
obtaining ID
from Registry
ATIRage128: using AGP
AirPortFirmware: start Sta f/w download
UniNEnet: Ethernet address 00:03:93:62:b0:5e
AirPortDriver: Ethernet address 00:30:65:0b:4a:ef
IOFireWireIP: FireWire address 00:03:93:ff:fe:62:b0:5e
ATY,RageM3p29s: vram [96000000:00800000]
UniNEnet::monitorLinkStatus - Link is up at 100 Mbps - Full Duplex
IP packet filtering initialized, divert enabled, rule-based forwarding enabled, default to accept, logging disabled
IPv6 packet filtering initialized, default to accept, logging disabled
IP firewall loaded

Some stuff here related to how the system started, but it is pretty brief.


No comments: