2003-06-24 21:22:11 +04:00
|
|
|
/*
|
2006-03-27 18:50:37 +04:00
|
|
|
* Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de.
|
2004-11-15 20:59:15 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2003-06-24 21:22:11 +04:00
|
|
|
#ifndef KERNEL_BOOT_PLATFORM_H
|
|
|
|
#define KERNEL_BOOT_PLATFORM_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <SupportDefs.h>
|
2003-10-14 04:26:04 +04:00
|
|
|
#include <boot/vfs.h>
|
2003-06-24 21:22:11 +04:00
|
|
|
|
|
|
|
|
|
|
|
struct stage2_args;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2003-10-01 05:02:36 +04:00
|
|
|
/* debug functions */
|
2003-06-24 21:22:11 +04:00
|
|
|
extern void panic(const char *format, ...);
|
2003-09-03 21:08:08 +04:00
|
|
|
extern void dprintf(const char *format, ...);
|
|
|
|
|
2003-10-01 05:02:36 +04:00
|
|
|
/* heap functions */
|
2003-10-08 02:10:55 +04:00
|
|
|
extern void platform_release_heap(struct stage2_args *args, void *base);
|
2003-06-24 21:22:11 +04:00
|
|
|
extern status_t platform_init_heap(struct stage2_args *args, void **_base, void **_top);
|
|
|
|
|
2003-10-16 21:55:21 +04:00
|
|
|
/* MMU/memory functions */
|
2005-12-29 04:50:23 +03:00
|
|
|
extern status_t platform_allocate_region(void **_virtualAddress, size_t size,
|
|
|
|
uint8 protection, bool exactAddress);
|
2003-10-16 21:55:21 +04:00
|
|
|
extern status_t platform_free_region(void *address, size_t size);
|
2020-09-11 19:46:27 +03:00
|
|
|
extern status_t platform_bootloader_address_to_kernel_address(void *address, addr_t *_result);
|
|
|
|
extern status_t platform_kernel_address_to_bootloader_address(addr_t address, void **_result);
|
2003-10-16 21:55:21 +04:00
|
|
|
|
2004-06-18 19:25:32 +04:00
|
|
|
/* boot options */
|
|
|
|
#define BOOT_OPTION_MENU 1
|
|
|
|
#define BOOT_OPTION_DEBUG_OUTPUT 2
|
|
|
|
|
|
|
|
extern uint32 platform_boot_options(void);
|
|
|
|
|
2003-10-01 05:02:36 +04:00
|
|
|
/* misc functions */
|
2004-06-22 04:27:04 +04:00
|
|
|
extern status_t platform_init_video(void);
|
2004-06-16 17:25:37 +04:00
|
|
|
extern void platform_switch_to_logo(void);
|
|
|
|
extern void platform_switch_to_text_mode(void);
|
2004-04-21 03:41:38 +04:00
|
|
|
extern void platform_start_kernel(void);
|
2004-08-25 19:18:33 +04:00
|
|
|
extern void platform_exit(void);
|
2020-02-20 19:20:54 +03:00
|
|
|
extern void platform_load_ucode(BootVolume& volume);
|
2003-10-01 05:02:36 +04:00
|
|
|
|
2003-06-24 21:22:11 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
2003-10-01 05:02:36 +04:00
|
|
|
|
2004-06-21 19:51:59 +04:00
|
|
|
// these functions have to be implemented in C++
|
|
|
|
|
|
|
|
/* device functions */
|
|
|
|
|
2003-10-01 05:02:36 +04:00
|
|
|
class Node;
|
|
|
|
namespace boot {
|
|
|
|
class Partition;
|
|
|
|
}
|
|
|
|
|
2006-03-27 18:50:37 +04:00
|
|
|
extern status_t platform_add_boot_device(struct stage2_args *args, NodeList *devicesList);
|
2003-10-14 04:26:04 +04:00
|
|
|
extern status_t platform_add_block_devices(struct stage2_args *args, NodeList *devicesList);
|
2021-07-05 01:35:18 +03:00
|
|
|
extern status_t platform_get_boot_partitions(struct stage2_args *args, Node *bootDevice,
|
|
|
|
NodeList *partitions, NodeList *bootPartitions);
|
2004-11-15 20:59:15 +03:00
|
|
|
extern status_t platform_register_boot_device(Node *device);
|
2010-06-13 19:00:45 +04:00
|
|
|
extern void platform_cleanup_devices();
|
2003-10-01 05:02:36 +04:00
|
|
|
|
2004-06-21 19:51:59 +04:00
|
|
|
/* menu functions */
|
|
|
|
|
|
|
|
class Menu;
|
|
|
|
class MenuItem;
|
|
|
|
|
|
|
|
extern void platform_add_menus(Menu *menu);
|
|
|
|
extern void platform_update_menu_item(Menu *menu, MenuItem *item);
|
|
|
|
extern void platform_run_menu(Menu *menu);
|
2011-05-24 07:21:51 +04:00
|
|
|
extern size_t platform_get_user_input_text(Menu *menu, MenuItem *item,
|
2011-05-19 05:38:02 +04:00
|
|
|
char *buffer, size_t bufferSize);
|
2011-06-13 03:31:57 +04:00
|
|
|
extern char* platform_debug_get_log_buffer(size_t* _size);
|
2004-06-21 19:51:59 +04:00
|
|
|
|
2003-06-24 21:22:11 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* KERNEL_BOOT_PLATFORM_H */
|