multiboot.h 2.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* multiboot.h - the header for Multiboot */
  2. /* Copyright (C) 1999 Free Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
  14. /* Macros. */
  15. /* The magic number for the Multiboot header. */
  16. #define MULTIBOOT_HEADER_MAGIC 0x1BADB002
  17. /* The flags for the Multiboot header. */
  18. #define MULTIBOOT_HEADER_FLAGS 0x00010003
  19. /* The magic number passed by a Multiboot-compliant boot loader. */
  20. #define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
  21. /* The size of our stack (16KB). */
  22. #define STACK_SIZE 0x4000
  23. /* C symbol format. HAVE_ASM_USCORE is defined by configure. */
  24. #ifdef HAVE_ASM_USCORE
  25. # define EXT_C(sym) _ ## sym
  26. #else
  27. # define EXT_C(sym) sym
  28. #endif
  29. #ifndef ASM
  30. /* Do not include here in boot.S. */
  31. /* Types. */
  32. /* The Multiboot header. */
  33. typedef struct multiboot_header
  34. {
  35. unsigned long magic;
  36. unsigned long flags;
  37. unsigned long checksum;
  38. unsigned long header_addr;
  39. unsigned long load_addr;
  40. unsigned long load_end_addr;
  41. unsigned long bss_end_addr;
  42. unsigned long entry_addr;
  43. } multiboot_header_t;
  44. /* The symbol table for a.out. */
  45. typedef struct aout_symbol_table
  46. {
  47. unsigned long tabsize;
  48. unsigned long strsize;
  49. unsigned long addr;
  50. unsigned long reserved;
  51. } aout_symbol_table_t;
  52. /* The section header table for ELF. */
  53. typedef struct elf_section_header_table
  54. {
  55. unsigned long num;
  56. unsigned long size;
  57. unsigned long addr;
  58. unsigned long shndx;
  59. } elf_section_header_table_t;
  60. /* The Multiboot information. */
  61. typedef struct multiboot_info
  62. {
  63. unsigned long flags;
  64. unsigned long mem_lower;
  65. unsigned long mem_upper;
  66. unsigned long boot_device;
  67. unsigned long cmdline;
  68. unsigned long mods_count;
  69. unsigned long mods_addr;
  70. union
  71. {
  72. aout_symbol_table_t aout_sym;
  73. elf_section_header_table_t elf_sec;
  74. } u;
  75. unsigned long mmap_length;
  76. unsigned long mmap_addr;
  77. } multiboot_info_t;
  78. /* The module structure. */
  79. typedef struct module
  80. {
  81. unsigned long mod_start;
  82. unsigned long mod_end;
  83. unsigned long string;
  84. unsigned long reserved;
  85. } module_t;
  86. /* The memory map. Be careful that the offset 0 is base_addr_low
  87. but no size. */
  88. typedef struct memory_map
  89. {
  90. unsigned long size;
  91. unsigned long base_addr_low;
  92. unsigned long base_addr_high;
  93. unsigned long length_low;
  94. unsigned long length_high;
  95. unsigned long type;
  96. } memory_map_t;
  97. #endif /* ! ASM */