-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* - WIP * - Updated QEMU (8.1.0-rc3) + Add ARM64 * - Adding ARM launch codes * - Adding ARM launch codes * - WIP - ARM32 * - WIP - ARM32 * - WIP - ARM32 * - WIP - ARM64 * - WIP - ARM64 * - WIP - ARM64 * - WIP - ARM64
- Loading branch information
Showing
341 changed files
with
3,004 additions
and
1,185 deletions.
There are no files selected for viewing
148 changes: 74 additions & 74 deletions
148
Source/Data/ARMv8A32-Instructions.json → Source/Data/ARM32-Instructions.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"Encoding": [ | ||
|
||
], | ||
"Instructions": [ | ||
{ | ||
"Name": "Nop", | ||
"Commutative": "false", | ||
"FamilyName": "ARM64", | ||
"FlagsCleared": "", | ||
"FlagsModified": "", | ||
"FlagsSet": "", | ||
"FlagsUnchanged": "CNZV", | ||
"FlagsUndefined": "", | ||
"FlagsUsed": "", | ||
"OperandCount": 0, | ||
"ResultCount": 0, | ||
"Description": "No Operation", | ||
"OpcodeEncoding": [ | ||
{ | ||
"Condition": "", | ||
"Encoding": "0xBF00" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) MOSA Project. Licensed under the New BSD License. | ||
|
||
using Mosa.Kernel.BareMetal; | ||
|
||
namespace Mosa.BareMetal.HelloWorld.ARM64; | ||
|
||
public static class Boot | ||
{ | ||
public static void Main() | ||
{ | ||
Debug.WriteLine("Boot::Main()"); | ||
Debug.WriteLine("MOSA ARM64 Kernel"); | ||
|
||
Program.EntryPoint(); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
Source/Mosa.BareMetal.HelloWorld.ARM64/Mosa.BareMetal.HelloWorld.ARM64.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<OutputType>Exe</OutputType> | ||
<StartupObject>Mosa.BareMetal.HelloWorld.ARM64.Boot</StartupObject> | ||
<DebugType>full</DebugType> | ||
<LangVersion>11.0</LangVersion> | ||
<OutputPath>..\..\bin\</OutputPath> | ||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> | ||
<DisableStandardFrameworkResolution>true</DisableStandardFrameworkResolution> | ||
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> | ||
<UseAppHost>false</UseAppHost> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Mosa.BareMetal.HelloWorld\Mosa.BareMetal.HelloWorld.csproj" /> | ||
<ProjectReference Include="..\Mosa.Kernel.BareMetal.ARM64\Mosa.Kernel.BareMetal.ARM64.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
Source/Mosa.Kernel.BareMetal.ARM64/Mosa.Kernel.BareMetal.ARM64.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<DebugType>full</DebugType> | ||
<LangVersion>11.0</LangVersion> | ||
<OutputPath>..\..\bin\</OutputPath> | ||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> | ||
<DisableStandardFrameworkResolution>true</DisableStandardFrameworkResolution> | ||
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<NoWarn>0219,0414</NoWarn> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugSymbols>True</DebugSymbols> | ||
<WarningLevel>2</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Mosa.Kernel.BareMetal\Mosa.Kernel.BareMetal.csproj" /> | ||
<ProjectReference Include="..\Mosa.Runtime.ARM64\Mosa.Runtime.ARM64.csproj" /> | ||
<ProjectReference Include="..\Mosa.Runtime\Mosa.Runtime.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
// Copyright (c) MOSA Project. Licensed under the New BSD License. | ||
|
||
using Mosa.DeviceSystem; | ||
using Mosa.Runtime; | ||
using Mosa.Runtime.Plug; | ||
|
||
namespace Mosa.Kernel.BareMetal.ARM64; | ||
|
||
public static class PlatformPlug | ||
{ | ||
private const uint BootReservedAddress = 0x00007E00; // Size=Undefined | ||
private const uint InitialGCMemoryPoolAddress = 0x03000000; // @ 48MB | ||
private const uint InitialGCMemoryPoolSize = 16 * 1024 * 1024; // [Size=16MB] | ||
|
||
[Plug("Mosa.Kernel.BareMetal.Platform::EntryPoint")] | ||
public static void EntryPoint() | ||
{ | ||
//var eax = Native.GetMultibootEAX(); | ||
//var ebx = Native.GetMultibootEBX(); | ||
|
||
//Multiboot.Setup(new Pointer(ebx), eax); | ||
|
||
//SSE.Setup(); | ||
//SerialDebug.Setup(); | ||
//PIC.Setup(); | ||
} | ||
|
||
[Plug("Mosa.Kernel.BareMetal.Platform::GetBootReservedRegion")] | ||
public static AddressRange GetBootReservedRegion() => new AddressRange(BootReservedAddress, Page.Size); | ||
|
||
[Plug("Mosa.Kernel.BareMetal.Platform::GetInitialGCMemoryPool")] | ||
public static AddressRange GetInitialGCMemoryPool() => new AddressRange(InitialGCMemoryPoolAddress, InitialGCMemoryPoolSize); | ||
|
||
public static PlatformArchitecture GetPlatformArchitecture() => PlatformArchitecture.ARM32; | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform::ConsoleWrite")] | ||
//public static void ConsoleWrite(byte c) => ARM32.VGAConsole.Write(c); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform::DebugWrite")] | ||
//public static void DebugWrite(byte c) => ARM32.SerialDebug.Write(c); | ||
|
||
public static class PageTablePlug | ||
{ | ||
//[Plug("Mosa.Kernel.BareMetal.Platform+PageTable::Setup")] | ||
//public static void Setup() => ARM32.PageTable.Setup(); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+PageTable::GetPageShift")] | ||
//public static uint GetPageShift() => 12; | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+PageTable::Initialize")] | ||
//public static void Initialize() => ARM32.PageTable.Initialize(); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+PageTable::Enable")] | ||
//public static void Enable() => ARM32.PageTable.Enable(); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+PageTable::MapVirtualAddressToPhysical")] | ||
//public static void MapVirtualAddressToPhysical(Pointer virtualAddress, Pointer physicalAddress, bool present = true) => ARM32.PageTable.MapVirtualAddressToPhysical(virtualAddress, physicalAddress, present); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+PageTable::GetPhysicalAddressFromVirtual")] | ||
//public static Pointer GetPhysicalAddressFromVirtual(Pointer virtualAddress) => ARM32.PageTable.GetPhysicalAddressFromVirtual(virtualAddress); | ||
} | ||
|
||
public static class InterruptPlug | ||
{ | ||
//[Plug("Mosa.Kernel.BareMetal.Platform+Interrupt::Setup")] | ||
//public static void Setup() => IDT.Setup(); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+Interrupt::SetHandler")] | ||
//public static void SetHandler(InterruptHandler handler) => IDT.SetInterruptHandler(handler); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+Interrupt::Enable")] | ||
//public static void Enable() => Native.Sti(); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+Interrupt::Disable")] | ||
//public static void Disable() => Native.Cli(); | ||
} | ||
|
||
public static class IOPlugPlug | ||
{ | ||
//[Plug("Mosa.Kernel.BareMetal.Platform+IO::In8")] | ||
//public static byte In8(ushort address) => Native.In8(address); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+IO::In16")] | ||
//public static ushort In16(ushort address) => Native.In16(address); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+IO::In32")] | ||
//public static uint In32(ushort address) => Native.In32(address); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+IO::Out8")] | ||
//public static void Out8(ushort address, byte data) => Native.Out8(address, data); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+IO::Out16")] | ||
//public static void Out16(ushort address, ushort data) => Native.Out16(address, data); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+IO::Out32")] | ||
//public static void Out32(ushort address, uint data) => Native.Out32(address, data); | ||
} | ||
|
||
public static class SchedulerPlug | ||
{ | ||
//[Plug("Mosa.Kernel.BareMetal.Platform+Scheduler::Start")] | ||
//public static void Start() => ARM32.Scheduler.Start(); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+Scheduler::Yield")] | ||
//public static void Yield() => ARM32.Scheduler.Yield(); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+Scheduler::SignalTermination")] | ||
//public static void SignalTermination() => ARM32.Scheduler.SignalTermination(); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+Scheduler::SwitchToThread")] | ||
//public static void SwitchToThread(Thread thread) => ARM32.Scheduler.SwitchToThread(thread); | ||
|
||
//[Plug("Mosa.Kernel.BareMetal.Platform+Scheduler::SetupThreadStack")] | ||
//public static Pointer SetupThreadStack(Pointer stackTop, Pointer methodAddress, Pointer termAddress) => ARM32.Scheduler.SetupThreadStack(stackTop, methodAddress, termAddress); | ||
} | ||
|
||
public static class SerialPlug | ||
{ | ||
//public static void Setup(int serial) => ARM32.Serial.Setup((ushort)serial); | ||
|
||
//public static void Write(int serial, byte data) => ARM32.Serial.Write((ushort)serial, data); | ||
|
||
//public static byte Read(int serial) => ARM32.Serial.Read((ushort)serial); | ||
|
||
//public static bool IsDataReady(int serial) => ARM32.Serial.IsDataReady((ushort)serial); | ||
} | ||
} |
Oops, something went wrong.