Skip to content

Commit

Permalink
Merge branch 'master' into task/ghaction
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinbreiz authored Sep 26, 2023
2 parents b55bed3 + 1f73caf commit ed15e3e
Show file tree
Hide file tree
Showing 461 changed files with 9,261 additions and 16,268 deletions.
32 changes: 22 additions & 10 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ root = true
# Use tabs as indentation
# Trim trailing whitespace
[*]
insert_final_newline = true
insert_final_newline = false
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
Expand All @@ -26,9 +26,9 @@ csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_var_elsewhere = true:none
csharp_style_var_for_built_in_types = true:none
csharp_style_var_when_type_is_apparent = true:warning
csharp_style_var_elsewhere = false:none
csharp_style_var_for_built_in_types = false:none
csharp_style_var_when_type_is_apparent = false:warning

csharp_indent_block_contents = true:warning
csharp_indent_braces = false:warning
Expand All @@ -49,6 +49,15 @@ csharp_space_before_comma = false:warning
csharp_space_before_dot = false:error
csharp_space_before_open_square_brackets = true:warning
csharp_space_before_semicolon_in_for_statement = false:error
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_indent_labels = one_less_than_current
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_prefer_not_pattern = true:suggestion

[*.{cs,vb}]
dotnet_sort_system_directives_first = true
Expand All @@ -59,18 +68,16 @@ dotnet_style_explicit_tuple_names = true:warning
dotnet_style_null_propagation = true:suggestion
dotnet_style_object_initializer = true:suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = false:warning
dotnet_style_predefined_type_for_member_access = true:warning
dotnet_style_qualification_for_event = false:warning
dotnet_style_qualification_for_field = false:warning
dotnet_style_qualification_for_method = false:warning

dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.parameters.capitalization = pascal_case
dotnet_naming_style.parameters.required_prefix = a
dotnet_naming_style.parameters.capitalization = camel_case

dotnet_naming_style.private_fields.capitalization = pascal_case
dotnet_naming_style.private_fields.required_prefix = _
dotnet_naming_style.private_fields.capitalization = camel_case

dotnet_naming_style.interfaces.capitalization = pascal_case
dotnet_naming_style.interfaces.required_prefix = I
Expand All @@ -94,8 +101,13 @@ dotnet_naming_rule.pascal_case_definitions.style = pascal_case

dotnet_naming_rule.parameters.severity = suggestion
dotnet_naming_rule.parameters.symbols = parameters
dotnet_naming_rule.parameters.style = parameters
dotnet_naming_rule.parameters.style = private_fields

dotnet_naming_rule.private_fields.severity = suggestion
dotnet_naming_rule.private_fields.symbols = private_fields
dotnet_naming_rule.private_fields.style = private_fields
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
end_of_line = crlf
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ Docs/~$RingsGen3.xlsx
*.map
/Resources/Dependencies/Dapper/DapperExtensions.StrongName.deps.json
/Resources/Dependencies/Dapper/ref/DapperExtensions.StrongName.dll


