grub.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * File : grub.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, RT-Thread Develop Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://openlab.rt-thread.com/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2006-10-09 Bernard the grub related definitions
  13. * (multiboot)
  14. */
  15. #ifndef __GRUB_H__
  16. #define __GRUB_H__
  17. /* the magic number for the multiboot header. */
  18. #define MULTIBOOT_HEADER_MAGIC 0x1BADB002
  19. /* the flags for the multiboot header. */
  20. #define MULTIBOOT_HEADER_FLAGS 0x00000003
  21. /* the magic number passed by a multiboot-compliant boot loader. */
  22. #define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
  23. #ifndef __ASM__
  24. /* the multiboot header. */
  25. typedef struct multiboot_header
  26. {
  27. unsigned long magic;
  28. unsigned long flags;
  29. unsigned long checksum;
  30. unsigned long header_addr;
  31. unsigned long load_addr;
  32. unsigned long load_end_addr;
  33. unsigned long bss_end_addr;
  34. unsigned long entry_addr;
  35. } multiboot_header_t;
  36. /* the section header table for elf. */
  37. typedef struct elf_section_header_table
  38. {
  39. unsigned long num;
  40. unsigned long size;
  41. unsigned long addr;
  42. unsigned long shndx;
  43. } elf_section_header_table_t;
  44. /* the multiboot information. */
  45. typedef struct multiboot_info
  46. {
  47. unsigned long flags;
  48. unsigned long mem_lower;
  49. unsigned long mem_upper;
  50. unsigned long boot_device;
  51. unsigned long cmdline;
  52. unsigned long mods_count;
  53. unsigned long mods_addr;
  54. union
  55. {
  56. aout_symbol_table_t aout_sym;
  57. elf_section_header_table_t elf_sec;
  58. } u;
  59. unsigned long mmap_length;
  60. unsigned long mmap_addr;
  61. } multiboot_info_t;
  62. /* the module structure. */
  63. typedef struct module
  64. {
  65. unsigned long mod_start;
  66. unsigned long mod_end;
  67. unsigned long string;
  68. unsigned long reserved;
  69. } module_t;
  70. /* the memory map. be careful that the offset 0 is base_addr_low
  71. but no size. */
  72. typedef struct memory_map
  73. {
  74. unsigned long size;
  75. unsigned long base_addr_low;
  76. unsigned long base_addr_high;
  77. unsigned long length_low;
  78. unsigned long length_high;
  79. unsigned long type;
  80. } memory_map_t;
  81. #endif
  82. #endif