Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

multiboot.h 3.0 KiB

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