You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

comboot.h 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 dest;
  49. uint32_t src;
  50. uint32_t len;
  51. } comboot_shuffle_descriptor;
  52. extern void hook_comboot_interrupts ( );
  53. /* These are not the correct prototypes, but it doens't matter,
  54. * as we only ever get the address of these functions;
  55. * they are only called from COM32 code running in PHYS_CODE
  56. */
  57. extern void com32_intcall_wrapper ( );
  58. extern void com32_farcall_wrapper ( );
  59. extern void com32_cfarcall_wrapper ( );
  60. /* Resolve a hostname to an (IPv4) address */
  61. extern int comboot_resolv ( const char *name, struct in_addr *address );
  62. /* setjmp/longjmp context buffer used to return after loading an image */
  63. extern jmp_buf comboot_return;
  64. /* Replacement image when exiting with COMBOOT_EXIT_RUN_KERNEL */
  65. extern struct image *comboot_replacement_image;
  66. extern void *com32_external_esp;
  67. #define COMBOOT_EXIT 1
  68. #define COMBOOT_EXIT_RUN_KERNEL 2
  69. #define COMBOOT_EXIT_COMMAND 3
  70. extern void comboot_force_text_mode ( void );
  71. #define COMBOOT_VIDEO_GRAPHICS 0x01
  72. #define COMBOOT_VIDEO_NONSTANDARD 0x02
  73. #define COMBOOT_VIDEO_VESA 0x04
  74. #define COMBOOT_VIDEO_NOTEXT 0x08
  75. #endif