.idea/
Binary file modified Artwork/liminewp.bmp
Binary file not shown.
26 changes: 13 additions & 13 deletions Build.sln
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test Runner", "Test Runner"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.TestRunner.TestController", "Tests\Cosmos.TestRunner.TestController\Cosmos.TestRunner.TestController.csproj", "{2EEC1BF8-758F-4D9D-B063-8CF005468B24}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TheRingMaster", "source\TheRingMaster\TheRingMaster.csproj", "{0EE3DF1C-44E6-4669-88AA-D8D2612DA817}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{3C4B0261-3B1D-4503-97F1-AC0252D500E6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NASM", "Tools\NASM\NASM.csproj", "{A7C295D2-8DEA-4CAE-A8CB-44CD0529EC65}"
Expand All @@ -99,6 +97,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DapperExtensions.StrongName
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2CPU.Debug.Symbols.Net48", "..\IL2CPU\source\IL2CPU.Debug.Symbols.Net48\IL2CPU.Debug.Symbols.Net48.csproj", "{440CE2D4-024F-45D3-A95C-9077CC0A51E3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cosmos.Plugs", "source\Cosmos.Plugs\Cosmos.Plugs.csproj", "{509FB0F8-6D0F-424F-9C6B-9E5818B06B21}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -364,16 +364,6 @@ Global
{2EEC1BF8-758F-4D9D-B063-8CF005468B24}.Release-CI|Any CPU.Build.0 = Release|Any CPU
{2EEC1BF8-758F-4D9D-B063-8CF005468B24}.TEST|Any CPU.ActiveCfg = TEST|Any CPU
{2EEC1BF8-758F-4D9D-B063-8CF005468B24}.TEST|Any CPU.Build.0 = TEST|Any CPU
{0EE3DF1C-44E6-4669-88AA-D8D2612DA817}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0EE3DF1C-44E6-4669-88AA-D8D2612DA817}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0EE3DF1C-44E6-4669-88AA-D8D2612DA817}.Debug-CI|Any CPU.ActiveCfg = Debug|Any CPU
{0EE3DF1C-44E6-4669-88AA-D8D2612DA817}.Debug-CI|Any CPU.Build.0 = Debug|Any CPU
{0EE3DF1C-44E6-4669-88AA-D8D2612DA817}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0EE3DF1C-44E6-4669-88AA-D8D2612DA817}.Release|Any CPU.Build.0 = Release|Any CPU
{0EE3DF1C-44E6-4669-88AA-D8D2612DA817}.Release-CI|Any CPU.ActiveCfg = Release|Any CPU
{0EE3DF1C-44E6-4669-88AA-D8D2612DA817}.Release-CI|Any CPU.Build.0 = Release|Any CPU
{0EE3DF1C-44E6-4669-88AA-D8D2612DA817}.TEST|Any CPU.ActiveCfg = TEST|Any CPU
{0EE3DF1C-44E6-4669-88AA-D8D2612DA817}.TEST|Any CPU.Build.0 = TEST|Any CPU
{A7C295D2-8DEA-4CAE-A8CB-44CD0529EC65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A7C295D2-8DEA-4CAE-A8CB-44CD0529EC65}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A7C295D2-8DEA-4CAE-A8CB-44CD0529EC65}.Debug-CI|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -440,6 +430,16 @@ Global
{440CE2D4-024F-45D3-A95C-9077CC0A51E3}.Release-CI|Any CPU.Build.0 = Release|Any CPU
{440CE2D4-024F-45D3-A95C-9077CC0A51E3}.TEST|Any CPU.ActiveCfg = TEST|Any CPU
{440CE2D4-024F-45D3-A95C-9077CC0A51E3}.TEST|Any CPU.Build.0 = TEST|Any CPU
{509FB0F8-6D0F-424F-9C6B-9E5818B06B21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{509FB0F8-6D0F-424F-9C6B-9E5818B06B21}.Debug|Any CPU.Build.0 = Debug|Any CPU
{509FB0F8-6D0F-424F-9C6B-9E5818B06B21}.Debug-CI|Any CPU.ActiveCfg = Debug|Any CPU
{509FB0F8-6D0F-424F-9C6B-9E5818B06B21}.Debug-CI|Any CPU.Build.0 = Debug|Any CPU
{509FB0F8-6D0F-424F-9C6B-9E5818B06B21}.Release|Any CPU.ActiveCfg = Release|Any CPU
{509FB0F8-6D0F-424F-9C6B-9E5818B06B21}.Release|Any CPU.Build.0 = Release|Any CPU
{509FB0F8-6D0F-424F-9C6B-9E5818B06B21}.Release-CI|Any CPU.ActiveCfg = Debug|Any CPU
{509FB0F8-6D0F-424F-9C6B-9E5818B06B21}.Release-CI|Any CPU.Build.0 = Debug|Any CPU
{509FB0F8-6D0F-424F-9C6B-9E5818B06B21}.TEST|Any CPU.ActiveCfg = Debug|Any CPU
{509FB0F8-6D0F-424F-9C6B-9E5818B06B21}.TEST|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -476,13 +476,13 @@ Global
{366C2EC6-B9D8-4676-9C88-98F041B8FC93} = {CAF5EB57-6CAD-446D-8FC7-4C03D4B996A6}
{535A7E34-AC73-4781-B791-2C81A9066A2C} = {CD3F5E45-8B24-424F-ADF1-0211712F4CB7}
{2EEC1BF8-758F-4D9D-B063-8CF005468B24} = {D4833110-032D-40E3-ACB3-F11583727B08}
{0EE3DF1C-44E6-4669-88AA-D8D2612DA817} = {6A15C540-8278-4B9C-B890-FA57FB6AE6A6}
{A7C295D2-8DEA-4CAE-A8CB-44CD0529EC65} = {3C4B0261-3B1D-4503-97F1-AC0252D500E6}
{C984AF76-66C2-4A5F-A3DC-9F8FE0CD4D2F} = {9C8A3E55-9045-44CA-BFD4-16D5B4343A90}
{0BA0EC69-F124-44C1-823D-C97FE3AEC59E} = {D95021E1-A2C9-4829-819E-ED433AF13162}
{9413B5A0-1120-43AD-8784-8A3726C1898C} = {FF5BAFDE-AE9D-438D-935A-86B33EE0A758}
{28F18214-DFF8-4A30-BA24-4F32C20CA910} = {FF5BAFDE-AE9D-438D-935A-86B33EE0A758}
{440CE2D4-024F-45D3-A95C-9077CC0A51E3} = {FF5BAFDE-AE9D-438D-935A-86B33EE0A758}
{509FB0F8-6D0F-424F-9C6B-9E5818B06B21} = {4D3F3613-E112-4013-AB81-B8CCED78A555}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E5429BF0-2CEE-45B0-BC73-2188A409E1D3}
Expand Down
File renamed without changes.
File renamed without changes.
Binary file removed Build/Tools/cygwin/cygiconv-2.dll
Binary file not shown.
Binary file removed Build/Tools/cygwin/cygintl-3.dll
Binary file not shown.
Binary file modified Build/Tools/cygwin/cygwin1.dll
Binary file not shown.
Binary file modified Build/Tools/cygwin/ld.exe
Binary file not shown.
7 changes: 7 additions & 0 deletions Build/Tools/cygwin/objdump.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@ECHO OFF

