/*++ Copyright (c) 1992 Microsoft Corporation Module Name: initia64.c Abstract: Gets boot environment vars from c:\boot.nvr -- This will go away once we r/w the vars directly to/fro nvram Author: Mudit Vats (v-muditv) 11-02-99 Revision History: --*/ #include "parsebnvr.h" #include "stdio.h" #include "string.h" #define SYSTEMPARTITION 0 #define OSLOADER 1 #define OSLOADPARTITION 2 #define OSLOADFILENAME 3 #define LOADIDENTIFIER 4 #define OSLOADOPTIONS 5 #define COUNTDOWN 6 #define AUTOLOAD 7 #define LASTKNOWNGOOD 8 #define MAXBOOTVARS 9 #define MAXBOOTVARSIZE 1024 CHAR g_szBootVars[MAXBOOTVARS][MAXBOOTVARSIZE]; CHAR szSelectKernelString[MAXBOOTVARSIZE]; VOID BlGetBootVars( IN PCHAR szBootNVR, IN ULONG nLengthBootNVR ) /*++ Routine Description: Parses the boot.txt file and determines the fully-qualified name of the kernel to be booted. Arguments: szBootNVR - pointer "boot.nvr" image in memory nLengthBootNVR - lenghth, in bytes, of szBootNVR Return Value: none --*/ { ULONG i=0, j; ULONG nbootvar; if (*szBootNVR == '\0') { // // No boot.nvr file, so we boot the default. // strcpy( g_szBootVars[ SYSTEMPARTITION ], "multi(0)disk(0)rdisk(0)partition(1)" ); strcpy( g_szBootVars[ OSLOADER ], "multi(0)disk(0)rdisk(0)partition(1)\\setupldr.efi" ); strcpy( g_szBootVars[ OSLOADPARTITION ], "multi(0)disk(0)rdisk(0)partition(2)" ); strcpy( g_szBootVars[ OSLOADFILENAME ], "\\$WIN_NT$.~LS\\IA64" ); strcpy( g_szBootVars[ LOADIDENTIFIER ], "Windows 2000 Setup" ); strcpy( g_szBootVars[ OSLOADOPTIONS ], "WINNT32" ); strcpy( g_szBootVars[ COUNTDOWN ], "10" ); strcpy( g_szBootVars[ AUTOLOAD ], "YES" ); strcpy( g_szBootVars[ LASTKNOWNGOOD ], "FALSE" ); } else { // // Get the boot vars // // BOOTVAR ::= = // ::= null | {;} | {;} | ; // for( nbootvar = SYSTEMPARTITION; nbootvar<=LASTKNOWNGOOD; nbootvar++ ) { // read to '=' while( (szBootNVR[i] != '=') && (i