mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-20 04:48:53 +00:00
This commit is contained in:
parent
1d0bfcf49f
commit
c420179ec7
7 changed files with 67 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ namespace Cosmos.Kernel {
|
|||
Console.Write("Creating IDT...");
|
||||
Hardware.CPU.CreateIDT();
|
||||
Console.WriteLine("Done");
|
||||
Keyboard.Initialize ();
|
||||
TestATA();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace Cosmos.Kernel.Staging.Stages {
|
|||
}
|
||||
|
||||
public override void Initialize() {
|
||||
CPU.TestATA ();
|
||||
//CPU.TestATA ();
|
||||
}
|
||||
|
||||
public override void Teardown() {
|
||||
|
|
|
|||
17
source/Cosmos/Cosmos.Shell.Console/Commands/FSTestCommand.cs
Normal file
17
source/Cosmos/Cosmos.Shell.Console/Commands/FSTestCommand.cs
Normal 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...");
|
||||
}
|
||||
}
|
||||
}
|
||||
19
source/Cosmos/Cosmos.Shell.Console/Commands/ICommand.cs
Normal file
19
source/Cosmos/Cosmos.Shell.Console/Commands/ICommand.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue