iPXE
comboot_call.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2008 Daniel Verkamp <daniel@drv.nu>.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
18 */
19
20/**
21 * @file SYSLINUX COMBOOT API
22 *
23 */
24
25FILE_LICENCE ( GPL2_OR_LATER );
26
27#include <errno.h>
28#include <realmode.h>
29#include <biosint.h>
30#include <ipxe/console.h>
31#include <stdlib.h>
32#include <comboot.h>
33#include <bzimage.h>
34#include <pxe_call.h>
35#include <rmsetjmp.h>
36#include <string.h>
37#include <ipxe/posix_io.h>
38#include <ipxe/process.h>
39#include <ipxe/serial.h>
40#include <ipxe/ns16550.h>
41#include <ipxe/init.h>
42#include <ipxe/image.h>
43#include <ipxe/version.h>
44#include <usr/imgmgmt.h>
45
46/** The "SYSLINUX" version string */
47static char __bss16_array ( syslinux_version, [32] );
48#define syslinux_version __use_data16 ( syslinux_version )
49
50/** The "SYSLINUX" copyright string */
51static char __data16_array ( syslinux_copyright, [] ) = " https://ipxe.org";
52#define syslinux_copyright __use_data16 ( syslinux_copyright )
53
55#define syslinux_configuration_file __use_data16 ( syslinux_configuration_file )
56
57/** Feature flags */
59#define comboot_feature_flags __use_data16 ( comboot_feature_flags )
60
64
65/** Initial register values for INT 22h AX=1Ah and 1Bh */
67#define comboot_initial_regs __use_text16 ( comboot_initial_regs )
68
69static struct segoff __text16 ( int20_vector );
70#define int20_vector __use_text16 ( int20_vector )
71
72static struct segoff __text16 ( int21_vector );
73#define int21_vector __use_text16 ( int21_vector )
74
75static struct segoff __text16 ( int22_vector );
76#define int22_vector __use_text16 ( int22_vector )
77
78extern void int20_wrapper ( void );
79extern void int21_wrapper ( void );
80extern void int22_wrapper ( void );
81
82/* setjmp/longjmp context buffer used to return after loading an image */
84
85/* Mode flags set by INT 22h AX=0017h */
87
88/**
89 * Print a string with a particular terminator
90 */
91static void print_user_string ( unsigned int segment, unsigned int offset, char terminator ) {
92 char *c;
93 for ( c = real_to_virt ( segment, offset ) ; *c != terminator ; c++ ) {
94 putchar ( *c );
95 }
96}
97
98
99/**
100 * Perform a series of memory copies from a list in low memory
101 */
102static void shuffle ( unsigned int list_segment, unsigned int list_offset, unsigned int count )
103{
105 unsigned int i;
106
107 /* Copy shuffle descriptor list so it doesn't get overwritten */
108 memcpy ( shuf, real_to_virt ( list_segment, list_offset ),
109 count * sizeof( comboot_shuffle_descriptor ) );
110
111 /* Do the copies */
112 for ( i = 0; i < count; i++ ) {
113 const void *src = phys_to_virt ( shuf[ i ].src );
114 void *dest = phys_to_virt ( shuf[ i ].dest );
115
116 if ( shuf[ i ].src == 0xFFFFFFFF ) {
117 /* Fill with 0 instead of copying */
118 memset ( dest, 0, shuf[ i ].len );
119 } else if ( shuf[ i ].dest == 0xFFFFFFFF ) {
120 /* Copy new list of descriptors */
121 count = shuf[ i ].len / sizeof( comboot_shuffle_descriptor );
123 memcpy ( shuf, src, shuf[ i ].len );
124 i = -1;
125 } else {
126 /* Regular copy */
127 memmove ( dest, src, shuf[ i ].len );
128 }
129 }
130}
131
132
133/**
134 * Set default text mode
135 */
138 /* Set VGA mode 3 via VESA VBE mode set */
140 REAL_CODE (
141 "mov $0x4F02, %%ax\n\t"
142 "mov $0x03, %%bx\n\t"
143 "int $0x10\n\t"
144 )
145 : : );
147 /* Set VGA mode 3 via standard VGA mode set */
149 REAL_CODE (
150 "mov $0x03, %%ax\n\t"
151 "int $0x10\n\t"
152 )
153 : : );
154 }
155
157}
158
159
160/**
161 * Fetch kernel and optional initrd
162 */
163static int comboot_fetch_kernel ( const char *kernel_file, char *cmdline ) {
164 struct image *kernel;
165 struct image *initrd;
166 char *initrd_file;
167 int rc;
168
169 /* Find initrd= parameter, if any */
170 if ( ( initrd_file = strstr ( cmdline, "initrd=" ) ) != NULL ) {
171 char *initrd_end;
172
173 /* skip "initrd=" */
174 initrd_file += 7;
175
176 /* Find terminating space, if any, and replace with NUL */
177 initrd_end = strchr ( initrd_file, ' ' );
178 if ( initrd_end )
179 *initrd_end = '\0';
180
181 DBG ( "COMBOOT: fetching initrd '%s'\n", initrd_file );
182
183 /* Fetch initrd */
184 if ( ( rc = imgdownload_string ( initrd_file, 0,
185 &initrd ) ) != 0 ) {
186 DBG ( "COMBOOT: could not fetch initrd: %s\n",
187 strerror ( rc ) );
188 return rc;
189 }
190
191 /* Restore space after initrd name, if applicable */
192 if ( initrd_end )
193 *initrd_end = ' ';
194 }
195
196 DBG ( "COMBOOT: fetching kernel '%s'\n", kernel_file );
197
198 /* Fetch kernel */
199 if ( ( rc = imgdownload_string ( kernel_file, 0, &kernel ) ) != 0 ) {
200 DBG ( "COMBOOT: could not fetch kernel: %s\n",
201 strerror ( rc ) );
202 return rc;
203 }
204
205 /* Replace comboot image with kernel */
206 if ( ( rc = image_replace ( kernel ) ) != 0 ) {
207 DBG ( "COMBOOT: could not replace with kernel: %s\n",
208 strerror ( rc ) );
209 return rc;
210 }
211
212 return 0;
213}
214
215
216/**
217 * Terminate program interrupt handler
218 */
219static __asmcall __used void int20 ( struct i386_all_regs *ix86 __unused ) {
221}
222
223
224/**
225 * DOS-compatible API
226 */
227static __asmcall __used void int21 ( struct i386_all_regs *ix86 ) {
228 ix86->flags |= CF;
229
230 switch ( ix86->regs.ah ) {
231 case 0x00:
232 case 0x4C: /* Terminate program */
234 break;
235
236 case 0x01: /* Get Key with Echo */
237 case 0x08: /* Get Key without Echo */
238 /* TODO: handle extended characters? */
239 ix86->regs.al = getchar( );
240
241 /* Enter */
242 if ( ix86->regs.al == 0x0A )
243 ix86->regs.al = 0x0D;
244
245 if ( ix86->regs.ah == 0x01 )
246 putchar ( ix86->regs.al );
247
248 ix86->flags &= ~CF;
249 break;
250
251 case 0x02: /* Write Character */
252 putchar ( ix86->regs.dl );
253 ix86->flags &= ~CF;
254 break;
255
256 case 0x04: /* Write Character to Serial Port */
257 if ( serial_console ) {
258 uart_transmit ( serial_console, ix86->regs.dl );
259 ix86->flags &= ~CF;
260 }
261 break;
262
263 case 0x09: /* Write DOS String to Console */
264 print_user_string ( ix86->segs.ds, ix86->regs.dx, '$' );
265 ix86->flags &= ~CF;
266 break;
267
268 case 0x0B: /* Check Keyboard */
269 if ( iskey() )
270 ix86->regs.al = 0xFF;
271 else
272 ix86->regs.al = 0x00;
273
274 ix86->flags &= ~CF;
275 break;
276
277 case 0x30: /* Check DOS Version */
278 /* Bottom halves all 0; top halves spell "SYSLINUX" */
279 ix86->regs.eax = 0x59530000;
280 ix86->regs.ebx = 0x4C530000;
281 ix86->regs.ecx = 0x4E490000;
282 ix86->regs.edx = 0x58550000;
283 ix86->flags &= ~CF;
284 break;
285
286 default:
287 DBG ( "COMBOOT unknown int21 function %02x\n", ix86->regs.ah );
288 break;
289 }
290}
291
292
293/**
294 * Dispatch PXE API call weakly
295 *
296 * @v ix86 Registers for PXE call
297 * @ret present Zero if the PXE stack is present, nonzero if not
298 *
299 * A successful return only indicates that the PXE stack was available
300 * for dispatching the call; it says nothing about the success of
301 * whatever the call asked for.
302 */
304 return -1;
305}
306
307/**
308 * SYSLINUX API
309 */
310static __asmcall __used void int22 ( struct i386_all_regs *ix86 ) {
311 ix86->flags |= CF;
312
313 switch ( ix86->regs.ax ) {
314 case 0x0001: /* Get Version */
315
316 /* Number of INT 22h API functions available */
317 ix86->regs.ax = 0x001D;
318
319 /* SYSLINUX version number */
320 ix86->regs.ch = 0; /* major */
321 ix86->regs.cl = 0; /* minor */
322
323 /* SYSLINUX derivative ID */
325
326 /* SYSLINUX version */
328 "\r\niPXE %s", product_version );
329
330 /* SYSLINUX version and copyright strings */
331 ix86->segs.es = rm_ds;
332 ix86->regs.si = ( ( unsigned ) __from_data16 ( syslinux_version ) );
333 ix86->regs.di = ( ( unsigned ) __from_data16 ( syslinux_copyright ) );
334
335 ix86->flags &= ~CF;
336 break;
337
338 case 0x0002: /* Write String */
339 print_user_string ( ix86->segs.es, ix86->regs.bx, '\0' );
340 ix86->flags &= ~CF;
341 break;
342
343 case 0x0003: /* Run command */
344 {
345 const char *cmd = real_to_virt ( ix86->segs.es,
346 ix86->regs.bx );
347 DBG ( "COMBOOT: executing command '%s'\n", cmd );
348 system ( cmd );
349 DBG ( "COMBOOT: exiting after executing command...\n" );
351 }
352 break;
353
354 case 0x0004: /* Run default command */
355 /* FIXME: just exit for now */
357 break;
358
359 case 0x0005: /* Force text mode */
361 ix86->flags &= ~CF;
362 break;
363
364 case 0x0006: /* Open file */
365 {
366 int fd;
367 const char *file = real_to_virt ( ix86->segs.es,
368 ix86->regs.si );
369
370 if ( file[0] == '\0' ) {
371 DBG ( "COMBOOT: attempted open with empty file name\n" );
372 break;
373 }
374
375 DBG ( "COMBOOT: opening file '%s'\n", file );
376
377 fd = open ( file );
378
379 if ( fd < 0 ) {
380 DBG ( "COMBOOT: error opening file %s\n", file );
381 break;
382 }
383
384 /* This relies on the fact that a iPXE POSIX fd will
385 * always fit in 16 bits.
386 */
387#if (POSIX_FD_MAX > 65535)
388#error POSIX_FD_MAX too large
389#endif
390 ix86->regs.si = (uint16_t) fd;
391
393 ix86->regs.eax = fsize ( fd );
394 ix86->flags &= ~CF;
395 }
396 break;
397
398 case 0x0007: /* Read file */
399 {
400 int fd = ix86->regs.si;
401 int len = ix86->regs.cx * COMBOOT_FILE_BLOCKSZ;
402 int rc;
403 fd_set fds;
404 void *buf = real_to_virt ( ix86->segs.es,
405 ix86->regs.bx );
406
407 /* Wait for data ready to read */
408 FD_ZERO ( &fds );
409 FD_SET ( fd, &fds );
410
411 select ( &fds, 1 );
412
413 rc = read ( fd, buf, len );
414 if ( rc < 0 ) {
415 DBG ( "COMBOOT: read failed\n" );
416 ix86->regs.si = 0;
417 break;
418 }
419
420 ix86->regs.ecx = rc;
421 ix86->flags &= ~CF;
422 }
423 break;
424
425 case 0x0008: /* Close file */
426 {
427 int fd = ix86->regs.si;
428 close ( fd );
429 ix86->flags &= ~CF;
430 }
431 break;
432
433 case 0x0009: /* Call PXE Stack */
434 if ( pxe_api_call_weak ( ix86 ) != 0 )
435 ix86->flags |= CF;
436 else
437 ix86->flags &= ~CF;
438 break;
439
440 case 0x000A: /* Get Derivative-Specific Information */
441
442 /* iPXE has its own derivative ID, so there is no defined
443 * output here; just return AL for now */
445 ix86->flags &= ~CF;
446 break;
447
448 case 0x000B: /* Get Serial Console Configuration */
449 if ( serial_console ) {
450 struct ns16550_uart *comport = serial_console->priv;
451
452 ix86->regs.dx = ( ( intptr_t ) comport->base );
453 ix86->regs.cx = comport->divisor;
454 ix86->regs.bx = 0;
455 ix86->flags &= ~CF;
456 }
457 break;
458
459 case 0x000C: /* Perform final cleanup */
461 break;
462
463 case 0x000E: /* Get configuration file name */
464 /* FIXME: stub */
465 ix86->segs.es = rm_ds;
466 ix86->regs.bx = ( ( unsigned ) __from_data16 ( syslinux_configuration_file ) );
467 ix86->flags &= ~CF;
468 break;
469
470 case 0x000F: /* Get IPAPPEND strings */
471 /* FIXME: stub */
472 ix86->regs.cx = 0;
473 ix86->segs.es = 0;
474 ix86->regs.bx = 0;
475 ix86->flags &= ~CF;
476 break;
477
478 case 0x0010: /* Resolve hostname */
479 {
480 const char *hostname = real_to_virt ( ix86->segs.es,
481 ix86->regs.bx );
482 struct in_addr addr;
483
484 /* TODO:
485 * "If the hostname does not contain a dot (.), the
486 * local domain name is automatically appended."
487 */
488
489 comboot_resolv ( hostname, &addr );
490
491 ix86->regs.eax = addr.s_addr;
492 ix86->flags &= ~CF;
493 }
494 break;
495
496 case 0x0011: /* Maximum number of shuffle descriptors */
498 ix86->flags &= ~CF;
499 break;
500
501 case 0x0012: /* Cleanup, shuffle and boot */
503 break;
504
505 /* Perform final cleanup */
507
508 /* Perform sequence of copies */
509 shuffle ( ix86->segs.es, ix86->regs.di, ix86->regs.cx );
510
511 /* Jump to real-mode entry point */
513 REAL_CODE (
514 "pushw %0\n\t"
515 "popw %%ds\n\t"
516 "pushl %1\n\t"
517 "lret\n\t"
518 )
519 :
520 : "R" ( ix86->segs.ds ),
521 "R" ( ix86->regs.ebp ),
522 "d" ( ix86->regs.ebx ),
523 "S" ( ix86->regs.esi ) );
524
525 assert ( 0 ); /* Execution should never reach this point */
526
527 break;
528
529 case 0x0013: /* Idle loop call */
530 step ( );
531 ix86->flags &= ~CF;
532 break;
533
534 case 0x0015: /* Get feature flags */
535 ix86->segs.es = rm_ds;
536 ix86->regs.bx = ( ( unsigned ) __from_data16 ( &comboot_feature_flags ) );
537 ix86->regs.cx = 1; /* Number of feature flag bytes */
538 ix86->flags &= ~CF;
539 break;
540
541 case 0x0016: /* Run kernel image */
542 {
543 const char *file = real_to_virt ( ix86->segs.ds,
544 ix86->regs.si );
545 char *cmd = real_to_virt ( ix86->segs.es,
546 ix86->regs.bx );
547
548 DBG ( "COMBOOT: run kernel %s %s\n", file, cmd );
549 comboot_fetch_kernel ( file, cmd );
550 /* Technically, we should return if we
551 * couldn't load the kernel, but it's not safe
552 * to do that since we have just overwritten
553 * part of the COMBOOT program's memory space.
554 */
555 DBG ( "COMBOOT: exiting to run kernel...\n" );
557 }
558 break;
559
560 case 0x0017: /* Report video mode change */
562 ix86->flags &= ~CF;
563 break;
564
565 case 0x0018: /* Query custom font */
566 /* FIXME: stub */
567 ix86->regs.al = 0;
568 ix86->segs.es = 0;
569 ix86->regs.bx = 0;
570 ix86->flags &= ~CF;
571 break;
572
573 case 0x001B: /* Cleanup, shuffle and boot to real mode */
575 break;
576
577 /* Perform final cleanup */
579
580 /* Perform sequence of copies */
581 shuffle ( ix86->segs.es, ix86->regs.di, ix86->regs.cx );
582
583 /* Copy initial register values to .text16 */
585 real_to_virt ( ix86->segs.ds, ix86->regs.si ),
586 sizeof(syslinux_rm_regs) );
587
588 /* Load initial register values */
590 REAL_CODE (
591 /* Point SS:SP at the register value structure */
592 "pushw %%cs\n\t"
593 "popw %%ss\n\t"
594 "movw $comboot_initial_regs, %%sp\n\t"
595
596 /* Segment registers */
597 "popw %%es\n\t"
598 "popw %%ax\n\t" /* Skip CS */
599 "popw %%ds\n\t"
600 "popw %%ax\n\t" /* Skip SS for now */
601 "popw %%fs\n\t"
602 "popw %%gs\n\t"
603
604 /* GP registers */
605 "popl %%eax\n\t"
606 "popl %%ecx\n\t"
607 "popl %%edx\n\t"
608 "popl %%ebx\n\t"
609 "popl %%ebp\n\t" /* Skip ESP for now */
610 "popl %%ebp\n\t"
611 "popl %%esi\n\t"
612 "popl %%edi\n\t"
613
614 /* Load correct SS:ESP */
615 "movw $(comboot_initial_regs + 6), %%sp\n\t"
616 "popw %%ss\n\t"
617 "movl %%cs:(comboot_initial_regs + 28), %%esp\n\t"
618
619 "ljmp *%%cs:(comboot_initial_regs + 44)\n\t"
620 )
621 : : );
622
623 break;
624
625 case 0x001C: /* Get pointer to auxilliary data vector */
626 /* FIXME: stub */
627 ix86->regs.cx = 0; /* Size of the ADV */
628 ix86->flags &= ~CF;
629 break;
630
631 case 0x001D: /* Write auxilliary data vector */
632 /* FIXME: stub */
633 ix86->flags &= ~CF;
634 break;
635
636 default:
637 DBG ( "COMBOOT unknown int22 function %04x\n", ix86->regs.ax );
638 break;
639 }
640}
641
642/**
643 * Hook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)
644 */
646
648 TEXT16_CODE ( "\nint20_wrapper:\n\t"
649 VIRT_CALL ( int20 )
650 "clc\n\t"
651 "call patch_cf\n\t"
652 "iret\n\t" ) : );
653
655
657 TEXT16_CODE ( "\nint21_wrapper:\n\t"
658 VIRT_CALL ( int21 )
659 "clc\n\t"
660 "call patch_cf\n\t"
661 "iret\n\t" ) : );
662
664
666 TEXT16_CODE ( "\nint22_wrapper:\n\t"
667 VIRT_CALL ( int22 )
668 "clc\n\t"
669 "call patch_cf\n\t"
670 "iret\n\t" ) : );
671
673}
674
675/**
676 * Unhook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)
677 */
689
690/* Avoid dragging in serial console support unconditionally */
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
struct golan_eqe_cmd cmd
Definition CIB_PRM.h:1
struct arbelprm_rc_send_wqe rc
Definition arbel.h:3
#define __asmcall
Declare a function with standard calling conventions.
Definition compiler.h:15
__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 short uint16_t
Definition stdint.h:11
unsigned long intptr_t
Definition stdint.h:21
unsigned char uint8_t
Definition stdint.h:10
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)
Definition string.h:151
static const void * src
Definition string.h:48
#define assert(condition)
Assert a condition at run-time.
Definition assert.h:50
void hook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Hook INT vector.
Definition biosint.c:25
int unhook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Unhook INT vector.
Definition biosint.c:70
#define BZI_LOADER_TYPE_IPXE
bzImage boot loader identifier for iPXE
Definition bzimage.h:93
uint16_t offset
Offset to command line.
Definition bzimage.h:3
SYSLINUX COMBOOT.
#define COMBOOT_FEATURE_IDLE_LOOP
Definition comboot.h:30
#define COMBOOT_EXIT
Definition comboot.h:119
#define COMBOOT_EXIT_COMMAND
Definition comboot.h:121
#define COMBOOT_MAX_SHUFFLE_DESCRIPTORS
Maximum number of shuffle descriptors for shuffle and boot functions (INT 22h AX=0012h,...
Definition comboot.h:36
#define COMBOOT_FILE_BLOCKSZ
Size of SYSLINUX file block in bytes.
Definition comboot.h:26
#define COMBOOT_VIDEO_GRAPHICS
Definition comboot.h:125
#define COMBOOT_EXIT_RUN_KERNEL
Definition comboot.h:120
#define COMBOOT_VIDEO_VESA
Definition comboot.h:127
void unhook_comboot_interrupts()
Unhook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)
static __asmcall __used void int20(struct i386_all_regs *ix86 __unused)
Terminate program interrupt handler.
#define int22_vector
#define comboot_feature_flags
rmjmp_buf comboot_return
static __asmcall __used void int22(struct i386_all_regs *ix86)
SYSLINUX API.
#define int21_vector
void hook_comboot_interrupts()
Hook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)
__weak int pxe_api_call_weak(struct i386_all_regs *ix86 __unused)
Dispatch PXE API call weakly.
void comboot_force_text_mode(void)
Set default text mode.
static void print_user_string(unsigned int segment, unsigned int offset, char terminator)
Print a string with a particular terminator.
#define syslinux_configuration_file
void int22_wrapper(void)
void int20_wrapper(void)
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.
#define comboot_initial_regs
static int comboot_fetch_kernel(const char *kernel_file, char *cmdline)
Fetch kernel and optional initrd.
#define syslinux_version
static __asmcall __used void int21(struct i386_all_regs *ix86)
DOS-compatible API.
static uint16_t comboot_graphics_mode
void int21_wrapper(void)
#define int20_vector
#define syslinux_copyright
int comboot_resolv(const char *name, struct in_addr *address)
int getchar(void)
Read a single character from any console.
Definition console.c:86
int iskey(void)
Check for available input on any console.
Definition console.c:131
int putchar(int character)
Write a single character to each console device.
Definition console.c:29
ring len
Length.
Definition dwmac.h:226
uint32_t addr
Buffer address.
Definition dwmac.h:9
uint32_t kernel
Kernel version (numeric)
Definition ena.h:9
Error codes.
struct eth_slow_terminator_tlv terminator
Terminator.
Definition eth_slow.h:9
uint8_t system[ETH_ALEN]
System identifier.
Definition eth_slow.h:13
#define __used
Declare a function as used.
Definition compiler.h:605
#define __unused
Declare a variable or data structure as unused.
Definition compiler.h:573
#define DBG(...)
Print a debugging message.
Definition compiler.h:498
static unsigned int count
Number of entries.
Definition dwmac.h:220
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
int image_replace(struct image *replacement)
Set replacement image.
Definition image.c:529
Executable images.
int imgdownload_string(const char *uri_string, unsigned long timeout, struct image **image)
Download a new image.
Definition imgmgmt.c:121
Image management.
#define __weak
Declare a function as weak (use before the definition)
Definition compiler.h:219
#define __attribute__(x)
Definition compiler.h:10
User interaction.
16550-compatible UART
Serial console.
String functions.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * memset(void *dest, int character, size_t len) __nonnull
void * memmove(void *dest, const void *src, size_t len) __nonnull
static void shutdown_boot(void)
Shut down system for OS boot.
Definition init.h:78
static physaddr_t initrd_end
End of reshuffle region.
Definition initrd.c:42
Version number.
#define rm_ds
Definition libkir.h:39
#define __data16(variable)
Definition libkir.h:14
#define __from_text16(pointer)
Definition libkir.h:23
#define REAL_CODE(asm_code_str)
Definition libkir.h:226
#define rm_cs
Definition libkir.h:38
#define TEXT16_CODE(asm_code_str)
Definition libkir.h:217
#define __data16_array(variable, array)
Definition libkir.h:15
#define __text16(variable)
Definition libkir.h:18
#define __from_data16(pointer)
Definition libkir.h:22
#define __bss16_array(variable, array)
Definition libkir.h:17
#define VIRT_CALL(function)
Call C function from real-mode code.
Definition librm.h:72
uint16_t segment
Code segment.
Definition librm.h:3
uint32_t cmdline
Definition multiboot.h:4
struct option_descriptor read[1]
Definition nvo_cmd.c:116
int select(fd_set *readfds, int wait)
Check file descriptors for readiness.
Definition posix_io.c:229
ssize_t fsize(int fd)
Determine file size.
Definition posix_io.c:310
int open(const char *uri_string)
Open file.
Definition posix_io.c:176
POSIX-like I/O.
uint32_t fd_set
File descriptor set as used for select()
Definition posix_io.h:21
__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 step(void)
Single-step a single process.
Definition process.c:99
Processes.
int pxe_api_call_weak(struct i386_all_regs *ix86)
Dispatch weak PXE API call with PXE stack available.
Definition pxe_call.c:182
PXE API entry point.
static __always_inline void * real_to_virt(unsigned int segment, unsigned int offset)
Convert segment:offset address to virtual address.
Definition realmode.h:77
#define CF
Definition registers.h:181
#define rmlongjmp(_env, _val)
Definition rmsetjmp.h:22
struct uart * serial_console
Active serial console UART.
Definition serial.c:69
char * strerror(int errno)
Retrieve string representation of error number.
Definition strerror.c:79
char * strchr(const char *src, int character)
Find character within a string.
Definition string.c:272
char * strstr(const char *haystack, const char *needle)
Find substring.
Definition string.c:310
A full register dump.
Definition registers.h:174
uint32_t flags
Definition registers.h:177
struct i386_seg_regs segs
Definition registers.h:175
struct i386_regs regs
Definition registers.h:176
uint16_t ax
Definition registers.h:108
uint16_t bx
Definition registers.h:84
uint8_t cl
Definition registers.h:97
uint8_t ah
Definition registers.h:106
uint8_t ch
Definition registers.h:98
uint16_t si
Definition registers.h:68
uint16_t cx
Definition registers.h:100
uint32_t ecx
Definition registers.h:101
uint32_t edx
Definition registers.h:93
uint8_t al
Definition registers.h:105
uint16_t di
Definition registers.h:64
uint32_t ebp
Definition registers.h:73
uint32_t esi
Definition registers.h:69
uint8_t dl
Definition registers.h:89
uint16_t dx
Definition registers.h:92
uint32_t ebx
Definition registers.h:85
uint32_t eax
Definition registers.h:109
uint16_t ds
Definition registers.h:141
uint16_t es
Definition registers.h:142
An executable image.
Definition image.h:24
IP address structure.
Definition in.h:42
A 16550-compatible UART.
Definition ns16550.h:80
void * base
Register base address.
Definition ns16550.h:82
uint16_t divisor
Baud rate divisor.
Definition ns16550.h:88
A real-mode-extended jump buffer.
Definition rmsetjmp.h:10
A generic UART.
Definition uart.h:17
syslinux_rm_regs rm
syslinux_pm_regs pm
const char product_version[]
Product version string.
Definition version.c:71
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition vsprintf.c:383
static struct evtchn_close * close
Definition xenevent.h:24