1
0

multiboot.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /*
  2. * multiboot.h
  3. *
  4. * Copyright (C) 2013 Aleksandar Andrejevic <theflash@sdf.lonestar.org>
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Affero General Public License as
  8. * published by the Free Software Foundation, either version 3 of the
  9. * License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Affero General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Affero General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef _MULTIBOOT_H_
  20. #define _MULTIBOOT_H_
  21. #include "../common.h"
  22. typedef struct
  23. {
  24. dword_t size;
  25. dword_t reserved;
  26. } multiboot_header_t;
  27. typedef enum
  28. {
  29. MULTIBOOT_INFO_END = 0,
  30. MULTIBOOT_INFO_CMDLINE,
  31. MULTIBOOT_INFO_LOADER,
  32. MULTIBOOT_INFO_MODULES,
  33. MULTIBOOT_INFO_MEMORY,
  34. MULTIBOOT_INFO_BOOT_DEVICE,
  35. MULTIBOOT_INFO_MEMORY_MAP,
  36. MULTIBOOT_INFO_VBE_INFO,
  37. MULTIBOOT_INFO_FRAMEBUFFER,
  38. MULTIBOOT_INFO_SECTIONS,
  39. MULTIBOOT_INFO_APM,
  40. MULTIBOOT_INFO_EFI32,
  41. MULTIBOOT_INFO_EFI64,
  42. MULTIBOOT_INFO_SMBIOS,
  43. MULTIBOOT_INFO_ACPI1_RSDP,
  44. MULTIBOOT_INFO_ACPI2_RSDP,
  45. MULTIBOOT_INFO_NETWORK,
  46. MULTIBOOT_INFO_EFI_MEMORY_MAP,
  47. MULTIBOOT_INFO_EFI_SERVICES,
  48. MULTIBOOT_INFO_EFI32_IMAGE_HANDLE,
  49. MULTIBOOT_INFO_EFI64_IMAGE_HANDLE,
  50. MULTIBOOT_INFO_BASE_ADDRESS,
  51. } multiboot_info_type_t;
  52. typedef struct
  53. {
  54. dword_t type;
  55. dword_t size;
  56. } multiboot_tag_t;
  57. typedef struct
  58. {
  59. dword_t type;
  60. dword_t size;
  61. char string[VARIABLE_SIZE];
  62. } multiboot_tag_cmdline_t, multiboot_tag_loader_t;
  63. typedef struct
  64. {
  65. dword_t type;
  66. dword_t size;
  67. dword_t mod_start;
  68. dword_t mod_end;
  69. char string[VARIABLE_SIZE];
  70. } multiboot_tag_module_t;
  71. typedef struct
  72. {
  73. dword_t type;
  74. dword_t size;
  75. dword_t mem_lower;
  76. dword_t mem_upper;
  77. } multiboot_tag_memory_t;
  78. typedef struct
  79. {
  80. dword_t type;
  81. dword_t size;
  82. dword_t bios_device;
  83. dword_t partition;
  84. dword_t sub_partition;
  85. } multiboot_tag_boot_device_t;
  86. typedef struct
  87. {
  88. union
  89. {
  90. struct { dword_t base_low, base_high; };
  91. qword_t base;
  92. };
  93. union
  94. {
  95. struct { dword_t length_low, length_high; };
  96. qword_t length;
  97. };
  98. dword_t type;
  99. dword_t reserved;
  100. } multiboot_mmap_entry_t;
  101. typedef struct
  102. {
  103. dword_t type;
  104. dword_t size;
  105. dword_t entry_size;
  106. dword_t entry_version;
  107. } multiboot_tag_mmap_t;
  108. typedef struct
  109. {
  110. dword_t type;
  111. dword_t size;
  112. word_t vbe_mode;
  113. word_t vbe_interface_seg;
  114. word_t vbe_interface_off;
  115. word_t vbe_interface_Len;
  116. byte_t vbe_control_info[512];
  117. byte_t vbe_mode_info[256];
  118. } multiboot_tag_vbe_t;
  119. typedef struct
  120. {
  121. dword_t type;
  122. dword_t size;
  123. qword_t fb_address;
  124. dword_t fb_pitch;
  125. dword_t fb_width;
  126. dword_t fb_height;
  127. byte_t fb_bpp;
  128. byte_t fb_type;
  129. byte_t fb_reserved;
  130. union
  131. {
  132. struct
  133. {
  134. dword_t palette_size;
  135. struct
  136. {
  137. byte_t red, green, blue;
  138. } palette[VARIABLE_SIZE];
  139. };
  140. struct
  141. {
  142. byte_t red_field_pos;
  143. byte_t red_mask_size;
  144. byte_t green_field_pos;
  145. byte_t green_mask_size;
  146. byte_t blue_field_pos;
  147. byte_t blue_mask_size;
  148. };
  149. };
  150. } multiboot_tag_framebuffer_t;
  151. typedef struct
  152. {
  153. dword_t type;
  154. dword_t size;
  155. dword_t num;
  156. dword_t entsize;
  157. dword_t shndx;
  158. } multiboot_tag_sections_t;
  159. #endif