MichalStrehovsky / zerosharp

Demo of the potential of C# for systems programming with the .NET native ahead-of-time compilation technology.
2k stars 103 forks source link

Consider adding a uefi library example. #41

Closed Shadowblitz16 closed 1 year ago

Shadowblitz16 commented 1 year ago

Consider adding a baremetal UEFI library example.

image

shadowblitz16@Node202-Debian:~/Documents/source/C#/NtSharp/Kernel$ dotnet publish
MSBuild version 17.4.0+18d5aef85 for .NET
  Determining projects to restore...
  Restored /home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj (in 52 ms).
  Restored /home/shadowblitz16/Documents/source/C#/NtSharp/Kernel/Kernel.csproj (in 64 ms).
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs(4,46): error CS0616: 'TargetFrameworkAttribute' is not an attribute class [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/obj/Debug/net7.0/LibCore.AssemblyInfo.cs(13,30): error CS0616: 'AssemblyCompanyAttribute' is not an attribute class [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/obj/Debug/net7.0/LibCore.AssemblyInfo.cs(14,30): error CS0616: 'AssemblyConfigurationAttribute' is not an attribute class [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/obj/Debug/net7.0/LibCore.AssemblyInfo.cs(15,30): error CS0616: 'AssemblyFileVersionAttribute' is not an attribute class [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/obj/Debug/net7.0/LibCore.AssemblyInfo.cs(16,30): error CS0616: 'AssemblyInformationalVersionAttribute' is not an attribute class [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/obj/Debug/net7.0/LibCore.AssemblyInfo.cs(17,30): error CS0616: 'AssemblyProductAttribute' is not an attribute class [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/obj/Debug/net7.0/LibCore.AssemblyInfo.cs(18,30): error CS0616: 'AssemblyTitleAttribute' is not an attribute class [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/obj/Debug/net7.0/LibCore.AssemblyInfo.cs(19,30): error CS0616: 'AssemblyVersionAttribute' is not an attribute class [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs(7,10): warning CS0436: The type 'IntPtr' in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs' conflicts with the imported type 'nint' in 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs'. [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs(14,32): warning CS0436: The type 'IntPtr' in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs' conflicts with the imported type 'nint' in 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs'. [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs(16,38): warning CS0436: The type 'IntPtr' in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs' conflicts with the imported type 'nint' in 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs'. [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs(18,25): warning CS0436: The type 'IntPtr' in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs' conflicts with the imported type 'nint' in 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs'. [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs(20,31): warning CS0436: The type 'IntPtr' in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs' conflicts with the imported type 'nint' in 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs'. [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs(78,30): warning CS0436: The type 'ValueType' in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs' conflicts with the imported type 'ValueType' in 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs'. [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs(127,47): warning CS0436: The type 'Attribute' in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs' conflicts with the imported type 'Attribute' in 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs'. [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs(100,43): warning CS0436: The type 'Delegate' in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs' conflicts with the imported type 'Delegate' in 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs'. [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs(129,33): warning CS0436: The type 'AttributeTargets' in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs' conflicts with the imported type 'AttributeTargets' in 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in '/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Core.cs'. [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs(13,3): error CS0246: The type or namespace name 'RuntimeExportAttribute' could not be found (are you missing a using directive or an assembly reference?) [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs(13,3): error CS0246: The type or namespace name 'RuntimeExport' could not be found (are you missing a using directive or an assembly reference?) [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs(15,3): error CS0246: The type or namespace name 'RuntimeExportAttribute' could not be found (are you missing a using directive or an assembly reference?) [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs(15,3): error CS0246: The type or namespace name 'RuntimeExport' could not be found (are you missing a using directive or an assembly reference?) [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs(17,3): error CS0246: The type or namespace name 'RuntimeExportAttribute' could not be found (are you missing a using directive or an assembly reference?) [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs(17,3): error CS0246: The type or namespace name 'RuntimeExport' could not be found (are you missing a using directive or an assembly reference?) [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs(19,3): error CS0246: The type or namespace name 'RuntimeExportAttribute' could not be found (are you missing a using directive or an assembly reference?) [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs(19,3): error CS0246: The type or namespace name 'RuntimeExport' could not be found (are you missing a using directive or an assembly reference?) [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs(22,3): error CS0246: The type or namespace name 'RuntimeExportAttribute' could not be found (are you missing a using directive or an assembly reference?) [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs(22,3): error CS0246: The type or namespace name 'RuntimeExport' could not be found (are you missing a using directive or an assembly reference?) [/home/shadowblitz16/Documents/source/C#/NtSharp/LibCore/LibCore.csproj]
nifanfa commented 1 year ago

https://github.com/nifanfa/BootTo.NET/tree/main/uefi-cs