iPXE
|
#include <errno.h>
#include <realmode.h>
#include <biosint.h>
#include <ipxe/console.h>
#include <stdlib.h>
#include <comboot.h>
#include <bzimage.h>
#include <pxe_call.h>
#include <rmsetjmp.h>
#include <string.h>
#include <ipxe/posix_io.h>
#include <ipxe/process.h>
#include <ipxe/serial.h>
#include <ipxe/init.h>
#include <ipxe/image.h>
#include <ipxe/version.h>
#include <usr/imgmgmt.h>
Go to the source code of this file.
Data Structures | |
union | syslinux_regs |
Macros | |
#define | syslinux_version __use_data16 ( syslinux_version ) |
#define | syslinux_copyright __use_data16 ( syslinux_copyright ) |
#define | syslinux_configuration_file __use_data16 ( syslinux_configuration_file ) |
#define | comboot_feature_flags __use_data16 ( comboot_feature_flags ) |
#define | comboot_initial_regs __use_text16 ( comboot_initial_regs ) |
#define | int20_vector __use_text16 ( int20_vector ) |
#define | int21_vector __use_text16 ( int21_vector ) |
#define | int22_vector __use_text16 ( int22_vector ) |
Functions | |
FILE_LICENCE (GPL2_OR_LATER) | |
static char | __bss16_array (syslinux_version, [32]) |
The "SYSLINUX" version string. More... | |
static char | __data16_array (syslinux_copyright, []) |
The "SYSLINUX" copyright string. More... | |
static char | __data16_array (syslinux_configuration_file, []) |
static uint8_t | __data16 (comboot_feature_flags) |
Feature flags. More... | |
static syslinux_regs | __text16 (comboot_initial_regs) |
Initial register values for INT 22h AX=1Ah and 1Bh. More... | |
static struct segoff | __text16 (int20_vector) |
static struct segoff | __text16 (int21_vector) |
static struct segoff | __text16 (int22_vector) |
void | int20_wrapper (void) |
void | int21_wrapper (void) |
void | int22_wrapper (void) |
static void | print_user_string (unsigned int segment, unsigned int offset, char terminator) |
Print a string with a particular terminator. More... | |
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. More... | |
void | comboot_force_text_mode (void) |
Set default text mode. More... | |
static int | comboot_fetch_kernel (char *kernel_file, char *cmdline) |
Fetch kernel and optional initrd. More... | |
static __asmcall __used void | int20 (struct i386_all_regs *ix86 __unused) |
Terminate program interrupt handler. More... | |
static __asmcall __used void | int21 (struct i386_all_regs *ix86) |
DOS-compatible API. More... | |
__weak int | pxe_api_call_weak (struct i386_all_regs *ix86 __unused) |
Dispatch PXE API call weakly. More... | |
static __asmcall __used void | int22 (struct i386_all_regs *ix86) |
SYSLINUX API. More... | |
void | hook_comboot_interrupts () |
Hook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h) More... | |
void | unhook_comboot_interrupts () |
Unhook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h) More... | |
Variables | |
rmjmp_buf | comboot_return |
static uint16_t | comboot_graphics_mode = 0 |
struct uart | serial_console |
Serial console UART. More... | |
#define syslinux_version __use_data16 ( syslinux_version ) |
Definition at line 47 of file comboot_call.c.
#define syslinux_copyright __use_data16 ( syslinux_copyright ) |
Definition at line 51 of file comboot_call.c.
#define syslinux_configuration_file __use_data16 ( syslinux_configuration_file ) |
Definition at line 54 of file comboot_call.c.
#define comboot_feature_flags __use_data16 ( comboot_feature_flags ) |
Definition at line 58 of file comboot_call.c.
#define comboot_initial_regs __use_text16 ( comboot_initial_regs ) |
Definition at line 66 of file comboot_call.c.
#define int20_vector __use_text16 ( int20_vector ) |
Definition at line 69 of file comboot_call.c.
#define int21_vector __use_text16 ( int21_vector ) |
Definition at line 72 of file comboot_call.c.
#define int22_vector __use_text16 ( int22_vector ) |
Definition at line 75 of file comboot_call.c.
FILE_LICENCE | ( | GPL2_OR_LATER | ) |
|
static |
The "SYSLINUX" version string.
|
static |
The "SYSLINUX" copyright string.
|
static |
|
static |
Feature flags.
|
static |
Initial register values for INT 22h AX=1Ah and 1Bh.
|
static |
|
static |
|
static |
void int20_wrapper | ( | void | ) |
Referenced by hook_comboot_interrupts(), and unhook_comboot_interrupts().
void int21_wrapper | ( | void | ) |
Referenced by hook_comboot_interrupts(), and unhook_comboot_interrupts().
void int22_wrapper | ( | void | ) |
Referenced by hook_comboot_interrupts(), and unhook_comboot_interrupts().
|
static |
Print a string with a particular terminator.
Definition at line 90 of file comboot_call.c.
References c, copy_from_user(), offset, putchar(), real_to_user(), segment, and terminator.
|
static |
Perform a series of memory copies from a list in low memory.
Definition at line 106 of file comboot_call.c.
References assert(), COMBOOT_MAX_SHUFFLE_DESCRIPTORS, copy_from_user(), count, dest, len, comboot_shuffle_descriptor::len, memmove_user(), memset_user(), phys_to_user(), real_to_user(), and src.
Referenced by int22().
void comboot_force_text_mode | ( | void | ) |
Set default text mode.
Definition at line 140 of file comboot_call.c.
References __asm__(), __volatile__(), comboot_graphics_mode, COMBOOT_VIDEO_GRAPHICS, COMBOOT_VIDEO_VESA, and REAL_CODE.
Referenced by com32_exec_loop(), comboot_exec_loop(), and int22().
|
static |
Fetch kernel and optional initrd.
Definition at line 167 of file comboot_call.c.
References cmdline, DBG, image_replace(), imgdownload_string(), kernel, NULL, rc, strchr(), strerror(), and strstr().
Referenced by int22().
|
static |
Terminate program interrupt handler.
Definition at line 223 of file comboot_call.c.
References COMBOOT_EXIT, comboot_return, and rmlongjmp.
Referenced by hook_comboot_interrupts().
|
static |
DOS-compatible API.
Definition at line 231 of file comboot_call.c.
References i386_regs::ah, i386_regs::al, uart::base, CF, COMBOOT_EXIT, comboot_return, DBG, i386_regs::dl, i386_seg_regs::ds, i386_regs::dx, i386_regs::eax, i386_regs::ebx, i386_regs::ecx, i386_regs::edx, i386_all_regs::flags, getchar(), iskey(), print_user_string(), putchar(), i386_all_regs::regs, rmlongjmp, i386_all_regs::segs, serial_console, and uart_transmit().
Referenced by hook_comboot_interrupts().
__weak int pxe_api_call_weak | ( | struct i386_all_regs *ix86 | __unused | ) |
Dispatch PXE API call weakly.
ix86 | Registers for PXE call |
present | Zero if the PXE stack is present, nonzero if not |
A successful return only indicates that the PXE stack was available for dispatching the call; it says nothing about the success of whatever the call asked for.
Definition at line 307 of file comboot_call.c.
Referenced by int22().
|
static |
SYSLINUX API.
Definition at line 314 of file comboot_call.c.
References __asm__(), __from_data16, __from_text16, __volatile__(), addr, i386_regs::al, assert(), i386_regs::ax, uart::base, i386_regs::bx, BZI_LOADER_TYPE_IPXE, CF, i386_regs::ch, i386_regs::cl, close, cmd, COMBOOT_EXIT_COMMAND, COMBOOT_EXIT_RUN_KERNEL, comboot_feature_flags, comboot_fetch_kernel(), COMBOOT_FILE_BLOCKSZ, comboot_force_text_mode(), comboot_graphics_mode, comboot_initial_regs, COMBOOT_MAX_SHUFFLE_DESCRIPTORS, comboot_resolv(), comboot_return, copy_from_user(), i386_regs::cx, DBG, i386_regs::di, uart::divisor, i386_regs::dl, i386_seg_regs::ds, i386_regs::dx, i386_regs::eax, i386_regs::ebp, i386_regs::ebx, i386_regs::ecx, i386_seg_regs::es, i386_regs::esi, i386_all_regs::flags, fsize(), len, memcpy_user(), open(), print_user_string(), product_version, pxe_api_call_weak(), rc, read_user(), REAL_CODE, real_to_user(), i386_all_regs::regs, rm_cs, rm_ds, rmlongjmp, i386_all_regs::segs, select(), serial_console, shuffle(), shutdown_boot(), i386_regs::si, snprintf(), step(), strlen_user(), syslinux_configuration_file, syslinux_copyright, syslinux_version, and system.
Referenced by hook_comboot_interrupts().
void hook_comboot_interrupts | ( | ) |
Hook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)
Definition at line 659 of file comboot_call.c.
References __asm__(), __volatile__(), hook_bios_interrupt(), int20(), int20_vector, int20_wrapper(), int21(), int21_vector, int21_wrapper(), int22(), int22_vector, int22_wrapper(), TEXT16_CODE, and VIRT_CALL.
Referenced by com32_exec_loop(), and comboot_exec_loop().
void unhook_comboot_interrupts | ( | ) |
Unhook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)
Definition at line 692 of file comboot_call.c.
References int20_vector, int20_wrapper(), int21_vector, int21_wrapper(), int22_vector, int22_wrapper(), and unhook_bios_interrupt().
Referenced by com32_exec_loop(), and comboot_exec_loop().
rmjmp_buf comboot_return |
Definition at line 82 of file comboot_call.c.
Referenced by com32_exec_loop(), comboot_exec_loop(), int20(), int21(), and int22().
|
static |
Definition at line 85 of file comboot_call.c.
Referenced by comboot_force_text_mode(), and int22().
struct uart serial_console |
Serial console UART.
Definition at line 705 of file comboot_call.c.