L4Re Operating System Framework
Interface and Usage Documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 * License: see LICENSE.spdx (in this directory or the directories above)
10 */
11
12#ifndef L4UTIL_MB_INFO_H
13#define L4UTIL_MB_INFO_H
14
15/******************************************************************************
16 * Multiboot (v1)
17 *****************************************************************************/
18
19#ifndef __ASSEMBLY__
20
21#include <l4/sys/compiler.h>
22#include <l4/sys/l4int.h>
23
24/*
25 * \defgroup l4util_mb_mod Multiboot v1
26 * \ingroup l4util_api
27 */
28
40
41
48typedef struct __attribute__((packed))
49{
54 /* unspecified optional padding... */
56
58#define MB_ARD_MEMORY 1
59
64#define MB_ART_MEMORY 1
65#define MB_ART_RESERVED 2
66#define MB_ART_ACPI 3
68#define MB_ART_NVS 4
69#define MB_ART_UNUSABLE 5
83
84/* Drive Mode. */
85#define MB_DI_CHS_MODE 0
86#define MB_DI_LBA_MODE 1
87
88
90typedef struct
91{
92 l4_uint16_t version;
93 l4_uint16_t cseg;
94 l4_uint32_t offset;
95 l4_uint16_t cseg_16;
96 l4_uint16_t dseg_16;
97 l4_uint16_t flags;
98 l4_uint16_t cseg_len;
99 l4_uint16_t cseg_16_len;
100 l4_uint16_t dseg_16_len;
101} __attribute__((packed)) l4util_mb_apm_t;
102static_assert(sizeof(l4util_mb_apm_t) == 20, "Check l4util_mb_apm_t");
103
104
106typedef struct
107{
108 l4_uint8_t signature[4];
109 l4_uint16_t version;
110 l4_uint32_t oem_string;
111 l4_uint32_t capabilities;
112 l4_uint32_t video_mode;
113 l4_uint16_t total_memory;
114 l4_uint16_t oem_software_rev;
115 l4_uint32_t oem_vendor_name;
116 l4_uint32_t oem_product_name;
117 l4_uint32_t oem_product_rev;
118 l4_uint8_t reserved[222];
119 l4_uint8_t oem_data[256];
120} __attribute__((packed)) l4util_mb_vbe_ctrl_t;
121static_assert(sizeof(l4util_mb_vbe_ctrl_t) == 512, "Check l4util_mb_vbe_ctrl_t");
122
123
125typedef struct
126{
234 l4_uint8_t reserved3[190];
236} __attribute__ ((packed)) l4util_mb_vbe_mode_t;
237static_assert(sizeof(l4util_mb_vbe_mode_t) == 256, "Check l4util_mb_vbe_mode_t");
238
239
295static_assert(sizeof(l4util_mb_info_t) == 88, "Check l4util_mb_info_t");
296
303static inline l4util_mb_addr_range_t *
304l4util_mb_first_mmap_entry(l4util_mb_info_t *mbi)
305{
307}
308
318static inline l4util_mb_addr_range_t *
319l4util_mb_next_mmap_entry(l4util_mb_addr_range_t *e)
320{
322 + sizeof(e->struct_size));
323}
324
332#define l4util_mb_for_each_mmap_entry(i, mbi) \
333 for (i = l4util_mb_first_mmap_entry(mbi); \
334 (unsigned long)i < (unsigned long)mbi->mmap_addr + mbi->mmap_length; \
335 i = l4util_mb_next_mmap_entry(i))
336
337#endif /* ! __ASSEMBLY__ */
338
344#define L4UTIL_MB_MEMORY 0x00000001
345
347#define L4UTIL_MB_BOOTDEV 0x00000002
348
350#define L4UTIL_MB_CMDLINE 0x00000004
351
353#define L4UTIL_MB_MODS 0x00000008
354
355/* These next two are mutually exclusive */
357#define L4UTIL_MB_AOUT_SYMS 0x00000010
358
360#define L4UTIL_MB_ELF_SHDR 0x00000020
361
363#define L4UTIL_MB_MEM_MAP 0x00000040
364
366#define L4UTIL_MB_DRIVE_INFO 0x00000080
367
369#define L4UTIL_MB_CONFIG_TABLE 0x00000100
370
372#define L4UTIL_MB_BOOT_LOADER_NAME 0x00000200
373
375#define L4UTIL_MB_APM_TABLE 0x00000400
376
378#define L4UTIL_MB_VIDEO_INFO 0x00000800
379
380
382#define L4UTIL_MB_VALID 0x2BADB002UL
383#define L4UTIL_MB_VALID_ASM 0x2BADB002
384
385
386/******************************************************************************
387 * Multiboot2
388 *****************************************************************************/
389
390#ifndef __ASSEMBLY__
391
392typedef struct
393{
394 l4_uint32_t total_size;
395 l4_uint32_t reserved;
396} __attribute__((packed)) l4util_mb2_info_t;
397
398typedef struct
399{
400 char string[0];
401} __attribute__((packed)) l4util_mb2_cmdline_tag_t;
402
403typedef struct
404{
405 l4_uint32_t mod_start;
406 l4_uint32_t mod_end;
407 char string[];
408} __attribute__((packed)) l4util_mb2_module_tag_t;
409
410typedef struct
411{
412 l4_uint64_t base_addr;
413 l4_uint64_t length;
414 l4_uint32_t type;
415 l4_uint32_t reserved;
416} __attribute__((packed)) l4util_mb2_memmap_entry_t;
417
418typedef struct
419{
420 l4_uint32_t entry_size;
421 l4_uint32_t entry_version;
422 l4util_mb2_memmap_entry_t entries[];
423} __attribute__((packed)) l4util_mb2_memmap_tag_t;
424
425typedef struct
426{
427 char data[0];
428} __attribute__((packed)) l4util_mb2_rsdp_tag_t;
429
430
431struct color_info_rgb_t
432{
433 l4_uint8_t framebuffer_red_field_position;
434 l4_uint8_t framebuffer_red_mask_size;
435 l4_uint8_t framebuffer_green_field_position;
436 l4_uint8_t framebuffer_green_mask_size;
437 l4_uint8_t framebuffer_blue_field_position;
438 l4_uint8_t framebuffer_blue_mask_size;
439} __attribute__((packed));
440
441typedef struct
442{
443 l4_uint64_t framebuffer_addr;
444 l4_uint32_t framebuffer_pitch;
445 l4_uint32_t framebuffer_width;
446 l4_uint32_t framebuffer_height;
447 l4_uint8_t framebuffer_bpp;
448 l4_uint8_t framebuffer_type;
449 l4_uint8_t reserved;
450
451 // color_info;
452 union
453 {
454 struct color_info_rgb_t color_info_rgb;
455 };
456} __attribute__((packed)) l4util_mb2_framebuffer_tag_t;
457
458typedef struct
459{
460 l4_uint32_t type;
461 l4_uint32_t size;
462
463 union
464 {
465 l4util_mb2_cmdline_tag_t cmdline;
466 l4util_mb2_module_tag_t module;
467 l4util_mb2_memmap_tag_t memmap;
468 l4util_mb2_framebuffer_tag_t fb;
469 l4util_mb2_rsdp_tag_t rsdp;
470 };
471} __attribute__((packed)) l4util_mb2_tag_t;
472
473#endif /* ! __ASSEMBLY__ */
474
475
476#define L4UTIL_MB2_MAGIC 0xE85250D6
477#define L4UTIL_MB2_ARCH_I386 0x0
478
479#define L4UTIL_MB2_TERMINATOR_HEADER_TAG 0
480#define L4UTIL_MB2_INFO_REQUEST_HEADER_TAG 1
481#define L4UTIL_MB2_ENTRY_ADDRESS_HEADER_TAG 3
482#define L4UTIL_MB2_FRAMEBUFFER_HEADER_TAG 5
483#define L4UTIL_MB2_RELOCATABLE_HEADER_TAG 10
484
485#define L4UTIL_MB2_TAG_FLAG_REQUIRED 0
486
487#define L4UTIL_MB2_TAG_ALIGN_SHIFT 3
488#define L4UTIL_MB2_TAG_ALIGN 8
489
490#define L4UTIL_MB2_TERMINATOR_INFO_TAG 0
491#define L4UTIL_MB2_BOOT_CMDLINE_INFO_TAG 1
492#define L4UTIL_MB2_MODULE_INFO_TAG 3
493#define L4UTIL_MB2_MEMORY_MAP_INFO_TAG 6
494#define L4UTIL_MB2_FRAMEBUFFER_INFO_TAG 8
495#define L4UTIL_MB2_RSDP_OLD_INFO_TAG 14
496#define L4UTIL_MB2_RSDP_NEW_INFO_TAG 15
497#define L4UTIL_MB2_IMAGE_LOAD_BASE_PHYS_INFO_TAG 21
498
499#define L4UTIL_MB2_RELO_PREFERED_NONE 0
500#define L4UTIL_MB2_RELO_PREFERED_MIN 1
501#define L4UTIL_MB2_RELO_PREFERED_MAX 2
502
503#endif
L4 compiler related defines.
unsigned long l4_addr_t
Address type.
Definition l4int.h:34
unsigned char l4_uint8_t
Unsigned 8bit value.
Definition l4int.h:25
unsigned int l4_uint32_t
Unsigned 32bit value.
Definition l4int.h:29
unsigned short int l4_uint16_t
Unsigned 16bit value.
Definition l4int.h:27
unsigned long long l4_uint64_t
Unsigned 64bit value.
Definition l4int.h:31
INT-15, AX=E820 style "AddressRangeDescriptor" ...with a "size" parameter on the front which is the s...
Definition mb_info.h:49
l4_uint32_t type
type of memory range
Definition mb_info.h:53
l4_uint64_t size
Size of memory range.
Definition mb_info.h:52
l4_uint64_t addr
Start address.
Definition mb_info.h:51
l4_uint32_t struct_size
Size of structure.
Definition mb_info.h:50
APM BIOS info.
Definition mb_info.h:91
Drive Info structure.
Definition mb_info.h:74
l4_uint8_t drive_number
<The size of this structure.
Definition mb_info.h:76
l4_uint8_t drive_mode
<The BIOS drive number.
Definition mb_info.h:77
l4_uint16_t drive_cylinders
<The access mode (see below).
Definition mb_info.h:78
l4_uint8_t drive_sectors
<number of heads
Definition mb_info.h:80
l4_uint8_t drive_heads
<number of cylinders
Definition mb_info.h:79
MultiBoot Info description.
Definition mb_info.h:248
l4_uint32_t drives_length
size of drive info buffer
Definition mb_info.h:283
l4_uint32_t num
(ELF) Kernel section header table
Definition mb_info.h:272
l4_uint16_t vbe_mode
VESA video mode number.
Definition mb_info.h:290
l4_uint32_t mmap_length
size of memory mapping buffer
Definition mb_info.h:281
l4_uint16_t vbe_interface_len
VESA lenght of prot BIOS interface.
Definition mb_info.h:293
l4_uint32_t drives_addr
address of driver info buffer
Definition mb_info.h:284
l4_uint32_t mem_upper
available memory starting from 1MB [kB]
Definition mb_info.h:251
l4_uint32_t tabsize
(a.out) Kernel symbol table info
Definition mb_info.h:262
l4_uint32_t boot_device
"root" partition
Definition mb_info.h:252
l4_uint32_t apm_table
APM table.
Definition mb_info.h:287
l4_uint32_t cmdline
Kernel command line.
Definition mb_info.h:253
l4_uint32_t config_table
ROM configuration table.
Definition mb_info.h:285
l4_uint16_t vbe_interface_off
VESA offset of prot BIOS interface.
Definition mb_info.h:292
l4_uint32_t mem_lower
available memory below 1MB
Definition mb_info.h:250
l4_uint32_t mmap_addr
address of memory mapping buffer
Definition mb_info.h:282
l4_uint32_t vbe_mode_info
VESA video mode info.
Definition mb_info.h:289
l4_uint32_t vbe_ctrl_info
VESA video contoller info.
Definition mb_info.h:288
l4_uint32_t mods_addr
module list
Definition mb_info.h:255
l4_uint32_t mods_count
number of modules
Definition mb_info.h:254
l4_uint32_t boot_loader_name
Boot Loader Name.
Definition mb_info.h:286
l4_uint32_t flags
MultiBoot info version number.
Definition mb_info.h:249
l4_uint16_t vbe_interface_seg
VESA segment of prot BIOS interface.
Definition mb_info.h:291
The structure type "mod_list" is used by the multiboot_info structure.
Definition mb_info.h:34
l4_uint32_t mod_start
Starting address of module in memory.
Definition mb_info.h:35
l4_uint32_t pad
padding to take it to 16 bytes
Definition mb_info.h:38
l4_uint32_t cmdline
Module command line.
Definition mb_info.h:37
l4_uint32_t mod_end
End address of module in memory.
Definition mb_info.h:36
VBE controller information.
Definition mb_info.h:107
VBE mode information.
Definition mb_info.h:126
l4_uint8_t number_of_banks
Number of banks.
Definition mb_info.h:164
l4_uint16_t linear_bytes_per_scanline
Bytes per scan line for linear modes.
Definition mb_info.h:210
l4_uint8_t linear_number_of_image_pages
Number of images for linear modes.
Definition mb_info.h:214
l4_uint16_t x_resolution
Horizontal resolution in pixels or characters.
Definition mb_info.h:152
l4_uint8_t linear_red_mask_size
Size of direct color red mask (linear modes).
Definition mb_info.h:216
l4_uint8_t win_b_attributes
Window B attributes.
Definition mb_info.h:134
l4_uint8_t red_field_position
Bit position of LSB of red mask.
Definition mb_info.h:180
l4_uint8_t blue_mask_size
Size of direct color blue mask in bits.
Definition mb_info.h:186
l4_uint8_t linear_reserved_mask_size
Size of direct color reserved mask (linear modes).
Definition mb_info.h:228
l4_uint8_t memory_model
Memory model type.
Definition mb_info.h:166
l4_uint16_t win_b_segment
Window B start segment.
Definition mb_info.h:142
l4_uint8_t linear_green_field_position
Bit position of LSB of green mask (linear modes).
Definition mb_info.h:222
l4_uint32_t phys_base
Physical address for flat memory memory frame buffer.
Definition mb_info.h:200
l4_uint8_t y_char_size
Character cell height in pixels.
Definition mb_info.h:158
l4_uint16_t bytes_per_scanline
Bytes per scan line.
Definition mb_info.h:146
l4_uint16_t win_granularity
Window granularity.
Definition mb_info.h:136
l4_uint32_t reserved1
Reserved – always set to 0.
Definition mb_info.h:202
l4_uint8_t red_mask_size
Size of direct color red mask in bits.
Definition mb_info.h:178
l4_uint8_t bits_per_pixel
Bits per pixel.
Definition mb_info.h:162
l4_uint8_t x_char_size
Character cell width in pixels.
Definition mb_info.h:156
l4_uint8_t green_mask_size
Size of direct color green mask in bits.
Definition mb_info.h:182
l4_uint32_t max_pixel_clock
Maximum pixel clock (in Hz) for graphics mode.
Definition mb_info.h:232
l4_uint8_t green_field_position
Bit position of LSB of green mask.
Definition mb_info.h:184
l4_uint16_t reversed2
Reserved – always set to 0.
Definition mb_info.h:204
l4_uint8_t number_of_planes
Number of memory planes.
Definition mb_info.h:160
l4_uint8_t linear_blue_mask_size
Size of direct color blue mask (linear modes).
Definition mb_info.h:224
l4_uint8_t linear_blue_field_position
Bit position of LSB of blue mask (linear modes).
Definition mb_info.h:226
l4_uint8_t linear_red_field_position
Bit position of LSB of red mask (linear modes).
Definition mb_info.h:218
l4_uint8_t banked_number_of_image_pages
Number of images for banked modes.
Definition mb_info.h:212
l4_uint8_t linear_reserved_field_position
Bit position of LSB of reserved mask (linear modes).
Definition mb_info.h:230
l4_uint32_t win_func
Real mode pointer to window function.
Definition mb_info.h:144
l4_uint8_t bank_size
Bank size in KiB.
Definition mb_info.h:168
l4_uint8_t reserved0
Reserved for page function.
Definition mb_info.h:172
l4_uint8_t win_a_attributes
Window A attributes.
Definition mb_info.h:132
l4_uint16_t win_size
Window size.
Definition mb_info.h:138
l4_uint16_t win_a_segment
Window A start segment.
Definition mb_info.h:140
l4_uint8_t blue_field_position
Bit position of LSB of blue mask.
Definition mb_info.h:188
l4_uint16_t mode_attributes
Mode attributes.
Definition mb_info.h:130
l4_uint8_t linear_green_mask_size
Size of direct color green mask (linear modes).
Definition mb_info.h:220
l4_uint16_t y_resolution
Vertical resolution in pixels or characters.
Definition mb_info.h:154
l4_uint8_t number_of_image_pages
Number of images.
Definition mb_info.h:170
l4_uint8_t reserved_mask_size
Size of direct color reserved mask in bits.
Definition mb_info.h:190
l4_uint8_t direct_color_mode_info
Direct color mode attributes.
Definition mb_info.h:194
l4_uint8_t reserved_field_position
Bit position of LSB of reserved mask.
Definition mb_info.h:192