xref: /haiku/headers/private/kernel/boot/kernel_args.h (revision 62f5ba006a08b0df30631375878effaf67ae5dbc)
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 	addr_range	physical_memory_range[MAX_PHYSICAL_MEMORY_RANGE];
51 	uint32		num_physical_allocated_ranges;
52 	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 
58 	uint32		num_cpus;
59 	addr_range	cpu_kstack[MAX_BOOT_CPUS];
60 
61 	KMessage	boot_volume;
62 
63 	struct driver_settings_file *driver_settings;
64 
65 	struct {
66 		addr_range physical_buffer;
67 		uint32	bytes_per_row;
68 		uint16	width;
69 		uint16	height;
70 		uint8	depth;
71 		bool	enabled;
72 	} frame_buffer;
73 
74 	void		*vesa_modes;
75 	uint16		vesa_modes_size;
76 	uint8		vesa_capabilities;
77 	void		*edid_info;
78 
79 	void		*debug_output;
80 	uint32		debug_size;
81 	bool		keep_debug_output_buffer;
82 
83 	platform_kernel_args platform_args;
84 	arch_kernel_args arch_args;
85 
86 	// bootsplash data
87 	uint8 		*boot_splash;
88 
89 } kernel_args;
90 
91 #endif	/* KERNEL_BOOT_KERNEL_ARGS_H */
92