Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
v0.2.0, the last commit to only come out at the same time as the rele…
Browse files Browse the repository at this point in the history
…ase.
  • Loading branch information
meliemelody committed Feb 3, 2023
1 parent be689eb commit 9f2fc62
Show file tree
Hide file tree
Showing 48 changed files with 2,302 additions and 316 deletions.
2 changes: 1 addition & 1 deletion Aqua.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33213.308
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aqua", "Aqua\Aqua.csproj", "{92AC7B9F-BE18-4954-85E3-B1FEDDA4D48F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aqua", "Aqua\Aqua.csproj", "{92AC7B9F-BE18-4954-85E3-B1FEDDA4D48F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
79 changes: 63 additions & 16 deletions Aqua/Aqua.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,65 +6,112 @@
<Platform>cosmos</Platform>
<SupportsX86Intrinsics>false</SupportsX86Intrinsics>
<SelfContained>True</SelfContained>
<Deterministic>false</Deterministic>
</PropertyGroup>

<PropertyGroup>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<TransformOnBuild>true</TransformOnBuild>
<OverwriteReadOnlyOutputFiles>true</OverwriteReadOnlyOutputFiles>
<TransformOutOfDateOnly>false</TransformOutOfDateOnly>
<Deterministic>false</Deterministic>
</PropertyGroup>

<PropertyGroup>
<EnableGDB>False</EnableGDB>
<StartCosmosGDB>True</StartCosmosGDB>
<VisualStudioDebugPort>Pipe: Cosmos\Serial</VisualStudioDebugPort>
<CosmosDebugPort>Serial: COM1</CosmosDebugPort>
<Launch>VMware</Launch>
<Profile>VMware</Profile>
<Description>Use VMware Player or Workstation to deploy and debug.</Description>
<PxeInterface>192.168.0.8</PxeInterface>
<CompileVBEMultiboot>False</CompileVBEMultiboot>
<VBEResolution>800x600x32</VBEResolution>
<Timeout>5</Timeout>
<VMWareEdition>Player</VMWareEdition>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<OptimizationLevel>2</OptimizationLevel>
<Deterministic>false</Deterministic>
<QemuNetworkDevice>RTL8139</QemuNetworkDevice>
<QemuAudioDriver>AC97</QemuAudioDriver>
<DebugEnabled>True</DebugEnabled>
<RemoveBootDebugOutput>False</RemoveBootDebugOutput>
<TraceMode>All</TraceMode>
<DebugEnabled>False</DebugEnabled>
<QemuUseCustomParameters>False</QemuUseCustomParameters>
<QemuUseCustomLocation>False</QemuUseCustomLocation>
<QemuUseSerial>True</QemuUseSerial>
<ExtractMapFile>True</ExtractMapFile>
<Timeout>3</Timeout>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<Version>$(VersionPrefix)</Version>
<TraceMode>All</TraceMode>
<VisualStudioDebugPort>Pipe: Cosmos\Serial</VisualStudioDebugPort>
<CosmosDebugPort>Serial: COM1</CosmosDebugPort>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" />

<ItemGroup>
<None Remove="Commands\Executables\Manual.cs~RF1397f7e.TMP" />
<None Remove="Commands\Executables\Time.cs~RF610cb61.TMP" />
<None Remove="Fonts\Font1.bf" />
<None Remove="Fonts\zap-ext-vga09.psf" />
<None Remove="Kernel.cs~RFb22bb1.TMP" />
<None Remove="Sounds\Startup.wav" />
<None Remove="Terminal\Login\LoginSystem.cs~RF25e82b9.TMP" />
<None Remove="Terminal\Login\LoginSystem.cs~RFbaceef.TMP" />
<None Remove="Terminal\Accounts\LoginSystem.cs~RF25e82b9.TMP" />
<None Remove="Terminal\Accounts\LoginSystem.cs~RFbaceef.TMP" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Fonts\Font1.bf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Fonts\zap-ext-light16.psf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Fonts\zap-ext-vga09.psf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Sounds\Startup.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Cosmos.Build" Version="0-*" NoWarn="NU1604" />
<PackageReference Include="Cosmos.Coroutines" Version="1.0.0" />
<PackageReference Include="Cosmos.Debug.Kernel" Version="0-*" NoWarn="NU1604" />
<PackageReference Include="Cosmos.System2" Version="0-*" NoWarn="NU1604" />
<PackageReference Include="CosmosFtpServer" Version="1.0.2" />
<PackageReference Include="ManagedSoftwareExecution" Version="1.2.2" />
<PackageReference Include="SharpDX" Version="4.2.0" />
</ItemGroup>

<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>

<ItemGroup>
<Folder Include="Assets\" />
</ItemGroup>

<ItemGroup>
<Reference Include="DotNetClr">
<HintPath>Assets\Libraries\DotNetClr.dll</HintPath>
</Reference>
<Reference Include="DotNetParser">
<HintPath>Assets\Libraries\DotNetParser.dll</HintPath>
</Reference>
<Reference Include="LibDotNetParser">
<HintPath>Assets\Libraries\LibDotNetParser.dll</HintPath>
</Reference>
<Reference Include="PrismNetwork">
<HintPath>Assets\Libraries\Network.dll</HintPath>
</Reference>
<Reference Include="PrismFilesystem">
<HintPath>Assets\Libraries\Filesystem.dll</HintPath>
</Reference>
<Reference Include="PrismAudio">
<HintPath>Assets\Libraries\Audio.dll</HintPath>
</Reference>
<Reference Include="PrismGraphics">
<HintPath>Assets\Libraries\Graphics.dll</HintPath>
</Reference>
<Reference Include="PrismTools">
<HintPath>Assets\Libraries\PrismTools.dll</HintPath>
</Reference>
</ItemGroup>

<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="cd Miscellaneous&#xD;&#xA;echo using System; &gt; CompileTime.cs&#xD;&#xA;echo namespace Aqua.Miscellaneous { &gt;&gt; CompileTime.cs&#xD;&#xA;echo static class Compilation { &gt;&gt; CompileTime.cs&#xD;&#xA;echo public static readonly string Date = @&quot;%25date%25&quot;; &gt;&gt; CompileTime.cs&#xD;&#xA;echo public static readonly string Time = @&quot;%25time%25&quot;; &gt;&gt; CompileTime.cs&#xD;&#xA;echo } &gt;&gt; CompileTime.cs&#xD;&#xA;echo } &gt;&gt; CompileTime.cs&#xD;&#xA;" />
</Target>

</Project>
Binary file added Aqua/Assets/Libraries/Audio.dll
Binary file not shown.
Binary file added Aqua/Assets/Libraries/DotNetClr.dll
Binary file not shown.
Binary file added Aqua/Assets/Libraries/DotNetParser.dll
Binary file not shown.
Binary file added Aqua/Assets/Libraries/Filesystem.dll
Binary file not shown.
Binary file added Aqua/Assets/Libraries/Graphics.dll
Binary file not shown.
Binary file added Aqua/Assets/Libraries/LibDotNetParser.dll
Binary file not shown.
Binary file added Aqua/Assets/Libraries/Network.dll
Binary file not shown.
Binary file added Aqua/Assets/Libraries/PrismTools.dll
Binary file not shown.
3 changes: 3 additions & 0 deletions Aqua/Commands/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ namespace Aqua.Commands
public class Command
{
public readonly String name;
public readonly String description;

public Command(String name) { this.name = name; }
public Command(String name, String description) { this.name = name; this.description = description; }

public virtual String Execute(String[] args) { return ""; }
}
Expand Down
57 changes: 57 additions & 0 deletions Aqua/Commands/Executables/Calculate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aqua.Commands.Executables
{
public class Calculate : Command
{
public Calculate(string name, string description) : base(name, description) { }
int firstNumber = 0, secondNumber = 0, calc;

public override string Execute(string[] args)
{
switch (args[0])
{
case "add":
Int32.TryParse(args[1], out firstNumber);
Int32.TryParse(args[2], out secondNumber);

calc = firstNumber + secondNumber;
return calc.ToString();

case "min":
Int32.TryParse(args[1], out firstNumber);
Int32.TryParse(args[2], out secondNumber);

calc = firstNumber - secondNumber;
return calc.ToString();

case "mult":
Int32.TryParse(args[1], out firstNumber);
Int32.TryParse(args[2], out secondNumber);

calc = firstNumber * secondNumber;
return calc.ToString();

case "div":
Int32.TryParse(args[1], out firstNumber);
Int32.TryParse(args[2], out secondNumber);

calc = firstNumber / secondNumber;
return calc.ToString();

case "perc":
Int32.TryParse(args[1], out firstNumber);
Int32.TryParse(args[2], out secondNumber);

calc = (100 * secondNumber) / firstNumber;
return calc.ToString() + "%";
}

return null;
}
}
}
2 changes: 1 addition & 1 deletion Aqua/Commands/Executables/Clear.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Aqua.Commands.Executables
{
public class Clear : Command
{
public Clear(String name) : base(name) { }
public Clear(String name, String description) : base(name, description) { }

public override string Execute(string[] args)
{
Expand Down
2 changes: 1 addition & 1 deletion Aqua/Commands/Executables/IO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Aqua.Commands.Executables
{
public class IO : Command
{
public IO(String name) : base(name) { }
public IO(String name, String description) : base(name, description) { }

public override string Execute(string[] args)
{
Expand Down
30 changes: 30 additions & 0 deletions Aqua/Commands/Executables/Manual.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aqua.Commands.Executables
{
public class Manual : Command
{
public Manual (string name, string description) : base (name, description) { }

public override string Execute(string[] args)
{
for (int i = 0; i < Manager.descriptionStrings.Count; i++)
{
if (Manager.commandStrings[i] == "f" || Manager.commandStrings[i] == "net")
Console.WriteLine();

Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write($" {Manager.commandStrings[i]} - ");

Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Manager.descriptionStrings[i]);
}

return null;
}
}
}
2 changes: 1 addition & 1 deletion Aqua/Commands/Executables/Print.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Aqua.Commands.Executables
{
public class Print : Command
{
public Print(string name) : base(name) { }
public Print(string name, string description) : base(name, description) { }

public override string Execute(string[] args)
{
Expand Down
18 changes: 18 additions & 0 deletions Aqua/Commands/Executables/TextEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aqua.Commands.Executables
{
public class TextEditor : Command
{
public TextEditor(string name, string description) : base(name, description) { }

public override string Execute(string[] args)
{
return Miscellaneous.TextEditor.Run(args);
}
}
}
30 changes: 30 additions & 0 deletions Aqua/Commands/Executables/Time.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;

namespace Aqua.Commands.Executables
{
public class Time : Command
{
public Time (string name, string description) : base (name, description) { }

public override string Execute(string[] args)
{
switch (args[0])
{
case "compile":
Console.ForegroundColor = ConsoleColor.Gray;
return Miscellaneous.Compilation.Date + " | " + Miscellaneous.Compilation.Time;

case "direct":
Console.ForegroundColor = ConsoleColor.Gray;
return DateTime.Now.ToString("dddd M MMMM yyyy | HH:mm:ss.fff");

default:
Console.ForegroundColor = ConsoleColor.DarkGray;
Console.WriteLine(" Next time, please specify an argument [\"compile\" or \"direct\"].");

Console.ForegroundColor = ConsoleColor.Gray;
return DateTime.Now.ToString("dddd M MMMM yyyy | HH:mm:ss.fff");
}
}
}
}
35 changes: 25 additions & 10 deletions Aqua/Commands/Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,38 @@ namespace Aqua.Commands
public class Manager
{
private List<Command> commands;
public static List<string> commandStrings = new(), descriptionStrings = new();

public Manager()
{
this.commands = new List<Command>(1)
this.commands = new List<Command>()
{
new Executables.Print("prt"),
new Executables.Clear("clr"),
new Executables.IO("io"),
// Executables
new Executables.Print("prt", "Echoes back your sentence."),
new Executables.Clear("clr", "Clears your entire screen, and leaves you with only the shell and the bar"),
new Executables.IO("io", "Used to shutdown or reboot/restart your computer."),
new Executables.Time("time", "Shows the current time with \"direct\", and the compile time with \"compile\"."),
new Executables.Calculate("calc", "Calculate values between them [only 2 values allowed for now]"),
new Executables.TextEditor("ted", "Execute the TED Editor, an all new text editor for Aqua System."),

new Filesystem.File("f"),
new Filesystem.Directory("d"),
new Filesystem.Filesystem("fs"),
// Filesystem commands
new Filesystem.File("f", "The file utilities, everything you need for creating, deleting and editing files."),
new Filesystem.Directory("d", "The directory utilities, same as the file utilities but with directories."),
new Filesystem.Filesystem("fs", "The file system utilities, used to format or see the type of the drive."),

new Network.NetworkCommands("net"),

new Graphics.grComs("gui")
// System-wise commands
new Network.Commands("net", "Manages your network and FTP."),
new Executables.Manual("man", "List all the commands and their description."),
new Network.PackageManager("pm", "The general package manager for Aqua."),
new Graphics.grComs("gui", "All your Graphical Interface needs start here."),
new Terminal.Accounts.Accounts("acc", "Manage your accounts and log out.")
};

foreach (Command command in this.commands)
{
commandStrings.Add(command.name);
descriptionStrings.Add(command.description);
}
}

public String ProcessInput(String input)
Expand Down
18 changes: 10 additions & 8 deletions Aqua/ErrorHandler/CrashHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ namespace Aqua.ErrorHandler
{
public static class CrashHandler
{
public static void CrashHandle(Exception ex)
public static void Handle(Exception ex)
{
term.DebugWrite(ex.ToString(), 5);
term.DebugWrite("More information about the crash will be available as \'system-crash-*number*.txt\'", 6);
Random rnd = new();
int number = rnd.Next(100, 999);

Console.WriteLine("\n");

term.DebugWrite(ex.ToString() + "\n", 5);
term.DebugWrite("More information about this fatal system failure will be available as \'system-crash-" + number + ".log\'", 6);

if (!System.IO.Directory.Exists(@"0:\Crash"))
{
Expand All @@ -25,11 +30,8 @@ public static void CrashHandle(Exception ex)

try
{
Random rnd = new Random();
int number = rnd.Next(3);

System.IO.File.Create(@"0:\Crash\system-crash-" + number + ".txt");
System.IO.File.WriteAllText("0:\\Crash\\system-crash-" + number + ".txt", ex.ToString());
System.IO.File.Create(@"0:\Crash\system-crash-" + number + ".log");
System.IO.File.WriteAllText("0:\\Crash\\system-crash-" + number + ".log", DateTime.Now.ToString("HH:mm:ss | ") + ex.ToString() + " | " + ex.Data.ToString());
}
catch (Exception e)
{
Expand Down
Loading

0 comments on commit 9f2fc62

Please sign in to comment.