From 5f95efd31b002233f86d4287cb42292fca48fd63 Mon Sep 17 00:00:00 2001 From: Scalpel_cp <165da7fc5536ee16440a98f161bfa866a8b94595G55xazV5> Date: Sat, 8 Mar 2008 23:47:57 +0000 Subject: [PATCH] Added TimeCommand in Shell.Console demo kernel. --- .../Commands/TimeCommand.cs | 26 +++++++++++++++++++ .../Cosmos.Shell.Console.csproj | 1 + .../Cosmos/Cosmos.Shell.Console/Prompter.cs | 1 + 3 files changed, 28 insertions(+) create mode 100644 source/Cosmos/Cosmos.Shell.Console/Commands/TimeCommand.cs diff --git a/source/Cosmos/Cosmos.Shell.Console/Commands/TimeCommand.cs b/source/Cosmos/Cosmos.Shell.Console/Commands/TimeCommand.cs new file mode 100644 index 000000000..96ddd381c --- /dev/null +++ b/source/Cosmos/Cosmos.Shell.Console/Commands/TimeCommand.cs @@ -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()); + } + } +} diff --git a/source/Cosmos/Cosmos.Shell.Console/Cosmos.Shell.Console.csproj b/source/Cosmos/Cosmos.Shell.Console/Cosmos.Shell.Console.csproj index 06d3fbd31..09b07caaa 100644 --- a/source/Cosmos/Cosmos.Shell.Console/Cosmos.Shell.Console.csproj +++ b/source/Cosmos/Cosmos.Shell.Console/Cosmos.Shell.Console.csproj @@ -55,6 +55,7 @@ + diff --git a/source/Cosmos/Cosmos.Shell.Console/Prompter.cs b/source/Cosmos/Cosmos.Shell.Console/Prompter.cs index 26e808c68..4fe4080fd 100644 --- a/source/Cosmos/Cosmos.Shell.Console/Prompter.cs +++ b/source/Cosmos/Cosmos.Shell.Console/Prompter.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());