mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 08:06:32 +00:00
🔧 更改为使用bochs虚拟机(qemu暂时没法正常显示画面)
This commit is contained in:
@ -1,8 +1,41 @@
|
||||
//
|
||||
// Created by longjin on 2022/1/20.
|
||||
//
|
||||
int *address = (int *)0xffff800000a00000; //帧缓存区的地址
|
||||
|
||||
void show_color_band(int width, int height, char a, char b, char c, char d)
|
||||
{
|
||||
/** 向帧缓冲区写入像素值
|
||||
* @param address: 帧缓存区的地址
|
||||
* @param val:像素值
|
||||
*/
|
||||
|
||||
for (int i = 0; i < width * height; ++i)
|
||||
{
|
||||
|
||||
*((char *)address + 0) = d;
|
||||
*((char *)address + 1) = c;
|
||||
*((char *)address + 2) = b;
|
||||
*((char *)address + 3) = a;
|
||||
++address;
|
||||
}
|
||||
}
|
||||
|
||||
//操作系统内核从这里开始执行
|
||||
void Start_Kernel(void)
|
||||
{
|
||||
while(1);
|
||||
|
||||
|
||||
|
||||
|
||||
show_color_band(1440, 20, 0x00, 0xff, 0x00, 0x00);
|
||||
|
||||
show_color_band(1440, 20, 0x00, 0x00, 0xff, 0x00);
|
||||
|
||||
show_color_band(1440, 20, 0x00, 0x00, 0x00, 0xff);
|
||||
|
||||
show_color_band(1440, 20, 0x00, 0xff, 0xff, 0xff);
|
||||
|
||||
while (1)
|
||||
;
|
||||
}
|
||||
|
Reference in New Issue
Block a user