L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
mb_info.h
Go to the documentation of this file.
1
5/*
6 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
7 * Frank Mehnert <fm3@os.inf.tu-dresden.de>
8 * economic rights: Technische Universität Dresden (Germany)
9 * This file is part of TUD:OS and distributed under the terms of the
10 * GNU Lesser General Public License 2.1.
11 * Please see the COPYING-LGPL-2.1 file for details.
12 */
13
14#ifndef L4UTIL_MB_INFO_H
15#define L4UTIL_MB_INFO_H
16
17/******************************************************************************
18 * Multiboot (v1)
19 *****************************************************************************/
20
21#ifndef __ASSEMBLY__
22
23#include <l4/sys/compiler.h>
24#include <l4/sys/l4int.h>
25
26/*
27 * \defgroup l4util_mb_mod Multiboot v1
28 * \ingroup l4util_api
29 */
30
42
43
50typedef struct __attribute__((packed))
51{
56 /* unspecified optional padding... */
58
60#define MB_ARD_MEMORY 1
61
66#define MB_ART_MEMORY 1
67#define MB_ART_RESERVED 2
68#define MB_ART_ACPI 3
70#define MB_ART_NVS 4
71#define MB_ART_UNUSABLE 5
85
86/* Drive Mode. */
87#define MB_DI_CHS_MODE 0
88#define MB_DI_LBA_MODE 1
89
90
92typedef struct
93{
94 l4_uint16_t version;
95 l4_uint16_t cseg;
96 l4_uint32_t offset;
97 l4_uint16_t cseg_16;
98 l4_uint16_t dseg_16;
99 l4_uint16_t flags;
100 l4_uint16_t cseg_len;
101 l4_uint16_t cseg_16_len;
102 l4_uint16_t dseg_16_len;
103} __attribute__((packed)) l4util_mb_apm_t;
104static_assert(sizeof(l4util_mb_apm_t) == 20, "Check l4util_mb_apm_t");
105
106
108typedef struct
109{
110 l4_uint8_t signature[4];
111 l4_uint16_t version;
112 l4_uint32_t oem_string;
113 l4_uint32_t capabilities;
114 l4_uint32_t video_mode;
115 l4_uint16_t total_memory;
116 l4_uint16_t oem_software_rev;
117 l4_uint32_t oem_vendor_name;
118 l4_uint32_t oem_product_name;
119 l4_uint32_t oem_product_rev;
120 l4_uint8_t reserved[222];
121 l4_uint8_t oem_data[256];
122} __attribute__((packed)) l4util_mb_vbe_ctrl_t;
123static_assert(sizeof(l4util_mb_vbe_ctrl_t) == 512, "Check l4util_mb_vbe_ctrl_t");
124
125
127typedef struct
128{
236 l4_uint8_t reserved3[190];
238} __attribute__ ((packed)) l4util_mb_vbe_mode_t;
239static_assert(sizeof(l4util_mb_vbe_mode_t) == 256, "Check l4util_mb_vbe_mode_t");
240
241
297static_assert(sizeof(l4util_mb_info_t) == 88, "Check l4util_mb_info_t");
298
305static inline l4util_mb_addr_range_t *
306l4util_mb_first_mmap_entry(l4util_mb_info_t *mbi)
307{
309}
310
320static inline l4util_mb_addr_range_t *
321l4util_mb_next_mmap_entry(l4util_mb_addr_range_t *e)
322{
324 + sizeof(e->struct_size));
325}
326
334#define l4util_mb_for_each_mmap_entry(i, mbi) \
335 for (i = l4util_mb_first_mmap_entry(mbi); \
336 (unsigned long)i < (unsigned long)mbi->mmap_addr + mbi->mmap_length; \
337 i = l4util_mb_next_mmap_entry(i))
338
339#endif /* ! __ASSEMBLY__ */
340
346#define L4UTIL_MB_MEMORY 0x00000001
347
349#define L4UTIL_MB_BOOTDEV 0x00000002
350
352#define L4UTIL_MB_CMDLINE 0x00000004
353
355#define L4UTIL_MB_MODS 0x00000008
356
357/* These next two are mutually exclusive */
359#define L4UTIL_MB_AOUT_SYMS 0x00000010
360
362#define L4UTIL_MB_ELF_SHDR 0x00000020
363
365#define L4UTIL_MB_MEM_MAP 0x00000040
366
368#define L4UTIL_MB_DRIVE_INFO 0x00000080
369
371#define L4UTIL_MB_CONFIG_TABLE 0x00000100
372
374#define L4UTIL_MB_BOOT_LOADER_NAME 0x00000200
375
377#define L4UTIL_MB_APM_TABLE 0x00000400
378
380#define L4UTIL_MB_VIDEO_INFO 0x00000800
381
382
384#define L4UTIL_MB_VALID 0x2BADB002UL
385#define L4UTIL_MB_VALID_ASM 0x2BADB002
386
387
388/******************************************************************************
389 * Multiboot2
390 *****************************************************************************/
391
392#ifndef __ASSEMBLY__
393
394typedef struct
395{
396 l4_uint32_t total_size;
397 l4_uint32_t reserved;
398} __attribute__((packed)) l4util_mb2_info_t;
399
400typedef struct
401{
402 char string[0];
403} __attribute__((packed)) l4util_mb2_cmdline_tag_t;
404
405typedef struct
406{
407 l4_uint32_t mod_start;
408 l4_uint32_t mod_end;
409 char string[];
410} __attribute__((packed)) l4util_mb2_module_tag_t;
411
412typedef struct
413{
414 l4_uint64_t base_addr;
415 l4_uint64_t length;
416 l4_uint32_t type;
417 l4_uint32_t reserved;
418} __attribute__((packed)) l4util_mb2_memmap_entry_t;
419
420typedef struct
421{
422 l4_uint32_t entry_size;
423 l4_uint32_t entry_version;
424 l4util_mb2_memmap_entry_t entries[];
425} __attribute__((packed)) l4util_mb2_memmap_tag_t;
426
427typedef struct
428{
429 char data[0];
430} __attribute__((packed)) l4util_mb2_rsdp_tag_t;
431
432typedef struct
433{
434 l4_uint32_t type;
435 l4_uint32_t size;
436
437 union
438 {
439 l4util_mb2_cmdline_tag_t cmdline;
440 l4util_mb2_module_tag_t module;
441 l4util_mb2_memmap_tag_t memmap;
442 l4util_mb2_rsdp_tag_t rsdp;
443 };
444} __attribute__((packed)) l4util_mb2_tag_t;
445
446#endif /* ! __ASSEMBLY__ */
447
448
449#define L4UTIL_MB2_MAGIC 0xE85250D6
450#define L4UTIL_MB2_ARCH_I386 0x0
451
452#define L4UTIL_MB2_TERMINATOR_HEADER_TAG 0
453#define L4UTIL_MB2_INFO_REQUEST_HEADER_TAG 1
454#define L4UTIL_MB2_ENTRY_ADDRESS_HEADER_TAG 3
455#define L4UTIL_MB2_RELOCATABLE_HEADER_TAG 10
456
457#define L4UTIL_MB2_TAG_FLAG_REQUIRED 0
458
459#define L4UTIL_MB2_TAG_ALIGN_SHIFT 3
460#define L4UTIL_MB2_TAG_ALIGN 8
461
462#define L4UTIL_MB2_TERMINATOR_INFO_TAG 0
463#define L4UTIL_MB2_BOOT_CMDLINE_INFO_TAG 1
464#define L4UTIL_MB2_MODULE_INFO_TAG 3
465#define L4UTIL_MB2_MEMORY_MAP_INFO_TAG 6
466#define L4UTIL_MB2_RSDP_OLD_INFO_TAG 14
467#define L4UTIL_MB2_RSDP_NEW_INFO_TAG 15
468#define L4UTIL_MB2_IMAGE_LOAD_BASE_PHYS_INFO_TAG 21
469
470#define L4UTIL_MB2_RELO_PREFERED_NONE 0
471#define L4UTIL_MB2_RELO_PREFERED_MIN 1
472#define L4UTIL_MB2_RELO_PREFERED_MAX 2
473
474#endif
L4 compiler related defines.
unsigned long l4_addr_t
Address type.
Definition l4int.h:45
unsigned char l4_uint8_t
Unsigned 8bit value.
Definition l4int.h:36
unsigned int l4_uint32_t
Unsigned 32bit value.
Definition l4int.h:40
unsigned short int l4_uint16_t
Unsigned 16bit value.
Definition l4int.h:38
unsigned long long l4_uint64_t
Unsigned 64bit value.
Definition l4int.h:42
INT-15, AX=E820 style "AddressRangeDescriptor" ...with a "size" parameter on the front which is the s...
Definition mb_info.h:51
l4_uint32_t type
type of memory range
Definition mb_info.h:55
l4_uint64_t size
Size of memory range.
Definition mb_info.h:54
l4_uint64_t addr
Start address.
Definition mb_info.h:53
l4_uint32_t struct_size
Size of structure.
Definition mb_info.h:52
APM BIOS info.
Definition mb_info.h:93
Drive Info structure.
Definition mb_info.h:76
l4_uint8_t drive_number
<The size of this structure.
Definition mb_info.h:78
l4_uint8_t drive_mode
<The BIOS drive number.
Definition mb_info.h:79
l4_uint16_t drive_cylinders
<The access mode (see below).
Definition mb_info.h:80
l4_uint8_t drive_sectors
<number of heads
Definition mb_info.h:82
l4_uint8_t drive_heads
<number of cylinders
Definition mb_info.h:81
MultiBoot Info description.
Definition mb_info.h:250
l4_uint32_t drives_length
size of drive info buffer
Definition mb_info.h:285
l4_uint32_t num
(ELF) Kernel section header table
Definition mb_info.h:274
l4_uint16_t vbe_mode
VESA video mode number.
Definition mb_info.h:292
l4_uint32_t mmap_length
size of memory mapping buffer
Definition mb_info.h:283
l4_uint16_t vbe_interface_len
VESA lenght of prot BIOS interface.
Definition mb_info.h:295
l4_uint32_t drives_addr
address of driver info buffer
Definition mb_info.h:286
l4_uint32_t mem_upper
available memory starting from 1MB [kB]
Definition mb_info.h:253
l4_uint32_t tabsize
(a.out) Kernel symbol table info
Definition mb_info.h:264
l4_uint32_t boot_device
"root" partition
Definition mb_info.h:254
l4_uint32_t apm_table
APM table.
Definition mb_info.h:289
l4_uint32_t cmdline
Kernel command line.
Definition mb_info.h:255
l4_uint32_t config_table
ROM configuration table.
Definition mb_info.h:287
l4_uint16_t vbe_interface_off
VESA offset of prot BIOS interface.
Definition mb_info.h:294
l4_uint32_t mem_lower
available memory below 1MB
Definition mb_info.h:252
l4_uint32_t mmap_addr
address of memory mapping buffer
Definition mb_info.h:284
l4_uint32_t vbe_mode_info
VESA video mode info.
Definition mb_info.h:291
l4_uint32_t vbe_ctrl_info
VESA video contoller info.
Definition mb_info.h:290
l4_uint32_t mods_addr
module list
Definition mb_info.h:257
l4_uint32_t mods_count
number of modules
Definition mb_info.h:256
l4_uint32_t boot_loader_name
Boot Loader Name.
Definition mb_info.h:288
l4_uint32_t flags
MultiBoot info version number.
Definition mb_info.h:251
l4_uint16_t vbe_interface_seg
VESA segment of prot BIOS interface.
Definition mb_info.h:293
The structure type "mod_list" is used by the multiboot_info structure.
Definition mb_info.h:36
l4_uint32_t mod_start
Starting address of module in memory.
Definition mb_info.h:37
l4_uint32_t pad
padding to take it to 16 bytes
Definition mb_info.h:40
l4_uint32_t cmdline
Module command line.
Definition mb_info.h:39
l4_uint32_t mod_end
End address of module in memory.
Definition mb_info.h:38
VBE controller information.
Definition mb_info.h:109
VBE mode information.
Definition mb_info.h:128
l4_uint8_t number_of_banks
Number of banks.
Definition mb_info.h:166
l4_uint16_t linear_bytes_per_scanline
Bytes per scan line for linear modes.
Definition mb_info.h:212
l4_uint8_t linear_number_of_image_pages
Number of images for linear modes.
Definition mb_info.h:216
l4_uint16_t x_resolution
Horizontal resolution in pixels or characters.
Definition mb_info.h:154
l4_uint8_t linear_red_mask_size
Size of direct color red mask (linear modes).
Definition mb_info.h:218
l4_uint8_t win_b_attributes
Window B attributes.
Definition mb_info.h:136
l4_uint8_t red_field_position
Bit position of LSB of red mask.
Definition mb_info.h:182
l4_uint8_t blue_mask_size
Size of direct color blue mask in bits.
Definition mb_info.h:188
l4_uint8_t linear_reserved_mask_size
Size of direct color reserved mask (linear modes).
Definition mb_info.h:230
l4_uint8_t memory_model
Memory model type.
Definition mb_info.h:168
l4_uint16_t win_b_segment
Window B start segment.
Definition mb_info.h:144
l4_uint8_t linear_green_field_position
Bit position of LSB of green mask (linear modes).
Definition mb_info.h:224
l4_uint32_t phys_base
Physical address for flat memory memory frame buffer.
Definition mb_info.h:202
l4_uint8_t y_char_size
Character cell height in pixels.
Definition mb_info.h:160
l4_uint16_t bytes_per_scanline
Bytes per scan line.
Definition mb_info.h:148
l4_uint16_t win_granularity
Window granularity.
Definition mb_info.h:138
l4_uint32_t reserved1
Reserved – always set to 0.
Definition mb_info.h:204
l4_uint8_t red_mask_size
Size of direct color red mask in bits.
Definition mb_info.h:180
l4_uint8_t bits_per_pixel
Bits per pixel.
Definition mb_info.h:164
l4_uint8_t x_char_size
Character cell width in pixels.
Definition mb_info.h:158
l4_uint8_t green_mask_size
Size of direct color green mask in bits.
Definition mb_info.h:184
l4_uint32_t max_pixel_clock
Maximum pixel clock (in Hz) for graphics mode.
Definition mb_info.h:234
l4_uint8_t green_field_position
Bit position of LSB of green mask.
Definition mb_info.h:186
l4_uint16_t reversed2
Reserved – always set to 0.
Definition mb_info.h:206
l4_uint8_t number_of_planes
Number of memory planes.
Definition mb_info.h:162
l4_uint8_t linear_blue_mask_size
Size of direct color blue mask (linear modes).
Definition mb_info.h:226
l4_uint8_t linear_blue_field_position
Bit position of LSB of blue mask (linear modes).
Definition mb_info.h:228
l4_uint8_t linear_red_field_position
Bit position of LSB of red mask (linear modes).
Definition mb_info.h:220
l4_uint8_t banked_number_of_image_pages
Number of images for banked modes.
Definition mb_info.h:214
l4_uint8_t linear_reserved_field_position
Bit position of LSB of reserved mask (linear modes).
Definition mb_info.h:232
l4_uint32_t win_func
Real mode pointer to window function.
Definition mb_info.h:146
l4_uint8_t bank_size
Bank size in KiB.
Definition mb_info.h:170
l4_uint8_t reserved0
Reserved for page function.
Definition mb_info.h:174
l4_uint8_t win_a_attributes
Window A attributes.
Definition mb_info.h:134
l4_uint16_t win_size
Window size.
Definition mb_info.h:140
l4_uint16_t win_a_segment
Window A start segment.
Definition mb_info.h:142
l4_uint8_t blue_field_position
Bit position of LSB of blue mask.
Definition mb_info.h:190
l4_uint16_t mode_attributes
Mode attributes.
Definition mb_info.h:132
l4_uint8_t linear_green_mask_size
Size of direct color green mask (linear modes).
Definition mb_info.h:222
l4_uint16_t y_resolution
Vertical resolution in pixels or characters.
Definition mb_info.h:156
l4_uint8_t number_of_image_pages
Number of images.
Definition mb_info.h:172
l4_uint8_t reserved_mask_size
Size of direct color reserved mask in bits.
Definition mb_info.h:192
l4_uint8_t direct_color_mode_info
Direct color mode attributes.
Definition mb_info.h:196
l4_uint8_t reserved_field_position
Bit position of LSB of reserved mask.
Definition mb_info.h:194