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