1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 11:27:34 +00:00

Import the "gerbert" kernel I worked on earlier this year.

It's a lot crappier than I remembered it. It's gonna need a lot of work.
This commit is contained in:
Andreas Kling 2018-10-16 11:01:38 +02:00
parent f608629704
commit 9396108034
55 changed files with 4600 additions and 0 deletions

46
Kernel/panel.cpp Normal file
View file

@ -0,0 +1,46 @@
#include "types.h"
#include "Task.h"
#include "VGA.h"
#include "system.h"
#include "i386.h"
#include "i8253.h"
#include "kmalloc.h"
PUBLIC void panel_main() NORETURN;
PUBLIC void
panel_main()
{
WORD c;
BYTE a;
for( ;; )
{
c = vga_get_cursor();
a = vga_get_attr();
/* HACK: Avoid getting interrupted while painting since
* that could lead to fugly artifacts ;P */
disableInterrupts();
vga_set_attr( 0x17 );
vga_set_cursor( 80 * 24 );
kprintf(
" Uptime: %u -- %u tasks (%u blocked) kmalloc: %u/%u ",
system.uptime / TICKS_PER_SECOND,
system.nprocess,
system.nblocked,
sum_alloc,
sum_free
);
vga_set_attr( a );
vga_set_cursor( c );
/* HACK cont.d */
enableInterrupts();
sleep( 1 * TICKS_PER_SECOND );
}
}