2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Common console output functions.
8 #include <aros/multiboot.h>
10 #include <bootconsole.h>
17 __attribute__((section(".data"))) unsigned char scr_Type
= SCR_UNKNOWN
;
19 __attribute__((section(".data"))) static unsigned char use_serial
= 0;
21 void con_InitVESA(unsigned short version
, struct vbe_mode
*mode
)
23 scr_FrameBuffer
= (version
>= 0x0200) ? (void *)(unsigned long)mode
->phys_base
: NULL
;
25 if (mode
->mode_attributes
& VM_GRAPHICS
)
31 /* Use 3.0-specific field if available */
32 if ((mode
->mode_attributes
& VM_LINEAR_FB
) && (version
>= 0x0300))
33 pitch
= mode
->linear_bytes_per_scanline
;
35 pitch
= mode
->bytes_per_scanline
;
37 fb_Init(mode
->x_resolution
, mode
->y_resolution
, mode
->bits_per_pixel
, pitch
);
42 scr_Width
= mode
->x_resolution
;
43 scr_Height
= mode
->y_resolution
;
45 /* CHECKME: is it correct? It should fall back to VGA buffer address for text modes */
47 scr_FrameBuffer
= (void *)((unsigned long)mode
->win_b_segment
<< 16);
49 * QEmu in text mode (VBE number 0x03) is known to supply neither phys_base nor
50 * window segments (all three are NULLs). This is a workaround for this.
53 scr_FrameBuffer
= VGA_TEXT_ADDR
;
58 /* We must have valid framebuffer address here */
60 scr_Type
= SCR_UNKNOWN
;
63 void con_InitVGA(void)
66 scr_FrameBuffer
= VGA_TEXT_ADDR
;
67 scr_Width
= VGA_TEXT_WIDTH
;
68 scr_Height
= VGA_TEXT_HEIGHT
;
73 void con_InitSerial(char *cmdline
)
75 char *opts
= strstr(cmdline
, "debug=serial");
81 serial_Init(&opts
[12]);
89 /* 0x03 character shuts off boot-time screen console */
92 scr_Type
= SCR_UNKNOWN
;