Compare commits

...

9 commits

Author SHA1 Message Date
Tony Bark
5888771e20 Removed nonexisting flag in workflow
- Moved shell instance as a global field
2023-01-07 14:47:52 -05:00
Tony Bark
c10e753c39 Unit tests
- Renamed GlobalUsings.cs to Usings.cs
- Refractored SysFS
- Seperated building of the terminal and unit tests
- To save on resources, the unit tests job on runs on Ubuntu
2023-01-07 14:31:09 -05:00
Tony Bark
19f7483fbd Social preview
- Possibly fixed formatting error with README
2023-01-07 13:20:31 -05:00
Tony Bark
6fb029b76e With the help of DALL-E 2, I now have a cute logo that I extracted the vector from with another AI tool 2023-01-07 13:09:52 -05:00
Tony Bark
f006ab41bf Issue and pull request templates
- Added code of conduct
- Code climate badges
2023-01-07 12:39:07 -05:00
Tony Bark
ac28f2b9a4 Global usings now reference Tomas.Core instead of Tomas.Common 2023-01-07 11:48:46 -05:00
Tony Bark
2794aa17f4 Copyright waiver under the Unlicense with BSD 3-Clause fallback. 2023-01-07 11:44:50 -05:00
Tony Bark
dc2176b26d Renamed Tomas.Common to Tomas.Core
- Imported CSTNet parser to kernal under Globalization namespace
- Added System.Diagnostics to global usings
- Split version systems between kernal and terminal emulator (see changelog)
2023-01-07 11:22:38 -05:00
Tony Bark
7b56b93edd Fixed typo with project directory
- Renamed IsFSActive to isFSEnabled
2023-01-07 10:44:51 -05:00
56 changed files with 1300 additions and 295 deletions

View file

@ -0,0 +1,17 @@
## Expected Behavior
## Actual Behavior
## Steps to Reproduce the Problem
1.
1.
1.
## Specifications
- Version:
- Platform:
- Operating System:

38
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View file

@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View file

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

7
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,7 @@
# Fixes
## Proposed Changes
-
-
-

View file

@ -4,9 +4,9 @@ on:
schedule:
- cron: "0 0 * * 0"
push:
branches: [main, develop, "feature/**"]
branches: [main, develop, "feature/**", "release/**"]
pull_request:
branches: [main, develop, "feature/**"]
branches: [main, develop, "feature/**", "release/**"]
jobs:
build:
@ -27,4 +27,23 @@ jobs:
- name: Install dependencies
run: dotnet restore src/Tomas.Terminal
- name: Build
run: dotnet build src/Tomas.Terminal -c Release --no-restore
run: dotnet build src/Tomas.Terminal -c Release --no-restore --nologo
test:
timeout-minutes: 15
continue-on-error: true
runs-on: ubuntu-latest
strategy:
matrix:
dotnet: ["6.0.x"]
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Install test dependencies
run: dotnet restore src/Tomas.Tests
- name: Test
run: dotnet test src --no-restore --nologo

View file

@ -2,10 +2,10 @@
## v23.0
- Calendar versioning, `YY.MINOR.MICRO`
- Split versioning systems between kernal and terminal
- Calendar versioning, `YY.MINOR.MICRO`, for kernal
- Semantic versioning for terminal
- If the file system is activate, system activity will be logged
- 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.

View file

