Reorganize project structure

This commit is contained in:
Stone_Red
2026-06-19 00:56:46 +02:00
parent 6f58eefb66
commit 95d88f1a8d
84 changed files with 267 additions and 186 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ bld/
[Oo]bj/
[Ll]og/
[Ll]ogs/
/output-x64
/RemSox.Kernel/output-x64
# Visual Studio 2015/2017 cache/options directory
.vs/
@@ -7,4 +7,4 @@ timeout: 0
protocol: limine
# Path to the kernel to boot. boot():/ represents the partition on which limine.conf is located.
path: boot():/boot/RemSox.elf
path: boot():/boot/RemSox.Kernel.elf
@@ -1,11 +1,11 @@
using Cosmos.Kernel.System.Keyboard;
using Cosmos.Kernel.System.Mouse;
using RemSox.Plugs;
using RemSox.Kernel.Plugs;
using System.Drawing;
namespace RemSox.Cryptography;
namespace RemSox.Kernel.Cryptography;
public static class CryptoManager
{
+8 -6
View File
@@ -1,18 +1,20 @@
global using Sys = Cosmos.Kernel.System;
using RemSox.Kernel.Cryptography;
using Cosmos.Kernel.HAL.Interfaces.Devices;
using Cosmos.Kernel.System.Network;
using Cosmos.Kernel.System.Network.Config;
using Cosmos.Kernel.System.Network.IPv4.UDP.DHCP;
using Cosmos.Kernel.System.Timer;
using RemSox.Cryptography;
using RemSox.Processes;
using RemSox.Processing;
using RemSox.UI.CLI;
using RemSox.UI.CLI.Commands;
using RemSox.Shared.Cryptography;
using RemSox.Kernel.Processes;
using RemSox.Kernel.Processing;
using RemSox.Kernel.UI.CLI;
using RemSox.Kernel.UI.CLI.Commands;
namespace RemSox;
namespace RemSox.Kernel;
/// <summary>
/// Main kernel class - inherits from Cosmos.Kernel.System.Kernel.
@@ -1,4 +1,4 @@
namespace RemSox.Logging;
namespace RemSox.Kernel.Logging;
public interface ILogger
{
@@ -1,6 +1,6 @@
using System.Collections.Concurrent;
namespace RemSox.Logging;
namespace RemSox.Kernel.Logging;
public class InMemoryLogger : ILogger
{
@@ -1,3 +1,3 @@
namespace RemSox.Logging;
namespace RemSox.Kernel.Logging;
public record LogEntry(string Message, LogSeverity Severity, DateTimeOffset Timestamp);
@@ -1,4 +1,4 @@
namespace RemSox.Logging;
namespace RemSox.Kernel.Logging;
public enum LogSeverity
{
@@ -1,4 +1,4 @@
namespace RemSox.Logging;
namespace RemSox.Kernel.Logging;
public class ProxyLogger(IEnumerable<ILogger> loggers) : ILogger
{
@@ -1,6 +1,6 @@
using Cosmos.Build.API.Attributes;
namespace RemSox.Plugs;
namespace RemSox.Kernel.Plugs;
[Plug("System.Security.Cryptography.RandomNumberGeneratorImplementation")]
/// <summary>
@@ -1,6 +1,6 @@
using System.Runtime;
using System.Runtime;
namespace RemSox.Plugs;
namespace RemSox.Kernel.Plugs;
public static partial class RuntimeExports
{
@@ -1,7 +1,7 @@
using RemSox.Processing;
using RemSox.UI.CLI;
using RemSox.Kernel.Processing;
using RemSox.Kernel.UI.CLI;
namespace RemSox.Processes;
namespace RemSox.Kernel.Processes;
internal class CliProcess() : Process("Cli")
{
@@ -1,17 +1,18 @@
using RemSox.Kernel.UI.GUI.Rendering;
using Cosmos.Kernel.System.Graphics;
using Cosmos.Kernel.System.Keyboard;
using Cosmos.Kernel.System.Mouse;
using RemSox.Processing;
using RemSox.UI;
using RemSox.UI.GUI.Layout;
using RemSox.UI.GUI.Rendering;
using RemSox.UI.GUI.UIEelements.Controls;
using RemSox.UI.GUI.Windows;
using RemSox.Kernel.Processing;
using RemSox.Shared.UI;
using RemSox.Kernel.UI.GUI.Layout;
using RemSox.Shared.UI.GUI.Rendering;
using RemSox.Kernel.UI.GUI.UIEelements.Controls;
using RemSox.Kernel.UI.GUI.Windows;
using System.Drawing;
namespace RemSox.Processes;
namespace RemSox.Kernel.Processes;
internal class DesktopProcess() : Process("Desktop Manager")
{
@@ -1,15 +1,16 @@
using Cosmos.Kernel.System.Graphics;
using Cosmos.Kernel.System.Keyboard;
using RemSox.Networking;
using RemSox.Processing;
using RemSox.UI;
using RemSox.UI.GUI.Rendering;
using RemSox.UI.GUI.Windows;
using RemSox.Shared.Networking;
using RemSox.Kernel.Processing;
using RemSox.Shared.UI;
using RemSox.Shared.UI.GUI.Rendering;
using RemSox.Kernel.UI.GUI.Rendering;
using RemSox.Kernel.UI.GUI.Windows;
using System.Text;
namespace RemSox.Processes;
namespace RemSox.Kernel.Processes;
internal sealed class RemoteDesktopProcess() : Process("Remote Desktop Server")
{
@@ -1,13 +1,13 @@
using Cosmos.Kernel.System.Keyboard;
using RemSox.Processing;
using RemSox.UI.CLI;
using RemSox.UI.GUI.UIEelements.Shapes;
using RemSox.UI.GUI.Windows;
using RemSox.Kernel.Processing;
using RemSox.Kernel.UI.CLI;
using RemSox.Kernel.UI.GUI.UIEelements.Shapes;
using RemSox.Kernel.UI.GUI.Windows;
using System.Drawing;
namespace RemSox.Processes;
namespace RemSox.Kernel.Processes;
public class TerminalProcess() : Process("Terminal")
{
@@ -1,11 +1,11 @@
using RemSox.Processing;
using RemSox.Processing.IPC;
using RemSox.UI.GUI.UIEelements.Shapes;
using RemSox.UI.GUI.Windows;
using RemSox.Kernel.Processing;
using RemSox.Kernel.Processing.IPC;
using RemSox.Kernel.UI.GUI.UIEelements.Shapes;
using RemSox.Kernel.UI.GUI.Windows;
using System.Drawing;
namespace RemSox.Processes;
namespace RemSox.Kernel.Processes;
public class TestProcess() : Process("Test Process")
{
@@ -1,9 +1,9 @@
using RemSox.Processing;
using RemSox.Utils;
using RemSox.Kernel.Processing;
using RemSox.Kernel.Utils;
using YesNt.Interpreter.Runtime;
namespace RemSox.Processes;
namespace RemSox.Kernel.Processes;
public class YesNtInterpreterProcess() : Process("YesNtInterpreter")
{
@@ -1,4 +1,4 @@
namespace RemSox.Processing.IPC;
namespace RemSox.Kernel.Processing.IPC;
internal static class InterProcessCommunicator
{
@@ -1,4 +1,4 @@
namespace RemSox.Processing.IPC;
namespace RemSox.Kernel.Processing.IPC;
public abstract class Message
{
@@ -1,10 +1,10 @@
using RemSox.Logging;
using RemSox.Processing.IPC;
using RemSox.UI.GUI.Windows;
using RemSox.Kernel.Logging;
using RemSox.Kernel.Processing.IPC;
using RemSox.Kernel.UI.GUI.Windows;
using System.Drawing;
namespace RemSox.Processing;
namespace RemSox.Kernel.Processing;
public abstract class Process(string name)
{
@@ -1,10 +1,10 @@
using RemSox.Logging;
using RemSox.UI.GUI.Windows;
using RemSox.Kernel.Logging;
using RemSox.Kernel.UI.GUI.Windows;
using System.Collections.Concurrent;
using System.Diagnostics;
namespace RemSox.Processing;
namespace RemSox.Kernel.Processing;
public static class ProcessManager
{
@@ -1,6 +1,6 @@
using RemSox.Processes;
using RemSox.Kernel.Processes;
namespace RemSox.Processing;
namespace RemSox.Kernel.Processing;
public static class ProcessManifest
{
@@ -1,4 +1,4 @@
namespace RemSox.Processing;
namespace RemSox.Kernel.Processing;
public class ProcessMetrics
{
@@ -4,7 +4,6 @@
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<!-- Core kernel packages -->
<ItemGroup>
<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.2" />
<PackageReference Include="Cosmos.Kernel" Version="3.0.58" />
@@ -12,6 +11,10 @@
<PackageReference Include="YesNt.Interpreter" Version="1.1.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RemSox.Shared\RemSox.Shared.csproj" />
</ItemGroup>
<UsingTask TaskName="PatchInteropSysSecureRandomTask" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<CoreLibPath ParameterType="System.String" Required="true" />
@@ -1,4 +1,4 @@
namespace RemSox.UI.CLI;
namespace RemSox.Kernel.UI.CLI;
public static class CommandManager
{
@@ -1,4 +1,4 @@
namespace RemSox.UI.CLI.Commands;
namespace RemSox.Kernel.UI.CLI.Commands;
public sealed class ClearCommand : ICommand
{
@@ -1,4 +1,4 @@
namespace RemSox.UI.CLI.Commands;
namespace RemSox.Kernel.UI.CLI.Commands;
public sealed class ShutdownCommand : ICommand
{
@@ -1,4 +1,4 @@
namespace RemSox.UI.CLI.Commands;
namespace RemSox.Kernel.UI.CLI.Commands;
public sealed class HelpCommand : ICommand
{
@@ -1,7 +1,7 @@
using RemSox.Processes;
using RemSox.Processing;
using RemSox.Kernel.Processes;
using RemSox.Kernel.Processing;
namespace RemSox.UI.CLI.Commands;
namespace RemSox.Kernel.UI.CLI.Commands;
public sealed class SpawnProcessCommand : ICommand
{
@@ -1,4 +1,4 @@
namespace RemSox.UI.CLI.Commands;
namespace RemSox.Kernel.UI.CLI.Commands;
public class RebootCommand : ICommand
{
@@ -1,7 +1,7 @@
using RemSox.Processes;
using RemSox.Processing;
using RemSox.Kernel.Processes;
using RemSox.Kernel.Processing;
namespace RemSox.UI.CLI.Commands;
namespace RemSox.Kernel.UI.CLI.Commands;
public class StartGuiCommand : ICommand
{
@@ -1,7 +1,7 @@
using RemSox.Processes;
using RemSox.Processing;
using RemSox.Kernel.Processes;
using RemSox.Kernel.Processing;
namespace RemSox.UI.CLI.Commands;
namespace RemSox.Kernel.UI.CLI.Commands;
public class StartRemoteDesktopCommand : ICommand
{
@@ -1,7 +1,7 @@
using RemSox.Processes;
using RemSox.Processing;
using RemSox.Kernel.Processes;
using RemSox.Kernel.Processing;
namespace RemSox.UI.CLI.Commands;
namespace RemSox.Kernel.UI.CLI.Commands;
public class StopGuiCommand : ICommand
{
@@ -1,7 +1,7 @@
using RemSox.Processes;
using RemSox.Processing;
using RemSox.Kernel.Processes;
using RemSox.Kernel.Processing;
namespace RemSox.UI.CLI.Commands;
namespace RemSox.Kernel.UI.CLI.Commands;
public class StopRemoteDesktopCommand : ICommand
{
@@ -1,7 +1,7 @@
using RemSox.Logging;
using RemSox.Processing;
using RemSox.Kernel.Logging;
using RemSox.Kernel.Processing;
namespace RemSox.UI.CLI.Commands;
namespace RemSox.Kernel.UI.CLI.Commands;
public class ViewProcessLogs : ICommand
{
@@ -1,6 +1,6 @@
using RemSox.Processing;
using RemSox.Kernel.Processing;
namespace RemSox.UI.CLI.Commands;
namespace RemSox.Kernel.UI.CLI.Commands;
public class YesNtCommand : ICommand
{
@@ -1,4 +1,4 @@
namespace RemSox.UI.CLI;
namespace RemSox.Kernel.UI.CLI;
/// <summary>
/// Defines a command executable via the CLI or GUI terminal.
/// </summary>
@@ -1,9 +1,9 @@
using RemSox.UI.GUI.UIEelements;
using RemSox.UI.GUI.Windows;
using RemSox.Kernel.UI.GUI.UIEelements;
using RemSox.Kernel.UI.GUI.Windows;
using System.Drawing;
namespace RemSox.UI.GUI.Layout;
namespace RemSox.Kernel.UI.GUI.Layout;
public sealed class GridLayout
{
@@ -1,6 +1,6 @@
using RemSox.UI.GUI.Windows;
using RemSox.Kernel.UI.GUI.Windows;
namespace RemSox.UI.GUI.Layout;
namespace RemSox.Kernel.UI.GUI.Layout;
public static class LayoutExtensions
{
@@ -1,9 +1,9 @@
using RemSox.UI.GUI.UIEelements;
using RemSox.UI.GUI.Windows;
using RemSox.Kernel.UI.GUI.UIEelements;
using RemSox.Kernel.UI.GUI.Windows;
using System.Drawing;
namespace RemSox.UI.GUI.Layout;
namespace RemSox.Kernel.UI.GUI.Layout;
public enum StackOrientation
{
@@ -1,12 +1,13 @@
using RemSox.Shared.UI.GUI.Rendering;
using Cosmos.Kernel.System.Graphics;
using Cosmos.Kernel.System.Graphics.Fonts;
using RemSox.UI.GUI.UIEelements;
using RemSox.Utils;
using RemSox.Kernel.UI.GUI.UIEelements;
using RemSox.Kernel.Utils;
using System.Drawing;
namespace RemSox.UI.GUI.Rendering;
namespace RemSox.Kernel.UI.GUI.Rendering;
public sealed class CanvasRenderSource : IRenderSource
{
@@ -1,6 +1,7 @@
using RemSox.Networking;
using RemSox.Shared.UI.GUI.Rendering;
using RemSox.Shared.Networking;
namespace RemSox.UI.GUI.Rendering;
namespace RemSox.Kernel.UI.GUI.Rendering;
public sealed class NetworkRenderSource(TcpRpcServer server) : IRenderSource
{
@@ -1,8 +1,9 @@
using RemSox.Shared.UI;
using Cosmos.Kernel.System.Keyboard;
using System.Drawing;
namespace RemSox.UI.GUI.UIEelements;
namespace RemSox.Kernel.UI.GUI.UIEelements;
public abstract class Control(string type) : UIElement(type)
{
@@ -1,8 +1,9 @@
using RemSox.UI.GUI.Rendering;
using RemSox.Shared.UI;
using RemSox.Shared.UI.GUI.Rendering;
using System.Drawing;
namespace RemSox.UI.GUI.UIEelements.Controls;
namespace RemSox.Kernel.UI.GUI.UIEelements.Controls;
public class Button() : Control("Button")
{
@@ -1,8 +1,9 @@
using RemSox.UI.GUI.Rendering;
using RemSox.Shared.UI;
using RemSox.Shared.UI.GUI.Rendering;
using System.Drawing;
namespace RemSox.UI.GUI.UIEelements.Controls;
namespace RemSox.Kernel.UI.GUI.UIEelements.Controls;
public class CheckBox() : Control("CheckBox")
{
@@ -1,6 +1,6 @@
using RemSox.UI.GUI.Rendering;
using RemSox.Shared.UI.GUI.Rendering;
namespace RemSox.UI.GUI.UIEelements.Controls;
namespace RemSox.Kernel.UI.GUI.UIEelements.Controls;
public class Panel() : Control("Panel")
{
@@ -1,8 +1,8 @@
using RemSox.UI.GUI.Rendering;
using RemSox.Shared.UI.GUI.Rendering;
using System.Drawing;
namespace RemSox.UI.GUI.UIEelements.Controls;
namespace RemSox.Kernel.UI.GUI.UIEelements.Controls;
public class ProgressBar() : Control("ProgressBar")
{
@@ -1,8 +1,9 @@
using RemSox.UI.GUI.Rendering;
using RemSox.Shared.UI;
using RemSox.Shared.UI.GUI.Rendering;
using System.Drawing;
namespace RemSox.UI.GUI.UIEelements.Controls;
namespace RemSox.Kernel.UI.GUI.UIEelements.Controls;
public class RadioButton() : Control("RadioButton")
{
@@ -1,8 +1,9 @@
using RemSox.UI.GUI.Rendering;
using RemSox.Shared.UI;
using RemSox.Shared.UI.GUI.Rendering;
using System.Drawing;
namespace RemSox.UI.GUI.UIEelements.Controls;
namespace RemSox.Kernel.UI.GUI.UIEelements.Controls;
public class Slider() : Control("Slider")
{
@@ -1,6 +1,6 @@
using System.Drawing;
namespace RemSox.UI.GUI.UIEelements;
namespace RemSox.Kernel.UI.GUI.UIEelements;
public abstract class Shape(string type) : UIElement(type)
{
@@ -1,6 +1,6 @@
using RemSox.UI.GUI.Rendering;
using RemSox.Shared.UI.GUI.Rendering;
namespace RemSox.UI.GUI.UIEelements.Shapes;
namespace RemSox.Kernel.UI.GUI.UIEelements.Shapes;
public class Circle() : Shape("Circle")
{
@@ -1,8 +1,8 @@
using RemSox.UI.GUI.Rendering;
using RemSox.Shared.UI.GUI.Rendering;
using System.Drawing;
namespace RemSox.UI.GUI.UIEelements.Shapes;
namespace RemSox.Kernel.UI.GUI.UIEelements.Shapes;
public class Line() : Shape("Line")
{
@@ -1,6 +1,6 @@
using RemSox.UI.GUI.Rendering;
using RemSox.Shared.UI.GUI.Rendering;
namespace RemSox.UI.GUI.UIEelements.Shapes;
namespace RemSox.Kernel.UI.GUI.UIEelements.Shapes;
public class Pixel() : Shape("Pixel")
{
@@ -1,8 +1,8 @@
using RemSox.UI.GUI.Rendering;
using RemSox.Shared.UI.GUI.Rendering;
using System.Drawing;
namespace RemSox.UI.GUI.UIEelements.Shapes;
namespace RemSox.Kernel.UI.GUI.UIEelements.Shapes;
public class Rectangle() : Shape("Rectangle")
{
@@ -1,8 +1,8 @@
using RemSox.UI.GUI.Rendering;
using RemSox.Shared.UI.GUI.Rendering;
using System.Drawing;
namespace RemSox.UI.GUI.UIEelements.Shapes;
namespace RemSox.Kernel.UI.GUI.UIEelements.Shapes;
public class Text() : UIElement("Text")
{
@@ -1,9 +1,9 @@
using RemSox.UI.GUI.Rendering;
using RemSox.Utils;
using RemSox.Shared.UI.GUI.Rendering;
using RemSox.Kernel.Utils;
using System.Drawing;
namespace RemSox.UI.GUI.UIEelements;
namespace RemSox.Kernel.UI.GUI.UIEelements;
public abstract class UIElement(string type) : ChangedPropertiesTracker
{
@@ -1,9 +1,10 @@
using RemSox.UI.GUI.Rendering;
using RemSox.UI.GUI.UIEelements;
using RemSox.Shared.UI;
using RemSox.Shared.UI.GUI.Rendering;
using RemSox.Kernel.UI.GUI.UIEelements;
using System.Drawing;
namespace RemSox.UI.GUI.Windows;
namespace RemSox.Kernel.UI.GUI.Windows;
/// <summary>
/// Represents a window within the GUI system, managing its state, UI elements, and interactions.
@@ -1,4 +1,4 @@
namespace RemSox.UI.GUI.Windows;
namespace RemSox.Kernel.UI.GUI.Windows;
public enum WindowLayer
{
@@ -1,12 +1,13 @@
using RemSox.Shared.UI;
using Cosmos.Kernel.System.Graphics;
using Cosmos.Kernel.System.Keyboard;
using RemSox.Processing;
using RemSox.UI.GUI.Rendering;
using RemSox.Kernel.Processing;
using RemSox.Shared.UI.GUI.Rendering;
using System.Drawing;
namespace RemSox.UI.GUI.Windows;
namespace RemSox.Kernel.UI.GUI.Windows;
/// <summary>
/// Manages window creation, focus, interaction, and rendering orchestration for the GUI system.
@@ -1,9 +1,9 @@
using Cosmos.Kernel.System.Graphics;
using Cosmos.Kernel.System.Graphics;
using Cosmos.Kernel.System.Graphics.Fonts;
using System.Drawing;
namespace RemSox.Utils;
namespace RemSox.Kernel.Utils;
public static class CanvasExtensions
{
@@ -1,6 +1,6 @@
using System.ComponentModel;
namespace RemSox.Utils;
namespace RemSox.Kernel.Utils;
public abstract class ChangedPropertiesTracker : INotifyPropertyChanged
{
@@ -1,8 +1,8 @@
using RemSox.Processing;
using RemSox.UI.GUI.UIEelements;
using RemSox.UI.GUI.UIEelements.Controls;
using RemSox.UI.GUI.UIEelements.Shapes;
using RemSox.UI.GUI.Windows;
using RemSox.Kernel.Processing;
using RemSox.Kernel.UI.GUI.UIEelements;
using RemSox.Kernel.UI.GUI.UIEelements.Controls;
using RemSox.Kernel.UI.GUI.UIEelements.Shapes;
using RemSox.Kernel.UI.GUI.Windows;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
@@ -10,9 +10,9 @@ using System.Drawing;
using YesNt.Interpreter.Runtime;
using YesNt.Interpreter.Utilities;
using ShapesRectangle = RemSox.UI.GUI.UIEelements.Shapes.Rectangle;
using ShapesRectangle = RemSox.Kernel.UI.GUI.UIEelements.Shapes.Rectangle;
namespace RemSox.Utils;
namespace RemSox.Kernel.Utils;
/// <summary>
/// <para>
+5
View File
@@ -0,0 +1,5 @@
cosmos build
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
#cosmos run
& "$env:LOCALAPPDATA\Cosmos\Tools\qemu\bin\qemu-system-x86_64.exe" -L "$env:LOCALAPPDATA\Cosmos\Tools\qemu\share\qemu" -M q35 -cpu max -m 512M -serial stdio -cdrom .\output-x64\RemSox.Kernel.iso -vga std -nic user,hostfwd=tcp::9999-:9999
@@ -5,7 +5,7 @@ using Org.BouncyCastle.Crypto.Parameters;
using System.Security.Cryptography;
using System.Text;
namespace RemSox.Cryptography;
namespace RemSox.Shared.Cryptography;
public static class AesGcmCrypto
{
@@ -1,9 +1,9 @@
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Digests;
using Org.BouncyCastle.Crypto.Generators;
using Org.BouncyCastle.Crypto.Parameters;
namespace RemSox.Cryptography;
namespace RemSox.Shared.Cryptography;
public static class Pkcs5S2PasswordKeyDeriver
{
@@ -1,8 +1,8 @@
using RemSox.Cryptography;
using RemSox.Shared.Cryptography;
namespace RemSox.Networking;
namespace RemSox.Shared.Networking;
internal class AesPacketCrypto(byte[] key) : IPacketCrypto
public class AesPacketCrypto(byte[] key) : IPacketCrypto
{
public byte[] Decrypt(byte[] data)
{
@@ -1,4 +1,4 @@
namespace RemSox.Networking;
namespace RemSox.Shared.Networking;
public interface IPacketCrypto
{
@@ -1,5 +1,7 @@
using System.Net.Sockets;
namespace RemSox.Shared.Networking;
/// <summary>
/// Simple wrapper around TcpClient to hold connection-scoped resources safely.
/// </summary>
@@ -1,4 +1,4 @@
namespace RemSox.Networking;
namespace RemSox.Shared.Networking;
public class TcpMessage
{
@@ -1,10 +1,10 @@
using RemSox.Networking;
using System.Buffers.Binary;
using System.Collections.Concurrent;
using System.Net.Sockets;
using System.Text;
namespace RemSox.Shared.Networking;
public abstract class TcpRpcBase(IPacketCrypto? crypto = null)
{
protected readonly IPacketCrypto? crypto = crypto;
@@ -1,16 +1,16 @@
using System.Net;
using System.Net;
using System.Net.Sockets;
namespace RemSox.Networking;
namespace RemSox.Shared.Networking;
public class TcpRpcClient(IPacketCrypto? crypto = null) : TcpRpcBase(crypto)
{
private TcpConnection? connection;
public void Connect(IPAddress ipAddress, int port)
public void Connect(string host, int port)
{
TcpClient client = new();
client.Connect(ipAddress, port);
client.Connect(host, port);
connection = new TcpConnection(client);
@@ -1,8 +1,8 @@
using System.Collections.Concurrent;
using System.Collections.Concurrent;
using System.Net;
using System.Net.Sockets;
namespace RemSox.Networking;
namespace RemSox.Shared.Networking;
public class TcpRpcServer(IPacketCrypto? crypto = null) : TcpRpcBase(crypto)
{
+11
View File
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.2" />
</ItemGroup>
</Project>
@@ -1,4 +1,4 @@
namespace RemSox.UI.GUI.Rendering;
namespace RemSox.Shared.UI.GUI.Rendering;
public interface IRenderSource
{
@@ -1,7 +1,7 @@
using System.Drawing;
using System.Text;
namespace RemSox.UI.GUI.Rendering;
namespace RemSox.Shared.UI.GUI.Rendering;
public class RenderCommand
{
@@ -1,4 +1,4 @@
namespace RemSox.UI.GUI.Rendering;
namespace RemSox.Shared.UI.GUI.Rendering;
/// <summary>
/// <para>Render command opcodes, grouped by category:</para>
@@ -1,4 +1,4 @@
namespace RemSox.UI;
namespace RemSox.Shared.UI;
public record MouseEvent(MouseEventType Type, int X = 0, int Y = 0, MouseButton Button = MouseButton.None, int Delta = 0)
{
+43
View File
@@ -0,0 +1,43 @@
using RemSox.Shared.Networking;
namespace RemSox.Viewer;
public class Program
{
public static async Task Main(string[] args)
{
Console.WriteLine("RemSox RDP Viewer");
Console.WriteLine("=================");
if (args.Length < 2)
{
Console.WriteLine("Usage: RemSox.Viewer <host> <port>");
return;
}
string host = args[0];
int port = int.Parse(args[1]);
TcpRpcClient client = new();
client.ListenTo("RenderCmd", async (payload) =>
{
Console.WriteLine($"Received render command: {payload.Length} bytes");
});
try
{
client.Connect(host, port);
Console.WriteLine($"Connected to {host}:{port}");
await client.RequestAsync("SyncRequest", []);
Console.WriteLine("Sync request sent.");
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
Console.WriteLine("Press Ctrl+C to exit.");
await Task.Delay(Timeout.Infinite);
}
}
+12
View File
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\RemSox.Shared\RemSox.Shared.csproj" />
</ItemGroup>
</Project>
+3 -1
View File
@@ -1,5 +1,7 @@
<Solution>
<Project Path="RemSox.csproj">
<Project Path="RemSox.Kernel\RemSox.Kernel.csproj">
<Build Solution="Debug|*" Project="false" />
</Project>
<Project Path="RemSox.Shared\RemSox.Shared.csproj" />
<Project Path="RemSox.Viewer\RemSox.Viewer.csproj" />
</Solution>
-7
View File
@@ -1,7 +0,0 @@
Set-Location $PSScriptRoot
cosmos build
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
#cosmos run
bash -c "qemu-system-x86_64 -M q35 -cpu max -m 512M -serial stdio -cdrom ./output-x64/RemSox.iso -vga std -nic user,hostfwd=tcp::9999-:9999"
-3
View File
@@ -1,3 +0,0 @@
# This directory is for native C files that will be compiled with GCC.
# Place your .c and .h files here.
# They will be automatically compiled and linked into your kernel.