您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

comboot.h 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. #ifndef COMBOOT_H
  2. #define COMBOOT_H
  3. /**
  4. * @file
  5. *
  6. * SYSLINUX COMBOOT
  7. */
  8. #include <stdint.h>
  9. #include <setjmp.h>
  10. #include <gpxe/in.h>
  11. /** Segment used for COMBOOT PSP and image */
  12. #define COMBOOT_PSP_SEG 0x07C0
  13. /** Entry point address of COM32 images */
  14. #define COM32_START_PHYS 0x101000
  15. /** COM32 bounce buffer segment */
  16. #define COM32_BOUNCE_SEG 0x07C0
  17. /** Size of SYSLINUX file block in bytes */
  18. #define COMBOOT_FILE_BLOCKSZ 512
  19. /** COMBOOT feature flags (INT 22h AX=15h) */
  20. #define COMBOOT_FEATURE_LOCAL_BOOT (1 << 0)
  21. #define COMBOOT_FEATURE_IDLE_LOOP (1 << 1)
  22. /** Maximum number of shuffle descriptors for
  23. * shuffle and boot functions
  24. * (INT 22h AX=0012h, 001Ah, 001Bh)
  25. */
  26. #define COMBOOT_MAX_SHUFFLE_DESCRIPTORS 682
  27. typedef union {
  28. uint32_t l;
  29. uint16_t w[2];
  30. uint8_t b[4];
  31. } com32_reg32_t;
  32. typedef struct {
  33. uint16_t gs; /* Offset 0 */
  34. uint16_t fs; /* Offset 2 */
  35. uint16_t es; /* Offset 4 */
  36. uint16_t ds; /* Offset 6 */
  37. com32_reg32_t edi; /* Offset 8 */
  38. com32_reg32_t esi; /* Offset 12 */
  39. com32_reg32_t ebp; /* Offset 16 */
  40. com32_reg32_t _unused_esp; /* Offset 20 */
  41. com32_reg32_t ebx; /* Offset 24 */
  42. com32_reg32_t edx; /* Offset 28 */
  43. com32_reg32_t ecx; /* Offset 32 */
  44. com32_reg32_t eax; /* Offset 36 */
  45. com32_reg32_t eflags; /* Offset 40 */
  46. } com32sys_t;
  47. typedef struct {
  48. uint32_t eax; /* Offset 0 */
  49. uint32_t ecx; /* Offset 4 */
  50. uint32_t edx; /* Offset 8 */
  51. uint32_t ebx; /* Offset 12 */
  52. uint32_t esp; /* Offset 16 */
  53. uint32_t ebp; /* Offset 20 */
  54. uint32_t esi; /* Offset 24 */
  55. uint32_t edi; /* Offset 28 */
  56. uint32_t eip; /* Offset 32 */
  57. } syslinux_pm_regs;
  58. typedef struct {
  59. uint16_t es; /* Offset 0 */
  60. uint16_t _unused_cs; /* Offset 2 */
  61. uint16_t ds; /* Offset 4 */
  62. uint16_t ss; /* Offset 6 */
  63. uint16_t fs; /* Offset 8 */
  64. uint16_t gs; /* Offset 10 */
  65. uint32_t eax; /* Offset 12 */
  66. uint32_t ecx; /* Offset 16 */
  67. uint32_t edx; /* Offset 20 */
  68. uint32_t ebx; /* Offset 24 */
  69. uint32_t esp; /* Offset 28 */
  70. uint32_t ebp; /* Offset 32 */
  71. uint32_t esi; /* Offset 36 */
  72. uint32_t edi; /* Offset 40 */
  73. uint16_t ip; /* Offset 44 */
  74. uint16_t cs; /* Offset 46 */
  75. } syslinux_rm_regs;
  76. typedef struct {
  77. uint32_t dest;
  78. uint32_t src;
  79. uint32_t len;
  80. } comboot_shuffle_descriptor;
  81. extern void hook_comboot_interrupts ( );
  82. extern void unhook_comboot_interrupts ( );
  83. /* These are not the correct prototypes, but it doens't matter,
  84. * as we only ever get the address of these functions;
  85. * they are only called from COM32 code running in PHYS_CODE
  86. */
  87. extern void com32_intcall_wrapper ( );
  88. extern void com32_farcall_wrapper ( );
  89. extern void com32_cfarcall_wrapper ( );
  90. /* Resolve a hostname to an (IPv4) address */
  91. extern int comboot_resolv ( const char *name, struct in_addr *address );
  92. /* setjmp/longjmp context buffer used to return after loading an image */
  93. extern rmjmp_buf comboot_return;
  94. /* Replacement image when exiting with COMBOOT_EXIT_RUN_KERNEL */
  95. extern struct image *comboot_replacement_image;
  96. extern void *com32_external_esp;
  97. #define COMBOOT_EXIT 1
  98. #define COMBOOT_EXIT_RUN_KERNEL 2
  99. #define COMBOOT_EXIT_COMMAND 3
  100. extern void comboot_force_text_mode ( void );
  101. #define COMBOOT_VIDEO_GRAPHICS 0x01
  102. #define COMBOOT_VIDEO_NONSTANDARD 0x02
  103. #define COMBOOT_VIDEO_VESA 0x04
  104. #define COMBOOT_VIDEO_NOTEXT 0x08
  105. #endif