REM %1 == ToolPath
REM %2 == ElfFile
REM %3 == MapFile

"%~1\objdump.exe" --wide --syms "%~2" > "%~3"
Binary file modified Build/Tools/cygwin/objdump.exe
Binary file not shown.
6 changes: 6 additions & 0 deletions Build/Tools/cygwin/objdump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# %1 == ToolPath
# %2 == ElfFile
# %3 == MapFile
objdump --wide --syms "$2" > "$3"
10 changes: 4 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
CosmosOS is a volunteer effort. We encourage you to pitch in. Join the team!

- Before you begin work, make sure to clear it with the project owners. It will save a lot of time down the road.
- Before you begin work, make sure to discuss it with the maintainers here on github or on discord. It will save a lot of time down the road.
- Fork the project over to your account, do not request repository access.
- Please be sure to check out the FAQ to see if any questions you have are already answered. [FAQ on GoCosmos.org](https://www.gocosmos.org/faq/)
- Please don't "bump" your issue(s). If you've filed it, we have seen it.
- Please be sure to install the [EditorConfig](https://visualstudiogallery.msdn.microsoft.com/c8bccfe2-650c-4b42-bc5c-845e21f96328). This ensures your pull requests meet the required formatting and conventions. [See here](https://github.com/CosmosOS/Cosmos/wiki/FAQ#what-is-this-editorconfig-file-and-how-do-i-use-it) for more info.

Want to get started contributing to Cosmos? Check out the open issues page:
- [High priority](https://github.com/CosmosOS/Cosmos/labels/Priority%3A%20High)
- [Medium priority](https://github.com/CosmosOS/Cosmos/labels/Priority%3A%20Medium)
- If you have any questions or need a bit of help feel free to open a discussion post or ask on the discord.

Want to get started contributing to Cosmos?
Check out the open issues page for open [issues](https://github.com/CosmosOS/Cosmos/labels/Up%20for%20Grabs).

Thanks!

Expand Down
Binary file removed Docs/RingsGen3.vsdx
Binary file not shown.
Binary file removed Docs/RingsGen3.xlsx
Binary file not shown.
12 changes: 12 additions & 0 deletions Docs/articles/Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Devkit changelog

## c5c087c697d106348adbcff86d5d43331500e648 (update then merged in)

### Features

* X# is now packaged as a nuget package
* Plugs are now packaged as a nuget package rather then been hard coded in build scripts

### Breaking changes

Plugs are now included via a nuget package, to update cosmos past this commit you need to add the `Cosmos.Plugs` package to your kernel project. Don't forget to tick the `Include prerelease` checkbox and to set the package origin to `All`!
8 changes: 4 additions & 4 deletions Docs/articles/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ console window, you will see the following:

![](images/SNAG-0003.png)

This is your operating system running in VMWare Player! Cosmos can of course
also be booted in VMWare Workstation, Hyper-V, Virtual PC, Bochs, or on real
hardware. But by default Cosmos uses VMWare Player because it is both free,
This is your operating system running in VMware Player! Cosmos can of course
also be booted in VMware Workstation, Hyper-V, Virtual PC, Bochs, or on real
hardware. But by default Cosmos uses VMware Player because it is both free,
and reliable. Cosmos can even debug in Visual Studio, even when running on
another machine.

Expand Down Expand Up @@ -70,7 +70,7 @@ over (F10) is not supported yet.

The debugger uses the serial port to communicate. Because of this, debugging
only works wtih virtualization environments that support serial ports such as
VMWare. QEMU supports serial ports as well, but its serial port implementation
VMware. QEMU supports serial ports as well, but its serial port implementation
is seriously broken on Windows and makes debugging impossible using QEMU. To
debug on real hardware, you must use a physical serial cable. In the future
Cosmos will also support debugging over Ethernet.
Expand Down
30 changes: 9 additions & 21 deletions Docs/articles/Installation/DevKit.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,31 @@
# Dev Kit Installation

### Prerequisites for Windows

* (Free) source code of Devloppement Kit from [Cosmos on GitHub](https://github.com/CosmosOS/Cosmos)
* (Free) source code of Development Kit from [Cosmos on GitHub](https://github.com/CosmosOS/Cosmos)
* You must clone the repository using Git. For a detailed walkthrough, [see here](https://help.github.com/articles/fork-a-repo/).
* When following the tutorial, replace *OctoCat* with *CosmosOS* and *Spoon-Knife* with *Cosmos*.
* (Free) [Visual Studio 2022 Community](https://visualstudio.microsoft.com/vs/)
* (Free) [InnoSetup QuickStart Kit](http://www.jrsoftware.org/isdl.php#qsp)
* (Free) [InnoSetup](http://www.jrsoftware.org/isdl.php#qsp)
* This is required to build the setup kit which is used to build and install the Visual Studio integration libaries for Cosmos.
* During install it will ask you about optional components to install. Be sure you check "Install Inno Setup Preprocessor".
* Visual Studio SDK: [download here](https://www.microsoft.com/en-us/download/details.aspx?id=40758).

### Prerequisites for Linux

* .NET 6 SDK: [Download .NET SDK](https://learn.microsoft.com/en-us/dotnet/core/install/linux)
* Make
* .NET SDK (6+): [Download .NET SDK](https://learn.microsoft.com/en-us/dotnet/core/install/linux)
* Make (`apt install make`)
* Yasm (`apt install yasm`)
* Xorriso (`apt install xorriso`)
* QEMU or any other virtual machine
* QEMU or any other virtual machine. See [Running](https://cosmosos.github.io/articles/Installation/Running.html) for more information.

### Installation on Windows

* Look in the downloaded sources and run **install-VS2022.bat** with admin privileges (UAC will ask for permission), needed for install in system directories.
* When the installation is complete, Visual Studio will automatically open and you may begin programming with your new, modified copy of Cosmos.

## Arguments for the 'install-VS2022.bat' file
The `install-VS2022.bat` accepts the following parameters :

- `-USERKIT` Run installer for the User Kit only. By default installer build and install Dev Kit.
- `-RESETHIVE` Reset Visual Studio Experimental Hive after installation.
- `-NOTASK` When specified installer would be run directly instead of running as the task in the Task Scheduler
- `-NOCLEAN` Don't clean solution before run installer.
- `-NOVSLAUNCH` Don't launch VS after installation.
- `-IGNOREVS` Ignore running VS during installation.
- `-VSEXPHIVE` or `/VSEXPHIVE` Use Visual Studio Experimental Hive for installation.

### Installation on Linux
Run `make all` to build Cosmos. Run `sudo make install`. Make sure to run `make nuget-install` under your user account, and not as sudo.
Run `make` to build Cosmos. Cosmos will clone all the required repos, build itself, and install it and it's nuget packages to the system automatically.

### dotnet Project Templates
If you are using linux or prefer not using Visual Studio for your projects, you can install the dotnet project template using `dotnet new --install .\source\templates\csharp\` assuming you are currently in the Cosmos base directory.
If you are using linux or prefer not using Visual Studio for your projects, you can install the dotnet project template using `dotnet new --install ./source/templates/csharp/` assuming you are currently in the Cosmos base directory.
After installing the template use `dotnet new cosmosCSKernel -n {name}` to create a new Cosmos Kernel project.
The dotnet template can be removed at a later time using `dotnet new --uninstall .\source\templates\csharp\`.
The dotnet template can be removed at a later time using `dotnet new --uninstall ./source/templates/csharp/`.
2 changes: 1 addition & 1 deletion Docs/articles/Installation/Running.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ VMWare Workstation can be downloaded for free trial [here](https://www.vmware.co

Not officially supported at this time, but can be done. Just use the ISO option above with debugging turned off.

QEMU can be downloaded [here](https://qemu.weilnetz.de/w64/)
QEMU can be downloaded [here](https://www.qemu.org/download/)

## Bochs

Expand Down
12 changes: 12 additions & 0 deletions Docs/articles/Internals/object.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Object

## Memory Layout

Each object is allocated with a header of three uints. The first uint is the type of the object, the second uint is the instance type of object (normal, boxed, array etc) and the third is the size in memory.

## Garbage Collector Information

The garbage collector itself also alloctes its own header of 1 uint (2 ushort). The first ushort is the allocated size of the object (this includes the size of both headers) while the second tracks the GC information.
The GC information is made up of a 1bit flag (the lowest bit) used to track if the GC has hit the object during the sweep phase already and the upper 7 bits count how many static references there are to the object.

Combined in memory we have the format | ushort: memory size | ushort: gc info | uint: object type | uint: instance type | uint: object size | variable: object data |
2 changes: 2 additions & 0 deletions Docs/articles/Kernel/Audio.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ var audioManager = new AudioManager()
audioManager.Enable();
```

The sampleAudioBytes are the bytes of a ttf audio file. You can read it from [VFS](https://cosmosos.github.io/articles/Kernel/VFS.html) or using [ManifestResourceStream](https://cosmosos.github.io/articles/Kernel/ManifestResouceStream.html)

## Audio Streams
An `AudioStream` is an object that can provide sample data to audio buffers. By design, the base `AudioStream` class does not have any length or position properties, as audio streams may be infinite - for example, an output stream from a microphone, or an audio mixer. All seekable streams inherit from the class `SeekableAudioStream`, which provides functionality for accessing the position/length properties and allows methods to determine whether they accept infinite and finite streams, or only finite streams.

Expand Down
Loading

0 comments on commit ed15e3e

Please sign in to comment.