From 2634cc8de450aee00812aa41bd917a9c5d6f3717 Mon Sep 17 00:00:00 2001 From: Tony Bark Date: Fri, 6 Jan 2023 22:00:48 -0500 Subject: [PATCH] Renamed ComConsts to SysMeta - With the help of ChatGPT, some of the code is now properly commented - Switched to calendar versioning due to the huge time skip and architectural changes - Screenshot! --- Changelog.md | 12 +++++- README.md | 10 ++--- screenshot.png | Bin 0 -> 10565 bytes src/Tomas.Common/ComConsts.cs | 29 -------------- src/Tomas.Common/GitInfo.txt | 2 +- src/Tomas.Common/SysMeta.cs | 54 +++++++++++++++++++++++++++ src/Tomas.Kernal/GlobalUsing.cs | 3 ++ src/Tomas.Kernal/Kernel.cs | 7 ---- src/Tomas.Kernal/Programs/About.cs | 3 +- src/Tomas.Kernal/Shell.cs | 10 +++++ src/Tomas.Kernal/TomFS.cs | 5 +-- src/Tomas.Terminal/Programs/About.cs | 2 +- 12 files changed, 86 insertions(+), 51 deletions(-) create mode 100644 screenshot.png delete mode 100644 src/Tomas.Common/ComConsts.cs create mode 100644 src/Tomas.Common/SysMeta.cs diff --git a/Changelog.md b/Changelog.md index dc0f161..de70050 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,8 +1,16 @@ # Change Log -## 0.1.0 +## v23.0 + +- Calendar versioning, `YY.MINOR.MICRO` + +- Build number based on commit hash + +Due to the huge time skip and architectural changes, I've (retroactively) switched to calendar versioning with ``v0.1`` now known as ``v20.1`` as well. + +## v20.1 - Filesystem (based on the Cosmos Wiki [guide](https://csos-guide-to-cosmos.fandom.com/wiki/Getting_Started_-_Materials_and_Setting_Up)) -- Proper versioning (thanks to Gitinfo!) +- Semantic versioning - Replaced BasicApp with AboutApp - Removd TerminalCancelEventArgs and everything related to it \ No newline at end of file diff --git a/README.md b/README.md index 4a212b9..d986d72 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # TOMAS +![](C:\Users\zc456\source\repos\tomas\screenshot.png) + TOMAS (**To**ny's **Ma**naged Operating **S**ystem) is a hobby operating system based on the [COSMOS](https://github.com/CosmosOS/Cosmos) framework that comes with a respective terminal emulator. ## Requirements @@ -7,13 +9,11 @@ TOMAS (**To**ny's **Ma**naged Operating **S**ystem) is a hobby operating system ### Prerequisites - Operating System - - Visual Studio 2022 - - COSMOS User Kit v2022 or later - - VMWare Workstation Player + - Visual Studio 2022 + - COSMOS User Kit v2022 or later + - VMWare Workstation Player - .NET 6 or later - - ## License This project is licensed under the BSD 3-Clause license - see the [LICENSE](LICENSE) file for details. diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..40fc5792da32ff7705961d01784d63b578061af7 GIT binary patch literal 10565 zcmeHtc~p{X-|o|P@2s{%yV_}v%~npCIS*vkRx@>%?VKeynK{oID%e}8^_F6pLz2>9 znp*`mffR+(k^%)4M^MR}azGSB1w_u%e$V%PXT9sJ^Z!}v{X1?? zJ?JO!{ni*~pLhUJY5V@Si5mU-DgYc|yPR>jbR&>A0)3!85TyIX(W;+f@bSYxcRbqf z@4FQrw8QoF^~ReD&c}3%e^7a>NI97kyldNbi?hpDmk(Y4)9T2r7dK0l4!YfZeRJO0 zrw=kBG|(T$NakOTbvsqihgf-!TIN1v=_-eK zs5!-aZ5!)W#oRS+%^Ei`#}TdLB=ZwmPn9R9IQw!^g|%P3@7G0WQEh!CdpHkSWAi6g zenG8vt9s;I8Ig!Sk5+ZYy+n>IYeXA}-x9|B8?LvHNH;i7VtGezkHS*NY#BPRx%4)m z$S)*!W5oDr*bjoG)fVlIxeAKThBPmI&&D_Idg7XgT#_cVF8J6qIK`C}_RU;2EY@{b z&1zFCRc6}T1O#pyTWj`-RD<(+@@wPP784>z?u|RO<-6kC2Krmsv=&3iC-*yjp8Bi- zj&Y9kI`S(@OGQ6Vu5E*aJ#$jQ-NAq-RHfE`NLb1QG=JQp4(T|<@msGtA##X=N=(g-Ik6Zr0_8r{yyQW@F)=MvJ z#I`8Tv7FS&#oxZz#H|k=Jm`M$OS|z;POW7}{K*Nxqcd+c7i4|5I$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{r^y9Dm%q4+#20C(bQ{K5jkZ90J^(n*uW5(2cdxoSdVLBkARiyGa0j3I zYD_Mp?Sf9G;HLRy^gcp7^a9(Q2Gs-OA7?9;*iKnto2#pJdpwTa7YsCF<3I)&fdv86 zmHh9%j|{%xQ`#?lb+W8;`x{BoADG9Hw3W$}o<1XJ-2YxXG~iX((3gzoA5#Pd!~Y)= zPVFyctZ}9w7&3&T{sg>ZT)&mDt#GFM>dewr>CuFg36L(pPT*ng3tx_g) zr>~MH*t8eTY0l^)HHDKdf%atqegTh&Px^KPz>D|EWu9-(Z?eglCv-h2Ow8!>#l`~c*}PYZaMr` z0$gto_?`H4TP8@jf|x&sdb)#H*$o7arj)UclB1l7 zxyE|i@8%bT9&n~^FE);(nMd+y0zy)y0oXnRyhvp@(6n{}xMRtbJD35)9(D~GqFc8gTaroz@YpPmQvB<;h(ORr(#MNaAh&;q)ce0Oe8t0HqHD4u#2Fa~Dn$ST_Gw&tR_3J_X5@eb!xvgv;u@@Vwb;qPo|FFU{ZTKvE_D zZoJNE5;$GZyTV}bffd*}>0r(m6;LLqZBW%z+4`RI>*K6X)cs)k9d`}MwLg*^LLc8% zz6nr&v9$+&qvLikl6b=zUH4c@8<++WYrWfFu9E=Jb!|K+K`CeQVsT%2jR6fr)gaB;447_5-zXITzYhD5-@wIrT@4AeV zN>Au$!oSvS{!OF#_X7Ugi2u8s^PgM)h($ literal 0 HcmV?d00001 diff --git a/src/Tomas.Common/ComConsts.cs b/src/Tomas.Common/ComConsts.cs deleted file mode 100644 index f9bdd81..0000000 --- a/src/Tomas.Common/ComConsts.cs +++ /dev/null @@ -1,29 +0,0 @@ -// I license this project under the BSD 3-Clause license. -// See the LICENSE file in the project root for more information. -using System.Text; - -namespace Tomas.Common; - -public struct ComConsts -{ - /// - /// Name of the operating system - /// - public const string NAME = "TOMAS"; - public const string VERSION = $"{ThisAssembly.Git.SemVer.Major}.{ThisAssembly.Git.SemVer.Minor}.{ThisAssembly.Git.SemVer.Patch}"; - - [SuppressMessage("Usage", "CA2211:Non-constant fields should not be visible")] - public static string BuildNumber = $"Build {BuildFromCommit}"; - - /// - /// Generate the build number from the commit hash. - /// - static uint BuildFromCommit - { - get - { - var commit = Encoding.UTF8.GetBytes(ThisAssembly.Git.Commit); - return BitConverter.ToUInt32(commit, 0) % 1000000; - } - } -} \ No newline at end of file diff --git a/src/Tomas.Common/GitInfo.txt b/src/Tomas.Common/GitInfo.txt index ceab6e1..4266d86 100644 --- a/src/Tomas.Common/GitInfo.txt +++ b/src/Tomas.Common/GitInfo.txt @@ -1 +1 @@ -0.1 \ No newline at end of file +23.0 \ No newline at end of file diff --git a/src/Tomas.Common/SysMeta.cs b/src/Tomas.Common/SysMeta.cs new file mode 100644 index 0000000..c9f1c90 --- /dev/null +++ b/src/Tomas.Common/SysMeta.cs @@ -0,0 +1,54 @@ +// I license this project under the BSD 3-Clause license. +// See the LICENSE file in the project root for more information. +using System.Text; + +namespace Tomas.Common; + +/// +/// System metdata, such as name, version and build number. +/// +public struct SysMeta +{ + /// + /// The name of the operating system. + /// + public const string NAME = "TOMAS"; + + /// + /// The version of the operating system, in the Calendar Versioning format: "yy.minor.patch". + /// The year, minor, and patch version numbers are automatically extracted from the Git repository + /// using the ThisAssembly.Git.SemVer object. + /// + public const string VERSION = $"{ThisAssembly.Git.SemVer.Major}.{ThisAssembly.Git.SemVer.Minor}.{ThisAssembly.Git.SemVer.Patch}"; + + /// + /// The build number of the operating system, generated from the commit hash. + /// The build number is a 6-digit number, with the first 3 digits being the first 3 digits of the commit hash + /// converted to a uint, and the last 3 digits being the last 3 digits of the commit hash converted to a uint. + /// + [SuppressMessage("Usage", "CA2211:Non-constant fields should not be visible")] + public static string BuildNumber = $"Build {BuildNumFromCommit}"; + + /// + /// Let's the system know that the file system is activated. + /// + public static bool IsFSActive = false; + + /// + /// Generates the build number from the commit hash. + /// + /// The build number as a uint. + static uint BuildNumFromCommit + { + get + { + // Get the bytes of the commit hash as a UTF-8 encoded string + var commit = Encoding.UTF8.GetBytes(ThisAssembly.Git.Commit); + + // Convert the first 4 bytes of the commit hash to a uint and return it modulo 1000000 + // (this will give us a 6-digit number with the first 3 digits being the first 3 digits of the commit hash + // and the last 3 digits being the last 3 digits of the commit hash) + return BitConverter.ToUInt32(commit, 0) % 1000000; + } + } +} diff --git a/src/Tomas.Kernal/GlobalUsing.cs b/src/Tomas.Kernal/GlobalUsing.cs index 9d9efd3..b847d34 100644 --- a/src/Tomas.Kernal/GlobalUsing.cs +++ b/src/Tomas.Kernal/GlobalUsing.cs @@ -1,4 +1,7 @@ global using Tomas.Common.Programs; global using Tomas.Interface; global using Tomas.Kernel.Programs; +global using Cosmos.System.FileSystem; +global using Cosmos.System.FileSystem.VFS; +global using Tomas.Common; global using Os = Cosmos.System; \ No newline at end of file diff --git a/src/Tomas.Kernal/Kernel.cs b/src/Tomas.Kernal/Kernel.cs index 1bffafd..3705c9c 100644 --- a/src/Tomas.Kernal/Kernel.cs +++ b/src/Tomas.Kernal/Kernel.cs @@ -14,13 +14,6 @@ public class Kernel : Os.Kernel protected override void Run() { - /* - Console.Write("$"); - var input = Console.ReadLine(); - Console.Write("Text typed: "); - Console.WriteLine(input); - */ - while (true) { var shell = new Shell(); diff --git a/src/Tomas.Kernal/Programs/About.cs b/src/Tomas.Kernal/Programs/About.cs index 1814a0c..365c563 100644 --- a/src/Tomas.Kernal/Programs/About.cs +++ b/src/Tomas.Kernal/Programs/About.cs @@ -1,6 +1,5 @@ // I license this project under the BSD 3-Clause license. // See the LICENSE file in the project root for more information. -using Tomas.Common; namespace Tomas.Kernel.Programs; @@ -8,7 +7,7 @@ public class About : IProgram { public bool Run(IShell shell) { - Console.WriteLine($"TOMAS v{ComConsts.VERSION} ({ComConsts.BuildNumber}) is a hobby operating system written in C# using the COSMOS framework.{Environment.NewLine}Commands:"); + Console.WriteLine($"TOMAS v{SysMeta.VERSION} ({SysMeta.BuildNumber}) is a hobby operating system written in C# using the COSMOS framework.{Environment.NewLine}Commands:"); var progs = shell.Programs; foreach (var commands in progs.Keys) Console.WriteLine(commands); diff --git a/src/Tomas.Kernal/Shell.cs b/src/Tomas.Kernal/Shell.cs index 975324c..1b49aa5 100644 --- a/src/Tomas.Kernal/Shell.cs +++ b/src/Tomas.Kernal/Shell.cs @@ -5,8 +5,11 @@ namespace Tomas.Kernel; public class Shell : IShell { + // The symbol to display before the cursor when the shell is waiting for user input const char SYMBOL = '$'; + // A dictionary containing the programs available to the shell, with the keys being the program names + // and the values being the program objects public Dictionary Programs => new() { {"about", new About() }, @@ -15,13 +18,20 @@ public class Shell : IShell {"commands", new Commands() } }; + // A property that allows the shell to read a line of input from the user public string ReadLine { get { + // Write the SYMBOL character to the console Console.Write(SYMBOL); + + // Read a line of input from the user var readl = Console.ReadLine(); + + // Return the line of input return readl; } } } + diff --git a/src/Tomas.Kernal/TomFS.cs b/src/Tomas.Kernal/TomFS.cs index 0854c4e..eca77af 100644 --- a/src/Tomas.Kernal/TomFS.cs +++ b/src/Tomas.Kernal/TomFS.cs @@ -1,8 +1,5 @@ // I license this project under the BSD 3-Clause license. // See the LICENSE file in the project root for more information. -using Cosmos.System.FileSystem; -using Cosmos.System.FileSystem.VFS; -using Tomas.Common; namespace Tomas.Kernel; @@ -21,7 +18,7 @@ class TomFS Console.WriteLine("Creating system files."); fs.CreateFile($"{SYSTEM_DIR}sysinfo.txt"); Console.WriteLine("Setting system preferences."); - File.WriteAllText($"{SYSTEM_DIR}sysinfo.txt", $"{ComConsts.NAME}, {ComConsts.BuildNumber}"); + File.WriteAllText($"{SYSTEM_DIR}sysinfo.txt", $"{SysMeta.NAME} v{SysMeta.VERSION} ({SysMeta.BuildNumber})"); Console.WriteLine("File system loaded sucesfully."); var intro = File.ReadAllText($"{SYSTEM_DIR}sysinfo.txt"); Console.WriteLine(intro); diff --git a/src/Tomas.Terminal/Programs/About.cs b/src/Tomas.Terminal/Programs/About.cs index e5ddf6c..bf3e15f 100644 --- a/src/Tomas.Terminal/Programs/About.cs +++ b/src/Tomas.Terminal/Programs/About.cs @@ -8,7 +8,7 @@ public class About : IProgram { public bool Run(IShell shell) { -Console.WriteLine($"{ComConsts.NAME} Terminal Emulator v{ComConsts.BuildNumber}{Environment.NewLine}" +Console.WriteLine($"{SysMeta.NAME} Terminal Emulator v{SysMeta.BuildNumber}{Environment.NewLine}" + "TOMAS (Tony's Managed Operating System) is a operating system written in C# using the COSMOS framework."); return true; }