summaryrefslogtreecommitdiff
path: root/Kernel/panel.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-10-16 11:01:38 +0200
committerAndreas Kling <awesomekling@gmail.com>2018-10-16 11:02:00 +0200
commit9396108034acd4bdd91532e13528f0b94af16653 (patch)
tree26d7870743b3276555db4f2408a4ce9c3f8ced9a /Kernel/panel.cpp
parentf6086297047b639ede6fc0e058e4efcfc09ea46f (diff)
downloadserenity-9396108034acd4bdd91532e13528f0b94af16653.zip
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.
Diffstat (limited to 'Kernel/panel.cpp')
-rw-r--r--Kernel/panel.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/Kernel/panel.cpp b/Kernel/panel.cpp
new file mode 100644
index 0000000000..2a127619a6
--- /dev/null
+++ b/Kernel/panel.cpp
@@ -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 );
+ }
+}