Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/CosmosOS/Cosmos
Browse files Browse the repository at this point in the history
  • Loading branch information
czhower committed Aug 10, 2017
2 parents ac525c2 + d839da5 commit 7eac7ba
Show file tree
Hide file tree
Showing 35 changed files with 55 additions and 27 deletions.
Binary file added Build/Tools/7zip/7za.exe
Binary file not shown.
Binary file added Build/Tools/NAsm/nasm.exe
Binary file not shown.
Binary file added Build/Tools/NAsm/ndisasm.exe
Binary file not shown.
Binary file added Build/Tools/VSIXBootstrapper.exe
Binary file not shown.
Binary file added Build/Tools/cygwin/cygiconv-2.dll
Binary file not shown.
Binary file added Build/Tools/cygwin/cygintl-3.dll
Binary file not shown.
Binary file added Build/Tools/cygwin/cygwin1.dll
Binary file not shown.
Binary file added Build/Tools/cygwin/ld.exe
Binary file not shown.
Binary file added Build/Tools/cygwin/objdump.exe
Binary file not shown.
Binary file added Build/Tools/gdb.exe
Binary file not shown.
Binary file added Build/Tools/mkisofs/mkisofs.exe
Binary file not shown.
Binary file added Build/Tools/nuget.exe
Binary file not shown.
Binary file added Build/Tools/syslinux.exe
Binary file not shown.
Binary file added Build/Tools/vswhere.exe
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Resources/Dependencies/Dapper/Dapper.dll
Binary file not shown.
Binary file not shown.
Binary file added Resources/Dependencies/Dapper/SQLinq.Dapper.dll
Binary file not shown.
Binary file added Resources/Dependencies/Dapper/SQLinq.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Resources/Dependencies/ILSpy/ILSpy.exe
Binary file not shown.
Binary file not shown.
Binary file added Resources/Dependencies/ILSpy/Mono.Cecil.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="NUnit" Version="3.7.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0-alpha1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="NUnit" Version="3.7.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
44 changes: 22 additions & 22 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,49 @@ build_script:
rem %APPVEYOR_BUILD_FOLDER%
nuget restore "Cosmos/Builder.sln"
nuget restore "Builder.sln"
nuget restore "Cosmos/Build.sln"
nuget restore "Build.sln"
nuget restore "Cosmos/Test.sln"
nuget restore "Test.sln"
msbuild "Cosmos/Builder.sln" /maxcpucount /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Platform="Any CPU" /p:Configuration=Debug /p:DeployExtension=false
msbuild "Builder.sln" /maxcpucount /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Platform="Any CPU" /p:Configuration=Debug /p:DeployExtension=false
msbuild "Cosmos/Build.sln" /maxcpucount /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Platform="Any CPU" /p:Configuration=Debug /p:OutputPath="%APPVEYOR_BUILD_FOLDER%\Cosmos\Build\VSIP" /p:DeployExtension=false
msbuild "Build.sln" /maxcpucount /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Platform="Any CPU" /p:Configuration=Debug /p:OutputPath="%APPVEYOR_BUILD_FOLDER%\Build\VSIP" /p:DeployExtension=false
msbuild "Cosmos/Test.sln" /maxcpucount /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Platform="Any CPU" /p:Configuration=Debug
msbuild "Test.sln" /maxcpucount /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Platform="Any CPU" /p:Configuration=Debug
dotnet publish Cosmos/source/Cosmos.Build.MSBuild -f net462 -r win7-x86 -o "c:\CosmosRun\Build\VSIP\"
dotnet publish source\Cosmos.Build.MSBuild -f net462 -r win7-x86 -o "c:\CosmosRun\Build\VSIP\"
dotnet publish Cosmos/source/IL2CPU -f netcoreapp1.0 -r win7-x86 -o "c:\CosmosRun\Build\IL2CPU\"
dotnet publish source\IL2CPU -f netcoreapp1.0 -r win7-x86 -o "c:\CosmosRun\Build\IL2CPU\"
dotnet publish Cosmos/source/XSharp.Compiler -f netcoreapp1.0 -r win7-x86 -o "c:\CosmosRun\Build\XSharp\"
dotnet publish source\XSharp.Compiler -f netcoreapp1.0 -r win7-x86 -o "c:\CosmosRun\Build\XSharp\"
xcopy /Y "Cosmos\Build\VSIP\Cosmos.Debug.Kernel.*" "c:\CosmosRun\Kernel\"
xcopy /Y "Build\VSIP\Cosmos.Debug.Kernel.*" "c:\CosmosRun\Kernel\"
xcopy /Y "Cosmos\Build\VSIP\Cosmos.Core.*" "c:\CosmosRun\Kernel\"
xcopy /Y "Build\VSIP\Cosmos.Core.*" "c:\CosmosRun\Kernel\"
xcopy /Y "Cosmos\Build\VSIP\Cosmos.HAL.*" "c:\CosmosRun\Kernel\"
xcopy /Y "Build\VSIP\Cosmos.HAL.*" "c:\CosmosRun\Kernel\"
xcopy /Y "Cosmos\Build\VSIP\Cosmos.System.*" "c:\CosmosRun\Kernel\"
xcopy /Y "Build\VSIP\Cosmos.System.*" "c:\CosmosRun\Kernel\"
xcopy /Y "Cosmos\Build\VSIP\Cosmos.Common.*" "c:\CosmosRun\Kernel\"
xcopy /Y "Build\VSIP\Cosmos.Common.*" "c:\CosmosRun\Kernel\"
xcopy /Y "Cosmos\Build\VSIP\Cosmos.Debug.GDB.exe" "c:\CosmosRun\Build\VSIP\"
xcopy /Y "Build\VSIP\Cosmos.Debug.GDB.exe" "c:\CosmosRun\Build\VSIP\"
xcopy /Y /S "Cosmos\Build\ISO" "c:\CosmosRun\Build\ISO\"
xcopy /Y /S "Build\ISO" "c:\CosmosRun\Build\ISO\"
xcopy /Y "Cosmos\Build\*.*" "c:\CosmosRun\Build\ISO\"
xcopy /Y "Build\*.*" "c:\CosmosRun\Build\ISO\"
xcopy /Y /S "Cosmos\Build\VMware\*" "c:\CosmosRun\Build\VMware\"
xcopy /Y /S "Build\VMware\*" "c:\CosmosRun\Build\VMware\"
xcopy /Y /S "Cosmos\Build\Tools" "c:\CosmosRun\Build\Tools\"
xcopy /Y /S "Build\Tools" "c:\CosmosRun\Build\Tools\"
xcopy /Y "Cosmos\source\Cosmos.Core.DebugStub\*.xs" "c:\CosmosRun\XSharp\DebugStub\"
xcopy /Y "source\Cosmos.Core.DebugStub\*.xs" "c:\CosmosRun\XSharp\DebugStub\"
xcopy /Y /S "Cosmos\Resources\Bochs\*.*" "%ProgramFiles(x86)%\Bochs-2.6.8\"
xcopy /Y /S "Resources\Bochs\*.*" "%ProgramFiles(x86)%\Bochs-2.6.8\"
reg add HKLM\SOFTWARE\WOW6432Node\Cosmos /v UserKit /d c:\CosmosRun\
Expand All @@ -67,7 +67,7 @@ build_script:
# - Cosmos.TestRunner.UnitTest.dll

