/** * PROJECT: ExectOS * COPYRIGHT: See COPYING.md in the top level directory * FILE: xtldr/xtldr.c * DESCRIPTION: XTOS UEFI Boot Loader * DEVELOPERS: Rafal Kupiec */ #include /** * This routine is the entry point of the XT EFI boot loader. * * @param ImageHandle * Firmware-allocated handle that identifies the image. * * @param SystemTable * Provides the EFI system table. * * @return This routine returns status code. * * @since XT 1.0 */ XTCDECL EFI_STATUS BlStartXtLoader(IN EFI_HANDLE ImageHandle, IN PEFI_SYSTEM_TABLE SystemTable) { EFI_STATUS Status; LIST_ENTRY ConfigSections; /* Set the system table and image handle */ EfiImageHandle = ImageHandle; EfiSystemTable = SystemTable; RtlInitializeListHead(&ConfigSections); /* Initialize UEFI console and early print XTLDR version */ BlConsoleInitialize(); BlConsolePrint(L"XTLDR boot loader v%s\n", XTOS_VERSION); /* Parse INI Configuration file */ BlConfigParseIniFile(L"# This is the XT Boot Loader (XTLDR) configuration file. It follows an INI format and is divided into sections, which\r\n# contain a properties. Each property has a name and value delimited by an equal (=) character. Comments must start\r\n# with a semicolon (;) or a hash character (#) and run to the end of the line.\r\n#\r\n# Basic section is [XTLDR] which contains a bootloader specific options:\r\n# Debug - enables the debugging port and consists of two comma-separated parameters: com port and baud rate;\r\n# it is also possible to specify custom port address with: COM0:[address],[baud_rate]\r\n# Default - specifies which operating system listen in config file will be started if no choice is made\r\n# Theme - allows to set a custom theme to personalize XTLDR's look'n'feel\r\n# Timeout - sets the countdown timer (in seconds) before the default OS get started automatically\r\n# Tune - plays a tune on the pcspeaker right before the XTLDR loads\r\n#\r\n# Another type of section is [OS-Section] which adds a new position (operating system) to the boot menu. Each type\r\n# of the operating system provides a set of available parameters. If unsupported option is added, it is being ignored\r\n# by the XT Boot Loader. The available options are:\r\n# SystemName - sets a long operating system name that will be shown on the boot menu\r\n# SystemType - specifies an OS type from a predefined list of supported boot protocols\r\n# SystemPath - the ARC path, eg. multi(0)disk(0)rdisk(0)partition(1)\r\n# KernelFile - sets kernel filename with optional path relative to SystemPath\r\n# InitrdFile - sets initramfs image filename with optional path relative to SystemPath\r\n# HalFile - sets HAL filename with optional path relative to SystemPath\r\n# Parameters - specifies extra boot options for the kernel\r\n[XTLDR]Tune=400 880 2 988 2 783 2 392 2 587 3Debug=COM1,115200Timeout=30Theme=FancyDefault=ExectOS[ExectOS]SystemName=\"ExectOS Operating System\"SystemType=XTOSSystemPath=multi(0)disk(0)rdisk(0)partition(1)/ExectOSKernelFile=xtoskrnl.exeParameters=DEBUG DEBUGPORT=COM1,115200[Windows]SystemName=\"Microsoft Windows 2000\"SystemType=NT50SystemPath=multi(0)disk(0)rdisk(0)partition(2)/WindowsKernelFile=ntoskrnl.exeHalFile=hal.dllParameters=/NOGUIBOOT /MININT[Linux]SystemName=\"GNU/Linux\"SystemType=LINUXSystemPath=multi(0)disk(0)rdisk(0)partition(3)/bootKernelFile=vmlinuzInitrdFile=initramfs.cpio.gzParameters=root=/dev/xvda3 rootfstype=ext4", &ConfigSections); /* Temporary infinite loop */ for(;;); /* This point should be never reached, if this happen return error code */ return STATUS_EFI_LOAD_ERROR; }