Lines Matching defs:image

22  * SYSLINUX COMBOOT (16-bit) image format
38 #include <gpxe/image.h>
51 /** INT 20 instruction, executed if COMBOOT image returns with RET */
68 * @v image COMBOOT image
70 static void comboot_copy_cmdline ( struct image * image, userptr_t seg_userptr ) {
71 const char *cmdline = ( image->cmdline ? image->cmdline : "" );
101 * @v image COMBOOT image
104 static void comboot_init_psp ( struct image * image, userptr_t seg_userptr ) {
116 DBGC ( image, "COMBOOT %p: first non-free paragraph = 0x%x\n",
117 image, psp.first_non_free_para );
125 comboot_copy_cmdline ( image, seg_userptr );
129 * Execute COMBOOT image
131 * @v image COMBOOT image
134 static int comboot_exec ( struct image *image ) {
144 comboot_init_psp ( image, seg_userptr );
149 DBGC ( image, "executing 16-bit COMBOOT image at %4x:0100\n",
152 /* Unregister image, so that a "boot" command doesn't
157 unregister_image ( image );
160 * in the PSP and jump to the image */
166 /* Set DS=ES=segment with image */
169 /* Set SS:SP to new stack (end of image segment) */
185 DBGC ( image, "COMBOOT %p: returned\n", image );
189 DBGC ( image, "COMBOOT %p: exited\n", image );
193 DBGC ( image, "COMBOOT %p: exited to run kernel %p\n",
194 image, comboot_replacement_image );
195 image->replacement = comboot_replacement_image;
197 image_autoload ( image->replacement );
201 DBGC ( image, "COMBOOT %p: exited after executing command\n",
202 image );
217 * Check image name extension
219 * @v image COMBOOT image
222 static int comboot_identify ( struct image *image ) {
225 ext = strrchr( image->name, '.' );
228 DBGC ( image, "COMBOOT %p: no extension\n",
229 image );
236 DBGC ( image, "COMBOOT %p: unrecognized extension %s\n",
237 image, ext );
245 * Load COMBOOT image into memory, preparing a segment and returning it
246 * @v image COMBOOT image
249 static int comboot_prepare_segment ( struct image *image )
255 /* Load image in segment */
258 /* Allow etra 0x100 bytes before image for PSP */
259 filesz = image->len + 0x100;
266 DBGC ( image, "COMBOOT %p: could not prepare segment: %s\n",
267 image, strerror ( rc ) );
274 /* Copy image to segment:0100 */
275 memcpy_user ( seg_userptr, 0x100, image->data, 0, image->len );
281 * Load COMBOOT image into memory
283 * @v image COMBOOT image
286 static int comboot_load ( struct image *image ) {
289 DBGC ( image, "COMBOOT %p: name '%s'\n",
290 image, image->name );
292 /* Check if this is a COMBOOT image */
293 if ( ( rc = comboot_identify ( image ) ) != 0 ) {
298 /* This is a 16-bit COMBOOT image, valid or otherwise */
299 if ( ! image->type )
300 image->type = &comboot_image_type;
303 if( image->len >= 0xFF00 ) {
304 DBGC( image, "COMBOOT %p: image too large\n",
305 image );
309 /* Prepare segment and load image */
310 if ( ( rc = comboot_prepare_segment ( image ) ) != 0 ) {
317 /** SYSLINUX COMBOOT (16-bit) image type */