test_script:
- cmd: dotnet test Cosmos\Tests\Cosmos.TestRunner.UnitTest\Cosmos.TestRunner.UnitTest.csproj --logger "trx;LogFileName=c:\Cosmos\TestResult.xml"
- cmd: dotnet test Tests\Cosmos.TestRunner.UnitTest\Cosmos.TestRunner.UnitTest.csproj --logger "trx;LogFileName=c:\Cosmos\TestResult.xml"

on_finish:
- ps: |
Expand Down
31 changes: 29 additions & 2 deletions source/TheRingMaster/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Runtime.Loader;

using Cosmos.Build.Common;
using Cosmos.IL2CPU.API.Attribs;

namespace TheRingMaster
{
Expand Down Expand Up @@ -50,6 +51,8 @@ public static void Main(string[] args)

void CheckRings(Assembly aAssembly, Ring aRing, string aSourceAssemblyName = null)
{
bool xDebugAllowed = false;

if (!RingCache.TryGetValue(aAssembly, out var xRing))
{
var xManifestName = aAssembly.GetManifestResourceNames()
Expand All @@ -72,10 +75,13 @@ void CheckRings(Assembly aAssembly, Ring aRing, string aSourceAssemblyName = nul

xCfg.TryGetValue("Ring", out var xRingName);

if (!Enum.TryParse(xRingName, out xRing))
if (!Enum.TryParse(xRingName, true, out xRing))
{
throw new Exception("Unknown ring! Ring: " + xRingName);
}

xCfg.TryGetValue("DebugRing", out var xDebugRing);
xDebugAllowed = xDebugRing.ToLower() == "allowed";
}
}

Expand All @@ -90,7 +96,9 @@ void CheckRings(Assembly aAssembly, Ring aRing, string aSourceAssemblyName = nul
// External ring, can be referenced by any ring
// OR
// One of the assemblies is Debug
if (aRing == xRing || xRing == Ring.External || aRing == Ring.Debug || xRing == Ring.Debug)
// OR
// Debug ring allowed
if (aRing == xRing || xRing == Ring.External || aRing == Ring.Debug || xRing == Ring.Debug || xDebugAllowed)
{
xValid = true;
}
Expand All @@ -116,6 +124,25 @@ void CheckRings(Assembly aAssembly, Ring aRing, string aSourceAssemblyName = nul
throw new Exception(xExceptionMessage);
}

if (xRing != Ring.CPU && xRing != Ring.Plugs)
{
foreach (var xModule in aAssembly.Modules)
{
// TODO: Check unsafe code
}
}

foreach (var xType in aAssembly.GetTypes())
{
if (xRing != Ring.Plugs)
{
if (xType.GetTypeInfo().GetCustomAttribute<Plug>() != null)
{
throw new Exception("Plugs are only allowed in the Plugs ring! Assembly: " + aAssembly.GetName().Name);
}
}
}

foreach (var xReference in aAssembly.GetReferencedAssemblies())
{
try
Expand Down
1 change: 1 addition & 0 deletions source/TheRingMaster/TheRingMaster.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

<ItemGroup>
<ProjectReference Include="..\Cosmos.Build.Common\Cosmos.Build.Common.csproj" />
<ProjectReference Include="..\Cosmos.IL2CPU.API\Cosmos.IL2CPU.API.csproj" />
</ItemGroup>

</Project>

0 comments on commit 7eac7ba

Please sign in to comment.