2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
5 Desc: Parse multiboot data and init console.
8 #include <exec/types.h>
9 #include <aros/macros.h>
10 #include <aros/multiboot2.h>
12 #include <bootconsole.h>
16 void con_InitMultiboot2(void *mb
)
19 struct mb2_tag_framebuffer_common
*fb
= NULL
;
20 struct mb2_tag_vbe
*vbe
= NULL
;
23 * Iterate all tags and retrieve console information.
24 * If we have command line supplied, we may also have serial console.
25 * The supplied pointer points to an UQUAD value specifying total length of the
26 * whole data array. We just skip it.
27 * Size doesn't include padding needed to align the next tag at 8-byte boundary.
29 for (tag
= mb
+ 8; tag
->type
!= MB2_TAG_END
; tag
= (void *)tag
+ AROS_ROUNDUP2(tag
->size
, 8))
34 con_InitSerial(((struct mb2_tag_string
*)tag
)->string
);
37 case MB2_TAG_FRAMEBUFFER
:
38 fb
= (struct mb2_tag_framebuffer_common
*)tag
;
42 vbe
= (struct mb2_tag_vbe
*)tag
;
49 /* Framebuffer was given, use it */
50 scr_FrameBuffer
= (void *)fb
->framebuffer_addr
;
52 switch (fb
->framebuffer_type
)
54 case MB2_FRAMEBUFFER_TEXT
:
55 /* Text framebuffer, size in characters */
56 scr_Width
= fb
->framebuffer_width
;
57 scr_Height
= fb
->framebuffer_height
;
63 /* Graphical framebuffer, size in pixels */
65 fb_Init(fb
->framebuffer_width
, fb
->framebuffer_height
, fb
->framebuffer_bpp
, fb
->framebuffer_pitch
);
69 con_InitVESA(vbe
->vbe_control_info
.version
, &vbe
->vbe_mode_info
);
71 /* Fallback to default, VGA text mode */