xref: /haiku/headers/private/kernel/boot/kernel_args.h (revision 294711f98c107cf2d9d05b7fc34cd863e87bd358)
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/FixedWidthPointer.h>
22 
23 
24 #define CURRENT_KERNEL_ARGS_VERSION	1
25 #define MAX_KERNEL_ARGS_RANGE		20
26 
27 // names of common boot_volume fields
28 #define BOOT_METHOD						"boot method"
29 #define BOOT_VOLUME_USER_SELECTED		"user selected"
30 #define BOOT_VOLUME_BOOTED_FROM_IMAGE	"booted from image"
31 #define BOOT_VOLUME_PARTITION_OFFSET	"partition offset"
32 #define BOOT_VOLUME_DISK_IDENTIFIER		"disk identifier"
33 
34 // boot methods
35 enum {
36 	BOOT_METHOD_HARD_DISK	= 0,
37 	BOOT_METHOD_CD			= 1,
38 	BOOT_METHOD_NET			= 2,
39 
40 	BOOT_METHOD_DEFAULT		= BOOT_METHOD_HARD_DISK
41 };
42 
43 typedef struct kernel_args {
44 	uint32		kernel_args_size;
45 	uint32		version;
46 
47 	FixedWidthPointer<struct preloaded_image> kernel_image;
48 	FixedWidthPointer<struct preloaded_image> preloaded_images;
49 
50 	uint32		num_physical_memory_ranges;
51 	addr_range	physical_memory_range[MAX_PHYSICAL_MEMORY_RANGE];
52 	uint32		num_physical_allocated_ranges;
53 	addr_range	physical_allocated_range[MAX_PHYSICAL_ALLOCATED_RANGE];
54 	uint32		num_virtual_allocated_ranges;
55 	addr_range	virtual_allocated_range[MAX_VIRTUAL_ALLOCATED_RANGE];
56 	uint32		num_kernel_args_ranges;
57 	addr_range	kernel_args_range[MAX_KERNEL_ARGS_RANGE];
58 	uint64		ignored_physical_memory;
59 
60 	uint32		num_cpus;
61 	addr_range	cpu_kstack[MAX_BOOT_CPUS];
62 
63 	// boot volume KMessage data
64 	FixedWidthPointer<void> boot_volume;
65 	int32		boot_volume_size;
66 
67 	FixedWidthPointer<struct driver_settings_file> driver_settings;
68 
69 	struct {
70 		addr_range	physical_buffer;
71 		uint32	bytes_per_row;
72 		uint16	width;
73 		uint16	height;
74 		uint8	depth;
75 		bool	enabled;
76 	} frame_buffer;
77 
78 	FixedWidthPointer<void> vesa_modes;
79 	uint16		vesa_modes_size;
80 	uint8		vesa_capabilities;
81 	FixedWidthPointer<void> edid_info;
82 
83 	FixedWidthPointer<void> debug_output;
84 	uint32		debug_size;
85 	bool		keep_debug_output_buffer;
86 
87 	platform_kernel_args platform_args;
88 	arch_kernel_args arch_args;
89 
90 	// bootsplash data
91 	FixedWidthPointer<uint8> boot_splash;
92 
93 } _PACKED kernel_args;
94 
95 #endif	/* KERNEL_BOOT_KERNEL_ARGS_H */
96