57 #define COMBOOT_PSP_CMDLINE_OFFSET 0x81 61 #define COMBOOT_MAX_CMDLINE_LEN 125 80 psp_cmdline[-1] = cmdline_len;
89 psp_cmdline[ 1 + cmdline_len ] =
'\r';
111 DBGC (
image,
"COMBOOT %s: first non-free paragraph = 0x%x\n",
139 DBGC (
image,
"executing 16-bit COMBOOT image at %4x:0100\n",
166 "xorw %%ax, %%ax\n\t" 167 "xorw %%bx, %%bx\n\t" 168 "xorw %%cx, %%cx\n\t" 169 "xorw %%dx, %%dx\n\t" 170 "xorw %%si, %%si\n\t" 171 "xorw %%di, %%di\n\t" 172 "xorw %%bp, %%bp\n\t" 184 DBGC (
image,
"COMBOOT %s: exited to run kernel %s\n",
189 DBGC (
image,
"COMBOOT %s: exited after executing command\n",
216 DBGC (
image,
"COMBOOT %s: no extension\n",
224 DBGC (
image,
"COMBOOT %s: unrecognized extension %s\n",
240 size_t filesz,
memsz;
254 DBGC (
image,
"COMBOOT %s: could not prepare segment: %s\n",
297 DBGC(
image,
"COMBOOT %s: image too large\n",
uint16_t int20
INT 20 instruction, executed if COMBOOT image returns with RET.
static int comboot_identify(struct image *image)
Check image name extension.
#define COMBOOT_PSP_CMDLINE_OFFSET
Offset in PSP of command line.
struct arbelprm_rc_send_wqe rc
static unsigned int get_fbms(void)
Read the BIOS free base memory counter.
char * strrchr(const char *src, int character)
Find rightmost character within a string.
const void * data
Read-only data.
#define COMBOOT_PSP_SEG
Segment used for COMBOOT PSP and image.
#define ENOEXEC
Exec format error.
An executable image type.
#define COMBOOT_MAX_CMDLINE_LEN
Maximum length of command line in PSP (127 bytes minus space and CR)
#define PROBE_NORMAL
Normal image probe priority.
int strcasecmp(const char *first, const char *second)
Compare case-insensitive strings.
#define FEATURE_IMAGE
Image formats.
static int comboot_probe(struct image *image)
Probe COMBOOT image.
char * name
Name of this image type.
char * cmdline
Command line to pass to image.
static __always_inline void * real_to_virt(unsigned int segment, unsigned int offset)
Convert segment:offset address to virtual address.
static int comboot_exec_loop(struct image *image)
Execute COMBOOT image.
Executable image segments.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
FILE_LICENCE(GPL2_OR_LATER)
#define DHCP_EB_FEATURE_COMBOOT
COMBOOT format.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
struct image_type comboot_image_type __image_type(PROBE_NORMAL)
SYSLINUX COMBOOT (16-bit) image type.
static void comboot_init_psp(struct image *image, void *seg)
Initialize PSP.
void comboot_force_text_mode(void)
Set default text mode.
char * strerror(int errno)
Retrieve string representation of error number.
uint16_t first_non_free_para
Segment of first non-free paragraph of memory.
void unhook_comboot_interrupts()
Unhook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)
size_t len
Length of raw file image.
static void comboot_copy_cmdline(struct image *image, void *seg)
Copy command line to PSP.
__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))
size_t strlen(const char *src)
Get length of string.
static int comboot_prepare_segment(struct image *image)
Load COMBOOT image into memory, preparing a segment and returning it.
static void console_reset(void)
Reset console.
uint16_t ext
Extended status.
#define COMBOOT_EXIT_RUN_KERNEL
COMBOOT PSP, copied to offset 0 of code segment.
void unregister_image(struct image *image)
Unregister executable image.
__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)
FEATURE(FEATURE_IMAGE, "COMBOOT", DHCP_EB_FEATURE_COMBOOT, 1)
#define COMBOOT_EXIT_COMMAND
static int comboot_exec(struct image *image)
Execute COMBOOT image.
struct image * replacement
Replacement image.
int prep_segment(void *segment, size_t filesz, size_t memsz)
Prepare segment for loading.
struct golan_mkey_seg seg
#define REAL_CODE(asm_code_str)
void * memset(void *dest, int character, size_t len) __nonnull