2 Copyright © 1995-2018, The AROS Development Team. All rights reserved.
6 #include <bootconsole.h>
9 #include "kernel_base.h"
10 #include "kernel_debug.h"
11 #include "kernel_intern.h"
13 __attribute__((section(".data"))) static unsigned int debug_y_resolution
= 0;
14 __attribute__((section(".data"))) static void *debug_framebuffer
= NULL
;
16 int krnPutC(int c
, struct KernelBase
*KernelBase
)
23 * Don't use Disable/Enable, because we want the interrupt enabled flag
24 * to stay the same as it was before the Disable() call
29 * If we got 0x03, this means graphics driver wants to take over the screen.
30 * If VESA hack is activated, it will use only upper half of the screen
31 * because y resolution was adjusted.
32 * In our turn, we need to switch over to lower half.
33 * VESA hack is supported only on graphical console of course. And do not
34 * expect it to work with native mode video driver. :)
36 if ((c
== 0x03) && (scr_Type
== SCR_GFX
) && debug_framebuffer
)
38 /* Reinitialize boot console with decreased height */
39 scr_FrameBuffer
= debug_framebuffer
;
40 fb_Resize(debug_y_resolution
);
46 * Interrupt flag is stored in flags - if it was enabled before,
47 * it will be re-enabled when the flags are restored
49 __restore_flags(flags
);
54 void vesahack_Init(char *cmdline
, struct vbe_mode
*vmode
)
56 if (cmdline
&& vmode
&& vmode
->phys_base
&& strstr(cmdline
, "vesahack"))
58 bug("[Kernel] VESA debugging hack activated\n");
62 * It divides screen height by 2 and increments framebuffer pointer.
63 * This allows VESA driver to use only upper half of the screen, while
64 * lower half will still be used for debug output.
66 vmode
->y_resolution
>>= 1;
68 debug_y_resolution
= vmode
->y_resolution
;
69 debug_framebuffer
= (void *)(unsigned long)vmode
->phys_base
+ vmode
->y_resolution
* vmode
->bytes_per_scanline
;