3 * Copyright (C) 2007 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 unsigned short *vesafb
= 0;
27 extern unsigned char vgagui
;
29 typedef struct PMInfoBlock
{
31 unsigned short EntryPoint
;
32 unsigned short PMInitialize
;
33 unsigned short BIOSDataSel
;
34 unsigned short A0000Sel
;
35 unsigned short B0000Sel
;
36 unsigned short B8000Sel
;
37 unsigned short CodeSegSel
;
42 typedef void (*void_fn_void_t
)(char *arg
, int flags
);
43 extern task_t
*_curr_task
;
45 unsigned init_video_vesa ()
47 #ifdef CONFIG_DRV_VESA
48 if (kernel_attr
& KERNEL_NOVESA
)
53 /* get address from hacked grub */
54 unsigned *grub_baseaddr
= (unsigned *) 0x60000;
56 vesafb
= (unsigned short *) *grub_baseaddr
;
63 //printf ("vesa: 0x%x\n", vesafb);
65 /* draw "clear" screen first */
67 for (p
= 0; p
< 800*600; p
++)
74 unsigned vesa_16cto16b (unsigned char color
)
80 return 0x0000f1; // ok
82 return 0xee8d00; // ok
84 return 0x808000; // ok
86 return 0xffa000; // ok
88 return 0x018051; // ok
90 return 0xC3993D; // ??
92 return 0xf007fd; // ??
94 return 0xb457fd; // ??
96 return 0x0a02fa; // ok
98 return 0xffef00; // ok
100 return 0x0a05fa; // ok
102 return 0x4f8800; // ok
104 return 0xf8faff; // ok
106 return 0xffffd0; // ok
108 return 0xffffff; // ok