99 memset ( bzimg, 0,
sizeof ( *bzimg ) );
103 DBGC (
image,
"bzImage %s too short for kernel header\n",
113 DBGC (
image,
"bzImage %s too short for %zd byte of setup\n",
125 DBGC (
image,
"bzImage %s missing 55AA signature\n",
142 DBGC (
image,
"bzImage %s bad syssize %x (expected "
150 is_bzimage = ( ( bzimg->
version >= 0x0200 ) ?
180 DBGC (
image,
"bzImage %s version %04x RM %#lx+%#zx PM %#lx+%#zx "
201 if ( bzimg->
version >= 0x0200 )
205 if ( bzimg->
version >= 0x0201 ) {
211 if ( bzimg->
version >= 0x0202 ) {
218 if ( bzimg->
version >= 0x0200 )
228 if ( bzimg->
version >= 0x0200 ) {
250 sep =
strchr ( vga,
' ' );
253 if (
strcmp ( vga,
"normal" ) == 0 ) {
255 }
else if (
strcmp ( vga,
"ext" ) == 0 ) {
257 }
else if (
strcmp ( vga,
"ask" ) == 0 ) {
262 DBGC (
image,
"bzImage %s strange \"vga=\" "
291 DBGC (
image,
"bzImage %s strange \"mem=\" "
315 DBGC (
image,
"bzImage %s command line \"%s\"\n",
343 DBGC (
image,
"bzImage %s no region for initrds: %s\n",
360 DBGC (
image,
"bzImage %s not enough space for initrds\n",
366 DBGC (
image,
"bzImage %s not enough space for initrds\n",
372 DBGC (
image,
"bzImage %s loading initrds from %#08lx downwards\n",
395 DBGC (
image,
"bzImage %s initrds at [%#08lx,%#08lx)\n",
419 DBGC (
image,
"bzImage %s could not prepare RM segment: %s\n",
424 bzimg.
pm_sz ) ) != 0 ) {
425 DBGC (
image,
"bzImage %s could not prepare PM segment: %s\n",
460 DBGC (
image,
"bzImage %s jumping to RM kernel at %04x:0000 (stack "
struct arbelprm_rc_send_wqe rc
__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))
unsigned long long uint64_t
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" retur dest)
#define assert(condition)
Assert a condition at run-time.
static int bzimage_parse_cmdline(struct image *image, struct bzimage_context *bzimg)
Parse kernel command line for bootloader parameters.
int bzimage_probe(struct image *image)
Probe bzImage image.
static void bzimage_load_initrds(struct image *image, struct bzimage_context *bzimg)
Load initrds, if any.
static void bzimage_update_header(struct image *image, struct bzimage_context *bzimg)
Update bzImage header in loaded kernel.
static void bzimage_set_cmdline(struct image *image, struct bzimage_context *bzimg)
Set command line.
static int bzimage_check_initrds(struct image *image, struct bzimage_context *bzimg)
Check that initrds can be loaded.
static int bzimage_exec(struct image *image)
Execute bzImage image.
static int bzimage_parse_header(struct image *image, struct bzimage_context *bzimg)
Parse bzImage header.
#define BZI_CMDLINE_SIZE
Maximum size of command line.
#define BZI_LOADER_TYPE_IPXE
bzImage boot loader identifier for iPXE
#define BZI_LOAD_HIGH
bzImage "load high" flag
#define BZI_INITRD_MAX
bzImage maximum initrd address for versions < 2.03
#define BZI_CMDLINE_MAGIC
bzImage command line present magic marker value
#define BZI_BOOT_FLAG
bzImage boot flag value
#define BZI_LOAD_HIGH_ADDR
Load address for high-loaded kernels.
#define BZI_VID_MODE_ASK
bzImage special video mode "ask"
#define BZI_ASSUMED_RM_SIZE
Assumed size of real-mode portion (including .bss)
#define BZI_VID_MODE_EXT
bzImage special video mode "ext"
uint16_t syssize
DO NOT USE - for bootsect.S use only.
#define BZI_LOAD_LOW_ADDR
Load address for low-loaded kernels.
#define BZI_VID_MODE_NORMAL
bzImage special video mode "normal"
#define BZI_SIGNATURE
bzImage magic signature value
#define BZI_CMDLINE_OFFSET
Offset of bzImage command-line structure within kernel image.
#define BZI_CAN_USE_HEAP
bzImage "kernel can use heap" flag
#define BZI_HDR_OFFSET
Offset of bzImage header within kernel image.
#define BZI_STACK_SIZE
Amount of stack space to provide.
#define DHCP_EB_FEATURE_BZIMAGE
bzImage format
#define FEATURE_IMAGE
Image formats.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define ENOEXEC
Exec format error.
#define ECANCELED
Operation canceled.
#define ENOBUFS
No buffer space available.
void unregister_image(struct image *image)
Unregister executable image.
const char * image_argument(struct image *image, const char *key)
Find argument within image command line.
static struct image * image_get(struct image *image)
Increment reference count on an image.
#define PROBE_NORMAL
Normal image probe priority.
#define __image_type(probe_order)
An executable image type.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * memset(void *dest, int character, size_t len) __nonnull
static void shutdown_boot(void)
Shut down system for OS boot.
int initrd_region(size_t len, struct memmap_region *region)
Calculate post-reshuffle initrd load region.
void initrd_reshuffle(void)
Reshuffle initrds into desired order at top of memory.
size_t initrd_load_all(void *address)
Load all initrds.
Initial ramdisk (initrd) reshuffling.
#define INITRD_ALIGN
Initial ramdisk chunk alignment.
#define FEATURE(category, text, feature_opt, version)
Declare a feature.
Access to external ("user") memory.
#define REAL_CODE(asm_code_str)
uint32_t end
Ending offset.
__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")
static __always_inline void * real_to_virt(unsigned int segment, unsigned int offset)
Convert segment:offset address to virtual address.
int prep_segment(void *segment, size_t filesz, size_t memsz)
Prepare segment for loading.
Executable image segments.
char * strerror(int errno)
Retrieve string representation of error number.
unsigned long strtoul(const char *string, char **endp, int base)
Convert string to numeric value.
int strcmp(const char *first, const char *second)
Compare strings.
char * strchr(const char *src, int character)
Find character within a string.
bzImage command-line structure used by older kernels
size_t rm_cmdline
Command line (offset from rm_kernel)
size_t cmdline_size
Command line maximum length.
void * pm_kernel
Non-real-mode kernel portion load address.
size_t rm_filesz
Real-mode kernel portion file size.
uint64_t mem_limit
Memory limit.
size_t pm_sz
Non-real-mode kernel portion file and memory size.
size_t rm_heap
Real-mode heap top (offset from rm_kernel)
unsigned int rm_kernel_seg
Real-mode kernel portion load segment address.
void * rm_kernel
Real-mode kernel portion load address.
size_t rm_memsz
Real-mode kernel portion total memory size.
physaddr_t initrd_size
Initrd size.
void * initrd
Initrd address.
unsigned int version
Boot protocol version.
unsigned int vid_mode
Video mode.
An executable image type.
const void * data
Read-only data.
size_t len
Length of raw file image.
char * cmdline
Command line to pass to image.
A memory region descriptor.
uint64_t min
Minimum address in region.
uint64_t max
Maximum address in region.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.