bconfp.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /*++
  2. Copyright (c) 2014 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. bconfp.h
  5. Abstract:
  6. This header contains internal definitions for the Boot Configuration
  7. Library. Consumers outside the library itself should not include this
  8. header.
  9. Author:
  10. Evan Green 20-Feb-2014
  11. --*/
  12. //
  13. // ------------------------------------------------------------------- Includes
  14. //
  15. //
  16. // ---------------------------------------------------------------- Definitions
  17. //
  18. //
  19. // Define the magic value that goes at the beginning of the boot configuration
  20. // file.
  21. //
  22. #define BOOT_CONFIGURATION_HEADER_MAGIC 0x666E4342 // 'fnCB'
  23. //
  24. // Define the current version of the boot configuration file. Future revisions
  25. // must be backwards compatible.
  26. //
  27. #define BOOT_CONFIGURATION_VERSION 0x00010000
  28. //
  29. // ------------------------------------------------------ Data Type Definitions
  30. //
  31. /*++
  32. Structure Description:
  33. This structure stores the global header at the top of the boot
  34. configuration file.
  35. Members:
  36. Magic - Stores a constant magic value. Set this to
  37. BOOT_CONFIGURATION_HEADER_MAGIC.
  38. Version - Stores the version of the file. Future revisions are backwards
  39. compatible. Set this to BOOT_CONFIGURATION_VERSION.
  40. Key - Stores a value that is changed each time any part of the
  41. configuration file is changed.
  42. TotalSize - Stores the total size of the boot configuration data, including
  43. the header, all entries, and the string table.
  44. Crc32 - Stores the CRC32 of the entire file. This field is set to zero
  45. during the computation.
  46. EntriesOffset - Stores the offset in bytes from the beginning of this
  47. header (the beginning of the file) to the first boot entry.
  48. EntrySize - Stores the size of a single boot entry.
  49. EntryCount - Stores the number of entries in the array.
  50. StringsOffset - Stores the offset in bytes from the beginning of this
  51. header (the beginning of the file) to the string table.
  52. StringsSize - Stores the number of bytes in the string table.
  53. DefaultEntry - Stores the ID of the default boot entry. Set to -1 if there
  54. is no default boot entry.
  55. BootOnce - Stores the ID of the boot entry to boot from on the next boot.
  56. The boot loader clears this value once the entry is selected. Set to -1
  57. to indicate none.
  58. Timeout - Stores the boot menu timeout, in milliseconds. Set to -1 to
  59. never time out, forcing the user to make a choice. Set to 0 to pick the
  60. default (or boot once) option without waiting for the user.
  61. --*/
  62. typedef struct _BOOT_CONFIGURATION_HEADER {
  63. ULONG Magic;
  64. ULONG Version;
  65. ULONG Key;
  66. ULONG TotalSize;
  67. ULONG Crc32;
  68. ULONG EntriesOffset;
  69. ULONG EntrySize;
  70. ULONG EntryCount;
  71. ULONG StringsOffset;
  72. ULONG StringsSize;
  73. ULONG DefaultEntry;
  74. ULONG BootOnce;
  75. ULONG Timeout;
  76. } PACKED BOOT_CONFIGURATION_HEADER, *PBOOT_CONFIGURATION_HEADER;
  77. /*++
  78. Structure Description:
  79. This structure stores the structure of a boot entry on the disk.
  80. Members:
  81. Id - Stores a unique identifier for this boot entry.
  82. Name - Stores the offset from the beginning of the string table to the name
  83. of this boot entry.
  84. DiskId - Stores the identifier of the disk this boot entry lives on.
  85. PartitionId - Stores the identifier of the partition this boot entry lives
  86. on.
  87. LoaderArguments - Stores the offset from the beginning of the string table
  88. to a string containing the command line arguments to pass to the loader.
  89. KernelArguments - Stores the offset from the beginning of the string table
  90. to a string containing the command line arguments to pass to the kernel.
  91. LoaderPath - Stores the offset from the beginning of the string table to
  92. the string containing the path to the loader. This is relative to the
  93. system path.
  94. KernelPath - Stores the offset from the beginning of the string table to
  95. the string containing the path to the kernel. This is relative to the
  96. system path.
  97. SystemPath - Stores the offset from the beginning of the string table to
  98. the string containing the system directory path. This is the base
  99. directory of the OS installation.
  100. Flags - Stores a bitfield of flags for the boot entry. See
  101. BOOT_ENTRY_FLAG_* definitions.
  102. DebugDevice - Stores the zero-based index of the debug device to use. This
  103. is an index into the array of successfully enumerated debug interfaces.
  104. --*/
  105. typedef struct _BOOT_CONFIGURATION_ENTRY {
  106. ULONG Id;
  107. ULONG Name;
  108. UCHAR DiskId[BOOT_DISK_ID_SIZE];
  109. UCHAR PartitionId[BOOT_PARTITION_ID_SIZE];
  110. ULONG LoaderArguments;
  111. ULONG KernelArguments;
  112. ULONG LoaderPath;
  113. ULONG KernelPath;
  114. ULONG SystemPath;
  115. ULONGLONG Flags;
  116. ULONG DebugDevice;
  117. } PACKED BOOT_CONFIGURATION_ENTRY, *PBOOT_CONFIGURATION_ENTRY;
  118. //
  119. // -------------------------------------------------------------------- Globals
  120. //
  121. //
  122. // -------------------------------------------------------- Function Prototypes
  123. //