mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-13 03:31:22 +00:00
Added TimeCommand in Shell.Console demo kernel.
This commit is contained in:
parent
b351e04de5
commit
5f95efd31b
3 changed files with 28 additions and 0 deletions
26
source/Cosmos/Cosmos.Shell.Console/Commands/TimeCommand.cs
Normal file
26
source/Cosmos/Cosmos.Shell.Console/Commands/TimeCommand.cs
Normal 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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" />
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Reference in a new issue