REM >Identify

REM GRUB  --  GRand Unified Bootloader
REM Copyright (C) 2004, 2005  Free Software Foundation, Inc.
REM
REM This program is free software; you can redistribute it and/or modify
REM it under the terms of the GNU General Public License as published by
REM the Free Software Foundation; either version 2 of the License, or
REM (at your option) any later version.
REM
REM This program is distributed in the hope that it will be useful,
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
REM GNU General Public License for more details.
REM
REM You should have received a copy of the GNU General Public License
REM along with this program; if not, write to the Free Software
REM Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


ON ERROR ERROR EXT ERR, REPORT$ + " at line " + STR$(ERL)

PRINT ''"Identify - Display machine indentification infomation"
PRINT "Copyright (C) 2004, 2005 Free Software Foundation"'

V% = 1

SYS "XOS_Byte", 0, 0 TO E%
PRINT "OS Version String (OS_Byte 0): "; FNstring(E%+4)
PRINT "OS Version Code: "; ~INKEY(-256)

PROCos_readsysinfo(0, "OS Version String (OS_ReadSysInfo)")
PROCos_readsysinfo(1, "Part Number")
PROCos_readsysinfo(2, "Build Date")
PROCos_readsysinfo(3, "Dealer Name")

SYS "XOS_ReadSysInfo", 8 TO A%, B%, C%; E%
IF (E% AND V%) = 0 THEN
  PRINT "Platform class: ";A%
  PRINT "  Other flags: ";~B%
  PRINT "  Flags mask: ";~C%
ENDIF

PRINT
END

DEF FNstring(P%)
  LOCAL S$
  IF P%=0 ="(null pointer)"
  SYS "XOS_GenerateError", P% TO S$
=""""+S$+""""

DEF PROCos_readsysinfo(I%, N$)
  LOCAL S%, E%
  SYS "XOS_ReadSysInfo", 9, I% TO S%; E%
  IF (E% AND V%) = 0 THEN PRINT N$; " :"; FNstring(S%)
ENDPROC
