Added TimeCommand in Shell.Console demo kernel.

This commit is contained in:
Scalpel_cp 2008-03-08 23:47:57 +00:00
parent b351e04de5
commit 5f95efd31b
3 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
using Cosmos.Hardware;
namespace Cosmos.Shell.Console.Commands
{
class TimeCommand : CommandBase
{
public override string Name
{
get { return "time"; }
}
public override string Summary
{
get { return "Displays the current time."; }
}
public override void Execute(string param)
{
//TODO: For some reason the values output are too high. F.instance GetSeconds goes to 90.
System.Console.WriteLine((int)RTC.GetHours() + ":" + RTC.GetMinutes() + ":" + RTC.GetSeconds());
}
}
}

View file

@ -55,6 +55,7 @@
<Compile Include="Commands\FailCommand.cs" />
<Compile Include="Commands\HelpCommand.cs" />
<Compile Include="Commands\MountCommand.cs" />
<Compile Include="Commands\TimeCommand.cs" />
<Compile Include="Commands\TypeCommand.cs" />
<Compile Include="Commands\CommandBase.cs" />
<Compile Include="Commands\VersionCommand.cs" />

View file

@ -31,6 +31,7 @@ namespace Cosmos.Shell.Console {
_commands.Add(new Commands.ExitCommand(Stop));
_commands.Add(new Commands.FailCommand());
_commands.Add(new Commands.HelpCommand(_commands));
_commands.Add(new Commands.TimeCommand());
_commands.Add(new Commands.TypeCommand());
_commands.Add(new Commands.VersionCommand());
_commands.Add(new Commands.LspciCommand());