@ -1,6 +1,20 @@
# TOMAS
<img title="" src="screenshot.png" alt="" data-align="center">
<p align="center">
<img title="" src="assets/logo.svg" width="250" alt=""">
<br>
<img title="" src="assets/screenshot.png" alt=""">
<hr>
</p>
<p align="center">
<a href="https://github.com/tonytins/tomas/blob/main/LICENSE"><img src="https://img.shields.io/github/license/tonytins/tomas" alt="GitHub license"></a>
<a href="https://github.com/tonytins/tomas/actions?query=workflow%3Adotnet.yml"><img src="https://img.shields.io/github/actions/workflow/status/tonytins/tomas/dotnet.yml" alt="GitHub Workflow Status"></a>
<img src="https://img.shields.io/github/commit-activity/w/tonytins/tomas" alt="GitHub commit activity">
<br>
<a href="code_of_conduct.md"><img src="https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg" alt="Contributor Covenant"></a>
<img src="https://img.shields.io/codeclimate/maintainability-percentage/tonytins/tomas" alt="Code Climate maintainability">
<img src="https://img.shields.io/codeclimate/tech-debt/tonytins/tomas" alt="Code Climate technical debt">
</p>
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.
@ -9,15 +23,11 @@ TOMAS (**To**ny's **Ma**naged Operating **S**ystem) is a hobby operating system
### Prerequisites
- Windows 10 or later
- Visual Studio 2022
- .NET 6 or later
- COSMOS User Kit v2022 or later
- VMWare Workstation Player
## License
This project is licensed under the BSD 3-Clause license - see the [LICENSE](LICENSE) file for details.
In jurisdictions that recognize copyright waivers, I've [waived all copyright](UNLICENSE) and related or neighboring rights for to this project. In areas where these waivers are not recognized, [BSD-3-Clause](LICENSE) is enforced.

24
UNLICENSE Normal file
View file

@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>

BIN
assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

246
assets/logo.svg Normal file
View file

@ -0,0 +1,246 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
viewBox="0 0 350 350.00001"
id="svg368"
sodipodi:docname="logo.svg"
width="350"
height="350"
inkscape:version="1.2 (dc2aedaf03, 2022-05-15)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs372">
<filter
style="color-interpolation-filters:sRGB;"
inkscape:label="Drop Shadow"
id="filter4772"
x="-0.08538938"
y="-0.10760133"
width="1.2050412"
height="1.2583777">
<feFlood
flood-opacity="0.498039"
flood-color="rgb(0,0,0)"
result="flood"
id="feFlood4762" />
<feComposite
in="flood"
in2="SourceGraphic"
operator="in"
result="composite1"
id="feComposite4764" />
<feGaussianBlur
in="composite1"
stdDeviation="6.23053"
result="blur"
id="feGaussianBlur4766" />
<feOffset
dx="6"
dy="6"
result="offset"
id="feOffset4768" />
<feComposite
in="offset"
in2="offset"
operator="atop"
result="fbSourceGraphic"
id="feComposite4770" />
<feColorMatrix
result="fbSourceGraphicAlpha"
in="fbSourceGraphic"
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
id="feColorMatrix4774" />
<feFlood
id="feFlood4776"
flood-opacity="0.498039"
flood-color="rgb(0,0,0)"
result="flood"
in="fbSourceGraphic" />
<feComposite
in2="fbSourceGraphic"
id="feComposite4778"
in="flood"
operator="in"
result="composite1" />
<feGaussianBlur
id="feGaussianBlur4780"
in="composite1"
stdDeviation="6.23053"
result="blur" />
<feOffset
id="feOffset4782"
dx="6"
dy="6"
result="offset" />
<feComposite
in2="offset"
id="feComposite4784"
in="offset"
operator="atop"
result="composite2" />
</filter>
</defs>
<sodipodi:namedview
id="namedview370"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="true"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="1.0097656"
inkscape:cx="61.895551"
inkscape:cy="184.20116"
inkscape:window-width="1366"
inkscape:window-height="697"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg368" />
<g
id="g2820-5"
transform="matrix(0.82401468,0,0,0.82444568,24.616324,35.386706)"
style="filter:url(#filter4772)">
<path
fill="#ffffff"
fill-opacity="1"
d="m 335.72772,32.435374 q 2.12,0.71 4.94,0.37 0.5,-0.06 0.92,0.21 5.86,3.58 7.45,11.86 2.3,12.6 0.19,25.81 -3.78,23.68 -14.04,45.999996 -1.48,2.94 -2.52,5.19 -4.62999,9.54 -11.99999,18.50002 -8.12,9.85 -19.85,18.7 -0.4,0.3 -0.83,0.56 -14.68,9.35 -31.51,14.55 -13.25,4.09 -26.25,5.75 -9.05,1.32 -18.54,1.5 -3.64,0.32 -7.21,0.5 -3.66,0.18 -6.19,1.81 -4.45,3.32 -8.1,8.69 -2.27,1.71 -3.46,5.75 -2.78,9.41 -3.25,20.5 -0.07,1.67 1.6,1.74 13.44,0.27 24.9,-2.49 13.07,-2.67 28.75,-0.25 5.84,0.9 11.11,2.73 0.45,0.21 0.94,0.34 14.09,4.22 28.01,15.37 1.12,0.89 1.69,1.52 -7.9,0.03 -16.25,0.04 -10.8,-0.21 -19.75,3 -15.51,5.1 -26.69,14.81 -9.18,7.99 -14.75,18.5 -5.53,9.56 -10.5,21.25 -3.79,8.88 -12.12,11.63 -12.46,4.52 -25.75,2.37 -4.22,-0.68 -8.75,-2.5 -6.25,-2.01 -11.02,-6.77 -0.36,-0.35 -0.62,-0.78 -2.2,-3.63 -4.05,-8.26 -5.82,-14.54 -14.69,-26.06 -7.04,-9.16 -16.87,-15.38 -19.119998,-12.04 -42.689998,-12.06 -0.5,0 -0.99,-0.08 -3.75,-0.59 -9.51,-0.46 1.62,-2.37 4.73,-3.81 0.46,-0.21 0.87,-0.5 14.69,-10.43 33.4,-14.65 4.729998,-1.07 10.249998,-1 11.9,-0.42 21.25,1 0.68,0.1 1.25,0.5 11.01,1.35 25.26,1.25 1.24,-0.01 0.94,-1.21 -0.78,-3.86 -1.64,-8.1 -1.84,-8.73 -6.31,-15.94 -0.56,-0.91 -1.25,-1.29 -3.15,-6.24 -9.94,-10.27 -4.68,-2.78 -11.27,-1.94 -0.15,-0.25 -0.79,-0.25 -28.829998,0.04 -53.479998,-10.61 -0.46,-0.2 -0.93,-0.36 -13.76,-4.57 -24.78,-13.84 -2.28,-1.92 -4.62,-3.88 -5.92,-4.34 -8.98,-9.08 -0.27,-0.42 -0.61,-0.79 -6.47,-7.48 -11.29,-16.50002 -1.92,-3.59 -4.27,-7.19 -0.99,-2.62 -2,-4.5 -7.4,-16.569996 -11.04,-34.749996 -2.94000004,-14.7 -2.00000004,-29 0.25,-6.28 2.31000004,-11.44 2.45,-5.5 9.19,-6.06 6.67,-0.77 13.44,0.06 3.84,0.47 7.81,1.19 4.22,0.67 7.48,2.11 0.46,0.2 0.95,0.27 4.24,0.55 8.06,2.34 0.45,0.22 0.84,-0.1 0.19,-0.15 0.92,0.42 -0.14,0.78 1.25,1.46 6.01,2.69 11.44,5.81 1.89,1.09 3.52,1.85 0.48,0.15 0.88,0.44 8.77,6.03 17.85,12.46 12.36,8.82 24.119998,23.38 8.9,11.01 17.32,21.729996 0.31,0.39 0.59,0.8 18.5,26.91002 38.25,55.24002 1.02,1.46 2.78,1.65 2.77,0.29 10.15,0.08 1.81,-0.06 2.88,-1.51 12.98,-17.37 25.72,-36.43002 14.56,-21.79 30.61,-40.679996 0.33,-0.38 0.68,-0.74 8.07,-8.37 18.4,-18.89 2.18,-2.22 4.37,-3.63 4.96,-2.72 10,-6.5 16.1,-12.05 34.69,-18.52 2.51,-0.76 5,-1.33 1.81,0.09 2.75,-0.92 6.86,-2.2 15.49999,-2.29 0.5,0 0.98,-0.13 2.38,-0.67 4.77,0.13 z M 252.91773,141.24539 q 2.35,2.03 5.31,2.94 4.52,1.66 10.5,0.5 15.33,-3.04 26.44,-12.06002 13.64,-11.08 22.62,-25.63 6.66,-10.699996 10.63,-20.619996 6.55999,-16.41 5.56999,-35.43 -0.03,-0.6 -0.58,-0.37 -12.01999,4.83 -23.11999,9.92 -20.41,9.38 -37.75,25.75 -5.21,4.78 -9.62,10.38 -6.98,8.849996 -11.88,19.619996 -3.07,6.62 -3.37,14.13 -0.03,2.99002 2,6.87002 1.25,2.44 3.25,4 z M 49.417732,127.99537 q 11.13,10.11002 25.25,15.00002 5.71,1.9 11.81,1.94 5.16,0.33 9.44,-2.56 6.129998,-4.14 6.059998,-12.69002 -0.12,-6.12 -2.689998,-12.56 -4.66,-11.7 -13,-20.999996 -5.47,-5.89 -10.48,-11.57 -0.33,-0.37 -0.71,-0.69 -13.41,-11.14 -28,-19.62 -0.43,-0.25 -0.88,-0.47 -13.38,-6.57 -29.24,-11.59 -1.81,-0.57 -1.75,1.25 0.59,26.98 14.44,50.559996 8.16,13.91 19.75,24 z M 161.80773,303.07539 q 2.65,1.57 6.17,1.61 6,0.06 12,0 3.25,0.04 6.03,-0.59 1.69,-0.42 2.21,-2.08 1.8,-6.41 -0.18,-12.39 -1.08,-4.05 -5.06,-4.94 -6.85,-1.53 -15.5,-0.77 -0.5,0.02 -0.98,0.14 -3.98,1.01 -5.71,4.69 -1.18,2.51 -2.1,4.49 -0.21,0.45 -0.07,0.93 0.62,2.08 0.92,5.46 0.21,2.33 2.27,3.45 z"
id="path280-3"
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-opacity:1" />
<path
fill="#7c91ad"
fill-opacity="1"
d="m 314.47773,34.725374 q -0.94,1.01 -2.75,0.92 0.89,-1.01 2.75,-0.92 z"
id="path282-5"
style="stroke:none" />
<path
fill="#017aff"
fill-opacity="1"
d="m 306.72773,36.975374 q -18.59,6.47 -34.69,18.52 -5.04,3.78 -10,6.5 -2.19,1.41 -4.37,3.63 -10.33,10.52 -18.4,18.89 -0.35,0.36 -0.68,0.74 -16.05,18.889996 -30.61,40.679996 -12.74,19.06002 -25.72,36.43002 -1.07,1.45 -2.88,1.51 -7.38,0.21 -10.15,-0.08 -1.76,-0.19 -2.78,-1.65 -19.75,-28.33 -38.25,-55.24002 -0.28,-0.41 -0.59,-0.8 -8.42,-10.719996 -17.32,-21.729996 -11.759998,-14.56 -24.119998,-23.38 -9.08,-6.43 -17.85,-12.46 -0.4,-0.29 -0.88,-0.44 -1.63,-0.76 -3.52,-1.85 -5.43,-3.12 -11.44,-5.81 -1.39,-0.68 -1.25,-1.46 7.37,1.63 13.44,4.52 4.92,2.35 9.34,4.28 0.47,0.16 0.91,0.4 8.89,4.86 17.75,10.82 9.959998,6.7 18.649998,15.64 0.35,0.36 0.73,0.68 7.58,6.24 16.62,11.93 1.77,1.12 3.79,0.56 12.35,-3.86 25.02,-5.87 7.86,-1.25 16.25,-1 21.47,-0.57 40,7.25 3.56,1.5 5.69,-0.06 4.62,-3.99 9.62,-6.88 5.18,-2.88 9.5,-7.5 3.61,-3.85 6.63,-6.37 22.23,-17.67 46.28,-25.84 0.47,-0.16 0.9,-0.41 6.64,-3.76 14.38,-4.15 z"
id="path284-5"
style="stroke:none;stroke-opacity:1" />
<path
fill="#ffbb00"
fill-opacity="1"
d="m 333.98772,50.945374 q 0.99,19.02 -5.56999,35.43 -3.97,9.92 -10.63,20.619996 -8.98,14.55 -22.62,25.63 -11.11,9.02002 -26.44,12.06002 -5.98,1.16 -10.5,-0.5 -2.96,-0.91 -5.31,-2.94 -2,-1.56 -3.25,-4 -2.03,-3.88 -2,-6.87002 0.3,-7.51 3.37,-14.13 4.9,-10.77 11.88,-19.619996 4.41,-5.6 9.62,-10.38 17.34,-16.37 37.75,-25.75 11.1,-5.09 23.11999,-9.92 0.55,-0.23 0.58,0.37 z"
id="path286-3"
style="stroke:none;stroke-opacity:1" />
<path
fill="#ffbb00"
fill-opacity="1"
d="m 16.977732,52.185374 q 15.86,5.02 29.24,11.59 0.45,0.22 0.88,0.47 14.59,8.48 28,19.62 0.38,0.32 0.71,0.69 5.01,5.68 10.48,11.57 8.34,9.299996 13,20.999996 2.569998,6.44 2.689998,12.56 0.07,8.55002 -6.059998,12.69002 -4.28,2.89 -9.44,2.56 -6.1,-0.04 -11.81,-1.94 -14.12,-4.89 -25.25,-15.00002 -11.59,-10.09 -19.75,-24 -13.85,-23.579996 -14.44,-50.559996 -0.06,-1.82 1.75,-1.25 z"
id="path288-7"
style="stroke:none;stroke-opacity:1" />
<path
fill="#374a6c"
fill-opacity="1"
d="m 13.267732,113.93537 q 1.01,1.88 2,4.5 -0.04,0.25 -0.08,0.5 -2.73,-2.53 -1.92,-5 z"
id="path294-3"
style="stroke:none" />
<path
fill="#017aff"
fill-opacity="1"
d="m 335.18772,116.68537 q -0.33,2.6 -1.71,5.25 -5.49999,10.59 -10.70999,20.87002 -0.23,0.44 -0.41,0.91 -4.39,11 -8.88,22.47 -2.29,5.85 -3.94,12.31 -4.37,16.87 -6.56,33.44 -1.73,13.1 -2.89,25.82 -0.05,0.49 -0.55,0.47 -2.65,-0.13 -7.06,-0.58 -0.57,-0.63 -1.69,-1.52 -13.92,-11.15 -28.01,-15.37 -0.49,-0.13 -0.94,-0.34 -5.27,-1.83 -11.11,-2.73 -15.68,-2.42 -28.75,0.25 -11.46,2.76 -24.9,2.49 -1.67,-0.07 -1.6,-1.74 0.47,-11.09 3.25,-20.5 1.19,-4.04 3.46,-5.75 -0.45,1.79 -1.03,3.28 -0.18,0.47 -0.05,0.95 1.48,5.55 5.93,11.21 6.14,8.03 16.19,6.31 5.87,-1 9.31,-7.19 3.56,-5.97 2.44,-12.81 -0.95,-5.81 -6.56,-9.44 -2.39,-1.54 -4.88,-2.37 -0.14,-0.08 0.15,-0.94 9.49,-0.18 18.54,-1.5 13,-1.66 26.25,-5.75 16.83,-5.2 31.51,-14.55 0.43,-0.26 0.83,-0.56 11.73,-8.85 19.85,-18.7 7.37,-8.96002 11.99999,-18.50002 1.04,-2.25 2.52,-5.19 z"
id="path296-6"
style="stroke:none;stroke-opacity:1" />
<path
fill="#017aff"
fill-opacity="1"
d="m 15.267732,118.43537 q 2.35,3.6 4.27,7.19 4.82,9.02002 11.29,16.50002 0.34,0.37 0.61,0.79 3.06,4.74 8.98,9.08 2.34,1.96 4.62,3.88 11.02,9.27 24.78,13.84 0.47,0.16 0.93,0.36 24.65,10.65 53.479998,10.61 0.64,0 0.79,0.25 0.09,0.71 -0.85,1.19 -5.65,2.45 -8.88,6.87 -4.25,5.83 -1.7,13.56 0.67,2.25 2.14,4.08 4.68,5.81 12.02,7.91 0.48,0.14 0.98,0.19 5.39,0.55 9.94,-1.86 5.58,-2.95 7.31,-8.94 1.43,-4.95 0.25,-9 -0.35,-1.22 0,-1.79 0.69,0.38 1.25,1.29 4.47,7.21 6.31,15.94 0.86,4.24 1.64,8.1 0.3,1.2 -0.94,1.21 -14.25,0.1 -25.26,-1.25 -0.57,-0.4 -1.25,-0.5 -9.35,-1.42 -21.25,-1 -5.52,-0.07 -10.249998,1 -18.71,4.22 -33.4,14.65 -0.41,0.29 -0.87,0.5 -3.11,1.44 -4.73,3.81 -4.1,0.12 -7.69,0 -0.5,-0.02 -0.53,-0.52 -0.91,-8.25 -1.28,-16.94 -0.3,-9.81 -2.25,-18 -2.6,-10.92 -4.47,-20.45 -0.09,-0.49 -0.24,-0.97 -5.63,-17.93 -12.92,-36.3 -0.18,-0.47 -0.45,-0.89 -7.87,-12.27002 -12.46,-23.89002 0.04,-0.25 0.08,-0.5 z"
id="path298-4"
style="stroke:none;stroke-opacity:1" />
<path
fill="#0e141d"
fill-opacity="1"
d="m 125.01773,180.93539 q 6.59,-0.84 11.27,1.94 6.79,4.03 9.94,10.27 -0.35,0.57 0,1.79 1.18,4.05 -0.25,9 -1.73,5.99 -7.31,8.94 -4.55,2.41 -9.94,1.86 -0.5,-0.05 -0.98,-0.19 -7.34,-2.1 -12.02,-7.91 -1.47,-1.83 -2.14,-4.08 -2.55,-7.73 1.7,-13.56 3.23,-4.42 8.88,-6.87 0.94,-0.48 0.85,-1.19 z"
id="path300-0"
style="stroke:none" />
<path
fill="#0d1120"
fill-opacity="1"
d="m 223.68773,181.43539 q -0.29,0.86 -0.15,0.94 2.49,0.83 4.88,2.37 5.61,3.63 6.56,9.44 1.12,6.84 -2.44,12.81 -3.44,6.19 -9.31,7.19 -10.05,1.72 -16.19,-6.31 -4.45,-5.66 -5.93,-11.21 -0.13,-0.48 0.05,-0.95 0.58,-1.49 1.03,-3.28 3.65,-5.37 8.1,-8.69 2.53,-1.63 6.19,-1.81 3.57,-0.18 7.21,-0.5 z"
id="path302-2"
style="stroke:none" />
<path
fill="#161a47"
fill-opacity="1"
d="m 167.47773,283.91539 q 8.65,-0.76 15.5,0.77 3.98,0.89 5.06,4.94 1.98,5.98 0.18,12.39 -0.52,1.66 -2.21,2.08 -2.78,0.63 -6.03,0.59 -6,0.06 -12,0 -3.52,-0.04 -6.17,-1.61 -2.06,-1.12 -2.27,-3.45 -0.3,-3.38 -0.92,-5.46 -0.14,-0.48 0.07,-0.93 0.92,-1.98 2.1,-4.49 1.73,-3.68 5.71,-4.69 0.48,-0.12 0.98,-0.14 z"
id="path304-8"
style="stroke:none" />
</g>
<g
id="g2820"
transform="matrix(0.82401468,0,0,0.82444568,34.26914,37.541234)">
<path
fill="#ffffff"
fill-opacity="1"
d="m 335.72772,32.435374 q 2.12,0.71 4.94,0.37 0.5,-0.06 0.92,0.21 5.86,3.58 7.45,11.86 2.3,12.6 0.19,25.81 -3.78,23.68 -14.04,45.999996 -1.48,2.94 -2.52,5.19 -4.62999,9.54 -11.99999,18.50002 -8.12,9.85 -19.85,18.7 -0.4,0.3 -0.83,0.56 -14.68,9.35 -31.51,14.55 -13.25,4.09 -26.25,5.75 -9.05,1.32 -18.54,1.5 -3.64,0.32 -7.21,0.5 -3.66,0.18 -6.19,1.81 -4.45,3.32 -8.1,8.69 -2.27,1.71 -3.46,5.75 -2.78,9.41 -3.25,20.5 -0.07,1.67 1.6,1.74 13.44,0.27 24.9,-2.49 13.07,-2.67 28.75,-0.25 5.84,0.9 11.11,2.73 0.45,0.21 0.94,0.34 14.09,4.22 28.01,15.37 1.12,0.89 1.69,1.52 -7.9,0.03 -16.25,0.04 -10.8,-0.21 -19.75,3 -15.51,5.1 -26.69,14.81 -9.18,7.99 -14.75,18.5 -5.53,9.56 -10.5,21.25 -3.79,8.88 -12.12,11.63 -12.46,4.52 -25.75,2.37 -4.22,-0.68 -8.75,-2.5 -6.25,-2.01 -11.02,-6.77 -0.36,-0.35 -0.62,-0.78 -2.2,-3.63 -4.05,-8.26 -5.82,-14.54 -14.69,-26.06 -7.04,-9.16 -16.87,-15.38 -19.119998,-12.04 -42.689998,-12.06 -0.5,0 -0.99,-0.08 -3.75,-0.59 -9.51,-0.46 1.62,-2.37 4.73,-3.81 0.46,-0.21 0.87,-0.5 14.69,-10.43 33.4,-14.65 4.729998,-1.07 10.249998,-1 11.9,-0.42 21.25,1 0.68,0.1 1.25,0.5 11.01,1.35 25.26,1.25 1.24,-0.01 0.94,-1.21 -0.78,-3.86 -1.64,-8.1 -1.84,-8.73 -6.31,-15.94 -0.56,-0.91 -1.25,-1.29 -3.15,-6.24 -9.94,-10.27 -4.68,-2.78 -11.27,-1.94 -0.15,-0.25 -0.79,-0.25 -28.829998,0.04 -53.479998,-10.61 -0.46,-0.2 -0.93,-0.36 -13.76,-4.57 -24.78,-13.84 -2.28,-1.92 -4.62,-3.88 -5.92,-4.34 -8.98,-9.08 -0.27,-0.42 -0.61,-0.79 -6.47,-7.48 -11.29,-16.50002 -1.92,-3.59 -4.27,-7.19 -0.99,-2.62 -2,-4.5 -7.4,-16.569996 -11.04,-34.749996 -2.94000004,-14.7 -2.00000004,-29 0.25,-6.28 2.31000004,-11.44 2.45,-5.5 9.19,-6.06 6.67,-0.77 13.44,0.06 3.84,0.47 7.81,1.19 4.22,0.67 7.48,2.11 0.46,0.2 0.95,0.27 4.24,0.55 8.06,2.34 0.45,0.22 0.84,-0.1 0.19,-0.15 0.92,0.42 -0.14,0.78 1.25,1.46 6.01,2.69 11.44,5.81 1.89,1.09 3.52,1.85 0.48,0.15 0.88,0.44 8.77,6.03 17.85,12.46 12.36,8.82 24.119998,23.38 8.9,11.01 17.32,21.729996 0.31,0.39 0.59,0.8 18.5,26.91002 38.25,55.24002 1.02,1.46 2.78,1.65 2.77,0.29 10.15,0.08 1.81,-0.06 2.88,-1.51 12.98,-17.37 25.72,-36.43002 14.56,-21.79 30.61,-40.679996 0.33,-0.38 0.68,-0.74 8.07,-8.37 18.4,-18.89 2.18,-2.22 4.37,-3.63 4.96,-2.72 10,-6.5 16.1,-12.05 34.69,-18.52 2.51,-0.76 5,-1.33 1.81,0.09 2.75,-0.92 6.86,-2.2 15.49999,-2.29 0.5,0 0.98,-0.13 2.38,-0.67 4.77,0.13 z M 252.91773,141.24539 q 2.35,2.03 5.31,2.94 4.52,1.66 10.5,0.5 15.33,-3.04 26.44,-12.06002 13.64,-11.08 22.62,-25.63 6.66,-10.699996 10.63,-20.619996 6.55999,-16.41 5.56999,-35.43 -0.03,-0.6 -0.58,-0.37 -12.01999,4.83 -23.11999,9.92 -20.41,9.38 -37.75,25.75 -5.21,4.78 -9.62,10.38 -6.98,8.849996 -11.88,19.619996 -3.07,6.62 -3.37,14.13 -0.03,2.99002 2,6.87002 1.25,2.44 3.25,4 z M 49.417732,127.99537 q 11.13,10.11002 25.25,15.00002 5.71,1.9 11.81,1.94 5.16,0.33 9.44,-2.56 6.129998,-4.14 6.059998,-12.69002 -0.12,-6.12 -2.689998,-12.56 -4.66,-11.7 -13,-20.999996 -5.47,-5.89 -10.48,-11.57 -0.33,-0.37 -0.71,-0.69 -13.41,-11.14 -28,-19.62 -0.43,-0.25 -0.88,-0.47 -13.38,-6.57 -29.24,-11.59 -1.81,-0.57 -1.75,1.25 0.59,26.98 14.44,50.559996 8.16,13.91 19.75,24 z M 161.80773,303.07539 q 2.65,1.57 6.17,1.61 6,0.06 12,0 3.25,0.04 6.03,-0.59 1.69,-0.42 2.21,-2.08 1.8,-6.41 -0.18,-12.39 -1.08,-4.05 -5.06,-4.94 -6.85,-1.53 -15.5,-0.77 -0.5,0.02 -0.98,0.14 -3.98,1.01 -5.71,4.69 -1.18,2.51 -2.1,4.49 -0.21,0.45 -0.07,0.93 0.62,2.08 0.92,5.46 0.21,2.33 2.27,3.45 z"
id="path280"
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-opacity:1" />
<path
fill="#7c91ad"
fill-opacity="1"
d="m 314.47773,34.725374 q -0.94,1.01 -2.75,0.92 0.89,-1.01 2.75,-0.92 z"
id="path282"
style="stroke:none" />
<path
fill="#017aff"
fill-opacity="1"
d="m 306.72773,36.975374 q -18.59,6.47 -34.69,18.52 -5.04,3.78 -10,6.5 -2.19,1.41 -4.37,3.63 -10.33,10.52 -18.4,18.89 -0.35,0.36 -0.68,0.74 -16.05,18.889996 -30.61,40.679996 -12.74,19.06002 -25.72,36.43002 -1.07,1.45 -2.88,1.51 -7.38,0.21 -10.15,-0.08 -1.76,-0.19 -2.78,-1.65 -19.75,-28.33 -38.25,-55.24002 -0.28,-0.41 -0.59,-0.8 -8.42,-10.719996 -17.32,-21.729996 -11.759998,-14.56 -24.119998,-23.38 -9.08,-6.43 -17.85,-12.46 -0.4,-0.29 -0.88,-0.44 -1.63,-0.76 -3.52,-1.85 -5.43,-3.12 -11.44,-5.81 -1.39,-0.68 -1.25,-1.46 7.37,1.63 13.44,4.52 4.92,2.35 9.34,4.28 0.47,0.16 0.91,0.4 8.89,4.86 17.75,10.82 9.959998,6.7 18.649998,15.64 0.35,0.36 0.73,0.68 7.58,6.24 16.62,11.93 1.77,1.12 3.79,0.56 12.35,-3.86 25.02,-5.87 7.86,-1.25 16.25,-1 21.47,-0.57 40,7.25 3.56,1.5 5.69,-0.06 4.62,-3.99 9.62,-6.88 5.18,-2.88 9.5,-7.5 3.61,-3.85 6.63,-6.37 22.23,-17.67 46.28,-25.84 0.47,-0.16 0.9,-0.41 6.64,-3.76 14.38,-4.15 z"
id="path284"
style="stroke:none;stroke-opacity:1" />
<path
fill="#ffbb00"
fill-opacity="1"
d="m 333.98772,50.945374 q 0.99,19.02 -5.56999,35.43 -3.97,9.92 -10.63,20.619996 -8.98,14.55 -22.62,25.63 -11.11,9.02002 -26.44,12.06002 -5.98,1.16 -10.5,-0.5 -2.96,-0.91 -5.31,-2.94 -2,-1.56 -3.25,-4 -2.03,-3.88 -2,-6.87002 0.3,-7.51 3.37,-14.13 4.9,-10.77 11.88,-19.619996 4.41,-5.6 9.62,-10.38 17.34,-16.37 37.75,-25.75 11.1,-5.09 23.11999,-9.92 0.55,-0.23 0.58,0.37 z"
id="path286"
style="stroke:none;stroke-opacity:1" />
<path
fill="#ffbb00"
fill-opacity="1"
d="m 16.977732,52.185374 q 15.86,5.02 29.24,11.59 0.45,0.22 0.88,0.47 14.59,8.48 28,19.62 0.38,0.32 0.71,0.69 5.01,5.68 10.48,11.57 8.34,9.299996 13,20.999996 2.569998,6.44 2.689998,12.56 0.07,8.55002 -6.059998,12.69002 -4.28,2.89 -9.44,2.56 -6.1,-0.04 -11.81,-1.94 -14.12,-4.89 -25.25,-15.00002 -11.59,-10.09 -19.75,-24 -13.85,-23.579996 -14.44,-50.559996 -0.06,-1.82 1.75,-1.25 z"
id="path288"
style="stroke:none;stroke-opacity:1" />
<path
fill="#374a6c"
fill-opacity="1"
d="m 13.267732,113.93537 q 1.01,1.88 2,4.5 -0.04,0.25 -0.08,0.5 -2.73,-2.53 -1.92,-5 z"
id="path294"
style="stroke:none" />
<path
fill="#017aff"
fill-opacity="1"
d="m 335.18772,116.68537 q -0.33,2.6 -1.71,5.25 -5.49999,10.59 -10.70999,20.87002 -0.23,0.44 -0.41,0.91 -4.39,11 -8.88,22.47 -2.29,5.85 -3.94,12.31 -4.37,16.87 -6.56,33.44 -1.73,13.1 -2.89,25.82 -0.05,0.49 -0.55,0.47 -2.65,-0.13 -7.06,-0.58 -0.57,-0.63 -1.69,-1.52 -13.92,-11.15 -28.01,-15.37 -0.49,-0.13 -0.94,-0.34 -5.27,-1.83 -11.11,-2.73 -15.68,-2.42 -28.75,0.25 -11.46,2.76 -24.9,2.49 -1.67,-0.07 -1.6,-1.74 0.47,-11.09 3.25,-20.5 1.19,-4.04 3.46,-5.75 -0.45,1.79 -1.03,3.28 -0.18,0.47 -0.05,0.95 1.48,5.55 5.93,11.21 6.14,8.03 16.19,6.31 5.87,-1 9.31,-7.19 3.56,-5.97 2.44,-12.81 -0.95,-5.81 -6.56,-9.44 -2.39,-1.54 -4.88,-2.37 -0.14,-0.08 0.15,-0.94 9.49,-0.18 18.54,-1.5 13,-1.66 26.25,-5.75 16.83,-5.2 31.51,-14.55 0.43,-0.26 0.83,-0.56 11.73,-8.85 19.85,-18.7 7.37,-8.96002 11.99999,-18.50002 1.04,-2.25 2.52,-5.19 z"
id="path296"
style="stroke:none;stroke-opacity:1" />
<path
fill="#017aff"
fill-opacity="1"
d="m 15.267732,118.43537 q 2.35,3.6 4.27,7.19 4.82,9.02002 11.29,16.50002 0.34,0.37 0.61,0.79 3.06,4.74 8.98,9.08 2.34,1.96 4.62,3.88 11.02,9.27 24.78,13.84 0.47,0.16 0.93,0.36 24.65,10.65 53.479998,10.61 0.64,0 0.79,0.25 0.09,0.71 -0.85,1.19 -5.65,2.45 -8.88,6.87 -4.25,5.83 -1.7,13.56 0.67,2.25 2.14,4.08 4.68,5.81 12.02,7.91 0.48,0.14 0.98,0.19 5.39,0.55 9.94,-1.86 5.58,-2.95 7.31,-8.94 1.43,-4.95 0.25,-9 -0.35,-1.22 0,-1.79 0.69,0.38 1.25,1.29 4.47,7.21 6.31,15.94 0.86,4.24 1.64,8.1 0.3,1.2 -0.94,1.21 -14.25,0.1 -25.26,-1.25 -0.57,-0.4 -1.25,-0.5 -9.35,-1.42 -21.25,-1 -5.52,-0.07 -10.249998,1 -18.71,4.22 -33.4,14.65 -0.41,0.29 -0.87,0.5 -3.11,1.44 -4.73,3.81 -4.1,0.12 -7.69,0 -0.5,-0.02 -0.53,-0.52 -0.91,-8.25 -1.28,-16.94 -0.3,-9.81 -2.25,-18 -2.6,-10.92 -4.47,-20.45 -0.09,-0.49 -0.24,-0.97 -5.63,-17.93 -12.92,-36.3 -0.18,-0.47 -0.45,-0.89 -7.87,-12.27002 -12.46,-23.89002 0.04,-0.25 0.08,-0.5 z"
id="path298"
style="stroke:none;stroke-opacity:1" />
<path
fill="#0e141d"
fill-opacity="1"
d="m 125.01773,180.93539 q 6.59,-0.84 11.27,1.94 6.79,4.03 9.94,10.27 -0.35,0.57 0,1.79 1.18,4.05 -0.25,9 -1.73,5.99 -7.31,8.94 -4.55,2.41 -9.94,1.86 -0.5,-0.05 -0.98,-0.19 -7.34,-2.1 -12.02,-7.91 -1.47,-1.83 -2.14,-4.08 -2.55,-7.73 1.7,-13.56 3.23,-4.42 8.88,-6.87 0.94,-0.48 0.85,-1.19 z"
id="path300"
style="stroke:none" />
<path
fill="#0d1120"
fill-opacity="1"
d="m 223.68773,181.43539 q -0.29,0.86 -0.15,0.94 2.49,0.83 4.88,2.37 5.61,3.63 6.56,9.44 1.12,6.84 -2.44,12.81 -3.44,6.19 -9.31,7.19 -10.05,1.72 -16.19,-6.31 -4.45,-5.66 -5.93,-11.21 -0.13,-0.48 0.05,-0.95 0.58,-1.49 1.03,-3.28 3.65,-5.37 8.1,-8.69 2.53,-1.63 6.19,-1.81 3.57,-0.18 7.21,-0.5 z"
id="path302"
style="stroke:none" />
<path
fill="#161a47"
fill-opacity="1"
d="m 167.47773,283.91539 q 8.65,-0.76 15.5,0.77 3.98,0.89 5.06,4.94 1.98,5.98 0.18,12.39 -0.52,1.66 -2.21,2.08 -2.78,0.63 -6.03,0.59 -6,0.06 -12,0 -3.52,-0.04 -6.17,-1.61 -2.06,-1.12 -2.27,-3.45 -0.3,-3.38 -0.92,-5.46 -0.14,-0.48 0.07,-0.93 0.92,-1.98 2.1,-4.49 1.73,-3.68 5.71,-4.69 0.48,-0.12 0.98,-0.14 z"
id="path304"
style="stroke:none" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 21 KiB

View file

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

BIN
assets/social-preview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
assets/social-preview.xcf Normal file

Binary file not shown.

132
code_of_conduct.md Normal file
View file

@ -0,0 +1,132 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[INSERT CONTACT METHOD].
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
at [https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

View file

@ -13,6 +13,8 @@ indent_style = space
indent_size = 4
insert_final_newline = false
trim_trailing_whitespace = true
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
# C# files
[*.cs]
@ -50,7 +52,7 @@ dotnet_style_predefined_type_for_member_access = true:suggestion
# Use camel_case for private or internal constant fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.required_modifiers = const
@ -62,7 +64,7 @@ dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# internal and private fields should be _camel_case
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
@ -122,3 +124,9 @@ csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = when_multiline:silent
csharp_style_namespace_declarations = file_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent

View file

@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33205.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tomas.Common", "Tomas.Common\Tomas.Common.csproj", "{C50F3A6F-CFF4-4725-A1A5-21C5A2BC3321}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tomas.Core", "Tomas.Core\Tomas.Core.csproj", "{C50F3A6F-CFF4-4725-A1A5-21C5A2BC3321}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{59C9B3FC-B1EE-4C23-9BD9-D33074BF1334}"
ProjectSection(SolutionItems) = preProject
@ -13,13 +13,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\LICENSE = ..\LICENSE
..\README.md = ..\README.md
TOMAS.sln.licenseheader = TOMAS.sln.licenseheader
..\UNLICENSE = ..\UNLICENSE
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tomas.Interface", "Tomas.Interface\Tomas.Interface.csproj", "{DAA9EDF4-83C7-4271-9805-FD6CE29E1796}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tomas.Terminal", "Tomas.Terminal\Tomas.Terminal.csproj", "{49E67E55-F9D2-419A-8097-38F39E98A95E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tomas.Kernel", "Tomas.Kernal\Tomas.Kernel.csproj", "{20750C95-A3C7-4958-BA9F-56E4C3BD0293}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tomas.Kernel", "Tomas.Kernel\Tomas.Kernel.csproj", "{B70BDFD5-64BA-4FCE-A00F-DDD209C2C0FB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tomas.Tests", "Tomas.Tests\Tomas.Tests.csproj", "{76AD2140-2975-43DA-89A9-0BEC70B2ECDD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -39,10 +42,14 @@ Global
{49E67E55-F9D2-419A-8097-38F39E98A95E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{49E67E55-F9D2-419A-8097-38F39E98A95E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{49E67E55-F9D2-419A-8097-38F39E98A95E}.Release|Any CPU.Build.0 = Release|Any CPU
{20750C95-A3C7-4958-BA9F-56E4C3BD0293}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20750C95-A3C7-4958-BA9F-56E4C3BD0293}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20750C95-A3C7-4958-BA9F-56E4C3BD0293}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20750C95-A3C7-4958-BA9F-56E4C3BD0293}.Release|Any CPU.Build.0 = Release|Any CPU
{B70BDFD5-64BA-4FCE-A00F-DDD209C2C0FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B70BDFD5-64BA-4FCE-A00F-DDD209C2C0FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B70BDFD5-64BA-4FCE-A00F-DDD209C2C0FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B70BDFD5-64BA-4FCE-A00F-DDD209C2C0FB}.Release|Any CPU.Build.0 = Release|Any CPU
{76AD2140-2975-43DA-89A9-0BEC70B2ECDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{76AD2140-2975-43DA-89A9-0BEC70B2ECDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{76AD2140-2975-43DA-89A9-0BEC70B2ECDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76AD2140-2975-43DA-89A9-0BEC70B2ECDD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -1,4 +1,8 @@
extensions: designer.cs generated.cs
extensions: .cs .cpp .h .fs
// I license this project under the BSD 3-Clause license.
// See the LICENSE file in the project root for more information.
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/

View file

@ -1,2 +0,0 @@
global using System.Diagnostics.CodeAnalysis;
global using Tomas.Interface;

View file

@ -1,13 +0,0 @@
// I license this project under the BSD 3-Clause license.
// See the LICENSE file in the project root for more information.
namespace Tomas.Common.Programs;
public class Clear : IProgram
{
public bool Run(IShell shell)
{
Console.Clear();
return true;
}
}

View file

@ -1,16 +0,0 @@
// I license this project under the BSD 3-Clause license.
// See the LICENSE file in the project root for more information.
namespace Tomas.Common.Programs;
public class Commands : IProgram
{
public bool Run(IShell shell)
{
Console.WriteLine($"Commands:");
var progs = shell.Programs;
foreach (var commands in progs.Keys)
Console.WriteLine(commands);
return true;
}
}

View file

@ -1,38 +0,0 @@
// I license this project under the BSD 3-Clause license.
// See the LICENSE file in the project root for more information.
namespace Tomas.Common.Programs;
public class FenSay : IProgram
{
/// <summary>
/// Fennec art by Todd Vargo
/// </summary>
const string _fennec = @" \/
/\ /\
//\\_//\\ ____
\_ _/ / /
/ * * \ /^^^]
\_\O/_/ [ ]
/ \_ [ /
\ \_ / /
[ [ / \/ _/
_[ [ \ /_/";
readonly string[] _phrases =
{
"[SCREAMS IN FENNEC]",
"Some people call me a coffee fox.",
"Drink Soda. It makes you see faster.",
"10/10, Wouldn't Recommend."
};
public bool Run(IShell shell)
{
var rng = new Random();
var phrases = _phrases[rng.Next(_phrases.Length)];
Console.WriteLine($"{phrases}{Environment.NewLine}{_fennec}");
return true;
}
}

View file

@ -0,0 +1,16 @@
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
namespace Tomas.Core.Programs;
public class Clear : IProgram
{
public bool Run(IShell shell)
{
Console.Clear();
return true;
}
}

View file

@ -0,0 +1,19 @@
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
namespace Tomas.Core.Programs;
public class Commands : IProgram
{
public bool Run(IShell shell)
{
Console.WriteLine($"Commands:");
var progs = shell.Programs;
foreach (var commands in progs.Keys)
Console.WriteLine(commands);
return true;
}
}

View file

@ -0,0 +1,41 @@
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
namespace Tomas.Core.Programs;
public class FenSay : IProgram
{
/// <summary>
/// Fennec art by Todd Vargo
/// </summary>
const string _fennec = @" \/
/\ /\
//\\_//\\ ____
\_ _/ / /
/ * * \ /^^^]
\_\O/_/ [ ]
/ \_ [ /
\ \_ / /
[ [ / \/ _/
_[ [ \ /_/";
readonly string[] _phrases =
{
"[SCREAMS IN FENNEC]",
"Some people call me a coffee fox.",
"Drink Soda. It makes you see faster.",
"10/10, Wouldn't Recommend."
};
public bool Run(IShell shell)
{
var rng = new Random();
var phrases = _phrases[rng.Next(_phrases.Length)];
Console.WriteLine($"{phrases}{Environment.NewLine}{_fennec}");
return true;
}
}

View file

@ -9,11 +9,4 @@
<ProjectReference Include="..\Tomas.Interface\Tomas.Interface.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="GitInfo" Version="2.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>

9
src/Tomas.Core/Usings.cs Normal file
View file

@ -0,0 +1,9 @@
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
global using System.Diagnostics.CodeAnalysis;
global using System.Diagnostics;
global using Tomas.Interface;

View file

@ -1,14 +1,18 @@
// I license this project under the BSD 3-Clause license.
// See the LICENSE file in the project root for more information.
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
namespace Tomas.Interface;
public interface IProgram
{
/// <summary>
/// The program's main entry point. Boolean behaves as an exit point.
/// True and False are the equivalent to C's 0 and 1, i.e. "Success" and "Failure," respectfully.
/// </summary>
/// <param name="shell">Allows the program to interact with the shell.</param>
/// <returns>Exit back to shell.</returns>
bool Run(IShell shell);
/// <summary>
/// The program's main entry point. Boolean behaves as an exit point.
/// True and False are the equivalent to C's 0 and 1, i.e. "Success" and "Failure," respectfully.
/// </summary>
/// <param name="shell">Allows the program to interact with the shell.</param>
/// <returns>Exit back to shell.</returns>
bool Run(IShell shell);
}

View file

@ -1,11 +1,14 @@
// I license this project under the BSD 3-Clause license.
// See the LICENSE file in the project root for more information.
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
namespace Tomas.Interface;
public interface IShell
{
string ReadLine { get; }
string ReadLine { get; }
Dictionary<string, IProgram> Programs { get; }
Dictionary<string, IProgram> Programs { get; }
}

View file

View file

@ -1,7 +0,0 @@
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;

View file

@ -1,51 +0,0 @@
// I license this project under the BSD 3-Clause license.
// See the LICENSE file in the project root for more information.
namespace Tomas.Kernel;
public class Kernel : Os.Kernel
{
protected override void BeforeRun()
{
SysFS.Initialize();
if (!SysMeta.IsFSActive)
Console.WriteLine($"{SysMeta.NAME} booted with errors.");
else
Console.WriteLine($"{SysMeta.NAME} booted successfully.");
}
protected override void Run()
{
while (true)
{
var shell = new Shell();
var command = shell.ReadLine;
var programs = shell.Programs;
if (!programs.TryGetValue(command, out var program))
{
Console.WriteLine("Command Not Found.");
continue;
}
try
{
var start = program.Run(shell);
switch (start)
{
case true:
continue;
case false:
Console.WriteLine("Program closed unexpectedly.");
continue;
}
}
catch (Exception err)
{
Console.WriteLine(err.Message);
}
}
}
}

View file

@ -1,17 +0,0 @@
// I license this project under the BSD 3-Clause license.
// See the LICENSE file in the project root for more information.
namespace Tomas.Kernel.Programs;
public class About : IProgram
{
public bool Run(IShell shell)
{
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);
return true;
}
}

View file

@ -0,0 +1,101 @@
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
namespace Tomas.Kernel.Globalization;
public class CST
{
const char CARET = '^';
const string LF = "\u000A";
const string CR = "\u000D";
const string CRLF = "\u000D\u000A";
const string LS = "\u2028";
/// <summary>
/// Gets the value from the digit-based key.
/// </summary>
/// <returns>Returns the entry</returns>
public static string Parse(string content, int key) => Parse(content, key.ToString());
/// <summary>
/// Gets the value from the string-based key.
/// </summary>
/// <returns>Returns the entry</returns>
public static string Parse(string content, string key)
{
var entries = NormalizeEntries(content);
return GetEntry(entries, key);
}
/// <summary>
/// Replaces the document's line endings with the native system line endings.
/// </summary>
/// <remarks>This stage ensures there are no crashes during parsing.</remarks>
/// <param name="content">The content of the document.</param>
/// <returns>The document's content with native system line endings.</returns>
static IEnumerable<string> NormalizeEntries(string content)
{
// Check if the document already uses native system line endings.
if (!content.Contains(Environment.NewLine))
{
// If not, check for and replace other line ending types.
if (content.Contains(LF))
content = content.Replace(LF, Environment.NewLine);
if (content.Contains(CR))
content = content.Replace(CR, Environment.NewLine);
if (content.Contains(CRLF))
content = content.Replace(CRLF, Environment.NewLine);
if (content.Contains(LS))
content = content.Replace(LS, Environment.NewLine);
}
// Split the content by the caret and newline characters.
var lines = content.Split(new[] { $"{CARET}{Environment.NewLine}" },
StringSplitOptions.RemoveEmptyEntries);
// Filter out any lines that start with "//", "#", "/*", or end with "*/".
return lines.Where(line =>
!line.StartsWith("//") &&
!line.StartsWith("#") &&
!line.StartsWith("/*") &&
!line.EndsWith("*/"))
.AsEnumerable();
}
/// <summary>
/// Retrieves the value for the specified key from the given entries.
/// </summary>
/// <param name="entries">The entries to search through.</param>
/// <param name="key">The key to search for.</param>
/// <returns>The value for the specified key, or a default string if not found.</returns>
static string GetEntry(IEnumerable<string> entries, string key)
{
// Iterate through the entries.
foreach (var entry in entries)
{
// If the line doesn't start with the key, keep searching.
if (!entry.StartsWith(key))
continue;
// Locate the index of the caret character.
var startIndex = entry.IndexOf(CARET);
// Get the line from the caret character to the end of the string.
var line = entry[startIndex..];
// Return the line with the caret characters trimmed.
return line.TrimStart(CARET).TrimEnd(CARET);
}
// If no entry is found, return a default string.
return "***MISSING***";
}
}

View file

@ -0,0 +1,23 @@
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
namespace Tomas.Kernel.Globalization;
public interface IUIText
{
/// <summary>
/// The base directory for the language files.
/// </summary>
string[] BasePath { get; set; }
/// <summary>
/// Get the text for the given id and key.
/// </summary>
/// <param name="id">The id of the text.</param>
/// <param name="key">The key of the text.</param>
/// <returns>The text for the given id and key.</returns>
string GetText(int id, int key);
}

View file

@ -0,0 +1,104 @@
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
namespace Tomas.Kernel.Globalization;
public class UIText : IUIText
{
/// <summary>
/// The language of the text.
/// </summary>
string Language { get; set; } = "english";
/// <summary>
/// The base directory for the language files.
/// </summary>
public string[] BasePath { get; set; } = { AppContext.BaseDirectory, "uitext" };
/// <summary>
/// Constructor for the UIText class.
/// </summary>
public UIText() { }
/// <summary>
/// Constructor for the UIText class.
/// Loads the language file for the specified language.
/// </summary>
/// <param name="language">Language to load</param>
public UIText(string language)
{
Language = language;
}
/// <summary>
/// Constructor for the UIText class.
/// Loads the language file for the specified language and base directory.
/// </summary>
/// <param name="language">Language to load</param>
/// <param name="basePath">Base directory for the language files.</param>
public UIText(string language, params string[] baseBath)
{
Language = language;
BasePath = baseBath;
}
/// <summary>
/// Get the text for the given id and key.
/// </summary>
/// <param name="id">The id of the text.</param>
/// <param name="key">The key of the text.</param>
/// <returns>The text for the given id and key.</returns>
public string GetText(int id, int key) => GetText(id, key.ToString());
/// <summary>
/// Get the text for the given id and key.
/// </summary>
/// <param name="id">The id of the text.</param>
/// <param name="key">The key of the text.</param>
/// <returns>The text for the given id and key.</returns>
public string GetText(int id, string key)
{
// Combine the base path and language path to get the full path of the language file.
var basePath = Path.Combine(BasePath);
var langPath = Path.Combine(basePath, $"{Language}.dir");
// Get all the files in the language directory.
var files = Directory.GetFiles(langPath);
// Iterate through the files in the language directory.
foreach (var file in files)
{
// Skip files that do not have the ".cst" extension.
if (!file.Contains(".cst"))
continue;
// Get the id of the current file.
var ids = Path.GetFileName(file);
var second = ids.IndexOf("_", 1, StringComparison.InvariantCultureIgnoreCase);
if (second == -1)
continue;
ids = ids.Substring(1, second - 1);
// If the id of the current file does not match the id passed to the function,
// skip to the next file.
if (ids != id.ToString())
continue;
// Read the content of the current file.
var content = File.ReadAllText(file);
// Return the text for the specified key.
return CST.Parse(content, key);
}
// If no text is found, return a default string.
return "***MISSING***";
}
}

View file

@ -0,0 +1,73 @@
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
namespace Tomas.Kernel;
public class Kernel : Os.Kernel
{
// This method is called before the Run method
protected override void BeforeRun()
{
// Initialize the file system
SysFS.Initialize();
// If the file system is not enabled, print an error message indicating that the system booted with errors
if (!SysMeta.IsFSEnabled)
Console.WriteLine($"{SysMeta.NAME} booted with errors.");
// If the file system is enabled, print a message indicating that the system booted successfully
else
Console.WriteLine($"{SysMeta.NAME} booted successfully.");
}
// This method is the main loop of the kernel, which handles input and runs programs
protected override void Run()
{
// Run the loop indefinitely
while (true)
{
// Create a new instance of the Shell class
var shell = new Shell();
// Read a line of input from the user
var command = shell.ReadLine;
// Get the dictionary of programs from the shell
var programs = shell.Programs;
// If the command is not a key in the dictionary of programs, print an error message
// and continue to the next iteration of the loop
if (!programs.TryGetValue(command, out var program))
{
Console.WriteLine("Command Not Found.");
continue;
}
// Try to run the program and handle any exceptions that may be thrown
try
{
// Run the program and store the returned value in the 'start' variable
var start = program.Run(shell);
// Check the value of 'start' and take the appropriate action
switch (start)
{
case true:
// If 'start' is true, continue to the next iteration of the loop
continue;
case false:
// If 'start' is false, print an error message and continue to the next iteration of the loop
Console.WriteLine("Program closed unexpectedly.");
continue;
}
}
catch (Exception err)
{
// If an exception is caught, print the error message and continue to the next iteration of the loop
Console.WriteLine(err.Message);
}
}
}
}

View file

@ -0,0 +1,20 @@
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
namespace Tomas.Kernel.Programs;
public class About : IProgram
{
public bool Run(IShell shell)
{
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);
return true;
}
}

View file

@ -1,6 +1,9 @@
// I license this project under the BSD 3-Clause license.
// See the LICENSE file in the project root for more information.
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
namespace Tomas.Kernel;
public class Shell : IShell

View file

@ -1,19 +1,26 @@
// I license this project under the BSD 3-Clause license.
// See the LICENSE file in the project root for more information.
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
namespace Tomas.Kernel;
static class SysFS
{
// The root directory of the file system
const string ROOT_DIR = "0:\\";
public const string ROOT_DIR = "0:\\";
// The system directory, located in the root directory
static string SYSTEM_DIR = $"{ROOT_DIR}\\SYSTEM\\";
static string LOG_FILE = $"{SYSTEM_DIR}system.log";
// An instance of the CosmosVFS class, used for accessing the virtual file system
static readonly CosmosVFS _fs = new();
public const string FS_ERROR = "File system disabled.";
/// <summary>
/// An instance of the CosmosVFS class, used for accessing the virtual file system
/// </summary>
static CosmosVFS fileSystem = new();
/// <summary>
/// Initializes the file system by creating the system directory and sysinfo.txt file
@ -23,49 +30,40 @@ static class SysFS
{
try
{
var createSysFiles = "Creating system files.";
var setSysPref = "Writing system info.";
var fsSuccess = "File system succesfully initialized.";
// File to store system information
const string sysInfoFile = "sysinfo.txt";
// Register the CosmosVFS instance as the virtual file system
VFSManager.RegisterVFS(_fs);
// Create system directory if it doesn't exist
if (!Directory.Exists(SYSTEM_DIR))
fileSystem.CreateDirectory(SYSTEM_DIR);
// Create the system directory
_fs.CreateDirectory(SYSTEM_DIR);
// Create system log file if it doesn't exist
if (!File.Exists($"{SYSTEM_DIR}{LOG_FILE}"))
fileSystem.CreateFile($"{SYSTEM_DIR}{LOG_FILE}");
_fs.CreateFile($"{SYSTEM_DIR}{LOG_FILE}");
// Create sysinfo.txt file if it doesn't exist
if (!File.Exists($"{SYSTEM_DIR}{sysInfoFile}"))
fileSystem.CreateFile($"{SYSTEM_DIR}{sysInfoFile}");
Console.WriteLine(createSysFiles);
File.AppendAllText(LOG_FILE, createSysFiles);
// Create the sysinfo.txt file in the system directory
_fs.CreateFile($"{SYSTEM_DIR}sysinfo.txt");
Console.WriteLine(setSysPref);
File.AppendAllText(LOG_FILE, setSysPref);
// Write the system name, version, and build number to the sysinfo.txt file
// Write system name, version, and build number to sysinfo.txt file
File.WriteAllText($"{SYSTEM_DIR}sysinfo.txt", $"{SysMeta.NAME} v{SysMeta.VERSION} ({SysMeta.BuildNumber})");
Console.WriteLine(fsSuccess);
File.AppendAllText(LOG_FILE, fsSuccess);
// Set IsFSEnabled property of SysMeta class to true
SysMeta.IsFSEnabled = true;
// Set the IsFSActive property of the SysMeta class to true
SysMeta.IsFSActive = true;
// Read the contents of the sysinfo.txt file and print it to the console
// Read contents of sysinfo.txt file and print to console
var systemInfo = File.ReadAllText($"{SYSTEM_DIR}sysinfo.txt");
Console.WriteLine(systemInfo);
}
catch (Exception err)
{
// If an exception is caught, print an error message indicating that the file system failed to load
// Print error message if an exception is caught
Console.WriteLine($"{err.Message}{Environment.NewLine}Warning: Error messages will not logged.");
}
}
/// <summary>
/// Creates a new directory at the specified path
/// </summary>
@ -74,8 +72,13 @@ static class SysFS
{
try
{
// If file system isn't enabeld, throw exception
if (!SysMeta.IsFSEnabled)
throw new IOException(FS_ERROR);
// Create the directory using the CosmosVFS instance
_fs.CreateDirectory($"{ROOT_DIR}\\{directory}");
if (!Directory.Exists($"{ROOT_DIR}\\{directory}"))
fileSystem.CreateDirectory($"{ROOT_DIR}\\{directory}");
}
catch (IOException err)
{
@ -94,8 +97,13 @@ static class SysFS
{
try
{
// If file system isn't enabeld, throw exception
if (!SysMeta.IsFSEnabled)
throw new IOException(FS_ERROR);
// Create the file using the CosmosVFS instance
_fs.CreateFile($"{ROOT_DIR}\\{path}\\{file}");
if (!File.Exists($"{ROOT_DIR}\\{path}\\{file}"))
fileSystem.CreateFile($"{ROOT_DIR}\\{path}\\{file}");
}
catch (IOException err)
{
@ -114,6 +122,10 @@ static class SysFS
{
try
{
// If file system isn't enabeld, throw exception
if (!SysMeta.IsFSEnabled)
throw new IOException(FS_ERROR);
// Get the directories in the specified path using the Directory.GetDirectories method
var dirs = Directory.GetDirectories(path);

View file

@ -1,13 +1,14 @@
// I license this project under the BSD 3-Clause license.
// See the LICENSE file in the project root for more information.
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
using System.Text;
namespace Tomas.Common;
namespace Tomas.Kernel;
/// <summary>
/// System metdata, such as name, version and build number.
/// </summary>
public struct SysMeta
internal struct SysMeta
{
/// <summary>
/// The name of the operating system.
@ -26,13 +27,12 @@ public struct SysMeta
/// 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.
/// </summary>
[SuppressMessage("Usage", "CA2211:Non-constant fields should not be visible")]
public static string BuildNumber = $"Build {BuildNumFromCommit}";
/// <summary>
/// Let's the system know that the file system is activated.
/// Let's the kernel know that the file system is activated.
/// </summary>
public static bool IsFSActive { get; set; } = false;
public static bool IsFSEnabled { get; set; } = false;
/// <summary>
/// Generates the build number from the commit hash.

View file

@ -5,6 +5,7 @@
<!--<RuntimeIdentifier>cosmos</RuntimeIdentifier>-->
<Platform>cosmos</Platform>
<SupportsX86Intrinsics>false</SupportsX86Intrinsics>
<Nullable>enable</Nullable>
<SelfContained>True</SelfContained>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
@ -24,10 +25,14 @@
<PackageReference Include="Cosmos.Build" Version="0-*" NoWarn="NU1604" />
<PackageReference Include="Cosmos.Debug.Kernel" Version="0-*" NoWarn="NU1604" />
<PackageReference Include="Cosmos.System2" Version="0-*" NoWarn="NU1604" />
<PackageReference Include="GitInfo" Version="2.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Tomas.Common\Tomas.Common.csproj" />
<ProjectReference Include="..\Tomas.Core\Tomas.Core.csproj" />
<ProjectReference Include="..\Tomas.Interface\Tomas.Interface.csproj" />
</ItemGroup>

View file

@ -0,0 +1,15 @@
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
global using System.Diagnostics.CodeAnalysis;
global using System.Diagnostics;
global using Tomas.Core.Programs;
global using Tomas.Interface;
global using Tomas.Kernel.Programs;
global using Cosmos.System.FileSystem;
global using Cosmos.System.FileSystem.VFS;
global using Tomas.Core;
global using Os = Cosmos.System;

View file

@ -0,0 +1 @@
0.1

View file

@ -1,2 +0,0 @@
global using Tomas.Common.Programs;
global using Tomas.Interface;

View file

@ -1,40 +1,43 @@
// I license this project under the BSD 3-Clause license.
// See the LICENSE file in the project root for more information.
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
namespace Tomas.Terminal;
class Program
{
static void Main()
static void Main()
{
while (true)
{
var shell = new Shell();
var command = shell.ReadLine;
var programs = shell.Programs;
if (!programs.TryGetValue(command, out var program))
{
Console.WriteLine("Command Not Found.");
continue;
}
try
{
var start = program.Run(shell);
switch (start)
{
while (true)
{
var shell = new Shell();
var command = shell.ReadLine;
var programs = shell.Programs;
if (!programs.TryGetValue(command, out var program))
{
Console.WriteLine("Command Not Found.");
continue;
}
try
{
var start = program.Run(shell);
switch (start)
{
case true:
continue;
case false:
Console.WriteLine("Program closed unexpectedly.");
continue;
}
}
catch (Exception err)
{
Console.WriteLine(err.Message);
}
}
case true:
continue;
case false:
Console.WriteLine("Program closed unexpectedly.");
continue;
}
}
catch (Exception err)
{
Console.WriteLine(err.Message);
}
}
}
}

View file

@ -1,15 +1,16 @@
// I license this project under the BSD 3-Clause license.
// See the LICENSE file in the project root for more information.
using Tomas.Common;
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
namespace Tomas.Terminal.Programs;
public class About : IProgram
{
public bool Run(IShell shell)
{
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;
}
public bool Run(IShell shell)
{
Console.WriteLine($"{TermMeta.NAME} Terminal Emulator v{TermMeta.VERSION}");
return true;
}
}

View file

@ -1,14 +1,18 @@
// I license this project under the BSD 3-Clause license.
// See the LICENSE file in the project root for more information.
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
using Tomas.Terminal.Programs;
namespace Tomas.Terminal;
public class Shell : IShell
{
const char SYMBOL = '$';
const char SYMBOL = '$';
public Dictionary<string, IProgram> Programs => new()
public Dictionary<string, IProgram> Programs => new()
{
{"about", new About()},
{"fensay", new FenSay()},
@ -16,13 +20,13 @@ public class Shell : IShell
{"commands", new Commands()}
};
public string ReadLine
{
get
{
Console.Write(SYMBOL);
var readl = Console.ReadLine();
return readl;
}
}
public string ReadLine
{
get
{
Console.Write(SYMBOL);
var readl = Console.ReadLine();
return readl;
}
}
}

View file

@ -0,0 +1,52 @@
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
using System.Text;
namespace Tomas.Terminal;
/// <summary>
/// System metdata, such as name, version and build number.
/// </summary>
public struct TermMeta
{
/// <summary>
/// The name of the operating system.
/// </summary>
public const string NAME = "TOMAS Emulator";
/// <summary>
/// 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.
/// </summary>
public const string VERSION = $"{ThisAssembly.Git.SemVer.Major}.{ThisAssembly.Git.SemVer.Minor}.{ThisAssembly.Git.SemVer.Patch}";
/// <summary>
/// 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.
/// </summary>
public static string BuildNumber = $"Build {BuildNumFromCommit}";
/// <summary>
/// Generates the build number from the commit hash.
/// </summary>
/// <returns>The build number as a uint.</returns>
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;
}
}
}

View file

@ -8,7 +8,15 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Tomas.Common\Tomas.Common.csproj" />
<PackageReference Include="GitInfo" Version="2.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NLua" Version="1.6.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Tomas.Core\Tomas.Core.csproj" />
<ProjectReference Include="..\Tomas.Interface\Tomas.Interface.csproj" />
</ItemGroup>

View file

@ -0,0 +1,10 @@
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
global using System.Diagnostics.CodeAnalysis;
global using System.Diagnostics;
global using Tomas.Core.Programs;
global using Tomas.Interface;

View file

@ -0,0 +1,16 @@
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
namespace Tomas.Tests.Shell;
internal class MockProgram : IProgram
{
public bool Run(IShell shell)
{
Debug.WriteLine("Test Program.");
return true;
}
}

View file

@ -0,0 +1,17 @@
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
namespace Tomas.Tests.Shell;
internal class MockShell : IShell
{
public string? ReadLine { get; }
public Dictionary<string, IProgram> Programs => new()
{
{ "test", new MockProgram() },
};
}

View file

@ -0,0 +1,26 @@
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
using Tomas.Tests.Shell;
namespace Tomas.Tests;
public class ShellTests
{
// Create a new instance of the mock shell
readonly MockShell _mockShell = new();
[Fact]
public void ProgramTest()
{
// Create a mock program instance
var program = new MockProgram();
// Assert that the Run method of the program and returns true when passed the shell object.
Assert.True(program.Run(_mockShell));
}
}

View file

@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Tomas.Core\Tomas.Core.csproj" />
<ProjectReference Include="..\Tomas.Interface\Tomas.Interface.csproj" />
</ItemGroup>
</Project>

11
src/Tomas.Tests/Usings.cs Normal file
View file

@ -0,0 +1,11 @@
/*
In jurisdictions that recognize copyright waivers, I've waived all copyright
and related or neighboring rights for to this project. In areas where these
waivers are not recognized, BSD-3-Clause is enforced.
See the (UN)LICENSE file in the project root for more information.
*/
global using Xunit;
global using System.Diagnostics.CodeAnalysis;
global using System.Diagnostics;
global using Tomas.Core;
global using Tomas.Interface;