1 /******************************************************************************
2 * Copyright (c) 2004, 2011 IBM Corporation
4 * This program and the accompanying materials
5 * are made available under the terms of the BSD License
6 * which accompanies this distribution, and is available at
7 * http://www.opensource.org/licenses/bsd-license.php
10 * IBM Corporation - initial implementation
11 *****************************************************************************/
16 #include <netapps/netapps.h>
17 #include <libbootmsg.h>
19 #ifdef SNK_BIOSEMU_APPS
20 #include "biosemu/biosemu.h"
21 #include "biosemu/vbe.h"
24 extern void _callback_entry(void);
25 int callback(int argc, char *argv[]);
29 main(int argc, char *argv[])
32 of_set_callback((void *) &_callback_entry);
34 if (strcmp(argv[0], "netboot") == 0 && argc >= 5)
35 return netboot(argc, argv);
36 if (strcmp(argv[0], "ping") == 0)
37 return ping(argc, argv);
38 #ifdef SNK_BIOSEMU_APPS
39 // BIOS Emulator applications
40 if (strcmp(argv[0], "biosemu") == 0)
41 return biosemu(argc, argv);
42 if (strcmp(argv[0], "get_vbe_info") == 0)
43 return vbe_get_info(argc, argv);
46 printf("Unknown client application called\n");
47 for (i = 0; i < argc; i++)
48 printf("argv[%d] %s\n", i, argv[i]);
54 callback(int argc, char *argv[])
61 * Register your application's callback handler here, similar to
62 * the way you would register an application.
63 * Please note that callback functions can be called safely only after
64 * your application has called of_yield(). If you return or exit() from
65 * your client application, the callback can no longer be used.
68 if (strcmp(argv[0], "example") == 0)
69 return example(argc, argv);
72 printf("No such callback function\n");
73 for (i = 0; i < argc; i++)
74 printf("argv[%d] %s\n", i, argv[i]);