xref: /haiku/headers/private/kernel/boot/kernel_args.h (revision 1294543de9ac0eff000eaea1b18368c36435d08e)
1 /*
2  * Copyright 2002-2009, Axel Dörfler, axeld@pinc-software.de.
3  * Distributed under the terms of the MIT License.
4  *
5  * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
6  * Distributed under the terms of the NewOS License.
7  */
8 #ifndef KERNEL_BOOT_KERNEL_ARGS_H
9 #define KERNEL_BOOT_KERNEL_ARGS_H
10 
11 
12 #include <SupportDefs.h>
13 
14 #include <boot/elf.h>
15 #include <boot/disk_identifier.h>
16 #include <boot/driver_settings.h>
17 
18 #include <platform_kernel_args.h>
19 #include <arch_kernel_args.h>
20 
21 #include <util/KMessage.h>
22 
23 #define CURRENT_KERNEL_ARGS_VERSION	1
24 #define MAX_KERNEL_ARGS_RANGE		20
25 
26 // names of common boot_volume fields
27 #define BOOT_METHOD						"boot method"
28 #define BOOT_VOLUME_USER_SELECTED		"user selected"
29 #define BOOT_VOLUME_BOOTED_FROM_IMAGE	"booted from image"
30 #define BOOT_VOLUME_PARTITION_OFFSET	"partition offset"
31 #define BOOT_VOLUME_DISK_IDENTIFIER		"disk identifier"
32 
33 // boot methods
34 enum {
35 	BOOT_METHOD_HARD_DISK	= 0,
36 	BOOT_METHOD_CD			= 1,
37 	BOOT_METHOD_NET			= 2,
38 
39 	BOOT_METHOD_DEFAULT		= BOOT_METHOD_HARD_DISK
40 };
41 
42 typedef struct kernel_args {
43 	uint32		kernel_args_size;
44 	uint32		version;
45 
46 	struct preloaded_image kernel_image;
47 	struct preloaded_image *preloaded_images;
48 
49 	uint32			num_physical_memory_ranges;
50 	phys_addr_range	physical_memory_range[MAX_PHYSICAL_MEMORY_RANGE];
51 	uint32			num_physical_allocated_ranges;
52 	phys_addr_range	physical_allocated_range[MAX_PHYSICAL_ALLOCATED_RANGE];
53 	uint32			num_virtual_allocated_ranges;
54 	addr_range		virtual_allocated_range[MAX_VIRTUAL_ALLOCATED_RANGE];
55 	uint32			num_kernel_args_ranges;
56 	addr_range		kernel_args_range[MAX_KERNEL_ARGS_RANGE];
57 	uint64			ignored_physical_memory;
58 
59 	uint32		num_cpus;
60 	addr_range	cpu_kstack[MAX_BOOT_CPUS];
61 
62 	KMessage	boot_volume;
63 
64 	struct driver_settings_file *driver_settings;
65 
66 	struct {
67 		phys_addr_range	physical_buffer;
68 		uint32	bytes_per_row;
69 		uint16	width;
70 		uint16	height;
71 		uint8	depth;
72 		bool	enabled;
73 	} frame_buffer;
74 
75 	void		*vesa_modes;
76 	uint16		vesa_modes_size;
77 	uint8		vesa_capabilities;
78 	void		*edid_info;
79 
80 	void		*debug_output;
81 	uint32		debug_size;
82 	bool		keep_debug_output_buffer;
83 
84 	platform_kernel_args platform_args;
85 	arch_kernel_args arch_args;
86 
87 	// bootsplash data
88 	uint8 		*boot_splash;
89 
90 } kernel_args;
91 
92 #endif	/* KERNEL_BOOT_KERNEL_ARGS_H */
93