iPXE
comboot.h
Go to the documentation of this file.
1#ifndef COMBOOT_H
2#define COMBOOT_H
3
4/**
5 * @file
6 *
7 * SYSLINUX COMBOOT
8 */
9
10FILE_LICENCE ( GPL2_OR_LATER );
11
12#include <stdint.h>
13#include <rmsetjmp.h>
14#include <ipxe/in.h>
15
16/** Segment used for COMBOOT PSP and image */
17#define COMBOOT_PSP_SEG 0x07C0
18
19/** Entry point address of COM32 images */
20#define COM32_START_PHYS 0x101000
21
22/** COM32 bounce buffer segment */
23#define COM32_BOUNCE_SEG 0x07C0
24
25/** Size of SYSLINUX file block in bytes */
26#define COMBOOT_FILE_BLOCKSZ 512
27
28/** COMBOOT feature flags (INT 22h AX=15h) */
29#define COMBOOT_FEATURE_LOCAL_BOOT (1 << 0)
30#define COMBOOT_FEATURE_IDLE_LOOP (1 << 1)
31
32/** Maximum number of shuffle descriptors for
33 * shuffle and boot functions
34 * (INT 22h AX=0012h, 001Ah, 001Bh)
35 */
36#define COMBOOT_MAX_SHUFFLE_DESCRIPTORS 682
37
38typedef union {
43
44typedef struct {
45 uint16_t gs; /* Offset 0 */
46 uint16_t fs; /* Offset 2 */
47 uint16_t es; /* Offset 4 */
48 uint16_t ds; /* Offset 6 */
49
50 com32_reg32_t edi; /* Offset 8 */
51 com32_reg32_t esi; /* Offset 12 */
52 com32_reg32_t ebp; /* Offset 16 */
53 com32_reg32_t _unused_esp; /* Offset 20 */
54 com32_reg32_t ebx; /* Offset 24 */
55 com32_reg32_t edx; /* Offset 28 */
56 com32_reg32_t ecx; /* Offset 32 */
57 com32_reg32_t eax; /* Offset 36 */
58
59 com32_reg32_t eflags; /* Offset 40 */
61
62typedef struct {
63 uint32_t eax; /* Offset 0 */
64 uint32_t ecx; /* Offset 4 */
65 uint32_t edx; /* Offset 8 */
66 uint32_t ebx; /* Offset 12 */
67 uint32_t esp; /* Offset 16 */
68 uint32_t ebp; /* Offset 20 */
69 uint32_t esi; /* Offset 24 */
70 uint32_t edi; /* Offset 28 */
71
72 uint32_t eip; /* Offset 32 */
74
75typedef struct {
76 uint16_t es; /* Offset 0 */
77 uint16_t _unused_cs; /* Offset 2 */
78 uint16_t ds; /* Offset 4 */
79 uint16_t ss; /* Offset 6 */
80 uint16_t fs; /* Offset 8 */
81 uint16_t gs; /* Offset 10 */
82
83 uint32_t eax; /* Offset 12 */
84 uint32_t ecx; /* Offset 16 */
85 uint32_t edx; /* Offset 20 */
86 uint32_t ebx; /* Offset 24 */
87 uint32_t esp; /* Offset 28 */
88 uint32_t ebp; /* Offset 32 */
89 uint32_t esi; /* Offset 36 */
90 uint32_t edi; /* Offset 40 */
91
92 uint16_t ip; /* Offset 44 */
93 uint16_t cs; /* Offset 46 */
95
101
102extern void hook_comboot_interrupts ( );
103extern void unhook_comboot_interrupts ( );
104
105/* These are not the correct prototypes, but it doens't matter,
106 * as we only ever get the address of these functions;
107 * they are only called from COM32 code running in PHYS_CODE
108 */
109extern void com32_intcall_wrapper ( );
110extern void com32_farcall_wrapper ( );
112
113/* Resolve a hostname to an (IPv4) address */
114extern int comboot_resolv ( const char *name, struct in_addr *address );
115
116/* setjmp/longjmp context buffer used to return after loading an image */
118
119#define COMBOOT_EXIT 1
120#define COMBOOT_EXIT_RUN_KERNEL 2
121#define COMBOOT_EXIT_COMMAND 3
122
123extern void comboot_force_text_mode ( void );
124
125#define COMBOOT_VIDEO_GRAPHICS 0x01
126#define COMBOOT_VIDEO_NONSTANDARD 0x02
127#define COMBOOT_VIDEO_VESA 0x04
128#define COMBOOT_VIDEO_NOTEXT 0x08
129
130#endif
unsigned short uint16_t
Definition stdint.h:11
unsigned int uint32_t
Definition stdint.h:12
unsigned char uint8_t
Definition stdint.h:10
const char * name
Definition ath9k_hw.c:1986
void unhook_comboot_interrupts()
Unhook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)
void com32_farcall_wrapper()
void com32_cfarcall_wrapper()
void hook_comboot_interrupts()
Hook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)
int comboot_resolv(const char *name, struct in_addr *address)
void comboot_force_text_mode(void)
Set default text mode.
void com32_intcall_wrapper()
rmjmp_buf comboot_return
uint64_t address
Base address.
Definition ena.h:13
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
uint16_t gs
Definition comboot.h:45
com32_reg32_t eax
Definition comboot.h:57
com32_reg32_t edx
Definition comboot.h:55
com32_reg32_t edi
Definition comboot.h:50
com32_reg32_t esi
Definition comboot.h:51
com32_reg32_t _unused_esp
Definition comboot.h:53
uint16_t fs
Definition comboot.h:46
com32_reg32_t eflags
Definition comboot.h:59
uint16_t es
Definition comboot.h:47
com32_reg32_t ebx
Definition comboot.h:54
uint16_t ds
Definition comboot.h:48
com32_reg32_t ebp
Definition comboot.h:52
com32_reg32_t ecx
Definition comboot.h:56
IP address structure.
Definition in.h:42
A real-mode-extended jump buffer.
Definition rmsetjmp.h:10
uint32_t ebx
Definition comboot.h:66
uint32_t esi
Definition comboot.h:69
uint32_t edi
Definition comboot.h:70
uint32_t esp
Definition comboot.h:67
uint32_t eax
Definition comboot.h:63
uint32_t edx
Definition comboot.h:65
uint32_t eip
Definition comboot.h:72
uint32_t ecx
Definition comboot.h:64
uint32_t ebp
Definition comboot.h:68
uint32_t eax
Definition comboot.h:83
uint16_t fs
Definition comboot.h:80
uint16_t gs
Definition comboot.h:81
uint32_t ecx
Definition comboot.h:84
uint16_t ip
Definition comboot.h:92
uint32_t edx
Definition comboot.h:85
uint16_t ds
Definition comboot.h:78
uint32_t ebp
Definition comboot.h:88
uint16_t cs
Definition comboot.h:93
uint32_t ebx
Definition comboot.h:86
uint32_t esi
Definition comboot.h:89
uint16_t es
Definition comboot.h:76
uint16_t _unused_cs
Definition comboot.h:77
uint32_t edi
Definition comboot.h:90
uint32_t esp
Definition comboot.h:87
uint16_t ss
Definition comboot.h:79
uint8_t b[4]
Definition comboot.h:41
uint32_t l
Definition comboot.h:39
uint16_t w[2]
Definition comboot.h:40