177b1fd22SAxel Dörfler /* 2*d013c8e9SAxel Dörfler * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. 377b1fd22SAxel Dörfler * Distributed under the terms of the MIT License. 477b1fd22SAxel Dörfler */ 577b1fd22SAxel Dörfler 677b1fd22SAxel Dörfler 777b1fd22SAxel Dörfler #include <boot/platform.h> 877b1fd22SAxel Dörfler #include <boot/kernel_args.h> 977b1fd22SAxel Dörfler 1077b1fd22SAxel Dörfler #include <stdio.h> 1177b1fd22SAxel Dörfler 1277b1fd22SAxel Dörfler 1377b1fd22SAxel Dörfler extern "C" int boot_main(struct stage2_args *args); 1477b1fd22SAxel Dörfler extern struct kernel_args gKernelArgs; 1577b1fd22SAxel Dörfler 1677b1fd22SAxel Dörfler 1777b1fd22SAxel Dörfler void platform_exit(void)1877b1fd22SAxel Dörflerplatform_exit(void) 1977b1fd22SAxel Dörfler { 2077b1fd22SAxel Dörfler puts("*** exit ***\n"); 2177b1fd22SAxel Dörfler exit(-1); 2277b1fd22SAxel Dörfler } 2377b1fd22SAxel Dörfler 2477b1fd22SAxel Dörfler 2577b1fd22SAxel Dörfler void platform_start_kernel(void)2677b1fd22SAxel Dörflerplatform_start_kernel(void) 2777b1fd22SAxel Dörfler { 28*d013c8e9SAxel Dörfler preloaded_elf32_image *image = static_cast<preloaded_elf32_image *>( 29*d013c8e9SAxel Dörfler gKernelArgs.kernel_image.Pointer()); 30*d013c8e9SAxel Dörfler 31*d013c8e9SAxel Dörfler printf("*** jump to kernel at %p ***\n*** program exits.\n", 32*d013c8e9SAxel Dörfler (void *)image->elf_header.e_entry); 3377b1fd22SAxel Dörfler exit(0); 3477b1fd22SAxel Dörfler } 3577b1fd22SAxel Dörfler 3677b1fd22SAxel Dörfler 3777b1fd22SAxel Dörfler int main(int argc,char ** argv)3877b1fd22SAxel Dörflermain(int argc, char **argv) 3977b1fd22SAxel Dörfler { 4077b1fd22SAxel Dörfler // The command arguments are evaluated in platform_devices.cpp! 4177b1fd22SAxel Dörfler 42d6e44a2aSAxel Dörfler stage2_args args; 43d6e44a2aSAxel Dörfler boot_main(&args); 4477b1fd22SAxel Dörfler 4577b1fd22SAxel Dörfler return 0; 4677b1fd22SAxel Dörfler } 47