1 /* ----------------------------------------------------------------------- *
3 * Copyright 2008 H. Peter Anvin - All Rights Reserved
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
8 * Boston MA 02110-1301, USA; either version 2 of the License, or
9 * (at your option) any later version; incorporated herein by reference.
11 * ----------------------------------------------------------------------- */
16 * Invoke an arbitrary gPXE command, if available.
31 struct s_PXENV_FILE_EXEC
{
33 struct segoff16 Command
;
36 static void gpxecmd(const char **args
)
39 struct s_PXENV_FILE_EXEC
*fx
;
42 memset(®
, 0, sizeof reg
);
44 fx
= __com32
.cs_bounce
;
48 fx
->Command
.offs
= OFFS(q
);
49 fx
->Command
.seg
= SEG(q
);
58 memset(®
, 0, sizeof reg
);
59 reg
.eax
.w
[0] = 0x0009;
60 reg
.ebx
.w
[0] = 0x00e5; /* PXENV_FILE_EXEC */
61 reg
.edi
.w
[0] = OFFS(fx
);
64 __intcall(0x22, ®
, ®
);
66 /* This should not return... */
69 int main(int argc
, const char *argv
[])
71 openconsole(&dev_null_r
, &dev_stdcon_w
);
74 printf("Usage: gpxecmd command...\n");
79 printf("gpxecmd: gPXE API not detected\n");