66 for ( i = 0, avail_mem_top = 0 ; i < memmap.
count ; i++ ) {
74 DBGC (
image,
"COM32 %p: available memory top = 0x%x\n",
75 image, avail_mem_top );
77 assert ( avail_mem_top != 0 );
94 "movl %%esp, (%k0)\n\t" 113 "movl 28(%%esp), %%esp\n\t" 117 :
"r" ( avail_mem_top ),
136 DBGC (
image,
"COM32 %p: exited to run kernel %s\n",
141 DBGC (
image,
"COM32 %p: exited after executing command\n",
164 static const uint8_t magic[] = { 0xB8, 0xFF, 0x4C, 0xCD, 0x21 };
174 DBGC (
image,
"COM32 %p: found magic number\n",
185 DBGC (
image,
"COM32 %p: no extension\n",
193 DBGC (
image,
"COM32 %p: unrecognized extension %s\n",
208 size_t filesz, memsz;
216 DBGC (
image,
"COM32 %p: could not prepare segment: %s\n",
235 size_t filesz, memsz;
246 if ( (
rc =
prep_segment ( seg_userptr, filesz, memsz ) ) != 0 ) {
247 DBGC (
image,
"COM32 %p: could not prepare bounce buffer segment: %s\n",
#define PHYS_CODE(asm_code_str)
struct arbelprm_rc_send_wqe rc
static int com32_exec_loop(struct image *image)
Execute COMBOOT image.
void get_memmap(struct memory_map *memmap)
Get memory map.
userptr_t data
Raw file image.
static int com32_prepare_bounce_buffer(struct image *image)
Prepare COM32 low memory bounce buffer.
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.
unsigned int count
Number of used regions.
#define COM32_BOUNCE_SEG
COM32 bounce buffer segment.
#define ENOEXEC
Exec format error.
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
static int com32_exec(struct image *image)
Execute COMBOOT image.
An executable image type.
#define PROBE_NORMAL
Normal image probe priority.
userptr_t phys_to_user(unsigned long phys_addr)
Convert physical address to user pointer.
int strcasecmp(const char *first, const char *second)
Compare case-insensitive strings.
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
#define COM32_START_PHYS
Entry point address of COM32 images.
static __always_inline unsigned long virt_to_phys(volatile const void *addr)
Convert virtual address to a physical address.
Access to external ("user") memory.
char * name
Name of this image type.
char * cmdline
Command line to pass to image.
struct memory_region regions[MAX_MEMORY_REGIONS]
Memory regions.
Executable image segments.
uint32_t userptr_t
A pointer to a user buffer.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
int prep_segment(userptr_t segment, size_t filesz, size_t memsz)
Prepare segment for loading.
static int com32_probe(struct image *image)
Probe COM32 image.
void comboot_force_text_mode(void)
Set default text mode.
FILE_LICENCE(GPL2_OR_LATER)
char * strerror(int errno)
Retrieve string representation of error number.
void unhook_comboot_interrupts()
Unhook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)
size_t len
Length of raw file image.
__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))
void com32_cfarcall_wrapper()
static void console_reset(void)
Reset console.
uint16_t magic
Magic signature.
void com32_farcall_wrapper()
uint16_t ext
Extended status.
#define COMBOOT_EXIT_RUN_KERNEL
static int com32_load_image(struct image *image)
Load COM32 image into memory.
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)
uint64_t start
Physical start address.
#define COMBOOT_EXIT_COMMAND
struct image * replacement
Replacement image.
static __always_inline userptr_t real_to_user(unsigned int segment, unsigned int offset)
Convert segment:offset address to user buffer.
struct image_type com32_image_type __image_type(PROBE_NORMAL)
SYSLINUX COM32 image type.
struct golan_mkey_seg seg
uint64_t end
Physical end address.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
static int com32_identify(struct image *image)
Check image name extension.
void memcpy_user(userptr_t dest, off_t dest_off, userptr_t src, off_t src_off, size_t len)
Copy data between user buffers.
void com32_intcall_wrapper()