-
Notifications
You must be signed in to change notification settings - Fork 0
/
Kernel.cs
43 lines (37 loc) · 1.12 KB
/
Kernel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using Cosmos.Core.Memory;
using Cosmos.Debug.Kernel;
using Cosmos.System.Graphics;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Text;
using Sys = Cosmos.System;
namespace OpenTerm
{
public class Kernel : Sys.Kernel
{
Canvas canv;
public static Debugger db;
Terminal term;
protected override void BeforeRun()
{
db = mDebugger;
canv = FullScreenCanvas.GetFullScreenCanvas(new Mode(1280,720,ColorDepth.ColorDepth32));
term = new Terminal(canv.Mode.Width, canv.Mode.Height);
Console.SetOut(term);
Console.WriteLine("§4Hello, §2World!");
}
protected override void Run()
{
canv.Clear();
Console.Write("Input: ");
var input = term.NonBlockingReadline();
Console.Write("Text typed: ");
Console.WriteLine(input);
canv.DrawImage(term.Draw(Color.Black),0,0);
canv.Display();
Heap.Collect();
}
}
}