├── .editorconfig ├── .gitignore ├── License.md ├── MinCLR ├── .editorconfig ├── BuildAllTargets.cmd ├── BuildAllTargets.proj ├── Directory.Build.props ├── MinCLR.sln └── ReadMe.md ├── MinInit ├── .editorconfig ├── MinInit.c ├── ReadMe.md └── build.sh ├── Platform ├── Linux │ ├── Packages │ │ ├── .gitignore │ │ ├── busybox-1.36.1-r15.apk │ │ ├── ca-certificates-bundle-20230506-r0.apk │ │ ├── dhcpcd-10.0.5-r0.apk │ │ ├── htop-3.2.2-r1.apk │ │ ├── icu-data-full-74.1-r0.apk │ │ ├── icu-libs-74.1-r0.apk │ │ ├── libcrypto3-3.1.4-r2.apk │ │ ├── libgcc-13.2.1_git20231014-r0.apk │ │ ├── libncursesw-6.4_p20231125-r0.apk │ │ ├── libssl3-3.1.4-r2.apk │ │ ├── libstdc++-13.2.1_git20231014-r0.apk │ │ ├── musl-1.2.4_git20230717-r4.apk │ │ ├── nano-7.2-r1.apk │ │ ├── ncurses-terminfo-base-6.4_p20231125-r0.apk │ │ ├── tzdata-2023c-r1.apk │ │ └── zlib-1.3-r2.apk │ ├── ReadMe.md │ └── Root │ │ ├── etc │ │ ├── init.d │ │ │ └── rcS │ │ ├── passwd │ │ └── profile │ │ └── opt │ │ └── powershell │ │ └── pwsh ├── RaySoul │ └── ReadMe.md └── ReadMe.md └── ReadMe.md /.editorconfig: -------------------------------------------------------------------------------- 1 | ## 2 | ## PROJECT: Mouri Internal Library Essentials 3 | ## FILE: .editorconfig 4 | ## PURPOSE: The root .editorconfig file for C++ Project 5 | ## 6 | ## LICENSE: The MIT License 7 | ## 8 | ## MAINTAINER: MouriNaruto (Kenji.Mouri@outlook.com) 9 | ## 10 | 11 | root = true 12 | 13 | [*] 14 | charset = utf-8-bom 15 | end_of_line = crlf 16 | 17 | [*.md] 18 | insert_final_newline = true 19 | 20 | [*.{c,c++,cc,cpp,cxx,h,h++,hh,hpp,hxx,idl,inl,ipp,tlh,tli}] 21 | indent_style = space 22 | indent_size = 4 23 | insert_final_newline = true 24 | trim_trailing_whitespace = true 25 | vc_generate_documentation_comments = doxygen_slash_star 26 | 27 | [*.{cs,csx,vb,vbx}] 28 | indent_style = space 29 | indent_size = 4 30 | insert_final_newline = true 31 | trim_trailing_whitespace = true 32 | 33 | [*.{js,json,xml,toml,xaml}] 34 | indent_style = space 35 | indent_size = 2 36 | insert_final_newline = true 37 | trim_trailing_whitespace = true 38 | 39 | [*.rc] 40 | charset = utf-16le 41 | 42 | [Mile.Project.Properties.Template.h] 43 | charset = utf-16le 44 | 45 | [Mile.Project.Properties.h] 46 | charset = utf-16le 47 | 48 | [*.bat] 49 | charset = utf-8 50 | insert_final_newline = true 51 | 52 | [*.sh] 53 | charset = utf-8 54 | end_of_line = lf 55 | insert_final_newline = true 56 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## 2 | ## PROJECT: Mouri Internal Library Essentials 3 | ## FILE: .gitignore 4 | ## PURPOSE: The root .gitignore file for Visual Studio C++ Project 5 | ## 6 | ## LICENSE: The MIT License 7 | ## 8 | ## MAINTAINER: MouriNaruto (Kenji.Mouri@outlook.com) 9 | ## 10 | 11 | ## 12 | ## Ignore Mile.Project specific temporary files, build results, 13 | ## and files generated by popular Visual Studio add-ons. 14 | ## 15 | Output/ 16 | 17 | ## 18 | ## Ignore Visual Studio temporary files, build results, and 19 | ## files generated by popular Visual Studio add-ons. 20 | ## 21 | 22 | # User-specific files 23 | *.rsuser 24 | *.suo 25 | *.user 26 | *.userosscache 27 | *.sln.docstates 28 | 29 | # User-specific files (MonoDevelop/Xamarin Studio) 30 | *.userprefs 31 | 32 | # Mono auto generated files 33 | mono_crash.* 34 | 35 | # Build results 36 | [Dd]ebug/ 37 | [Dd]ebugPublic/ 38 | [Rr]elease/ 39 | [Rr]eleases/ 40 | x64/ 41 | x86/ 42 | [Ww][Ii][Nn]32/ 43 | [Aa][Rr][Mm]/ 44 | [Aa][Rr][Mm]64/ 45 | bld/ 46 | [Bb]in/ 47 | [Oo]bj/ 48 | [Ll]og/ 49 | [Ll]ogs/ 50 | 51 | # Visual Studio 2015/2017 cache/options directory 52 | .vs/ 53 | # Uncomment if you have tasks that create the project's static files in wwwroot 54 | #wwwroot/ 55 | 56 | # Visual Studio 2017 auto generated files 57 | Generated\ Files/ 58 | 59 | # MSTest test Results 60 | [Tt]est[Rr]esult*/ 61 | [Bb]uild[Ll]og.* 62 | 63 | # NUnit 64 | *.VisualState.xml 65 | TestResult.xml 66 | nunit-*.xml 67 | 68 | # Build Results of an ATL Project 69 | [Dd]ebugPS/ 70 | [Rr]eleasePS/ 71 | dlldata.c 72 | 73 | # Benchmark Results 74 | BenchmarkDotNet.Artifacts/ 75 | 76 | # .NET Core 77 | project.lock.json 78 | project.fragment.lock.json 79 | artifacts/ 80 | 81 | # ASP.NET Scaffolding 82 | ScaffoldingReadMe.txt 83 | 84 | # StyleCop 85 | StyleCopReport.xml 86 | 87 | # Files built by Visual Studio 88 | *_i.c 89 | *_p.c 90 | *_h.h 91 | *.ilk 92 | *.meta 93 | *.obj 94 | *.iobj 95 | *.pch 96 | *.pdb 97 | *.ipdb 98 | *.pgc 99 | *.pgd 100 | *.rsp 101 | *.sbr 102 | *.tlb 103 | *.tli 104 | *.tlh 105 | *.tmp 106 | *.tmp_proj 107 | *_wpftmp.csproj 108 | *.log 109 | *.tlog 110 | *.vspscc 111 | *.vssscc 112 | .builds 113 | *.pidb 114 | *.svclog 115 | *.scc 116 | 117 | # Chutzpah Test files 118 | _Chutzpah* 119 | 120 | # Visual C++ cache files 121 | ipch/ 122 | *.aps 123 | *.ncb 124 | *.opendb 125 | *.opensdf 126 | *.sdf 127 | *.cachefile 128 | *.VC.db 129 | *.VC.VC.opendb 130 | 131 | # Visual Studio profiler 132 | *.psess 133 | *.vsp 134 | *.vspx 135 | *.sap 136 | 137 | # Visual Studio Trace Files 138 | *.e2e 139 | 140 | # TFS 2012 Local Workspace 141 | $tf/ 142 | 143 | # Guidance Automation Toolkit 144 | *.gpState 145 | 146 | # ReSharper is a .NET coding add-in 147 | _ReSharper*/ 148 | *.[Rr]e[Ss]harper 149 | *.DotSettings.user 150 | 151 | # TeamCity is a build add-in 152 | _TeamCity* 153 | 154 | # DotCover is a Code Coverage Tool 155 | *.dotCover 156 | 157 | # AxoCover is a Code Coverage Tool 158 | .axoCover/* 159 | !.axoCover/settings.json 160 | 161 | # Coverlet is a free, cross platform Code Coverage Tool 162 | coverage*.json 163 | coverage*.xml 164 | coverage*.info 165 | 166 | # Visual Studio code coverage results 167 | *.coverage 168 | *.coveragexml 169 | 170 | # NCrunch 171 | _NCrunch_* 172 | .*crunch*.local.xml 173 | nCrunchTemp_* 174 | 175 | # MightyMoose 176 | *.mm.* 177 | AutoTest.Net/ 178 | 179 | # Web workbench (sass) 180 | .sass-cache/ 181 | 182 | # Installshield output folder 183 | [Ee]xpress/ 184 | 185 | # DocProject is a documentation generator add-in 186 | DocProject/buildhelp/ 187 | DocProject/Help/*.HxT 188 | DocProject/Help/*.HxC 189 | DocProject/Help/*.hhc 190 | DocProject/Help/*.hhk 191 | DocProject/Help/*.hhp 192 | DocProject/Help/Html2 193 | DocProject/Help/html 194 | 195 | # Click-Once directory 196 | publish/ 197 | 198 | # Publish Web Output 199 | *.[Pp]ublish.xml 200 | *.azurePubxml 201 | # Note: Comment the next line if you want to checkin your web deploy settings, 202 | # but database connection strings (with potential passwords) will be unencrypted 203 | *.pubxml 204 | *.publishproj 205 | 206 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 207 | # checkin your Azure Web App publish settings, but sensitive information contained 208 | # in these scripts will be unencrypted 209 | PublishScripts/ 210 | 211 | # NuGet Packages 212 | *.nupkg 213 | # NuGet Symbol Packages 214 | *.snupkg 215 | # The packages folder can be ignored because of Package Restore 216 | **/[Pp]ackages/* 217 | # except build/, which is used as an MSBuild target. 218 | !**/[Pp]ackages/build/ 219 | # Uncomment if necessary however generally it will be regenerated when needed 220 | #!**/[Pp]ackages/repositories.config 221 | # NuGet v3's project.json files produces more ignorable files 222 | *.nuget.props 223 | *.nuget.targets 224 | 225 | # Microsoft Azure Build Output 226 | csx/ 227 | *.build.csdef 228 | 229 | # Microsoft Azure Emulator 230 | ecf/ 231 | rcf/ 232 | 233 | # Windows Store app package directories and files 234 | AppPackages/ 235 | BundleArtifacts/ 236 | Package.StoreAssociation.xml 237 | _pkginfo.txt 238 | *.appx 239 | *.appxbundle 240 | *.appxupload 241 | 242 | # Visual Studio cache files 243 | # files ending in .cache can be ignored 244 | *.[Cc]ache 245 | # but keep track of directories ending in .cache 246 | !?*.[Cc]ache/ 247 | 248 | # Others 249 | ClientBin/ 250 | ~$* 251 | *~ 252 | *.dbmdl 253 | *.dbproj.schemaview 254 | *.jfm 255 | *.pfx 256 | *.publishsettings 257 | orleans.codegen.cs 258 | 259 | # Including strong name files can present a security risk 260 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 261 | #*.snk 262 | 263 | # Since there are multiple workflows, uncomment next line to ignore bower_components 264 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 265 | #bower_components/ 266 | 267 | # RIA/Silverlight projects 268 | Generated_Code/ 269 | 270 | # Backup & report files from converting an old project file 271 | # to a newer Visual Studio version. Backup files are not needed, 272 | # because we have git ;-) 273 | _UpgradeReport_Files/ 274 | Backup*/ 275 | UpgradeLog*.XML 276 | UpgradeLog*.htm 277 | ServiceFabricBackup/ 278 | *.rptproj.bak 279 | 280 | # SQL Server files 281 | *.mdf 282 | *.ldf 283 | *.ndf 284 | 285 | # Business Intelligence projects 286 | *.rdl.data 287 | *.bim.layout 288 | *.bim_*.settings 289 | *.rptproj.rsuser 290 | *- [Bb]ackup.rdl 291 | *- [Bb]ackup ([0-9]).rdl 292 | *- [Bb]ackup ([0-9][0-9]).rdl 293 | 294 | # Microsoft Fakes 295 | FakesAssemblies/ 296 | 297 | # GhostDoc plugin setting file 298 | *.GhostDoc.xml 299 | 300 | # Node.js Tools for Visual Studio 301 | .ntvs_analysis.dat 302 | node_modules/ 303 | 304 | # Visual Studio 6 build log 305 | *.plg 306 | 307 | # Visual Studio 6 workspace options file 308 | *.opt 309 | 310 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 311 | *.vbw 312 | 313 | # Visual Studio 6 auto-generated project file (contains which files were open etc.) 314 | *.vbp 315 | 316 | # Visual Studio 6 workspace and project file (working project files containing files to include in project) 317 | *.dsw 318 | *.dsp 319 | 320 | # Visual Studio 6 technical files 321 | *.ncb 322 | *.aps 323 | 324 | # Visual Studio LightSwitch build output 325 | **/*.HTMLClient/GeneratedArtifacts 326 | **/*.DesktopClient/GeneratedArtifacts 327 | **/*.DesktopClient/ModelManifest.xml 328 | **/*.Server/GeneratedArtifacts 329 | **/*.Server/ModelManifest.xml 330 | _Pvt_Extensions 331 | 332 | # Paket dependency manager 333 | .paket/paket.exe 334 | paket-files/ 335 | 336 | # FAKE - F# Make 337 | .fake/ 338 | 339 | # CodeRush personal settings 340 | .cr/personal 341 | 342 | # Python Tools for Visual Studio (PTVS) 343 | __pycache__/ 344 | *.pyc 345 | 346 | # Cake - Uncomment if you are using it 347 | # tools/** 348 | # !tools/packages.config 349 | 350 | # Tabs Studio 351 | *.tss 352 | 353 | # Telerik's JustMock configuration file 354 | *.jmconfig 355 | 356 | # BizTalk build output 357 | *.btp.cs 358 | *.btm.cs 359 | *.odx.cs 360 | *.xsd.cs 361 | 362 | # OpenCover UI analysis results 363 | OpenCover/ 364 | 365 | # Azure Stream Analytics local run output 366 | ASALocalRun/ 367 | 368 | # MSBuild Binary and Structured Log 369 | *.binlog 370 | 371 | # NVidia Nsight GPU debugger configuration file 372 | *.nvuser 373 | 374 | # MFractors (Xamarin productivity tool) working folder 375 | .mfractor/ 376 | 377 | # Local History for Visual Studio 378 | .localhistory/ 379 | 380 | # Visual Studio History (VSHistory) files 381 | .vshistory/ 382 | 383 | # BeatPulse healthcheck temp database 384 | healthchecksdb 385 | 386 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 387 | MigrationBackup/ 388 | 389 | # Ionide (cross platform F# VS Code tools) working folder 390 | .ionide/ 391 | 392 | # Fody - auto-generated XML schema 393 | FodyWeavers.xsd 394 | 395 | # VS Code files for those working on multiple tools 396 | .vscode/* 397 | !.vscode/settings.json 398 | !.vscode/tasks.json 399 | !.vscode/launch.json 400 | !.vscode/extensions.json 401 | *.code-workspace 402 | 403 | # Local History for Visual Studio Code 404 | .history/ 405 | 406 | # Windows Installer files from build outputs 407 | *.cab 408 | *.msi 409 | *.msix 410 | *.msm 411 | *.msp 412 | 413 | # JetBrains Rider 414 | *.sln.iml 415 | -------------------------------------------------------------------------------- /License.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) M2-Team and Contributors. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MinCLR/.editorconfig: -------------------------------------------------------------------------------- 1 | ## 2 | ## PROJECT: Mouri Internal Library Essentials 3 | ## FILE: .editorconfig 4 | ## PURPOSE: The root .editorconfig file for .NET Project 5 | ## 6 | ## LICENSE: The MIT License 7 | ## 8 | ## DEVELOPER: Mouri_Naruto (Mouri_Naruto AT Outlook.com) 9 | ## 10 | 11 | root = true 12 | 13 | [*] 14 | charset = utf-8-bom 15 | end_of_line = crlf 16 | 17 | [*.md] 18 | indent_size = 2 19 | insert_final_newline = true 20 | 21 | [*.{cs,csx,vb,vbx}] 22 | indent_style = space 23 | indent_size = 4 24 | insert_final_newline = true 25 | trim_trailing_whitespace = true 26 | 27 | [*.{js,json,xml,toml,xaml}] 28 | indent_style = space 29 | indent_size = 2 30 | insert_final_newline = true 31 | trim_trailing_whitespace = true 32 | 33 | [*.bat] 34 | charset = utf-8 35 | insert_final_newline = true 36 | 37 | [*.sh] 38 | charset = utf-8 39 | end_of_line = lf 40 | insert_final_newline = true 41 | -------------------------------------------------------------------------------- /MinCLR/BuildAllTargets.cmd: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem PROJECT: Mouri Internal Library Essentials 3 | @rem FILE: BuildAllTargets.cmd 4 | @rem PURPOSE: Build all targets script for Visual Studio .NET Project 5 | @rem 6 | @rem LICENSE: The MIT License 7 | @rem 8 | @rem DEVELOPER: Mouri_Naruto (Mouri_Naruto AT Outlook.com) 9 | @rem 10 | 11 | @setlocal 12 | @echo off 13 | 14 | rem Change to the current folder. 15 | cd "%~dp0" 16 | 17 | rem Remove the output folder for a fresh compile. 18 | rd /s /q Output 19 | 20 | set VisualStudioInstallerFolder="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer" 21 | if %PROCESSOR_ARCHITECTURE%==x86 set VisualStudioInstallerFolder="%ProgramFiles%\Microsoft Visual Studio\Installer" 22 | 23 | pushd %VisualStudioInstallerFolder% 24 | for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.NetCore.Component.SDK -property installationPath`) do ( 25 | set VisualStudioInstallDir=%%i 26 | ) 27 | popd 28 | 29 | call "%VisualStudioInstallDir%\VC\Auxiliary\Build\vcvarsall.bat" x86 30 | 31 | rem Build all targets 32 | MSBuild -m BuildAllTargets.proj 33 | 34 | @endlocal -------------------------------------------------------------------------------- /MinCLR/BuildAllTargets.proj: -------------------------------------------------------------------------------- 1 |  2 | 11 | 14 | 15 | $(MSBuildThisFileDirectory)*.sln 16 | 17 | 18 | 19 | Configuration=Debug;Platform=Any CPU 20 | 21 | 22 | Configuration=Release;Platform=Any CPU 23 | 24 | 25 | 26 | 31 | 32 | 33 | 39 | 40 | 41 | 47 | 48 | -------------------------------------------------------------------------------- /MinCLR/Directory.Build.props: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | $(SolutionDir)Output\Binaries\$(MSBuildProjectName)\$(Configuration)\ 14 | $(SolutionDir)Output\Objects\$(MSBuildProjectName)\$(Configuration)\ 15 | $(SolutionDir)Output\Objects\$(MSBuildProjectName)\$(Configuration)\ 16 | $(SolutionDir)Output\Objects\$(MSBuildProjectName)\$(Configuration)\ 17 | 18 | -------------------------------------------------------------------------------- /MinCLR/MinCLR.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.32126.317 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Global 7 | GlobalSection(SolutionProperties) = preSolution 8 | HideSolutionNode = FALSE 9 | EndGlobalSection 10 | GlobalSection(ExtensibilityGlobals) = postSolution 11 | SolutionGuid = {95365A0A-44C2-4EAB-B26F-52293AE39A06} 12 | EndGlobalSection 13 | EndGlobal 14 | -------------------------------------------------------------------------------- /MinCLR/ReadMe.md: -------------------------------------------------------------------------------- 1 | # MinCLR Infrastructure 2 | 3 | Work In Progress. 4 | -------------------------------------------------------------------------------- /MinInit/.editorconfig: -------------------------------------------------------------------------------- 1 | ## 2 | ## PROJECT: Mouri Internal Library Essentials 3 | ## FILE: .editorconfig 4 | ## PURPOSE: The root .editorconfig file for C++ Project 5 | ## 6 | ## LICENSE: The MIT License 7 | ## 8 | ## DEVELOPER: Mouri_Naruto (Mouri_Naruto AT Outlook.com) 9 | ## 10 | 11 | root = true 12 | 13 | [*] 14 | charset = utf-8-bom 15 | end_of_line = crlf 16 | 17 | [*.md] 18 | insert_final_newline = true 19 | 20 | [*.{c,c++,cc,cpp,cxx,h,h++,hh,hpp,hxx,idl,inl,ipp,tlh,tli}] 21 | indent_style = space 22 | indent_size = 4 23 | insert_final_newline = true 24 | trim_trailing_whitespace = true 25 | vc_generate_documentation_comments = doxygen_slash_star 26 | 27 | [*.{js,json,xml,toml,xaml}] 28 | indent_style = space 29 | indent_size = 2 30 | insert_final_newline = true 31 | trim_trailing_whitespace = true 32 | 33 | [*.rc] 34 | charset = utf-16le 35 | 36 | [Mile.Project.Properties.Template.h] 37 | charset = utf-16le 38 | 39 | [Mile.Project.Properties.h] 40 | charset = utf-16le 41 | 42 | [*.bat] 43 | charset = utf-8 44 | insert_final_newline = true 45 | 46 | [*.sh] 47 | charset = utf-8 48 | end_of_line = lf 49 | insert_final_newline = true 50 | -------------------------------------------------------------------------------- /MinInit/MinInit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PROJECT: MinInit 3 | * FILE: MinInit.c 4 | * PURPOSE: Implementation for MinInit 5 | * 6 | * LICENSE: The MIT License 7 | * 8 | * DEVELOPER: Mouri_Naruto (Mouri_Naruto AT Outlook.com) 9 | */ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #include 19 | 20 | void print_message(const char *message) 21 | { 22 | printf("[MinInit] %s\n", message); 23 | } 24 | 25 | int main() 26 | { 27 | { 28 | int confd = open("/dev/console", O_RDWR); 29 | if (-1 != confd) 30 | { 31 | dup2(confd, STDIN_FILENO); 32 | dup2(confd, STDOUT_FILENO); 33 | dup2(confd, STDERR_FILENO); 34 | 35 | if (confd > STDERR_FILENO) 36 | { 37 | close(confd); 38 | } 39 | } 40 | } 41 | 42 | if (-1 == mount( 43 | "udev", 44 | "/dev", 45 | "devtmpfs", 46 | MS_NOSUID | MS_NOEXEC | MS_RELATIME, 47 | "size=10240k,mode=755") && errno != EBUSY) 48 | { 49 | print_message("Failed to mount /dev.\n"); 50 | } 51 | 52 | if (-1 == mount( 53 | "proc", 54 | "/proc", 55 | "proc", 56 | MS_NOSUID | MS_NOEXEC | MS_RELATIME | MS_NODEV, 57 | NULL) && errno != EBUSY) 58 | { 59 | print_message("Failed to mount /proc.\n"); 60 | } 61 | 62 | if (-1 == mount( 63 | "sysfs", 64 | "/sys", 65 | "sysfs", 66 | MS_NOSUID | MS_NOEXEC | MS_RELATIME | MS_NODEV, 67 | NULL) && errno != EBUSY) 68 | { 69 | print_message("Failed to mount /sys.\n"); 70 | } 71 | 72 | if (-1 == mount( 73 | "tmpfs", 74 | "/tmp", 75 | "tmpfs", 76 | 0, 77 | NULL)) 78 | { 79 | print_message("Failed to mount /tmp to tmpfs.\n"); 80 | } 81 | 82 | chdir("/root"); 83 | 84 | const char* envp[] = 85 | { 86 | "PATH=/usr/sbin:/usr/bin:/sbin:/bin", 87 | "TERM=xterm-256color", 88 | "HOME=/root", 89 | NULL 90 | }; 91 | 92 | const char* argv[] = 93 | { 94 | "/bin/pwsh", 95 | "-NoLogo", 96 | NULL 97 | }; 98 | 99 | execve(argv[0], (char* const*)argv, (char* const*)envp); 100 | 101 | print_message("Failed to start PowerShell.\n"); 102 | 103 | return 0; 104 | } 105 | -------------------------------------------------------------------------------- /MinInit/ReadMe.md: -------------------------------------------------------------------------------- 1 | # MinInit 2 | 3 | Init system implementation mainly used by MinCLR. 4 | 5 | Use `build.sh` to build it. 6 | -------------------------------------------------------------------------------- /MinInit/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## 3 | ## PROJECT: MinCLR 4 | ## FILE: .editorconfig 5 | ## PURPOSE: Build script for MinInit 6 | ## 7 | ## LICENSE: The MIT License 8 | ## 9 | ## DEVELOPER: Mouri_Naruto (Mouri_Naruto AT Outlook.com) 10 | ## 11 | 12 | SOURCE_ROOT=$(dirname $(realpath -s ${BASH_SOURCE[0]})) 13 | OUTPUT_ROOT=$SOURCE_ROOT/Output/Binaries 14 | mkdir -p $OUTPUT_ROOT 15 | musl-gcc -std=c99 -static -O2 -s -o $OUTPUT_ROOT/mininit $SOURCE_ROOT/MinInit.c 16 | -------------------------------------------------------------------------------- /Platform/Linux/Packages/.gitignore: -------------------------------------------------------------------------------- 1 | !* -------------------------------------------------------------------------------- /Platform/Linux/Packages/busybox-1.36.1-r15.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Packages/busybox-1.36.1-r15.apk -------------------------------------------------------------------------------- /Platform/Linux/Packages/ca-certificates-bundle-20230506-r0.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Packages/ca-certificates-bundle-20230506-r0.apk -------------------------------------------------------------------------------- /Platform/Linux/Packages/dhcpcd-10.0.5-r0.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Packages/dhcpcd-10.0.5-r0.apk -------------------------------------------------------------------------------- /Platform/Linux/Packages/htop-3.2.2-r1.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Packages/htop-3.2.2-r1.apk -------------------------------------------------------------------------------- /Platform/Linux/Packages/icu-data-full-74.1-r0.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Packages/icu-data-full-74.1-r0.apk -------------------------------------------------------------------------------- /Platform/Linux/Packages/icu-libs-74.1-r0.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Packages/icu-libs-74.1-r0.apk -------------------------------------------------------------------------------- /Platform/Linux/Packages/libcrypto3-3.1.4-r2.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Packages/libcrypto3-3.1.4-r2.apk -------------------------------------------------------------------------------- /Platform/Linux/Packages/libgcc-13.2.1_git20231014-r0.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Packages/libgcc-13.2.1_git20231014-r0.apk -------------------------------------------------------------------------------- /Platform/Linux/Packages/libncursesw-6.4_p20231125-r0.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Packages/libncursesw-6.4_p20231125-r0.apk -------------------------------------------------------------------------------- /Platform/Linux/Packages/libssl3-3.1.4-r2.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Packages/libssl3-3.1.4-r2.apk -------------------------------------------------------------------------------- /Platform/Linux/Packages/libstdc++-13.2.1_git20231014-r0.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Packages/libstdc++-13.2.1_git20231014-r0.apk -------------------------------------------------------------------------------- /Platform/Linux/Packages/musl-1.2.4_git20230717-r4.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Packages/musl-1.2.4_git20230717-r4.apk -------------------------------------------------------------------------------- /Platform/Linux/Packages/nano-7.2-r1.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Packages/nano-7.2-r1.apk -------------------------------------------------------------------------------- /Platform/Linux/Packages/ncurses-terminfo-base-6.4_p20231125-r0.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Packages/ncurses-terminfo-base-6.4_p20231125-r0.apk -------------------------------------------------------------------------------- /Platform/Linux/Packages/tzdata-2023c-r1.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Packages/tzdata-2023c-r1.apk -------------------------------------------------------------------------------- /Platform/Linux/Packages/zlib-1.3-r2.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Packages/zlib-1.3-r2.apk -------------------------------------------------------------------------------- /Platform/Linux/ReadMe.md: -------------------------------------------------------------------------------- 1 | # Linux Platform for MinCLR Project (.NET/Linux) 2 | 3 | This is the repository contains the Linux Platform for MinCLR Project. 4 | 5 | ## Optimized Linux Kernel 6 | 7 | Source code available at https://github.com/SherryPlatform/MinLin.Kernel. 8 | 9 | Here are available configurations for the optimized Linux Kernel. 10 | 11 | ### Hyper-V Generation 2 Virtual Machines 12 | 13 | You can choose these configurations for Azure, Hyper-V and NanaBox. 14 | 15 | Note: NanaBox is a third-party lightweight XAML-based out-of-box-experience 16 | oriented Hyper-V virtualization software based on Host Compute System API, 17 | Remote Desktop ActiveX control and XAML Islands, project repository available 18 | at https://github.com/M2Team/NanaBox. NanaBox is the reference and prototype 19 | virtualization platform for MinLin and MinCLR. 20 | 21 | - [x64, generic, as modularized as possible](https://github.com/SherryPlatform/MinLin.Kernel/blob/main/MinLin/config-MinLin.Kernel.NanaBox) 22 | - [x64, generic, make all modules builtin](https://github.com/SherryPlatform/MinLin.Kernel/blob/main/MinLin/config-MinLin.Kernel.NanaBox.Single) 23 | 24 | Note: All modules builtin is highly recommended unless .NET based kernel module 25 | on-demand loading implementation is available. 26 | 27 | For Hyper-V Generation 2 Virtual Machines, systemd-boot is suggested for the 28 | bootloader because Hyper-V Generation 2 Virtual Machines only support UEFI 29 | Class 3. So, it's really suitable. 30 | 31 | Here are the original links for systemd-boot package. For use systemd-boot as 32 | bootloader, `/usr/lib/systemd/boot/efi/systemd-bootx64.efi` is all you need. 33 | 34 | https://mirrors.tuna.tsinghua.edu.cn//debian/pool/main/s/systemd/systemd-boot-efi_252.19-1~deb12u1_amd64.deb 35 | 36 | Here is the NanaBox virtual machine configuration file sample. 37 | 38 | More information available at https://github.com/M2Team/NanaBox/blob/main/Documents/ConfigurationReference.md 39 | 40 | ``` 41 | { 42 | "NanaBox": { 43 | "ComPorts": { 44 | "UefiConsole": "Disabled" 45 | }, 46 | "Gpu": { 47 | "AssignmentMode": "Disabled" 48 | }, 49 | "GuestType": "Windows", 50 | "MemorySize": 192, 51 | "Name": "MinCLR", 52 | "NetworkAdapters": [ 53 | { 54 | "Connected": true 55 | } 56 | ], 57 | "ProcessorCount": 1, 58 | "ScsiDevices": [ 59 | { 60 | "Path": ".\\MinCLR.vhdx", 61 | "Type": "VirtualDisk" 62 | } 63 | ], 64 | "Type": "VirtualMachine", 65 | "Version": 1 66 | } 67 | } 68 | ``` 69 | 70 | ## Minimum Native Infrastructure 71 | 72 | Based on the reference in [dotnet-docker] and [PowerShell-Docker] project, we 73 | only need these Alpine packages to build the root file system for running a 74 | standard .NET 8.0 Runtime with full i18n support and PowerShell 7.4.0. 75 | 76 | [dotnet-docker]: https://github.com/dotnet/dotnet-docker/blob/main/src/runtime-deps/8.0/alpine3.18-extra/amd64/Dockerfile 77 | [PowerShell-Docker]: https://github.com/PowerShell/PowerShell-Docker/blob/master/release/7-5/alpine317/docker/Dockerfile 78 | 79 | Here are the original links for Alpine packages. You also can browse [Packages] 80 | folder for get the backup packages. 81 | 82 | [Packages]: Packages 83 | 84 | - Core Packages 85 | - https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.19/main/x86_64/musl-1.2.4_git20230717-r4.apk 86 | - https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.19/main/x86_64/busybox-1.36.1-r15.apk 87 | - .NET Runtime Dependencies 88 | - https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.19/main/x86_64/libstdc%2B%2B-13.2.1_git20231014-r0.apk 89 | - https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.19/main/x86_64/libgcc-13.2.1_git20231014-r0.apk 90 | - https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.19/main/x86_64/libcrypto3-3.1.4-r2.apk 91 | - https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.19/main/x86_64/libssl3-3.1.4-r2.apk 92 | - https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.19/main/x86_64/ca-certificates-bundle-20230506-r0.apk 93 | - https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.19/main/x86_64/zlib-1.3-r2.apk 94 | - .NET Runtime i18n Support Dependencies 95 | - https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.19/main/x86_64/tzdata-2023c-r1.apk 96 | - https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.19/main/x86_64/icu-libs-74.1-r0.apk 97 | - https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.19/main/x86_64/icu-data-full-74.1-r0.apk 98 | - PowerShell Dependencies 99 | - https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.19/main/x86_64/ncurses-terminfo-base-6.4_p20231125-r0.apk 100 | - Useful utilities for bootable image 101 | - https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.19/main/x86_64/libncursesw-6.4_p20231125-r0.apk 102 | - https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.19/main/x86_64/htop-3.2.2-r1.apk 103 | - https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.19/main/x86_64/dhcpcd-10.0.5-r0.apk 104 | - https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.19/main/x86_64/nano-7.2-r1.apk 105 | 106 | ## Additional files for root file system 107 | 108 | You also can browse [Root](Root) folder for get these files. 109 | -------------------------------------------------------------------------------- /Platform/Linux/Root/etc/init.d/rcS: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mount -t proc proc /proc 4 | mount -t sysfs sysfs /sys 5 | mount -o remount,rw / 6 | 7 | dhcpcd eth0 8 | 9 | cd /opt/MinCLR.SimpleWebServer/ 10 | HOME="/root" /opt/dotnet/dotnet MinCLR.SimpleWebServer.dll & 11 | cd / 12 | -------------------------------------------------------------------------------- /Platform/Linux/Root/etc/passwd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SherryPlatform/MinCLR/932b8dc8af654938895d9575458bde47b989e1da/Platform/Linux/Root/etc/passwd -------------------------------------------------------------------------------- /Platform/Linux/Root/etc/profile: -------------------------------------------------------------------------------- 1 | export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 2 | export HOME="/root" 3 | export SHELL="/opt/powershell/pwsh" 4 | 5 | cd ~ 6 | exec $SHELL 7 | -------------------------------------------------------------------------------- /Platform/Linux/Root/opt/powershell/pwsh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /opt/dotnet/dotnet /opt/powershell/pwsh.dll $* 3 | -------------------------------------------------------------------------------- /Platform/RaySoul/ReadMe.md: -------------------------------------------------------------------------------- 1 | # RaySoul Platform for MinCLR Project 2 | 3 | Work In Progress. 4 | 5 | Read https://github.com/ChaosAIOfficial/RaySoul for more information. 6 | -------------------------------------------------------------------------------- /Platform/ReadMe.md: -------------------------------------------------------------------------------- 1 | # MinCLR Platform 2 | 3 | - [Linux](Linux/ReadMe.md) 4 | - [RaySoul](RaySoul/ReadMe.md) 5 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | # MinCLR 2 | 3 | Minimal bootable Linux distro for .NET environment. 4 | 5 | ## Components 6 | 7 | - [Platform](Platform) 8 | - [MinInit](MinInit) 9 | - [MinCLR](MinCLR) 10 | --------------------------------------------------------------------------------