[SETUPLIB] Store a machine architecture type

It will be used to determine how the bootloader has to be installed, etc.

Currently hardcoded for XBOX, or rnutime-determined for NEC PC-98 and BIOS-based PC-AT.
More thorough runtime determination will be added in the future.
This commit is contained in:
Hermès Bélusca-Maïto 2024-07-20 22:15:47 +02:00
parent 9b9065df52
commit 8056081c2f
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 22 additions and 0 deletions

View file

@ -1028,6 +1028,17 @@ InitializeSetup(
DPRINT1("SourceRootPath (2): '%wZ'\n", &pSetupData->SourceRootPath); DPRINT1("SourceRootPath (2): '%wZ'\n", &pSetupData->SourceRootPath);
DPRINT1("SourceRootDir (2): '%wZ'\n", &pSetupData->SourceRootDir); DPRINT1("SourceRootDir (2): '%wZ'\n", &pSetupData->SourceRootDir);
/* Retrieve the target machine architecture type */
// FIXME: This should be determined at runtime!!
// FIXME: Allow for (pre-)installing on an architecture
// different from the current one?
#if defined(SARCH_XBOX)
pSetupData->ArchType = ARCH_Xbox;
// #elif defined(SARCH_PC98)
#else // TODO: Arc, UEFI
pSetupData->ArchType = (IsNEC_98 ? ARCH_NEC98x86 : ARCH_PcAT);
#endif
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }

View file

@ -66,6 +66,16 @@ struct _USETUP_DATA;
typedef VOID typedef VOID
(__cdecl *PSETUP_ERROR_ROUTINE)(IN struct _USETUP_DATA*, ...); (__cdecl *PSETUP_ERROR_ROUTINE)(IN struct _USETUP_DATA*, ...);
typedef enum _ARCHITECTURE_TYPE
{
ARCH_PcAT, //< Standard BIOS-based PC-AT
ARCH_NEC98x86, //< NEC PC-98
ARCH_Xbox, //< Original Xbox
ARCH_Arc, //< ARC-based (MIPS, SGI)
ARCH_Efi, //< EFI and UEFI
// Place other architectures supported by the Setup below.
} ARCHITECTURE_TYPE;
typedef struct _USETUP_DATA typedef struct _USETUP_DATA
{ {
/* Error handling *****/ /* Error handling *****/
@ -123,6 +133,7 @@ typedef struct _USETUP_DATA
PGENERIC_LIST LanguageList; PGENERIC_LIST LanguageList;
/* Settings *****/ /* Settings *****/
ARCHITECTURE_TYPE ArchType; //< Target architecture (MachineType)
PCWSTR ComputerType; PCWSTR ComputerType;
PCWSTR DisplayType; PCWSTR DisplayType;
// PCWSTR KeyboardDriver; // PCWSTR KeyboardDriver;