This commit is contained in:
moitoius_cp 2008-01-01 16:12:32 +00:00
parent 1d0bfcf49f
commit c420179ec7
7 changed files with 67 additions and 4 deletions

View file

@ -27,8 +27,28 @@ namespace Cosmos.Kernel.Plugs {
TextScreen.NewLine();
}
public static void Write(char[] buffer) {
for (int i = 0; i < buffer.Length; i++)
Write (buffer[i]);
}
public static void WriteLine(char[] buffer) {
Write (buffer);
WriteLine ();
}
public static void WriteLine() {
TextScreen.NewLine();
}
public static string ReadLine() {
char current;
string result = "";
while ((current = Keyboard.ReadChar ()) != 'a') {
result += new string (new char[] { current });
Write (current);
}
return result;
}
}
}

View file

@ -34,6 +34,7 @@ namespace Cosmos.Kernel {
Console.Write("Creating IDT...");
Hardware.CPU.CreateIDT();
Console.WriteLine("Done");
Keyboard.Initialize ();
TestATA();
}

View file

@ -13,7 +13,7 @@ namespace Cosmos.Kernel.Staging.Stages {
}
public override void Initialize() {
CPU.TestATA ();
//CPU.TestATA ();
}
public override void Teardown() {

View file

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Cosmos.Shell.Console.Commands {
public class FSTestCommand : ICommand {
public override string Name {
get {
return "fstest";
}
}
public override void Execute() {
System.Console.WriteLine ("Testing...");
}
}
}

View file

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Cosmos.Shell.Console.Commands {
/// <summary>
/// Represents a command.
/// </summary>
public abstract class ICommand {
/// <summary>
/// Gets the name of the command (must be lowercase).
/// </summary>
public abstract string Name {
get;
}
public abstract void Execute();
}
}

View file

@ -41,6 +41,8 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Commands\FSTestCommand.cs" />
<Compile Include="Commands\ICommand.cs" />
<Compile Include="Program.cs" />
<Compile Include="Prompter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@ -51,9 +53,6 @@
<Name>Cosmos.Kernel</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Commands\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View file

@ -14,7 +14,14 @@ namespace Cosmos.Shell.Console {
}
}
private List<Commands.ICommand> _commands;
public override void Initialize() {
string a = "Hi";
a = System.Console.ReadLine ();
System.Console.WriteLine (a);
}
public override void Teardown() {