xref: /haiku/src/tests/system/boot/loader/platform_start.cpp (revision 21258e2674226d6aa732321b6f8494841895af5f)
1 /*
2  * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <boot/platform.h>
8 #include <boot/kernel_args.h>
9 
10 #include <stdio.h>
11 
12 
13 extern "C" int boot_main(struct stage2_args *args);
14 extern struct kernel_args gKernelArgs;
15 
16 
17 void
18 platform_exit(void)
19 {
20 	puts("*** exit ***\n");
21 	exit(-1);
22 }
23 
24 
25 void
26 platform_start_kernel(void)
27 {
28 	preloaded_elf32_image *image = static_cast<preloaded_elf32_image *>(
29 		gKernelArgs.kernel_image.Pointer());
30 
31 	printf("*** jump to kernel at %p ***\n*** program exits.\n",
32 		(void *)image->elf_header.e_entry);
33 	exit(0);
34 }
35 
36 
37 int
38 main(int argc, char **argv)
39 {
40 	// The command arguments are evaluated in platform_devices.cpp!
41 
42 	stage2_args args;
43 	boot_main(&args);
44 
45 	return 0;
46 }
47