1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-11 22:52:07 +00:00
serenity/Kernel/panel.cpp
Andreas Kling 46ff281695 Turn the syscall interrupt into a trap (by switching the gate type.)
This leaves interrupts enabled while we're in the kernel, which is
precisely what we want.

This uncovered a horrendous problem with kernel tasks silently
overflowing their stacks. For now I've simply increased the stack size
but I need a more MMU-y solution for this eventually.
2018-10-19 11:31:18 +02:00

46 lines
906 B
C++

#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( ;; )
{
/* HACK: Avoid getting interrupted while painting since
* that could lead to fugly artifacts ;P */
cli();
c = vga_get_cursor();
a = vga_get_attr();
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 */
sti();
sleep( 1 * TICKS_PER_SECOND );
}
}