48 #define syslinux_version __use_data16 ( syslinux_version ) 52 #define syslinux_copyright __use_data16 ( syslinux_copyright ) 55 #define syslinux_configuration_file __use_data16 ( syslinux_configuration_file ) 59 #define comboot_feature_flags __use_data16 ( comboot_feature_flags ) 67 #define comboot_initial_regs __use_text16 ( comboot_initial_regs ) 70 #define int20_vector __use_text16 ( int20_vector ) 73 #define int21_vector __use_text16 ( int21_vector ) 76 #define int22_vector __use_text16 ( int22_vector ) 102 static void shuffle (
unsigned int list_segment,
unsigned int list_offset,
unsigned int count )
112 for ( i = 0; i <
count; i++ ) {
113 const void *
src = phys_to_virt ( shuf[ i ].
src );
114 void *
dest = phys_to_virt ( shuf[ i ].
dest );
116 if ( shuf[ i ].
src == 0xFFFFFFFF ) {
119 }
else if ( shuf[ i ].
dest == 0xFFFFFFFF ) {
141 "mov $0x4F02, %%ax\n\t" 142 "mov $0x03, %%bx\n\t" 150 "mov $0x03, %%ax\n\t" 165 struct image *initrd;
181 DBG (
"COMBOOT: fetching initrd '%s'\n", initrd_file );
186 DBG (
"COMBOOT: could not fetch initrd: %s\n",
196 DBG (
"COMBOOT: fetching kernel '%s'\n", kernel_file );
200 DBG (
"COMBOOT: could not fetch kernel: %s\n",
207 DBG (
"COMBOOT: could not replace with kernel: %s\n",
230 switch ( ix86->
regs.
ah ) {
242 if ( ix86->
regs.
al == 0x0A )
245 if ( ix86->
regs.
ah == 0x01 )
287 DBG (
"COMBOOT unknown int21 function %02x\n", ix86->
regs.
ah );
313 switch ( ix86->
regs.
ax ) {
347 DBG (
"COMBOOT: executing command '%s'\n",
cmd );
349 DBG (
"COMBOOT: exiting after executing command...\n" );
370 if ( file[0] ==
'\0' ) {
371 DBG (
"COMBOOT: attempted open with empty file name\n" );
375 DBG (
"COMBOOT: opening file '%s'\n", file );
380 DBG (
"COMBOOT: error opening file %s\n", file );
387 #if (POSIX_FD_MAX > 65535) 388 #error POSIX_FD_MAX too large 415 DBG (
"COMBOOT: read failed\n" );
548 DBG (
"COMBOOT: run kernel %s %s\n", file,
cmd );
555 DBG (
"COMBOOT: exiting to run kernel...\n" );
594 "movw $comboot_initial_regs, %%sp\n\t" 615 "movw $(comboot_initial_regs + 6), %%sp\n\t" 617 "movl %%cs:(comboot_initial_regs + 28), %%esp\n\t" 619 "ljmp *%%cs:(comboot_initial_regs + 44)\n\t" 637 DBG (
"COMBOOT unknown int22 function %04x\n", ix86->
regs.
ax );
#define syslinux_configuration_file
static void print_user_string(unsigned int segment, unsigned int offset, char terminator)
Print a string with a particular terminator.
struct option_descriptor read[1]
uint16_t segment
Code segment.
struct arbelprm_rc_send_wqe rc
static uint8_t __data16(comboot_feature_flags)
Feature flags.
struct i386_seg_regs segs
#define syslinux_copyright
#define VIRT_CALL(function)
Call C function from real-mode code.
void * base
Register base address.
#define __from_text16(pointer)
static syslinux_regs __text16(comboot_initial_regs)
Initial register values for INT 22h AX=1Ah and 1Bh.
#define COMBOOT_VIDEO_VESA
#define COMBOOT_FEATURE_IDLE_LOOP
static physaddr_t initrd_end
End of reshuffle region.
__weak int pxe_api_call_weak(struct i386_all_regs *ix86 __unused)
Dispatch PXE API call weakly.
static __always_inline void * real_to_virt(unsigned int segment, unsigned int offset)
Convert segment:offset address to virtual address.
void hook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Hook INT vector.
int unhook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Unhook INT vector.
ssize_t fsize(int fd)
Determine file size.
char * strstr(const char *haystack, const char *needle)
Find substring.
struct uart * serial_console
Active serial console UART.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define __asmcall
Declare a function with standard calling conventions.
#define __used
Declare a function as used.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define __unused
Declare a variable or data structure as unused.
void comboot_force_text_mode(void)
Set default text mode.
static unsigned int count
Number of entries.
#define BZI_LOADER_TYPE_IPXE
bzImage boot loader identifier for iPXE
uint16_t divisor
Baud rate divisor.
uint32_t kernel
Kernel version (numeric)
static uint16_t comboot_graphics_mode
uint32_t fd_set
File descriptor set as used for select()
int getchar(void)
Read a single character from any console.
char * strerror(int errno)
Retrieve string representation of error number.
static int comboot_fetch_kernel(const char *kernel_file, char *cmdline)
Fetch kernel and optional initrd.
static char __bss16_array(syslinux_version, [32])
The "SYSLINUX" version string.
void unhook_comboot_interrupts()
Unhook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)
static char __data16_array(syslinux_copyright, [])
The "SYSLINUX" copyright string.
char * strchr(const char *src, int character)
Find character within a string.
void * priv
Driver-private data.
int image_replace(struct image *replacement)
Set replacement image.
uint32_t addr
Buffer address.
#define comboot_feature_flags
__asm__ __volatile__("call *%9" :"=a"(result), "=c"(discard_ecx), "=d"(discard_edx) :"d"(0), "a"(code), "b"(0), "c"(in_phys), "D"(0), "S"(out_phys), "m"(hypercall))
const char product_version[]
Product version string.
int select(fd_set *readfds, int wait)
Check file descriptors for readiness.
void * memmove(void *dest, const void *src, size_t len) __nonnull
static void shuffle(unsigned int list_segment, unsigned int list_offset, unsigned int count)
Perform a series of memory copies from a list in low memory.
#define COMBOOT_EXIT_RUN_KERNEL
int comboot_resolv(const char *name, struct in_addr *address)
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")
void hook_comboot_interrupts()
Hook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)
#define __from_data16(pointer)
int imgdownload_string(const char *uri_string, unsigned long timeout, struct image **image)
Download a new image.
#define COMBOOT_EXIT_COMMAND
void step(void)
Single-step a single process.
static __asmcall __used void int22(struct i386_all_regs *ix86)
SYSLINUX API.
FILE_LICENCE(GPL2_OR_LATER)
int open(const char *uri_string)
Open file.
if(len >=6 *4) __asm__ __volatile__("movsl" if(len >=5 *4) __asm__ __volatile__("movsl" if(len >=4 *4) __asm__ __volatile__("movsl" if(len >=3 *4) __asm__ __volatile__("movsl" if(len >=2 *4) __asm__ __volatile__("movsl" if(len >=1 *4) __asm__ __volatile__("movsl" if((len % 4) >=2) __asm__ __volatile__("movsw" if((len % 2) >=1) __asm__ __volatile__("movsb" return dest
#define __weak
Declare a function as weak (use before the definition)
#define COMBOOT_MAX_SHUFFLE_DESCRIPTORS
Maximum number of shuffle descriptors for shuffle and boot functions (INT 22h AX=0012h,...
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
static struct evtchn_close * close
static __asmcall __used void int20(struct i386_all_regs *ix86 __unused)
Terminate program interrupt handler.
static __asmcall __used void int21(struct i386_all_regs *ix86)
DOS-compatible API.
uint16_t offset
Offset to command line.
#define DBG(...)
Print a debugging message.
#define rmlongjmp(_env, _val)
struct eth_slow_terminator_tlv terminator
Terminator.
#define comboot_initial_regs
static void shutdown_boot(void)
Shut down system for OS boot.
#define REAL_CODE(asm_code_str)
#define NULL
NULL pointer (VOID *)
int putchar(int character)
Write a single character to each console device.
#define COMBOOT_VIDEO_GRAPHICS
int iskey(void)
Check for available input on any console.
A real-mode-extended jump buffer.
#define COMBOOT_FILE_BLOCKSZ
Size of SYSLINUX file block in bytes.
#define TEXT16_CODE(asm_code_str)
uint8_t system[ETH_ALEN]
System identifier.
void * memset(void *dest, int character, size_t len) __nonnull