mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-05-28 23:44:31 +00:00
Multitasking test code
This commit is contained in:
parent
50ebd3fbd1
commit
589b3f9d4b
37
KThread.cpp
37
KThread.cpp
@ -1,11 +1,48 @@
|
||||
#include "kernel.h"
|
||||
|
||||
#include <power.hpp>
|
||||
#include <printf.h>
|
||||
|
||||
void KernelMainThread()
|
||||
{
|
||||
KPrint("Kernel main thread started!");
|
||||
// asm("int $0x1");
|
||||
|
||||
KPrint("\e22AA11Starting color test.");
|
||||
uint32_t Color = 0x000000;
|
||||
int itrupd = 0;
|
||||
int BoxSize = 64;
|
||||
|
||||
while (1)
|
||||
{
|
||||
Color++;
|
||||
itrupd++;
|
||||
|
||||
Display->SetBufferCursor(0, 0, 0);
|
||||
|
||||
for (int i = 0; i < BoxSize; i++)
|
||||
for (int j = 0; j < BoxSize; j++)
|
||||
Display->SetPixel(i, j, Color, 0);
|
||||
|
||||
int r = (Color >> 16) & 0xFF;
|
||||
int g = (Color >> 8) & 0xFF;
|
||||
int b = (Color >> 0) & 0xFF;
|
||||
printf_("\e%02x%02x%02x0x%06X",
|
||||
255 - r, 255 - g, 255 - b,
|
||||
Color);
|
||||
|
||||
if (itrupd == BoxSize)
|
||||
itrupd = 0;
|
||||
|
||||
if (itrupd == 0)
|
||||
Display->SetBuffer(0);
|
||||
|
||||
if (Color > 0xFFFFFF)
|
||||
break;
|
||||
}
|
||||
|
||||
KPrint("\e22AA11Color test finished.");
|
||||
|
||||
while (1)
|
||||
CPU::Halt();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user