diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 000000000..a8a91fd05
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,26 @@
+---
+name: Bug Report
+about: Create a report to help us improve XenevaOS
+title: 'Bug: '
+labels: 'bug'
+assignees: ''
+---
+
+## Summary
+
+
+## Steps to Reproduce
+1.
+2.
+3.
+
+## Expected Behavior
+
+
+## Actual Behavior
+
+
+## Environment
+- **Compiler/Toolchain:**
+- **Testing Environment:**
+- **OS Build/Branch:**
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 000000000..bc98273f6
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,19 @@
+---
+name: Feature Request
+about: Suggest an idea for XenevaOS
+title: 'Feature: '
+labels: 'enhancement'
+assignees: ''
+---
+
+## Summary
+
+
+## Motivation
+
+
+## Proposed Implementation
+
+
+## Related
+
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 000000000..bf5f396ba
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,17 @@
+## Summary
+
+
+## Changes
+### [Module/Component Name]
+- **Before:**
+- **What:**
+- **Why:**
+
+## Compatibility
+- [ ] Existing functionality is unchanged (or breaking changes are explicitly documented).
+- [ ] MSVC/Windows build toolchain remains fully compatible.
+- [ ] GCC/Linux build toolchain remains fully compatible.
+- [ ] No regression in bootloader, kernel, or user-space runtime logic.
+
+## Related
+
diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml
index 185b7c3f9..2632e1f27 100644
--- a/.github/workflows/build-check.yml
+++ b/.github/workflows/build-check.yml
@@ -55,8 +55,10 @@ jobs:
Expand-Archive -Path Resources/nasmprops.zip -DestinationPath nasmprops -Force
$vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
$vcPath = Join-Path $vsPath "MSBuild\Microsoft\VC"
- $customizationsPath = Get-ChildItem -Path $vcPath -Filter "BuildCustomizations" -Directory -Recurse | Select-Object -ExpandProperty FullName -First 1
- Copy-Item nasmprops\* -Destination $customizationsPath -Force -Recurse
+ $customizationsPaths = Get-ChildItem -Path $vcPath -Filter "BuildCustomizations" -Directory -Recurse | Select-Object -ExpandProperty FullName
+ foreach ($path in $customizationsPaths) {
+ Copy-Item nasmprops\* -Destination $path -Force -Recurse
+ }
- name: Build Solution (Aurora.sln)
run: |
diff --git a/.gitignore b/.gitignore
index 1f4cc386e..89ada595b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,17 +11,23 @@ gnu-efi/
*.Build.CppClean.log
*.recipe
*.exp
+*.db
#Intellisense and precompiled headers
.vs/
ipch/
*.ipch
+
# Visual Studio specific files
.vs/
*.sdf
*.suo
*.user
+*.ipch
+*.VC.db
+*.log
+.vs/Aurora/v16/*.db
x64/
ARM64/
Debug/
@@ -35,3 +41,11 @@ initrd2.img
qemu.pid
dump.s
*.so
+*.a
+Process/**/*.elf
+Process/**/*.exe
+Libs/**/*.a
+
+# Exclude compiled user-space applications
+Resources/resources/*.exe
+Resources/resources/ARCH_ARM64/*.exe
diff --git a/.vs/Aurora/v16/Browse.VC.db b/.vs/Aurora/v16/Browse.VC.db
new file mode 100644
index 000000000..0d44c41a1
Binary files /dev/null and b/.vs/Aurora/v16/Browse.VC.db differ
diff --git a/.vs/Aurora/v16/Solution.VC.db b/.vs/Aurora/v16/Solution.VC.db
new file mode 100644
index 000000000..2f1254b96
Binary files /dev/null and b/.vs/Aurora/v16/Solution.VC.db differ
diff --git a/.vs/Aurora/v16/ipch/AutoPCH/757ad2bbe97081d4/BUTTON.ipch b/.vs/Aurora/v16/ipch/AutoPCH/757ad2bbe97081d4/BUTTON.ipch
new file mode 100644
index 000000000..a60f10b76
Binary files /dev/null and b/.vs/Aurora/v16/ipch/AutoPCH/757ad2bbe97081d4/BUTTON.ipch differ
diff --git a/.vs/Aurora/v16/ipch/AutoPCH/ba8d67e3b70c3d5b/UART0.ipch b/.vs/Aurora/v16/ipch/AutoPCH/ba8d67e3b70c3d5b/UART0.ipch
new file mode 100644
index 000000000..68121accb
Binary files /dev/null and b/.vs/Aurora/v16/ipch/AutoPCH/ba8d67e3b70c3d5b/UART0.ipch differ
diff --git a/.vs/Aurora/v16/ipch/AutoPCH/c49da8d5028221e5/CHITRALEKHA.ipch b/.vs/Aurora/v16/ipch/AutoPCH/c49da8d5028221e5/CHITRALEKHA.ipch
new file mode 100644
index 000000000..c667d47b5
Binary files /dev/null and b/.vs/Aurora/v16/ipch/AutoPCH/c49da8d5028221e5/CHITRALEKHA.ipch differ
diff --git a/.vs/Aurora/v16/ipch/AutoPCH/d2b1a8c2fcf8466e/AUCON.ipch b/.vs/Aurora/v16/ipch/AutoPCH/d2b1a8c2fcf8466e/AUCON.ipch
new file mode 100644
index 000000000..bd841110f
Binary files /dev/null and b/.vs/Aurora/v16/ipch/AutoPCH/d2b1a8c2fcf8466e/AUCON.ipch differ
diff --git a/.vs/Aurora/v16/ipch/AutoPCH/f725405ac9a5380/INIT.ipch b/.vs/Aurora/v16/ipch/AutoPCH/f725405ac9a5380/INIT.ipch
new file mode 100644
index 000000000..e6f4fc0f3
Binary files /dev/null and b/.vs/Aurora/v16/ipch/AutoPCH/f725405ac9a5380/INIT.ipch differ
diff --git a/Acpica/Acpica.vcxproj b/Acpica/Acpica.vcxproj
index 5f4106c0d..e6e105a10 100644
--- a/Acpica/Acpica.vcxproj
+++ b/Acpica/Acpica.vcxproj
@@ -104,7 +104,7 @@
false..\Build\acpica.dll
- ..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
diff --git a/Aurora.sln b/Aurora.sln
index 456c59951..0aa885208 100644
--- a/Aurora.sln
+++ b/Aurora.sln
@@ -5,35 +5,6 @@ VisualStudioVersion = 16.0.34729.46
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Kernel", "Kernel\Kernel.vcxproj", "{BED35751-DD14-4197-9081-D61F574C0847}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Acpica", "Acpica\Acpica.vcxproj", "{EAF15281-D090-4519-88B4-F770E10FF50C}"
- ProjectSection(ProjectDependencies) = postProject
- {BED35751-DD14-4197-9081-D61F574C0847} = {BED35751-DD14-4197-9081-D61F574C0847}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Init", "Process\Init\Init.vcxproj", "{B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Usb3", "Drivers\Usb3\Usb3.vcxproj", "{8F9021E7-02A2-4827-BD34-71175D1DD3EE}"
- ProjectSection(ProjectDependencies) = postProject
- {BED35751-DD14-4197-9081-D61F574C0847} = {BED35751-DD14-4197-9081-D61F574C0847}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IntelHDA", "Drivers\Sound\IntelHDA\IntelHDA.vcxproj", "{F6062DC1-AD86-4384-AAB0-3562A0FCFA51}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XEClib", "Libs\XEClib\XEClib.vcxproj", "{38A7B436-745B-4193-A5F3-4FE14D682F8A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XELoader", "XELoader\XELoader.vcxproj", "{FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Deodhai", "Process\Deodhai\Deodhai.vcxproj", "{8363E128-4810-4036-B0C9-3537A3CDB90D}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XECrt", "Libs\XECrt\XECrt.vcxproj", "{7E566DB6-F1A9-4C46-B769-79915CB9B182}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chitralekha", "Libs\Chitralekha\Chitralekha.vcxproj", "{13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "E1000", "Drivers\E1000\E1000.vcxproj", "{60C723A8-AED4-4689-B960-F0091B16466F}"
- ProjectSection(ProjectDependencies) = postProject
- {BED35751-DD14-4197-9081-D61F574C0847} = {BED35751-DD14-4197-9081-D61F574C0847}
- EndProjectSection
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9B3819FC-B327-4C42-A93D-E842CC5E498A}"
ProjectSection(SolutionItems) = preProject
Resources\resources\audrv.cnf = Resources\resources\audrv.cnf
@@ -42,1417 +13,154 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
soundapp_demo.txt = soundapp_demo.txt
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "..\..\os_dev\freetype2-master\freetype2-master\builds\windows\vc2010\freetype.vcxproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Terminal", "Process\Terminal\Terminal.vcxproj", "{9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VMSvga", "Drivers\VMSvga\VMSvga.vcxproj", "{F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XNLDR", "..\UEFI\XNLDR\XNLDR\XNLDR.vcxproj", "{D2E47D80-2231-4757-B3BC-E96E593CF0E3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmware", "Drivers\vmware\vmware.vcxproj", "{3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vbox", "Drivers\vbox\vbox.vcxproj", "{DE288211-D073-4253-A9AA-8A3B4A69BA6D}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XEShell", "Process\XEShell\XEShell.vcxproj", "{B2711B30-AE9C-4015-AF37-8795C0EC9064}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "play", "Process\play\play.vcxproj", "{2DA5FF1E-745A-4C30-A73E-53849F22D18A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Namdapha", "Process\Namdapha\Namdapha.vcxproj", "{E423E38B-E351-4151-895D-5336D27C9A2F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XELnch", "Process\XELnch\XELnch.vcxproj", "{400E59EB-6E4C-461A-91B2-202F85F33D41}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Calculator", "Process\Calculator\Calculator.vcxproj", "{CAE7FB4D-2145-4D85-96FB-734576BA5F07}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Files", "Process\Files\Files.vcxproj", "{CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AudioPlayer", "Process\AudioPlayer\AudioPlayer.vcxproj", "{01D9EF82-5076-4E5C-95FF-C027864A8302}"
- ProjectSection(ProjectDependencies) = postProject
- {38A7B436-745B-4193-A5F3-4FE14D682F8A} = {38A7B436-745B-4193-A5F3-4FE14D682F8A}
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC} = {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}
- {7E566DB6-F1A9-4C46-B769-79915CB9B182} = {7E566DB6-F1A9-4C46-B769-79915CB9B182}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NVMe", "Drivers\NVMe\NVMe.vcxproj", "{B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}"
- ProjectSection(ProjectDependencies) = postProject
- {BED35751-DD14-4197-9081-D61F574C0847} = {BED35751-DD14-4197-9081-D61F574C0847}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NETMngr", "Process\NETMngr\NETMngr.vcxproj", "{567DA5F4-5B2E-4993-9370-C4A4F022C928}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DeodhaiAudio", "Process\DeodhaiAudio\DeodhaiAudio.vcxproj", "{6CEF9127-6B8C-4885-BA8D-C2B206EA7134}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Piano", "Process\Piano\Piano.vcxproj", "{7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}"
- ProjectSection(ProjectDependencies) = postProject
- {38A7B436-745B-4193-A5F3-4FE14D682F8A} = {38A7B436-745B-4193-A5F3-4FE14D682F8A}
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC} = {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}
- {7E566DB6-F1A9-4C46-B769-79915CB9B182} = {7E566DB6-F1A9-4C46-B769-79915CB9B182}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Control", "Process\Control\Control.vcxproj", "{20D3BAD1-1583-44C2-8625-46DAF5F0E975}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AHCI", "Drivers\AHCI\AHCI.vcxproj", "{C4794DDD-B777-49DF-8600-ED1D71F96EBE}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Calender", "Process\Calender\Calender.vcxproj", "{156536F4-42E1-4125-A964-DB92D386E706}"
- ProjectSection(ProjectDependencies) = postProject
- {38A7B436-745B-4193-A5F3-4FE14D682F8A} = {38A7B436-745B-4193-A5F3-4FE14D682F8A}
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC} = {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}
- {7E566DB6-F1A9-4C46-B769-79915CB9B182} = {7E566DB6-F1A9-4C46-B769-79915CB9B182}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ping", "Process\ping\ping.vcxproj", "{D106EC5D-389E-45A6-92FB-6E79550B0519}"
- ProjectSection(ProjectDependencies) = postProject
- {38A7B436-745B-4193-A5F3-4FE14D682F8A} = {38A7B436-745B-4193-A5F3-4FE14D682F8A}
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC} = {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nslook", "Process\nslook\nslook.vcxproj", "{4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cat", "Process\cat\cat.vcxproj", "{7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rm", "Process\rm\rm.vcxproj", "{7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}"
- ProjectSection(ProjectDependencies) = postProject
- {38A7B436-745B-4193-A5F3-4FE14D682F8A} = {38A7B436-745B-4193-A5F3-4FE14D682F8A}
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC} = {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}
- {7E566DB6-F1A9-4C46-B769-79915CB9B182} = {7E566DB6-F1A9-4C46-B769-79915CB9B182}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xHCI", "Drivers\xHCI\xHCI.vcxproj", "{D6BF34CD-F14A-49D0-A075-AB2024FF0A62}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hid", "Drivers\USB\hid\hid.vcxproj", "{5D58F57E-75D1-483E-BBCD-C203BCB35D50}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Boot", "Boot\Boot.vcxproj", "{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msc", "Drivers\USB\msc\msc.vcxproj", "{B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "usbhci", "Drivers\USB\usbhci\usbhci.vcxproj", "{69F8AABD-ABEF-475C-88EB-AA69B2C4231C}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mp4plr", "Process\mp4plr\mp4plr.vcxproj", "{8C9C714F-B369-4625-A9D4-CA461DA4335A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "systray", "Process\systray\systray.vcxproj", "{AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BootAA64", "BootAA64\BootAA64.vcxproj", "{FEA7A458-0E08-4754-AD51-57FDD680BEEB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KernelAA64", "KernelAA64\KernelAA64.vcxproj", "{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DeodhaiXR", "Process\DeodhaiXR\DeodhaiXR.vcxproj", "{22A06C2D-60BB-4040-8214-30EA17701F94}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "virtionet", "Drivers\Net\virtionet\virtionet.vcxproj", "{51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "virtiogpu", "Drivers\GPU\virtiogpu\virtiogpu.vcxproj", "{7CDDFA23-2897-4297-B245-ACDE5031E9F3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lcdif", "Drivers\fbset\lcdif\lcdif.vcxproj", "{F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hdmi", "Drivers\hdmi\hdmi.vcxproj", "{AD7FE42E-814F-4DC7-86DF-B6AD041251DB}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dwc2-otg", "Drivers\USB\dwc2-otg\dwc2-otg.vcxproj", "{E121230A-7D08-42F0-966B-D96349EF976F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glimpse", "Process\glimpse\glimpse.vcxproj", "{B44F1C3D-F499-49F4-940D-227B5D5F5DD2}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dwc2", "Drivers\linux\dwc2\dwc2.vcxproj", "{0130DFA1-9BCA-4108-9065-62FE5495CDA2}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dwc2-uspi", "Drivers\USB\dwc2-uspi\dwc2-uspi.vcxproj", "{B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "virtiosnd", "Drivers\Sound\virtiosnd\virtiosnd.vcxproj", "{B5055A6B-3AF7-443B-9A60-5068D7A10D4A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "virtioblk", "Drivers\virtioblk\virtioblk.vcxproj", "{219C18BE-21F7-4653-A0A5-710DA04F1F9A}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug Static|ARM64 = Debug Static|ARM64
Debug Static|Mixed Platforms = Debug Static|Mixed Platforms
Debug Static|Win32 = Debug Static|Win32
Debug Static|x64 = Debug Static|x64
+ Debug|ARM64 = Debug|ARM64
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
+ Release Static|ARM64 = Release Static|ARM64
Release Static|Mixed Platforms = Release Static|Mixed Platforms
Release Static|Win32 = Release Static|Win32
Release Static|x64 = Release Static|x64
+ Release|ARM64 = Release|ARM64
Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {BED35751-DD14-4197-9081-D61F574C0847}.Debug Static|ARM64.ActiveCfg = Debug|ARM64
+ {BED35751-DD14-4197-9081-D61F574C0847}.Debug Static|ARM64.Build.0 = Debug|ARM64
{BED35751-DD14-4197-9081-D61F574C0847}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
{BED35751-DD14-4197-9081-D61F574C0847}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
{BED35751-DD14-4197-9081-D61F574C0847}.Debug Static|Win32.ActiveCfg = Debug|Win32
{BED35751-DD14-4197-9081-D61F574C0847}.Debug Static|Win32.Build.0 = Debug|Win32
{BED35751-DD14-4197-9081-D61F574C0847}.Debug Static|x64.ActiveCfg = Debug|x64
{BED35751-DD14-4197-9081-D61F574C0847}.Debug Static|x64.Build.0 = Debug|x64
+ {BED35751-DD14-4197-9081-D61F574C0847}.Debug|ARM64.ActiveCfg = Debug|ARM64
{BED35751-DD14-4197-9081-D61F574C0847}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {BED35751-DD14-4197-9081-D61F574C0847}.Debug|Mixed Platforms.Build.0 = Debug|x64
{BED35751-DD14-4197-9081-D61F574C0847}.Debug|Win32.ActiveCfg = Debug|Win32
{BED35751-DD14-4197-9081-D61F574C0847}.Debug|Win32.Build.0 = Debug|Win32
{BED35751-DD14-4197-9081-D61F574C0847}.Debug|x64.ActiveCfg = Debug|x64
{BED35751-DD14-4197-9081-D61F574C0847}.Debug|x64.Build.0 = Debug|x64
+ {BED35751-DD14-4197-9081-D61F574C0847}.Release Static|ARM64.ActiveCfg = Release|ARM64
+ {BED35751-DD14-4197-9081-D61F574C0847}.Release Static|ARM64.Build.0 = Release|ARM64
{BED35751-DD14-4197-9081-D61F574C0847}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
{BED35751-DD14-4197-9081-D61F574C0847}.Release Static|Mixed Platforms.Build.0 = Release|Win32
{BED35751-DD14-4197-9081-D61F574C0847}.Release Static|Win32.ActiveCfg = Release|Win32
{BED35751-DD14-4197-9081-D61F574C0847}.Release Static|Win32.Build.0 = Release|Win32
{BED35751-DD14-4197-9081-D61F574C0847}.Release Static|x64.ActiveCfg = Release|x64
{BED35751-DD14-4197-9081-D61F574C0847}.Release Static|x64.Build.0 = Release|x64
+ {BED35751-DD14-4197-9081-D61F574C0847}.Release|ARM64.ActiveCfg = Release|ARM64
{BED35751-DD14-4197-9081-D61F574C0847}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{BED35751-DD14-4197-9081-D61F574C0847}.Release|Mixed Platforms.Build.0 = Release|Win32
{BED35751-DD14-4197-9081-D61F574C0847}.Release|Win32.ActiveCfg = Release|Win32
{BED35751-DD14-4197-9081-D61F574C0847}.Release|Win32.Build.0 = Release|Win32
{BED35751-DD14-4197-9081-D61F574C0847}.Release|x64.ActiveCfg = Release|x64
{BED35751-DD14-4197-9081-D61F574C0847}.Release|x64.Build.0 = Release|x64
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Debug Static|Win32.Build.0 = Debug|Win32
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Debug Static|x64.ActiveCfg = Debug|x64
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Debug Static|x64.Build.0 = Debug|x64
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Debug|Win32.ActiveCfg = Debug|Win32
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Debug|Win32.Build.0 = Debug|Win32
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Debug|x64.ActiveCfg = Debug|x64
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Debug|x64.Build.0 = Debug|x64
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Release Static|Win32.ActiveCfg = Release|Win32
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Release Static|Win32.Build.0 = Release|Win32
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Release Static|x64.ActiveCfg = Release|x64
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Release Static|x64.Build.0 = Release|x64
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Release|Mixed Platforms.Build.0 = Release|Win32
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Release|Win32.ActiveCfg = Release|Win32
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Release|Win32.Build.0 = Release|Win32
- {EAF15281-D090-4519-88B4-F770E10FF50C}.Release|x64.ActiveCfg = Release|Win32
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Debug Static|Win32.Build.0 = Debug|Win32
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Debug Static|x64.ActiveCfg = Debug|x64
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Debug Static|x64.Build.0 = Debug|x64
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Debug|Win32.ActiveCfg = Debug|Win32
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Debug|Win32.Build.0 = Debug|Win32
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Debug|x64.ActiveCfg = Debug|x64
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Debug|x64.Build.0 = Debug|x64
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Release Static|Win32.ActiveCfg = Release|Win32
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Release Static|Win32.Build.0 = Release|Win32
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Release Static|x64.ActiveCfg = Release|x64
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Release Static|x64.Build.0 = Release|x64
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Release|Mixed Platforms.Build.0 = Release|Win32
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Release|Win32.ActiveCfg = Release|Win32
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Release|Win32.Build.0 = Release|Win32
- {B702D8E8-62F0-4DC1-9EC7-EACE0B76716A}.Release|x64.ActiveCfg = Release|Win32
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Debug Static|Win32.Build.0 = Debug|Win32
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Debug Static|x64.ActiveCfg = Debug|x64
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Debug Static|x64.Build.0 = Debug|x64
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Debug|Win32.ActiveCfg = Debug|Win32
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Debug|Win32.Build.0 = Debug|Win32
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Debug|x64.ActiveCfg = Debug|x64
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Release Static|Win32.ActiveCfg = Release|Win32
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Release Static|Win32.Build.0 = Release|Win32
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Release Static|x64.ActiveCfg = Release|x64
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Release Static|x64.Build.0 = Release|x64
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Release|Mixed Platforms.Build.0 = Release|Win32
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Release|Win32.ActiveCfg = Release|Win32
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Release|Win32.Build.0 = Release|Win32
- {8F9021E7-02A2-4827-BD34-71175D1DD3EE}.Release|x64.ActiveCfg = Release|Win32
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Debug Static|Win32.Build.0 = Debug|Win32
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Debug Static|x64.ActiveCfg = Debug|x64
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Debug Static|x64.Build.0 = Debug|x64
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Debug|Win32.ActiveCfg = Debug|Win32
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Debug|Win32.Build.0 = Debug|Win32
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Debug|x64.ActiveCfg = Debug|x64
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Release Static|Win32.ActiveCfg = Release|Win32
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Release Static|Win32.Build.0 = Release|Win32
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Release Static|x64.ActiveCfg = Release|x64
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Release Static|x64.Build.0 = Release|x64
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Release|Mixed Platforms.Build.0 = Release|Win32
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Release|Win32.ActiveCfg = Release|Win32
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Release|Win32.Build.0 = Release|Win32
- {F6062DC1-AD86-4384-AAB0-3562A0FCFA51}.Release|x64.ActiveCfg = Release|Win32
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Debug Static|Win32.Build.0 = Debug|Win32
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Debug Static|x64.ActiveCfg = Debug|x64
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Debug Static|x64.Build.0 = Debug|x64
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Debug|Win32.ActiveCfg = Debug|Win32
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Debug|Win32.Build.0 = Debug|Win32
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Debug|x64.ActiveCfg = Debug|x64
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Release Static|Win32.ActiveCfg = Release|Win32
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Release Static|Win32.Build.0 = Release|Win32
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Release Static|x64.ActiveCfg = Release|x64
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Release Static|x64.Build.0 = Release|x64
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Release|Mixed Platforms.Build.0 = Release|Win32
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Release|Win32.ActiveCfg = Release|Win32
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Release|Win32.Build.0 = Release|Win32
- {38A7B436-745B-4193-A5F3-4FE14D682F8A}.Release|x64.ActiveCfg = Release|Win32
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Debug Static|Win32.Build.0 = Debug|Win32
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Debug Static|x64.ActiveCfg = Debug|x64
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Debug Static|x64.Build.0 = Debug|x64
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Debug|Win32.ActiveCfg = Debug|Win32
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Debug|Win32.Build.0 = Debug|Win32
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Debug|x64.ActiveCfg = Debug|x64
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Release Static|Win32.ActiveCfg = Release|Win32
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Release Static|Win32.Build.0 = Release|Win32
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Release Static|x64.ActiveCfg = Release|x64
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Release Static|x64.Build.0 = Release|x64
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Release|Mixed Platforms.Build.0 = Release|Win32
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Release|Win32.ActiveCfg = Release|Win32
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Release|Win32.Build.0 = Release|Win32
- {FD948B35-2AB4-4AB3-88EF-7CC30E4A7B56}.Release|x64.ActiveCfg = Release|Win32
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Debug Static|Win32.Build.0 = Debug|Win32
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Debug Static|x64.ActiveCfg = Debug|x64
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Debug Static|x64.Build.0 = Debug|x64
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Debug|Win32.ActiveCfg = Debug|Win32
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Debug|Win32.Build.0 = Debug|Win32
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Debug|x64.ActiveCfg = Debug|x64
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Release Static|Win32.ActiveCfg = Release|Win32
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Release Static|Win32.Build.0 = Release|Win32
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Release Static|x64.ActiveCfg = Release|x64
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Release Static|x64.Build.0 = Release|x64
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Release|Mixed Platforms.Build.0 = Release|Win32
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Release|Win32.ActiveCfg = Release|Win32
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Release|Win32.Build.0 = Release|Win32
- {8363E128-4810-4036-B0C9-3537A3CDB90D}.Release|x64.ActiveCfg = Release|Win32
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Debug Static|Win32.Build.0 = Debug|Win32
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Debug Static|x64.ActiveCfg = Debug|x64
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Debug Static|x64.Build.0 = Debug|x64
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Debug|Win32.ActiveCfg = Debug|Win32
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Debug|Win32.Build.0 = Debug|Win32
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Debug|x64.ActiveCfg = Debug|x64
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Release Static|Win32.ActiveCfg = Release|Win32
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Release Static|Win32.Build.0 = Release|Win32
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Release Static|x64.ActiveCfg = Release|x64
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Release Static|x64.Build.0 = Release|x64
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Release|Mixed Platforms.Build.0 = Release|Win32
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Release|Win32.ActiveCfg = Release|Win32
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Release|Win32.Build.0 = Release|Win32
- {7E566DB6-F1A9-4C46-B769-79915CB9B182}.Release|x64.ActiveCfg = Release|Win32
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Debug Static|Win32.Build.0 = Debug|Win32
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Debug Static|x64.ActiveCfg = Debug|x64
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Debug Static|x64.Build.0 = Debug|x64
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Debug|Win32.ActiveCfg = Debug|Win32
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Debug|Win32.Build.0 = Debug|Win32
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Debug|x64.ActiveCfg = Debug|x64
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Release Static|Win32.ActiveCfg = Release|Win32
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Release Static|Win32.Build.0 = Release|Win32
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Release Static|x64.ActiveCfg = Release|x64
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Release Static|x64.Build.0 = Release|x64
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Release|Mixed Platforms.Build.0 = Release|Win32
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Release|Win32.ActiveCfg = Release|Win32
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Release|Win32.Build.0 = Release|Win32
- {13366E8F-2DBF-4E21-A7A7-52D8B788F4BC}.Release|x64.ActiveCfg = Release|Win32
- {60C723A8-AED4-4689-B960-F0091B16466F}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {60C723A8-AED4-4689-B960-F0091B16466F}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {60C723A8-AED4-4689-B960-F0091B16466F}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {60C723A8-AED4-4689-B960-F0091B16466F}.Debug Static|Win32.Build.0 = Debug|Win32
- {60C723A8-AED4-4689-B960-F0091B16466F}.Debug Static|x64.ActiveCfg = Debug|x64
- {60C723A8-AED4-4689-B960-F0091B16466F}.Debug Static|x64.Build.0 = Debug|x64
- {60C723A8-AED4-4689-B960-F0091B16466F}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {60C723A8-AED4-4689-B960-F0091B16466F}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {60C723A8-AED4-4689-B960-F0091B16466F}.Debug|Win32.ActiveCfg = Debug|Win32
- {60C723A8-AED4-4689-B960-F0091B16466F}.Debug|Win32.Build.0 = Debug|Win32
- {60C723A8-AED4-4689-B960-F0091B16466F}.Debug|x64.ActiveCfg = Debug|x64
- {60C723A8-AED4-4689-B960-F0091B16466F}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {60C723A8-AED4-4689-B960-F0091B16466F}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {60C723A8-AED4-4689-B960-F0091B16466F}.Release Static|Win32.ActiveCfg = Release|Win32
- {60C723A8-AED4-4689-B960-F0091B16466F}.Release Static|Win32.Build.0 = Release|Win32
- {60C723A8-AED4-4689-B960-F0091B16466F}.Release Static|x64.ActiveCfg = Release|x64
- {60C723A8-AED4-4689-B960-F0091B16466F}.Release Static|x64.Build.0 = Release|x64
- {60C723A8-AED4-4689-B960-F0091B16466F}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {60C723A8-AED4-4689-B960-F0091B16466F}.Release|Mixed Platforms.Build.0 = Release|Win32
- {60C723A8-AED4-4689-B960-F0091B16466F}.Release|Win32.ActiveCfg = Release|Win32
- {60C723A8-AED4-4689-B960-F0091B16466F}.Release|Win32.Build.0 = Release|Win32
- {60C723A8-AED4-4689-B960-F0091B16466F}.Release|x64.ActiveCfg = Release|Win32
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Static|Mixed Platforms.ActiveCfg = Debug Static|Win32
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Static|Mixed Platforms.Build.0 = Debug Static|Win32
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Static|Win32.ActiveCfg = Debug Static|Win32
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Static|Win32.Build.0 = Debug Static|Win32
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Static|x64.ActiveCfg = Debug Static|x64
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Static|x64.Build.0 = Debug Static|x64
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.ActiveCfg = Debug|x64
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.Build.0 = Debug|x64
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Static|Mixed Platforms.ActiveCfg = Release Static|Win32
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Static|Mixed Platforms.Build.0 = Release Static|Win32
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Static|Win32.ActiveCfg = Release Static|Win32
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Static|Win32.Build.0 = Release Static|Win32
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Static|x64.ActiveCfg = Release Static|x64
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Static|x64.Build.0 = Release Static|x64
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Mixed Platforms.Build.0 = Release|Win32
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.ActiveCfg = Release|x64
- {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.Build.0 = Release|x64
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Debug Static|Win32.Build.0 = Debug|Win32
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Debug Static|x64.ActiveCfg = Debug|Win32
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Debug|Win32.ActiveCfg = Debug|Win32
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Debug|Win32.Build.0 = Debug|Win32
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Debug|x64.ActiveCfg = Debug|x64
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Release Static|Win32.ActiveCfg = Release|Win32
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Release Static|Win32.Build.0 = Release|Win32
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Release Static|x64.ActiveCfg = Release|Win32
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Release|Mixed Platforms.Build.0 = Release|Win32
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Release|Win32.ActiveCfg = Release|Win32
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Release|Win32.Build.0 = Release|Win32
- {9CAAF0AB-D0A2-4CA1-9AB0-881D1D12FD19}.Release|x64.ActiveCfg = Release|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Debug Static|Win32.Build.0 = Debug|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Debug Static|x64.ActiveCfg = Debug|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Debug|Win32.ActiveCfg = Debug|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Debug|Win32.Build.0 = Debug|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Debug|x64.ActiveCfg = Debug|x64
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Release Static|Win32.ActiveCfg = Release|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Release Static|Win32.Build.0 = Release|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Release Static|x64.ActiveCfg = Release|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Release|Mixed Platforms.Build.0 = Release|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Release|Win32.ActiveCfg = Release|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Release|Win32.Build.0 = Release|Win32
- {F863B74F-B85F-4D17-BCF4-D3716A8C0D7F}.Release|x64.ActiveCfg = Release|Win32
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Debug Static|Win32.Build.0 = Debug|Win32
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Debug Static|x64.ActiveCfg = Debug|x64
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Debug Static|x64.Build.0 = Debug|x64
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Debug|Win32.ActiveCfg = Debug|Win32
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Debug|Win32.Build.0 = Debug|Win32
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Debug|x64.ActiveCfg = Debug|x64
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Debug|x64.Build.0 = Debug|x64
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Release Static|Win32.ActiveCfg = Release|Win32
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Release Static|Win32.Build.0 = Release|Win32
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Release Static|x64.ActiveCfg = Release|x64
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Release Static|x64.Build.0 = Release|x64
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Release|Mixed Platforms.Build.0 = Release|Win32
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Release|Win32.ActiveCfg = Release|Win32
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Release|Win32.Build.0 = Release|Win32
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Release|x64.ActiveCfg = Release|x64
- {D2E47D80-2231-4757-B3BC-E96E593CF0E3}.Release|x64.Build.0 = Release|x64
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Debug Static|Win32.Build.0 = Debug|Win32
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Debug Static|x64.ActiveCfg = Debug|Win32
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Debug|Win32.ActiveCfg = Debug|Win32
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Debug|Win32.Build.0 = Debug|Win32
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Debug|x64.ActiveCfg = Debug|x64
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Release Static|Win32.ActiveCfg = Release|Win32
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Release Static|Win32.Build.0 = Release|Win32
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Release Static|x64.ActiveCfg = Release|Win32
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Release|Mixed Platforms.Build.0 = Release|Win32
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Release|Win32.ActiveCfg = Release|Win32
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Release|Win32.Build.0 = Release|Win32
- {3C8EB62C-FB88-4BAE-81E6-A6FE98B43885}.Release|x64.ActiveCfg = Release|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Debug Static|Win32.Build.0 = Debug|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Debug Static|x64.ActiveCfg = Debug|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Debug|Win32.ActiveCfg = Debug|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Debug|Win32.Build.0 = Debug|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Debug|x64.ActiveCfg = Debug|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Release Static|Win32.ActiveCfg = Release|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Release Static|Win32.Build.0 = Release|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Release Static|x64.ActiveCfg = Release|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Release|Mixed Platforms.Build.0 = Release|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Release|Win32.ActiveCfg = Release|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Release|Win32.Build.0 = Release|Win32
- {DE288211-D073-4253-A9AA-8A3B4A69BA6D}.Release|x64.ActiveCfg = Release|Win32
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Debug Static|Win32.Build.0 = Debug|Win32
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Debug Static|x64.ActiveCfg = Debug|x64
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Debug Static|x64.Build.0 = Debug|x64
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Debug|Win32.ActiveCfg = Debug|Win32
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Debug|Win32.Build.0 = Debug|Win32
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Debug|x64.ActiveCfg = Debug|x64
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Debug|x64.Build.0 = Debug|x64
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Release Static|Win32.ActiveCfg = Release|Win32
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Release Static|Win32.Build.0 = Release|Win32
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Release Static|x64.ActiveCfg = Release|x64
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Release Static|x64.Build.0 = Release|x64
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Release|Mixed Platforms.Build.0 = Release|Win32
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Release|Win32.ActiveCfg = Release|Win32
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Release|Win32.Build.0 = Release|Win32
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Release|x64.ActiveCfg = Release|x64
- {B2711B30-AE9C-4015-AF37-8795C0EC9064}.Release|x64.Build.0 = Release|x64
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Debug Static|Win32.Build.0 = Debug|Win32
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Debug Static|x64.ActiveCfg = Debug|x64
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Debug Static|x64.Build.0 = Debug|x64
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Debug|Win32.ActiveCfg = Debug|Win32
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Debug|Win32.Build.0 = Debug|Win32
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Debug|x64.ActiveCfg = Debug|x64
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Debug|x64.Build.0 = Debug|x64
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Release Static|Win32.ActiveCfg = Release|Win32
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Release Static|Win32.Build.0 = Release|Win32
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Release Static|x64.ActiveCfg = Release|x64
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Release Static|x64.Build.0 = Release|x64
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Release|Mixed Platforms.Build.0 = Release|Win32
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Release|Win32.ActiveCfg = Release|Win32
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Release|Win32.Build.0 = Release|Win32
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Release|x64.ActiveCfg = Release|x64
- {2DA5FF1E-745A-4C30-A73E-53849F22D18A}.Release|x64.Build.0 = Release|x64
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Debug Static|Win32.Build.0 = Debug|Win32
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Debug Static|x64.ActiveCfg = Debug|x64
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Debug Static|x64.Build.0 = Debug|x64
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Debug|Win32.ActiveCfg = Debug|Win32
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Debug|Win32.Build.0 = Debug|Win32
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Debug|x64.ActiveCfg = Debug|x64
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Debug|x64.Build.0 = Debug|x64
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Release Static|Win32.ActiveCfg = Release|Win32
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Release Static|Win32.Build.0 = Release|Win32
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Release Static|x64.ActiveCfg = Release|x64
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Release Static|x64.Build.0 = Release|x64
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Release|Mixed Platforms.Build.0 = Release|Win32
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Release|Win32.ActiveCfg = Release|Win32
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Release|Win32.Build.0 = Release|Win32
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Release|x64.ActiveCfg = Release|x64
- {E423E38B-E351-4151-895D-5336D27C9A2F}.Release|x64.Build.0 = Release|x64
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Debug Static|Win32.Build.0 = Debug|Win32
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Debug Static|x64.ActiveCfg = Debug|x64
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Debug Static|x64.Build.0 = Debug|x64
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Debug|Win32.ActiveCfg = Debug|Win32
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Debug|Win32.Build.0 = Debug|Win32
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Debug|x64.ActiveCfg = Debug|x64
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Debug|x64.Build.0 = Debug|x64
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Release Static|Win32.ActiveCfg = Release|Win32
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Release Static|Win32.Build.0 = Release|Win32
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Release Static|x64.ActiveCfg = Release|x64
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Release Static|x64.Build.0 = Release|x64
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Release|Mixed Platforms.Build.0 = Release|Win32
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Release|Win32.ActiveCfg = Release|Win32
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Release|Win32.Build.0 = Release|Win32
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Release|x64.ActiveCfg = Release|x64
- {400E59EB-6E4C-461A-91B2-202F85F33D41}.Release|x64.Build.0 = Release|x64
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Debug Static|Win32.Build.0 = Debug|Win32
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Debug Static|x64.ActiveCfg = Debug|x64
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Debug Static|x64.Build.0 = Debug|x64
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Debug|Win32.ActiveCfg = Debug|Win32
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Debug|Win32.Build.0 = Debug|Win32
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Debug|x64.ActiveCfg = Debug|x64
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Debug|x64.Build.0 = Debug|x64
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Release Static|Win32.ActiveCfg = Release|Win32
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Release Static|Win32.Build.0 = Release|Win32
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Release Static|x64.ActiveCfg = Release|x64
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Release Static|x64.Build.0 = Release|x64
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Release|Mixed Platforms.Build.0 = Release|Win32
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Release|Win32.ActiveCfg = Release|Win32
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Release|Win32.Build.0 = Release|Win32
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Release|x64.ActiveCfg = Release|x64
- {CAE7FB4D-2145-4D85-96FB-734576BA5F07}.Release|x64.Build.0 = Release|x64
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Debug Static|Win32.Build.0 = Debug|Win32
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Debug Static|x64.ActiveCfg = Debug|x64
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Debug Static|x64.Build.0 = Debug|x64
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Debug|Win32.ActiveCfg = Debug|Win32
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Debug|Win32.Build.0 = Debug|Win32
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Debug|x64.ActiveCfg = Debug|x64
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Debug|x64.Build.0 = Debug|x64
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Release Static|Win32.ActiveCfg = Release|Win32
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Release Static|Win32.Build.0 = Release|Win32
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Release Static|x64.ActiveCfg = Release|x64
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Release Static|x64.Build.0 = Release|x64
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Release|Mixed Platforms.Build.0 = Release|Win32
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Release|Win32.ActiveCfg = Release|Win32
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Release|Win32.Build.0 = Release|Win32
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Release|x64.ActiveCfg = Release|x64
- {CB840DBD-BC3E-45DA-80A1-FF92E0DB3463}.Release|x64.Build.0 = Release|x64
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Debug Static|Win32.Build.0 = Debug|Win32
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Debug Static|x64.ActiveCfg = Debug|x64
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Debug Static|x64.Build.0 = Debug|x64
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Debug|Win32.ActiveCfg = Debug|Win32
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Debug|Win32.Build.0 = Debug|Win32
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Debug|x64.ActiveCfg = Debug|x64
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Debug|x64.Build.0 = Debug|x64
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Release Static|Win32.ActiveCfg = Release|Win32
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Release Static|Win32.Build.0 = Release|Win32
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Release Static|x64.ActiveCfg = Release|x64
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Release Static|x64.Build.0 = Release|x64
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Release|Mixed Platforms.Build.0 = Release|Win32
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Release|Win32.ActiveCfg = Release|Win32
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Release|Win32.Build.0 = Release|Win32
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Release|x64.ActiveCfg = Release|x64
- {01D9EF82-5076-4E5C-95FF-C027864A8302}.Release|x64.Build.0 = Release|x64
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Debug Static|Win32.Build.0 = Debug|Win32
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Debug Static|x64.ActiveCfg = Debug|x64
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Debug Static|x64.Build.0 = Debug|x64
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Debug|Win32.ActiveCfg = Debug|Win32
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Debug|Win32.Build.0 = Debug|Win32
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Debug|x64.ActiveCfg = Debug|x64
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Debug|x64.Build.0 = Debug|x64
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Release Static|Win32.ActiveCfg = Release|Win32
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Release Static|Win32.Build.0 = Release|Win32
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Release Static|x64.ActiveCfg = Release|x64
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Release Static|x64.Build.0 = Release|x64
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Release|Mixed Platforms.Build.0 = Release|Win32
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Release|Win32.ActiveCfg = Release|Win32
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Release|Win32.Build.0 = Release|Win32
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Release|x64.ActiveCfg = Release|x64
- {B3D51D1A-09E7-47D9-A6A5-5E6059585D6E}.Release|x64.Build.0 = Release|x64
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Debug Static|Win32.Build.0 = Debug|Win32
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Debug Static|x64.ActiveCfg = Debug|x64
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Debug Static|x64.Build.0 = Debug|x64
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Debug|Win32.ActiveCfg = Debug|Win32
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Debug|Win32.Build.0 = Debug|Win32
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Debug|x64.ActiveCfg = Debug|x64
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Debug|x64.Build.0 = Debug|x64
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Release Static|Win32.ActiveCfg = Release|Win32
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Release Static|Win32.Build.0 = Release|Win32
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Release Static|x64.ActiveCfg = Release|x64
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Release Static|x64.Build.0 = Release|x64
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Release|Mixed Platforms.Build.0 = Release|Win32
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Release|Win32.ActiveCfg = Release|Win32
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Release|Win32.Build.0 = Release|Win32
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Release|x64.ActiveCfg = Release|x64
- {567DA5F4-5B2E-4993-9370-C4A4F022C928}.Release|x64.Build.0 = Release|x64
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Debug Static|Win32.Build.0 = Debug|Win32
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Debug Static|x64.ActiveCfg = Debug|x64
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Debug Static|x64.Build.0 = Debug|x64
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Debug|Win32.ActiveCfg = Debug|Win32
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Debug|Win32.Build.0 = Debug|Win32
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Debug|x64.ActiveCfg = Debug|x64
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Debug|x64.Build.0 = Debug|x64
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Release Static|Win32.ActiveCfg = Release|Win32
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Release Static|Win32.Build.0 = Release|Win32
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Release Static|x64.ActiveCfg = Release|x64
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Release Static|x64.Build.0 = Release|x64
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Release|Mixed Platforms.Build.0 = Release|Win32
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Release|Win32.ActiveCfg = Release|Win32
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Release|Win32.Build.0 = Release|Win32
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Release|x64.ActiveCfg = Release|x64
- {6CEF9127-6B8C-4885-BA8D-C2B206EA7134}.Release|x64.Build.0 = Release|x64
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Debug Static|Win32.Build.0 = Debug|Win32
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Debug Static|x64.ActiveCfg = Debug|x64
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Debug Static|x64.Build.0 = Debug|x64
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Debug|Win32.ActiveCfg = Debug|Win32
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Debug|Win32.Build.0 = Debug|Win32
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Debug|x64.ActiveCfg = Debug|x64
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Debug|x64.Build.0 = Debug|x64
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Release Static|Win32.ActiveCfg = Release|Win32
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Release Static|Win32.Build.0 = Release|Win32
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Release Static|x64.ActiveCfg = Release|x64
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Release Static|x64.Build.0 = Release|x64
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Release|Mixed Platforms.Build.0 = Release|Win32
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Release|Win32.ActiveCfg = Release|Win32
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Release|Win32.Build.0 = Release|Win32
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Release|x64.ActiveCfg = Release|x64
- {7727F0D3-F3B1-4BB6-A563-90C9FE19A0A7}.Release|x64.Build.0 = Release|x64
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Debug Static|Win32.Build.0 = Debug|Win32
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Debug Static|x64.ActiveCfg = Debug|x64
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Debug Static|x64.Build.0 = Debug|x64
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Debug|Win32.ActiveCfg = Debug|Win32
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Debug|Win32.Build.0 = Debug|Win32
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Debug|x64.ActiveCfg = Debug|x64
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Debug|x64.Build.0 = Debug|x64
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Release Static|Win32.ActiveCfg = Release|Win32
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Release Static|Win32.Build.0 = Release|Win32
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Release Static|x64.ActiveCfg = Release|x64
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Release Static|x64.Build.0 = Release|x64
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Release|Mixed Platforms.Build.0 = Release|Win32
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Release|Win32.ActiveCfg = Release|Win32
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Release|Win32.Build.0 = Release|Win32
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Release|x64.ActiveCfg = Release|x64
- {20D3BAD1-1583-44C2-8625-46DAF5F0E975}.Release|x64.Build.0 = Release|x64
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Debug Static|Win32.Build.0 = Debug|Win32
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Debug Static|x64.ActiveCfg = Debug|x64
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Debug Static|x64.Build.0 = Debug|x64
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Debug|Win32.ActiveCfg = Debug|Win32
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Debug|Win32.Build.0 = Debug|Win32
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Debug|x64.ActiveCfg = Debug|x64
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Debug|x64.Build.0 = Debug|x64
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Release Static|Win32.ActiveCfg = Release|Win32
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Release Static|Win32.Build.0 = Release|Win32
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Release Static|x64.ActiveCfg = Release|x64
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Release Static|x64.Build.0 = Release|x64
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Release|Mixed Platforms.Build.0 = Release|Win32
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Release|Win32.ActiveCfg = Release|Win32
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Release|Win32.Build.0 = Release|Win32
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Release|x64.ActiveCfg = Release|x64
- {C4794DDD-B777-49DF-8600-ED1D71F96EBE}.Release|x64.Build.0 = Release|x64
- {156536F4-42E1-4125-A964-DB92D386E706}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {156536F4-42E1-4125-A964-DB92D386E706}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {156536F4-42E1-4125-A964-DB92D386E706}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {156536F4-42E1-4125-A964-DB92D386E706}.Debug Static|Win32.Build.0 = Debug|Win32
- {156536F4-42E1-4125-A964-DB92D386E706}.Debug Static|x64.ActiveCfg = Debug|x64
- {156536F4-42E1-4125-A964-DB92D386E706}.Debug Static|x64.Build.0 = Debug|x64
- {156536F4-42E1-4125-A964-DB92D386E706}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {156536F4-42E1-4125-A964-DB92D386E706}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {156536F4-42E1-4125-A964-DB92D386E706}.Debug|Win32.ActiveCfg = Debug|Win32
- {156536F4-42E1-4125-A964-DB92D386E706}.Debug|Win32.Build.0 = Debug|Win32
- {156536F4-42E1-4125-A964-DB92D386E706}.Debug|x64.ActiveCfg = Debug|x64
- {156536F4-42E1-4125-A964-DB92D386E706}.Debug|x64.Build.0 = Debug|x64
- {156536F4-42E1-4125-A964-DB92D386E706}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {156536F4-42E1-4125-A964-DB92D386E706}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {156536F4-42E1-4125-A964-DB92D386E706}.Release Static|Win32.ActiveCfg = Release|Win32
- {156536F4-42E1-4125-A964-DB92D386E706}.Release Static|Win32.Build.0 = Release|Win32
- {156536F4-42E1-4125-A964-DB92D386E706}.Release Static|x64.ActiveCfg = Release|x64
- {156536F4-42E1-4125-A964-DB92D386E706}.Release Static|x64.Build.0 = Release|x64
- {156536F4-42E1-4125-A964-DB92D386E706}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {156536F4-42E1-4125-A964-DB92D386E706}.Release|Mixed Platforms.Build.0 = Release|Win32
- {156536F4-42E1-4125-A964-DB92D386E706}.Release|Win32.ActiveCfg = Release|Win32
- {156536F4-42E1-4125-A964-DB92D386E706}.Release|Win32.Build.0 = Release|Win32
- {156536F4-42E1-4125-A964-DB92D386E706}.Release|x64.ActiveCfg = Release|x64
- {156536F4-42E1-4125-A964-DB92D386E706}.Release|x64.Build.0 = Release|x64
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Debug Static|Win32.Build.0 = Debug|Win32
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Debug Static|x64.ActiveCfg = Debug|x64
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Debug Static|x64.Build.0 = Debug|x64
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Debug|Win32.ActiveCfg = Debug|Win32
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Debug|Win32.Build.0 = Debug|Win32
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Debug|x64.ActiveCfg = Debug|x64
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Debug|x64.Build.0 = Debug|x64
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Release Static|Win32.ActiveCfg = Release|Win32
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Release Static|Win32.Build.0 = Release|Win32
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Release Static|x64.ActiveCfg = Release|x64
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Release Static|x64.Build.0 = Release|x64
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Release|Mixed Platforms.Build.0 = Release|Win32
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Release|Win32.ActiveCfg = Release|Win32
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Release|Win32.Build.0 = Release|Win32
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Release|x64.ActiveCfg = Release|x64
- {D106EC5D-389E-45A6-92FB-6E79550B0519}.Release|x64.Build.0 = Release|x64
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Debug Static|Win32.Build.0 = Debug|Win32
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Debug Static|x64.ActiveCfg = Debug|x64
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Debug Static|x64.Build.0 = Debug|x64
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Debug|Win32.ActiveCfg = Debug|Win32
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Debug|Win32.Build.0 = Debug|Win32
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Debug|x64.ActiveCfg = Debug|x64
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Debug|x64.Build.0 = Debug|x64
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Release Static|Win32.ActiveCfg = Release|Win32
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Release Static|Win32.Build.0 = Release|Win32
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Release Static|x64.ActiveCfg = Release|x64
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Release Static|x64.Build.0 = Release|x64
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Release|Mixed Platforms.Build.0 = Release|Win32
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Release|Win32.ActiveCfg = Release|Win32
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Release|Win32.Build.0 = Release|Win32
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Release|x64.ActiveCfg = Release|x64
- {4B0CA96B-1BED-45AB-B8AA-A1CDCD6F68C0}.Release|x64.Build.0 = Release|x64
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Debug Static|Win32.Build.0 = Debug|Win32
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Debug Static|x64.ActiveCfg = Debug|x64
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Debug Static|x64.Build.0 = Debug|x64
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Debug|Win32.ActiveCfg = Debug|Win32
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Debug|Win32.Build.0 = Debug|Win32
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Debug|x64.ActiveCfg = Debug|x64
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Debug|x64.Build.0 = Debug|x64
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Release Static|Win32.ActiveCfg = Release|Win32
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Release Static|Win32.Build.0 = Release|Win32
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Release Static|x64.ActiveCfg = Release|x64
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Release Static|x64.Build.0 = Release|x64
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Release|Mixed Platforms.Build.0 = Release|Win32
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Release|Win32.ActiveCfg = Release|Win32
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Release|Win32.Build.0 = Release|Win32
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Release|x64.ActiveCfg = Release|x64
- {7CDEF64B-6E81-46CC-AF2A-18BF136D4E9F}.Release|x64.Build.0 = Release|x64
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Debug Static|Win32.Build.0 = Debug|Win32
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Debug Static|x64.ActiveCfg = Debug|x64
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Debug Static|x64.Build.0 = Debug|x64
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Debug|Win32.ActiveCfg = Debug|Win32
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Debug|Win32.Build.0 = Debug|Win32
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Debug|x64.ActiveCfg = Debug|x64
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Debug|x64.Build.0 = Debug|x64
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Release Static|Win32.ActiveCfg = Release|Win32
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Release Static|Win32.Build.0 = Release|Win32
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Release Static|x64.ActiveCfg = Release|x64
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Release Static|x64.Build.0 = Release|x64
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Release|Mixed Platforms.Build.0 = Release|Win32
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Release|Win32.ActiveCfg = Release|Win32
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Release|Win32.Build.0 = Release|Win32
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Release|x64.ActiveCfg = Release|x64
- {7E852587-A5BD-4E6C-A0AB-ED1D38A65BEF}.Release|x64.Build.0 = Release|x64
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Debug Static|Win32.Build.0 = Debug|Win32
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Debug Static|x64.ActiveCfg = Debug|x64
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Debug Static|x64.Build.0 = Debug|x64
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Debug|Win32.ActiveCfg = Debug|Win32
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Debug|Win32.Build.0 = Debug|Win32
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Debug|x64.ActiveCfg = Debug|x64
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Debug|x64.Build.0 = Debug|x64
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Release Static|Win32.ActiveCfg = Release|Win32
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Release Static|Win32.Build.0 = Release|Win32
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Release Static|x64.ActiveCfg = Release|x64
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Release Static|x64.Build.0 = Release|x64
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Release|Mixed Platforms.Build.0 = Release|Win32
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Release|Win32.ActiveCfg = Release|Win32
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Release|Win32.Build.0 = Release|Win32
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Release|x64.ActiveCfg = Release|x64
- {D6BF34CD-F14A-49D0-A075-AB2024FF0A62}.Release|x64.Build.0 = Release|x64
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Debug Static|Win32.Build.0 = Debug|Win32
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Debug Static|x64.ActiveCfg = Debug|x64
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Debug Static|x64.Build.0 = Debug|x64
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Debug|Win32.ActiveCfg = Debug|Win32
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Debug|Win32.Build.0 = Debug|Win32
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Debug|x64.ActiveCfg = Debug|x64
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Debug|x64.Build.0 = Debug|x64
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Release Static|Win32.ActiveCfg = Release|Win32
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Release Static|Win32.Build.0 = Release|Win32
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Release Static|x64.ActiveCfg = Release|x64
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Release Static|x64.Build.0 = Release|x64
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Release|Mixed Platforms.Build.0 = Release|Win32
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Release|Win32.ActiveCfg = Release|Win32
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Release|Win32.Build.0 = Release|Win32
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Release|x64.ActiveCfg = Release|x64
- {5D58F57E-75D1-483E-BBCD-C203BCB35D50}.Release|x64.Build.0 = Release|x64
+ {1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Debug Static|ARM64.ActiveCfg = Debug|ARM64
+ {1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Debug Static|ARM64.Build.0 = Debug|ARM64
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Debug Static|Win32.ActiveCfg = Debug|Win32
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Debug Static|Win32.Build.0 = Debug|Win32
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Debug Static|x64.ActiveCfg = Debug|x64
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Debug Static|x64.Build.0 = Debug|x64
+ {1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Debug|ARM64.ActiveCfg = Debug|ARM64
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Debug|Win32.ActiveCfg = Debug|Win32
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Debug|Win32.Build.0 = Debug|Win32
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Debug|x64.ActiveCfg = Debug|x64
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Debug|x64.Build.0 = Debug|x64
+ {1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Release Static|ARM64.ActiveCfg = Release|ARM64
+ {1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Release Static|ARM64.Build.0 = Release|ARM64
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Release Static|Mixed Platforms.Build.0 = Release|Win32
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Release Static|Win32.ActiveCfg = Release|Win32
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Release Static|Win32.Build.0 = Release|Win32
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Release Static|x64.ActiveCfg = Release|x64
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Release Static|x64.Build.0 = Release|x64
+ {1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Release|ARM64.ActiveCfg = Release|ARM64
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Release|Mixed Platforms.Build.0 = Release|Win32
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Release|Win32.ActiveCfg = Release|Win32
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Release|Win32.Build.0 = Release|Win32
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Release|x64.ActiveCfg = Release|x64
{1998E8D0-DF15-4A59-B9C1-0728EC4ACA15}.Release|x64.Build.0 = Release|x64
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Debug Static|Win32.Build.0 = Debug|Win32
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Debug Static|x64.ActiveCfg = Debug|x64
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Debug Static|x64.Build.0 = Debug|x64
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Debug|Win32.ActiveCfg = Debug|Win32
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Debug|Win32.Build.0 = Debug|Win32
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Debug|x64.ActiveCfg = Debug|x64
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Debug|x64.Build.0 = Debug|x64
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Release Static|Win32.ActiveCfg = Release|Win32
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Release Static|Win32.Build.0 = Release|Win32
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Release Static|x64.ActiveCfg = Release|x64
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Release Static|x64.Build.0 = Release|x64
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Release|Mixed Platforms.Build.0 = Release|Win32
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Release|Win32.ActiveCfg = Release|Win32
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Release|Win32.Build.0 = Release|Win32
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Release|x64.ActiveCfg = Release|x64
- {B8C53F70-A4F1-4DA7-8580-B98077EEFCC1}.Release|x64.Build.0 = Release|x64
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Debug Static|Win32.Build.0 = Debug|Win32
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Debug Static|x64.ActiveCfg = Debug|x64
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Debug Static|x64.Build.0 = Debug|x64
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Debug|Win32.ActiveCfg = Debug|Win32
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Debug|Win32.Build.0 = Debug|Win32
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Debug|x64.ActiveCfg = Debug|x64
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Debug|x64.Build.0 = Debug|x64
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Release Static|Win32.ActiveCfg = Release|Win32
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Release Static|Win32.Build.0 = Release|Win32
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Release Static|x64.ActiveCfg = Release|x64
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Release Static|x64.Build.0 = Release|x64
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Release|Mixed Platforms.Build.0 = Release|Win32
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Release|Win32.ActiveCfg = Release|Win32
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Release|Win32.Build.0 = Release|Win32
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Release|x64.ActiveCfg = Release|x64
- {69F8AABD-ABEF-475C-88EB-AA69B2C4231C}.Release|x64.Build.0 = Release|x64
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Debug Static|Win32.Build.0 = Debug|Win32
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Debug Static|x64.ActiveCfg = Debug|x64
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Debug Static|x64.Build.0 = Debug|x64
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Debug|Win32.ActiveCfg = Debug|Win32
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Debug|Win32.Build.0 = Debug|Win32
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Debug|x64.ActiveCfg = Debug|x64
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Debug|x64.Build.0 = Debug|x64
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Release Static|Win32.ActiveCfg = Release|Win32
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Release Static|Win32.Build.0 = Release|Win32
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Release Static|x64.ActiveCfg = Release|x64
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Release Static|x64.Build.0 = Release|x64
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Release|Mixed Platforms.Build.0 = Release|Win32
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Release|Win32.ActiveCfg = Release|Win32
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Release|Win32.Build.0 = Release|Win32
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Release|x64.ActiveCfg = Release|x64
- {8C9C714F-B369-4625-A9D4-CA461DA4335A}.Release|x64.Build.0 = Release|x64
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Debug Static|Win32.Build.0 = Debug|Win32
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Debug Static|x64.ActiveCfg = Debug|x64
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Debug Static|x64.Build.0 = Debug|x64
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Debug|Win32.ActiveCfg = Debug|Win32
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Debug|Win32.Build.0 = Debug|Win32
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Debug|x64.ActiveCfg = Debug|x64
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Debug|x64.Build.0 = Debug|x64
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Release Static|Win32.ActiveCfg = Release|Win32
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Release Static|Win32.Build.0 = Release|Win32
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Release Static|x64.ActiveCfg = Release|x64
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Release Static|x64.Build.0 = Release|x64
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Release|Mixed Platforms.Build.0 = Release|Win32
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Release|Win32.ActiveCfg = Release|Win32
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Release|Win32.Build.0 = Release|Win32
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Release|x64.ActiveCfg = Release|x64
- {AF79F28C-7E9C-4B35-8559-E18EF40C5E2A}.Release|x64.Build.0 = Release|x64
+ {FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Debug Static|ARM64.ActiveCfg = Debug|ARM64
+ {FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Debug Static|ARM64.Build.0 = Debug|ARM64
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Debug Static|Win32.ActiveCfg = Debug|Win32
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Debug Static|Win32.Build.0 = Debug|Win32
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Debug Static|x64.ActiveCfg = Debug|x64
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Debug Static|x64.Build.0 = Debug|x64
+ {FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Debug|ARM64.Build.0 = Debug|ARM64
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Debug|Win32.ActiveCfg = Debug|Win32
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Debug|Win32.Build.0 = Debug|Win32
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Debug|x64.ActiveCfg = Debug|x64
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Debug|x64.Build.0 = Debug|x64
+ {FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Release Static|ARM64.ActiveCfg = Release|ARM64
+ {FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Release Static|ARM64.Build.0 = Release|ARM64
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Release Static|Mixed Platforms.Build.0 = Release|Win32
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Release Static|Win32.ActiveCfg = Release|Win32
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Release Static|Win32.Build.0 = Release|Win32
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Release Static|x64.ActiveCfg = Release|x64
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Release Static|x64.Build.0 = Release|x64
+ {FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Release|ARM64.ActiveCfg = Release|ARM64
+ {FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Release|ARM64.Build.0 = Release|ARM64
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Release|Mixed Platforms.Build.0 = Release|Win32
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Release|Win32.ActiveCfg = Release|Win32
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Release|Win32.Build.0 = Release|Win32
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Release|x64.ActiveCfg = Release|x64
{FEA7A458-0E08-4754-AD51-57FDD680BEEB}.Release|x64.Build.0 = Release|x64
+ {2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug Static|ARM64.ActiveCfg = Debug|ARM64
+ {2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug Static|ARM64.Build.0 = Debug|ARM64
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug Static|Win32.ActiveCfg = Debug|Win32
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug Static|Win32.Build.0 = Debug|Win32
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug Static|x64.ActiveCfg = Debug|x64
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug Static|x64.Build.0 = Debug|x64
- {2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
+ {2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug|ARM64.ActiveCfg = Release|ARM64
+ {2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug|ARM64.Build.0 = Release|ARM64
+ {2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug|Mixed Platforms.ActiveCfg = Release|ARM64
+ {2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug|Mixed Platforms.Build.0 = Release|ARM64
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug|Win32.ActiveCfg = Debug|Win32
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug|Win32.Build.0 = Debug|Win32
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug|x64.ActiveCfg = Debug|x64
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Debug|x64.Build.0 = Debug|x64
+ {2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Release Static|ARM64.ActiveCfg = Release|ARM64
+ {2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Release Static|ARM64.Build.0 = Release|ARM64
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Release Static|Mixed Platforms.Build.0 = Release|Win32
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Release Static|Win32.ActiveCfg = Release|Win32
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Release Static|Win32.Build.0 = Release|Win32
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Release Static|x64.ActiveCfg = Release|x64
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Release Static|x64.Build.0 = Release|x64
+ {2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Release|ARM64.ActiveCfg = Release|ARM64
+ {2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Release|ARM64.Build.0 = Release|ARM64
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Release|Mixed Platforms.Build.0 = Release|Win32
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Release|Win32.ActiveCfg = Release|Win32
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Release|Win32.Build.0 = Release|Win32
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Release|x64.ActiveCfg = Release|x64
{2DA020D0-9C8A-4879-A2CA-9829BFF52BD8}.Release|x64.Build.0 = Release|x64
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Debug Static|Win32.Build.0 = Debug|Win32
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Debug Static|x64.ActiveCfg = Debug|x64
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Debug Static|x64.Build.0 = Debug|x64
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Debug|Win32.ActiveCfg = Debug|Win32
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Debug|Win32.Build.0 = Debug|Win32
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Debug|x64.ActiveCfg = Debug|x64
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Debug|x64.Build.0 = Debug|x64
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Release Static|Win32.ActiveCfg = Release|Win32
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Release Static|Win32.Build.0 = Release|Win32
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Release Static|x64.ActiveCfg = Release|x64
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Release Static|x64.Build.0 = Release|x64
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Release|Mixed Platforms.Build.0 = Release|Win32
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Release|Win32.ActiveCfg = Release|Win32
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Release|Win32.Build.0 = Release|Win32
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Release|x64.ActiveCfg = Release|x64
- {22A06C2D-60BB-4040-8214-30EA17701F94}.Release|x64.Build.0 = Release|x64
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Debug Static|Win32.Build.0 = Debug|Win32
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Debug Static|x64.ActiveCfg = Debug|x64
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Debug Static|x64.Build.0 = Debug|x64
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Debug|Win32.ActiveCfg = Debug|Win32
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Debug|Win32.Build.0 = Debug|Win32
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Debug|x64.ActiveCfg = Debug|x64
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Debug|x64.Build.0 = Debug|x64
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Release Static|Win32.ActiveCfg = Release|Win32
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Release Static|Win32.Build.0 = Release|Win32
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Release Static|x64.ActiveCfg = Release|x64
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Release Static|x64.Build.0 = Release|x64
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Release|Mixed Platforms.Build.0 = Release|Win32
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Release|Win32.ActiveCfg = Release|Win32
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Release|Win32.Build.0 = Release|Win32
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Release|x64.ActiveCfg = Release|x64
- {51D1FDFC-3E19-428A-9D1A-9C82C9E5B5A5}.Release|x64.Build.0 = Release|x64
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Debug Static|Win32.Build.0 = Debug|Win32
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Debug Static|x64.ActiveCfg = Debug|x64
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Debug Static|x64.Build.0 = Debug|x64
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Debug|Win32.ActiveCfg = Debug|Win32
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Debug|Win32.Build.0 = Debug|Win32
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Debug|x64.ActiveCfg = Debug|x64
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Debug|x64.Build.0 = Debug|x64
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Release Static|Win32.ActiveCfg = Release|Win32
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Release Static|Win32.Build.0 = Release|Win32
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Release Static|x64.ActiveCfg = Release|x64
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Release Static|x64.Build.0 = Release|x64
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Release|Mixed Platforms.Build.0 = Release|Win32
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Release|Win32.ActiveCfg = Release|Win32
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Release|Win32.Build.0 = Release|Win32
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Release|x64.ActiveCfg = Release|x64
- {7CDDFA23-2897-4297-B245-ACDE5031E9F3}.Release|x64.Build.0 = Release|x64
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Debug Static|Win32.Build.0 = Debug|Win32
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Debug Static|x64.ActiveCfg = Debug|x64
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Debug Static|x64.Build.0 = Debug|x64
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Debug|Win32.ActiveCfg = Debug|Win32
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Debug|Win32.Build.0 = Debug|Win32
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Debug|x64.ActiveCfg = Debug|x64
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Debug|x64.Build.0 = Debug|x64
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Release Static|Win32.ActiveCfg = Release|Win32
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Release Static|Win32.Build.0 = Release|Win32
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Release Static|x64.ActiveCfg = Release|x64
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Release Static|x64.Build.0 = Release|x64
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Release|Mixed Platforms.Build.0 = Release|Win32
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Release|Win32.ActiveCfg = Release|Win32
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Release|Win32.Build.0 = Release|Win32
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Release|x64.ActiveCfg = Release|x64
- {F3C02000-9AF8-48EC-99B7-3C9A8B7D6BF1}.Release|x64.Build.0 = Release|x64
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Debug Static|Win32.Build.0 = Debug|Win32
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Debug Static|x64.ActiveCfg = Debug|x64
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Debug Static|x64.Build.0 = Debug|x64
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Debug|Win32.ActiveCfg = Debug|Win32
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Debug|Win32.Build.0 = Debug|Win32
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Debug|x64.ActiveCfg = Debug|x64
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Debug|x64.Build.0 = Debug|x64
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Release Static|Win32.ActiveCfg = Release|Win32
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Release Static|Win32.Build.0 = Release|Win32
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Release Static|x64.ActiveCfg = Release|x64
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Release Static|x64.Build.0 = Release|x64
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Release|Mixed Platforms.Build.0 = Release|Win32
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Release|Win32.ActiveCfg = Release|Win32
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Release|Win32.Build.0 = Release|Win32
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Release|x64.ActiveCfg = Release|x64
- {AD7FE42E-814F-4DC7-86DF-B6AD041251DB}.Release|x64.Build.0 = Release|x64
- {E121230A-7D08-42F0-966B-D96349EF976F}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {E121230A-7D08-42F0-966B-D96349EF976F}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {E121230A-7D08-42F0-966B-D96349EF976F}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {E121230A-7D08-42F0-966B-D96349EF976F}.Debug Static|Win32.Build.0 = Debug|Win32
- {E121230A-7D08-42F0-966B-D96349EF976F}.Debug Static|x64.ActiveCfg = Debug|x64
- {E121230A-7D08-42F0-966B-D96349EF976F}.Debug Static|x64.Build.0 = Debug|x64
- {E121230A-7D08-42F0-966B-D96349EF976F}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {E121230A-7D08-42F0-966B-D96349EF976F}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {E121230A-7D08-42F0-966B-D96349EF976F}.Debug|Win32.ActiveCfg = Debug|Win32
- {E121230A-7D08-42F0-966B-D96349EF976F}.Debug|Win32.Build.0 = Debug|Win32
- {E121230A-7D08-42F0-966B-D96349EF976F}.Debug|x64.ActiveCfg = Debug|x64
- {E121230A-7D08-42F0-966B-D96349EF976F}.Debug|x64.Build.0 = Debug|x64
- {E121230A-7D08-42F0-966B-D96349EF976F}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {E121230A-7D08-42F0-966B-D96349EF976F}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {E121230A-7D08-42F0-966B-D96349EF976F}.Release Static|Win32.ActiveCfg = Release|Win32
- {E121230A-7D08-42F0-966B-D96349EF976F}.Release Static|Win32.Build.0 = Release|Win32
- {E121230A-7D08-42F0-966B-D96349EF976F}.Release Static|x64.ActiveCfg = Release|x64
- {E121230A-7D08-42F0-966B-D96349EF976F}.Release Static|x64.Build.0 = Release|x64
- {E121230A-7D08-42F0-966B-D96349EF976F}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {E121230A-7D08-42F0-966B-D96349EF976F}.Release|Mixed Platforms.Build.0 = Release|Win32
- {E121230A-7D08-42F0-966B-D96349EF976F}.Release|Win32.ActiveCfg = Release|Win32
- {E121230A-7D08-42F0-966B-D96349EF976F}.Release|Win32.Build.0 = Release|Win32
- {E121230A-7D08-42F0-966B-D96349EF976F}.Release|x64.ActiveCfg = Release|x64
- {E121230A-7D08-42F0-966B-D96349EF976F}.Release|x64.Build.0 = Release|x64
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Debug Static|Win32.Build.0 = Debug|Win32
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Debug Static|x64.ActiveCfg = Debug|x64
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Debug Static|x64.Build.0 = Debug|x64
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Debug|Win32.ActiveCfg = Debug|Win32
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Debug|Win32.Build.0 = Debug|Win32
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Debug|x64.ActiveCfg = Debug|x64
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Debug|x64.Build.0 = Debug|x64
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Release Static|Win32.ActiveCfg = Release|Win32
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Release Static|Win32.Build.0 = Release|Win32
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Release Static|x64.ActiveCfg = Release|x64
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Release Static|x64.Build.0 = Release|x64
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Release|Mixed Platforms.Build.0 = Release|Win32
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Release|Win32.ActiveCfg = Release|Win32
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Release|Win32.Build.0 = Release|Win32
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Release|x64.ActiveCfg = Release|x64
- {B44F1C3D-F499-49F4-940D-227B5D5F5DD2}.Release|x64.Build.0 = Release|x64
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Debug Static|Win32.Build.0 = Debug|Win32
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Debug Static|x64.ActiveCfg = Debug|x64
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Debug Static|x64.Build.0 = Debug|x64
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Debug|Win32.ActiveCfg = Debug|Win32
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Debug|Win32.Build.0 = Debug|Win32
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Debug|x64.ActiveCfg = Debug|x64
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Debug|x64.Build.0 = Debug|x64
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Release Static|Win32.ActiveCfg = Release|Win32
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Release Static|Win32.Build.0 = Release|Win32
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Release Static|x64.ActiveCfg = Release|x64
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Release Static|x64.Build.0 = Release|x64
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Release|Mixed Platforms.Build.0 = Release|Win32
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Release|Win32.ActiveCfg = Release|Win32
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Release|Win32.Build.0 = Release|Win32
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Release|x64.ActiveCfg = Release|x64
- {0130DFA1-9BCA-4108-9065-62FE5495CDA2}.Release|x64.Build.0 = Release|x64
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Debug Static|Win32.Build.0 = Debug|Win32
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Debug Static|x64.ActiveCfg = Debug|x64
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Debug Static|x64.Build.0 = Debug|x64
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Debug|Win32.ActiveCfg = Debug|Win32
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Debug|Win32.Build.0 = Debug|Win32
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Debug|x64.ActiveCfg = Debug|x64
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Debug|x64.Build.0 = Debug|x64
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Release Static|Win32.ActiveCfg = Release|Win32
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Release Static|Win32.Build.0 = Release|Win32
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Release Static|x64.ActiveCfg = Release|x64
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Release Static|x64.Build.0 = Release|x64
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Release|Mixed Platforms.Build.0 = Release|Win32
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Release|Win32.ActiveCfg = Release|Win32
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Release|Win32.Build.0 = Release|Win32
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Release|x64.ActiveCfg = Release|x64
- {B8BF3983-424E-4915-AAA5-FA90DFFEB7C8}.Release|x64.Build.0 = Release|x64
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Debug Static|Win32.Build.0 = Debug|Win32
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Debug Static|x64.ActiveCfg = Debug|x64
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Debug Static|x64.Build.0 = Debug|x64
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Debug|Win32.ActiveCfg = Debug|Win32
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Debug|Win32.Build.0 = Debug|Win32
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Debug|x64.ActiveCfg = Debug|x64
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Debug|x64.Build.0 = Debug|x64
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Release Static|Win32.ActiveCfg = Release|Win32
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Release Static|Win32.Build.0 = Release|Win32
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Release Static|x64.ActiveCfg = Release|x64
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Release Static|x64.Build.0 = Release|x64
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Release|Mixed Platforms.Build.0 = Release|Win32
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Release|Win32.ActiveCfg = Release|Win32
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Release|Win32.Build.0 = Release|Win32
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Release|x64.ActiveCfg = Release|x64
- {B5055A6B-3AF7-443B-9A60-5068D7A10D4A}.Release|x64.Build.0 = Release|x64
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Debug Static|Mixed Platforms.ActiveCfg = Debug|Win32
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Debug Static|Mixed Platforms.Build.0 = Debug|Win32
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Debug Static|Win32.ActiveCfg = Debug|Win32
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Debug Static|Win32.Build.0 = Debug|Win32
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Debug Static|x64.ActiveCfg = Debug|x64
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Debug Static|x64.Build.0 = Debug|x64
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Debug|Mixed Platforms.ActiveCfg = Debug|ARM64
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Debug|Mixed Platforms.Build.0 = Debug|ARM64
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Debug|Win32.ActiveCfg = Debug|Win32
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Debug|Win32.Build.0 = Debug|Win32
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Debug|x64.ActiveCfg = Debug|x64
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Debug|x64.Build.0 = Debug|x64
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Release Static|Mixed Platforms.ActiveCfg = Release|Win32
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Release Static|Mixed Platforms.Build.0 = Release|Win32
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Release Static|Win32.ActiveCfg = Release|Win32
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Release Static|Win32.Build.0 = Release|Win32
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Release Static|x64.ActiveCfg = Release|x64
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Release Static|x64.Build.0 = Release|x64
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Release|Mixed Platforms.Build.0 = Release|Win32
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Release|Win32.ActiveCfg = Release|Win32
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Release|Win32.Build.0 = Release|Win32
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Release|x64.ActiveCfg = Release|x64
- {219C18BE-21F7-4653-A0A5-710DA04F1F9A}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/BaseHdr/Board/board.h b/BaseHdr/Board/board.h
index ce151594e..5c5b47f76 100644
--- a/BaseHdr/Board/board.h
+++ b/BaseHdr/Board/board.h
@@ -60,4 +60,10 @@ extern void AuAA64BoardPowerDown();
*/
extern void AuAA64BoardReboot();
+/**
+ * @brief AuAA64BoardGetBootEpoch -- returns the
+ * boot epoch time from board
+ */
+extern uint64_t AuAA64BoardGetBootEpoch();
+
#endif
\ No newline at end of file
diff --git a/BaseHdr/Board/imx8mp/imx8mp_clk.h b/BaseHdr/Board/imx8mp/imx8mp_clk.h
index 35abfae37..6515e9fdd 100644
--- a/BaseHdr/Board/imx8mp/imx8mp_clk.h
+++ b/BaseHdr/Board/imx8mp/imx8mp_clk.h
@@ -88,6 +88,227 @@ typedef enum _clock_root_select_ {
HDMI_REF_266M_ROOT,
/* incomplete */
}imx8mp_clock_root_select;
+
+typedef enum _root_id_ {
+ IMX8MP_CLK_GPC_ROOT = 183,
+ IMX8MP_CLK_ANAMIX_ROOT,
+ IMX8MP_CLK_CPU_ROOT,
+ IMX8MP_CLK_CSU_ROOT,
+ IMX8MP_CLK_DEBUG_ROOT,
+ IMX8MP_CLK_DRAM1_ROOT,
+ IMX8MP_CLK_ECSPI1_ROOT,
+ IMX8MP_CLK_ECSPI2_ROOT,
+ IMX8MP_CLK_ECSPI3_ROOT,
+ IMX8MP_CLK_ENET1_ROOT,
+ IMX8MP_CLK_GPIO1_ROOT,
+ IMX8MP_CLK_GPIO2_ROOT,
+ IMX8MP_CLK_GPIO3_ROOT,
+ IMX8MP_CLK_GPIO4_ROOT,
+ IMX8MP_CLK_GPIO5_ROOT,
+ IMX8MP_CLK_GPT1_ROOT,
+ IMX8MP_CLK_GPT2_ROOT,
+ IMX8MP_CLK_GPT3_ROOT,
+ IMX8MP_CLK_GPT4_ROOT,
+ IMX8MP_CLK_GPT5_ROOT,
+ IMX8MP_CLK_GPT6_ROOT,
+ IMX8MP_CLK_HS_ROOT,
+ IMX8MP_CLK_I2C1_ROOT,
+ IMX8MP_CLK_I2C2_ROOT,
+ IMX8MP_CLK_I2C3_ROOT,
+ IMX8MP_CLK_I2C4_ROOT,
+ IMX8MP_CLK_IOMUX_ROOT,
+ IMX8MP_CLK_IPMUX1_ROOT,
+ IMX8MP_CLK_IPMUX2_ROOT,
+ IMX8MP_CLK_MU_ROOT,
+ IMX8MP_CLK_OCOTP_ROOT,
+ IMX8MP_CLK_OCRAM_ROOT,
+ IMX8MP_CLK_PCIE_ROOT,
+ IMX8MP_CLK_PERFMON1_ROOT,
+ IMX8MP_CLK_PERFMON2_ROOT,
+ IMX8MP_CLK_PWM1_ROOT,
+ IMX8MP_CLK_PWM2_ROOT,
+ IMX8MP_CLK_PWM3_ROOT,
+ IMX8MP_CLK_PWM4_ROOT,
+ IMX8MP_CLK_QOS_ROOT,
+ IMX8MP_CLK_QOS_ENET_ROOT,
+ IMX8MP_CLK_QSPI_ROOT,
+ IMX8MP_CLK_NAND_ROOT,
+ IMX8MP_CLK_NAND_USDHC_BUS_RAWNAND_CLK,
+ IMX8MP_CLK_RDC_ROOT,
+ IMX8MP_CLK_ROM_ROOT,
+ IMX8MP_CLK_I2C5_ROOT,
+ IMX8MP_CLK_I2C6_ROOT,
+ IMX8MP_CLK_CAN1_ROOT,
+ IMX8MP_CLK_CAN2_ROOT,
+ IMX8MP_CLK_SCTR_ROOT,
+ IMX8MP_CLK_SDMA1_ROOT,
+ IMX8MP_CLK_ENET_QOS_ROOT,
+ IMX8MP_CLK_SEC_DEBUG_ROOT,
+ IMX8MP_CLK_SEMA1_ROOT,
+ IMX8MP_CLK_SEMA2_ROOT,
+ IMX8MP_CLK_IRQ_STEER_ROOT,
+ IMX8MP_CLK_SIM_ENET_ROOT,
+ IMX8MP_CLK_SIM_M_ROOT,
+ IMX8MP_CLK_SIM_MAIN_ROOT,
+ IMX8MP_CLK_SIM_S_ROOT,
+ IMX8MP_CLK_SIM_WAKEUP_ROOT,
+ IMX8MP_CLK_GPU2D_ROOT,
+ IMX8MP_CLK_GPU3D_ROOT,
+ IMX8MP_CLK_SNVS_ROOT,
+ IMX8MP_CLK_TRACE_ROOT,
+ IMX8MP_CLK_UART1_ROOT,
+ IMX8MP_CLK_UART2_ROOT,
+ IMX8MP_CLK_UART3_ROOT,
+ IMX8MP_CLK_UART4_ROOT,
+ IMX8MP_CLK_USB_ROOT,
+ IMX8MP_CLK_USB_PHY_ROOT,
+ IMX8MP_CLK_USDHC1_ROOT,
+ IMX8MP_CLK_USDHC2_ROOT,
+ IMX8MP_CLK_WDOG1_ROOT,
+ IMX8MP_CLK_WDOG2_ROOT,
+ IMX8MP_CLK_WDOG3_ROOT,
+ IMX8MP_CLK_VPU_G1_ROOT,
+ IMX8MP_CLK_GPU_ROOT,
+ IMX8MP_CLK_NOC_WRAPPER_ROOT,
+ IMX8MP_CLK_VPU_VC8KE_ROOT,
+ IMX8MP_CLK_VPU_G2_ROOT,
+ IMX8MP_CLK_NPU_ROOT,
+ IMX8MP_CLK_HSIO_ROOT,
+ IMX8MP_CLK_MEDIA_APB_ROOT,
+ IMX8MP_CLK_MEDIA_AXI_ROOT,
+ IMX8MP_CLK_MEDIA_CAM1_PIX_ROOT,
+ IMX8MP_CLK_MEDIA_CAM2_PIX_ROOT,
+ IMX8MP_CLK_MEDIA_DISP1_PIX_ROOT,
+ IMX8MP_CLK_MEDIA_DISP2_PIX_ROOT,
+ IMX8MP_CLK_MEDIA_MIPI_PHY1_REF_ROOT,
+ IMX8MP_CLK_MEDIA_ISP_ROOT,
+ IMX8MP_CLK_USDHC3_ROOT,
+ IMX8MP_CLK_HDMI_ROOT,
+ IMX8MP_CLK_XTAL_ROOT,
+ IMX8MP_CLK_PLL_ROOT,
+ IMX8MP_CLK_TSENSOR_ROOT,
+ IMX8MP_CLK_VPU_ROOT,
+ IMX8MP_CLK_MRPR_ROOT,
+ IMX8MP_CLK_AUDIO_ROOT,
+ IMX8MP_CLK_DRAM_ALT_ROOT,
+ IMX8MP_CLK_MEDIA_LDB_ROOT,
+ IMX8MP_CLK_AUDIO_AHB_ROOT,
+ IMX8MP_CLK_AUDIO_AXI_ROOT,
+ IMX8MP_CLK_SAI1_ROOT,
+ IMX8MP_CLK_SAI2_ROOT,
+ IMX8MP_CLK_SAI3_ROOT,
+ IMX8MP_CLK_SAI5_ROOT,
+ IMX8MP_CLK_SAI6_ROOT,
+ IMX8MP_CLK_SAI7_ROOT,
+ IMX8MP_CLK_PDM_ROOT,
+ IMX8MP_CLK_USB_SUSP,
+}imx8mp_clk_root_id;
+
+#define DT_IMX8MP_CLK_GPC_ROOT 183
+#define DT_IMX8MP_CLK_ANAMIX_ROOT 184
+#define DT_IMX8MP_CLK_CPU_ROOT 185
+#define DT_IMX8MP_CLK_CSU_ROOT 186
+#define DT_IMX8MP_CLK_DEBUG_ROOT 187
+#define DT_IMX8MP_CLK_DRAM1_ROOT 188
+#define DT_IMX8MP_CLK_ECSPI1_ROOT 189
+#define DT_IMX8MP_CLK_ECSPI2_ROOT 190
+#define DT_IMX8MP_CLK_ECSPI3_ROOT 191
+#define DT_IMX8MP_CLK_ENET1_ROOT 192
+#define DT_IMX8MP_CLK_GPIO1_ROOT 193
+#define DT_IMX8MP_CLK_GPIO2_ROOT 194
+#define DT_IMX8MP_CLK_GPIO3_ROOT 195
+#define DT_IMX8MP_CLK_GPIO4_ROOT 196
+#define DT_IMX8MP_CLK_GPIO5_ROOT 197
+#define DT_IMX8MP_CLK_GPT1_ROOT 198
+#define DT_IMX8MP_CLK_GPT2_ROOT 199
+#define DT_IMX8MP_CLK_GPT3_ROOT 200
+#define DT_IMX8MP_CLK_GPT4_ROOT 201
+#define DT_IMX8MP_CLK_GPT5_ROOT 202
+#define DT_IMX8MP_CLK_GPT6_ROOT 203
+#define DT_IMX8MP_CLK_HS_ROOT 204
+#define DT_IMX8MP_CLK_I2C1_ROOT 205
+#define DT_IMX8MP_CLK_I2C2_ROOT 206
+#define DT_IMX8MP_CLK_I2C3_ROOT 207
+#define DT_IMX8MP_CLK_I2C4_ROOT 208
+#define DT_IMX8MP_CLK_IOMUX_ROOT 209
+#define DT_IMX8MP_CLK_IPMUX1_ROOT 210
+#define DT_IMX8MP_CLK_IPMUX2_ROOT 211
+#define DT_IMX8MP_CLK_IPMUX3_ROOT 212
+#define DT_IMX8MP_CLK_MU_ROOT 213
+#define DT_IMX8MP_CLK_OCUTP_ROOT 214
+#define DT_IMX8MP_CLK_OCRAM_ROOT 215
+#define DT_IMX8MP_CLK_OCRAM_S_ROOT 216
+#define DT_IMX8MP_CLK_PCIE_ROOT 217
+#define DT_IMX8MP_CLK_PERFMON1_ROOT 218
+#define DT_IMX8MP_CLK_PERFMON2_ROOT 219
+#define DT_IMX8MP_CLK_PWM1_ROOT 220
+#define DT_IMX8MP_CLK_PWM2_ROOT 221
+#define DT_IMX8MP_CLK_PWM3_ROOT 222
+#define DT_IMX8MP_CLK_PWM4_ROOT 223
+#define DT_IMX8MP_CLK_QOS_ROOT 224
+#define DT_IMX8MP_CLK_QOS_ENET_ROOT 225
+#define DT_IMX8MP_CLK_QSPI_ROOT 226
+#define DT_IMX8MP_CLK_NAND_ROOT 227
+#define DT_IMX8MP_CLK_NAND_USDHC_BUS_RAWNAND_CLK 228
+#define DT_IMX8MP_CLK_RDC_ROOT 229
+#define DT_IMX8MP_CLK_ROM_ROOT 230
+#define DT_IMX8MP_CLK_I2C5_ROOT 231
+#define DT_IMX8MP_CLK_I2C6_ROOT 232
+#define DT_IMX8MP_CLK_CAN1_ROOT 233
+#define DT_IMX8MP_CLK_CAN2_ROOT 234
+#define DT_IMX8MP_CLK_SCTR_ROOT 235
+#define DT_IMX8MP_CLK_SDMA1_ROOT 236
+#define DT_IMX8MP_CLK_ENET_QOS_ROOT 237
+#define DT_IMX8MP_CLK_SEC_DEBUG_ROOT 238
+#define DT_IMX8MP_CLK_SEMA1_ROOT 239
+#define DT_IMX8MP_CLK_SEMA2_ROOT 240
+#define DT_IMX8MP_CLK_IRQ_STEER_ROOT 241
+#define DT_IMX8MP_CLK_SIM_ENET_ROOT 242
+#define DT_IMX8MP_CLK_SIM_M_ROOT 243
+#define DT_IMX8MP_CLK_SIM_MAIN_ROOT 244
+#define DT_IMX8MP_CLK_SIM_S_ROOT 245
+#define DT_IMX8MP_CLK_SIM_WAKEUP_ROOT 246
+#define DT_IMX8MP_CLK_GPU2D_ROOT 247
+#define DT_IMX8MP_CLK_GPU3D_ROOT 248
+#define DT_IMX8MP_CLK_SNVS_ROOT 249
+#define DT_IMX8MP_CLK_TRACE_ROOT 250
+#define DT_IMX8MP_CLK_UART1_ROOT 251
+#define DT_IMX8MP_CLK_UART2_ROOT 252
+#define DT_IMX8MP_CLK_UART3_ROOT 253
+#define DT_IMX8MP_CLK_UART4_ROOT 254
+#define DT_IMX8MP_CLK_USB_ROOT 255
+#define DT_IMX8MP_CLK_USB_PHY_ROOT 256
+#define DT_IMX8MP_CLK_USDHC1_ROOT 257
+#define DT_IMX8MP_CLK_USDHC2_ROOT 258
+#define DT_IMX8MP_CLK_WDOG1_ROOT 259
+#define DT_IMX8MP_CLK_WDOG2_ROOT 260
+#define DT_IMX8MP_CLK_WDOG3_ROOT 261
+#define DT_IMX8MP_CLK_VPU_G1_ROOT 262
+#define DT_IMX8MP_CLK_GPU_ROOT 263
+#define DT_IMX8MP_CLK_NOC_WRAPPER_ROOT 264
+#define DT_IMX8MP_CLK_VPU_VC8KE_ROOT 265
+#define DT_IMX8MP_CLK_VPU_G2_ROOT 266
+#define DT_IMX8MP_CLK_NPU_ROOT 267
+#define DT_IMX8MP_CLK_HSIO_ROOT 268
+#define DT_IMX8MP_CLK_MEDIA_APB_ROOT 269
+#define DT_IMX8MP_CLK_MEDIA_AXI_ROOT 270
+#define DT_IMX8MP_CLK_MEDIA_CAM1_PIX_ROOT 271
+#define DT_IMX8MP_CLK_MEDIA_CAM2_PIX_ROOT 272
+#define DT_IMX8MP_CLK_MEDIA_DISP1_PIX_ROOT 273
+#define DT_IMX8MP_CLK_MEDIA_DISP2_PIX_ROOT 274
+#define DT_IMX8MP_CLK_MEDIA_MIPI_PHY1_REF_ROOT 275
+#define DT_IMX8MP_CLK_MEDIA_ISP_ROOT 276
+#define DT_IMX8MP_CLK_USDHC3_ROOT 277
+#define DT_IMX8MP_CLK_HDMI_ROOT 278
+#define DT_IMX8MP_CLK_XTAL_ROOT 279
+#define DT_IMX8MP_CLK_PLL_ROOT 280
+#define DT_IMX8MP_CLK_TSENSOR_ROOT 281
+#define DT_IMX8MP_CLK_VPU_ROOT 282
+#define DT_IMX8MP_CLK_MRPR_ROOT 283
+#define DT_IMX8MP_CLK_AUDIO_ROOT 284
+#define DT_IMX8MP_CLK_DRAM_ALT_ROOT 285
+#define DT_IMX8MP_CLK_DRAM_CORE 286
+
/**
* formula to get specific peripheral clock source
*/
diff --git a/BaseHdr/Board/imx8mp/imx8mp_clk_div.h b/BaseHdr/Board/imx8mp/imx8mp_clk_div.h
new file mode 100644
index 000000000..657f1deef
--- /dev/null
+++ b/BaseHdr/Board/imx8mp/imx8mp_clk_div.h
@@ -0,0 +1,38 @@
+/**
+* @file imx8mp_clk_div.h
+*
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#ifndef __IMX8MP_CLK_DIV_H__
+#define __IMX8MP_CLK_DIV_H__
+
+#include
+
+
+#endif
diff --git a/BaseHdr/Board/imx8mp/imx8mp_clk_gate.h b/BaseHdr/Board/imx8mp/imx8mp_clk_gate.h
new file mode 100644
index 000000000..2f7752d0e
--- /dev/null
+++ b/BaseHdr/Board/imx8mp/imx8mp_clk_gate.h
@@ -0,0 +1,53 @@
+/**
+* @file imx8mp_gate.h
+*
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#ifndef __IMX8MP_CLK_GATE_H__
+#define __IMX8MP_CLK_GATE_H__
+
+#include
+
+typedef struct _imx8mp_gate_ {
+ uint32_t root_id; //defined by the kernel
+ uint64_t base_addr;
+ bool _gate4;
+}_imx8mp_gate_t;
+
+
+/**
+ * @brief imx8mp_gate_init -- initialize gate data registry
+ */
+extern void imx8mp_gate_init();
+
+extern int imx8mp_clk_gate_enable(uint32_t clk_root_id);
+
+extern int imx8mp_clk_gate_disable(uint32_t clk_root_id);
+
+#endif
diff --git a/BaseHdr/Board/imx8mp/imx8mp_gpc.h b/BaseHdr/Board/imx8mp/imx8mp_gpc.h
new file mode 100644
index 000000000..a5c49fd50
--- /dev/null
+++ b/BaseHdr/Board/imx8mp/imx8mp_gpc.h
@@ -0,0 +1,56 @@
+/**
+* @file imx8mp_gpc.h
+*
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#ifndef __IMX8MP_GPC_H__
+#define __IMX8MP_GPC_G__
+
+enum _power_domain_id_ {
+ IMX8MP_POWER_DOMAIN_MIPI_PHY1,
+ IMX8MP_POWER_DOMAIN_PCIE_PHY,
+ IMX8MP_POWER_DOMAIN_USB1_PHY,
+ IMX8MP_POWER_DOMAIN_USB2_PHY,
+ IMX8MP_POWER_DOMAIN_MLMIX,
+ IMX8MP_POWER_DOMAIN_AUDIOMIX,
+ IMX8MP_POWER_DOMAIN_GPU2D,
+ IMX8MP_POWER_DOMAIN_GPUMIX,
+ IMX8MP_POWER_DOMAIN_VPUMIX,
+ IMX8MP_POWER_DOMAIN_GPU3D,
+ IMX8MP_POWER_DOMAIN_MEDIAMIX,
+ IMX8MP_POWER_DOMAIN_VPU_G1,
+ IMX8MP_POWER_DOMAIN_VPU_G2,
+ IMX8MP_POWER_DOMAIN_VPU_VC8000E,
+ IMX8MP_POWER_DOMAIN_HDMIMIX,
+ IMX8MP_POWER_DOMAIN_HDMI_PHY,
+ IMX8MP_POWER_DOMAIN_MIPI_PHY2,
+ IMX8MP_POWER_DOMAIN_HSIOMIX,
+ IMX8MP_POWER_DOMAIN_MEDIAMIX_ISPDWP
+};
+#endif
diff --git a/BaseHdr/Board/imx8mp/imx8mp_pll.h b/BaseHdr/Board/imx8mp/imx8mp_pll.h
new file mode 100644
index 000000000..d197dfbcb
--- /dev/null
+++ b/BaseHdr/Board/imx8mp/imx8mp_pll.h
@@ -0,0 +1,144 @@
+/**
+* @file imx8mp_pll.h
+*
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#ifndef __IMX8MP_PLL_H__
+#define __IMX8MP_PLL_H__
+
+#include
+
+/** This file is all about PLL interface, which is used to
+ * change or modify PLL clock source from CCM module,
+ * by default, values are set according to the suitable environment
+ * so directly PLL can be used on target registers
+ */
+#define __IMX8MP_CCM_BASE__ 0x30360000 //hardcoded from IMX8MP reference PRM, CCM_ANALOG_BASE
+/** GROUP A table **/
+#define __IMX8MP_AUDIO_PLL1_GEN_CTRL __IMX8MP_CCM_BASE__
+#define __IMX8MP_AUDIO_PLL1_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x4)
+#define __IMX8MP_AUDIO_PLL1_FDIV_CTL1 (__IMX8MP_CCM_BASE__ + 0x8)
+#define __IMX8MP_AUDIO_PLL1_SSCG_CTRL (__IMX8MP_CCM_BASE__ + 0xC)
+#define __IMX8MP_AUDIO_PLL1_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x10)
+
+
+#define __IMX8MP_AUDIO_PLL2_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x14)
+#define __IMX8MP_AUDIO_PLL2_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x18)
+#define __IMX8MP_AUDIO_PLL2_FDIV_CTL1 (__IMX8MP_CCM_BASE__ + 0x1C)
+#define __IMX8MP_AUDIO_PLL2_SSCG_CTRL (__IMX8MP_CCM_BASE__ + 0x20)
+#define __IMX8MP_AUDIO_PLL2_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x24)
+
+#define __IMX8MP_VIDEO_PLL1_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x28)
+#define __IMX8MP_VIDEO_PLL1_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x2C)
+#define __IMX8MP_VIDEO_PLL1_FDIV_CTL1 (__IMX8MP_CCM_BASE__ + 0x30)
+#define __IMX8MP_VIDEO_PLL1_SSCG_CTRL (__IMX8MP_CCM_BASE__ + 0x34)
+#define __IMX8MP_VIDEO_PLL1_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x38)
+
+#define __IMX8MP_DRAM_PLL_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x50)
+#define __IMX8MP_DRAM_PLL_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x54)
+#define __IMX8MP_DRAM_PLL_FDIV_CTL1 (__IMX8MP_CCM_BASE__ + 0x58)
+#define __IMX8MP_DRAM_PLL_SSCG_CTRL (__IMX8MP_CCM_BASE__ + 0x5C)
+#define __IMX8MP_DRAM_PLL_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x60)
+
+#define __IMX8MP_GPU_PLL_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x64)
+#define __IMX8MP_GPU_PLL_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x68)
+#define __IMX8MP_GPU_PLL_LOCKD_CTRL (__IMX8MP_CCM_BASE__ + 0x6C)
+#define __IMX8MP_GPU_PLL_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x70)
+
+#define __IMX8MP_VPU_PLL_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x74)
+#define __IMX8MP_VPU_PLL_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x78)
+#define __IMX8MP_VPU_PLL_LOCKD_CTRL (__IMX8MP_CCM_BASE__ + 0x7C)
+#define __IMX8MP_VPU_PLL_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x80)
+
+#define __IMX8MP_ARM_PLL_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x84)
+#define __IMX8MP_ARM_PLL_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x88)
+#define __IMX8MP_ARM_PLL_LOCKD_CTRL (__IMX8MP_CCM_BASE__ + 0x8C)
+#define __IMX8MP_ARM_PLL_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x90)
+
+#define __IMX8MP_SYS_PLL1_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x94)
+#define __IMX8MP_SYS_PLL1_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x98)
+#define __IMX8MP_SYS_PLL1_LOCKD_CTRL (__IMX8MP_CCM_BASE__ + 0x9C)
+#define __IMX8MP_SYS_PLL1_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x100)
+
+#define __IMX8MP_SYS_PLL2_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x104)
+#define __IMX8MP_SYS_PLL2_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x108)
+#define __IMX8MP_SYS_PLL2_LOCKD_CTRL (__IMX8MP_CCM_BASE__ + 0x10C)
+#define __IMX8MP_SYS_PLL2_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x110)
+
+#define __IMX8MP_SYS_PLL3_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x114)
+#define __IMX8MP_SYS_PLL3_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x118)
+#define __IMX8MP_SYS_PLL3_LOCKD_CTRL (__IMX8MP_CCM_BASE__ + 0x11C)
+#define __IMX8MP_SYS_PLL3_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x120)
+
+#define __IMX8MP_OSC_MISC_CFG (__IMX8MP_CCM_BASE__ + 0x124)
+#define __IMX8MP_ANAMIX_PLL_MNIT_CTL (__IMX8MP_CCM_BASE__ + 0X128)
+#define __IMX8MP_CCM_ANALOG_DIGPROG 0x800
+
+
+/** imx8mp uses PLL14xx modern analog hardware ip block **/
+#define IMX8MP_PLL14XX_MDIV_SHIFT 12
+#define IMX8MP_PLL14XX_MDIV_MASK BORDOISILA_GENMASK(21,12)
+#define IMX8MP_PLL14XX_PDIV_SHIFT 4
+#define IMX8MP_PLL14XX_PDIV_MASK BORDOISILA_GENMASK(9,4)
+#define IMX8MP_PLL14XX_SDIV_SHIFT 0
+#define IMX8MP_PLL14XX_SDIV_MASK BORDOISILA_GENMASK(2, 0)
+#define IMX8MP_PLL14XX_KDIV_SHIFT 0
+#define IMX8MP_PLL14XX_KDIV_MASK BORDOISILA_GENMASK(15, 0)
+
+#define LOCK_STATUS BORDOISILA_BIT(31)
+#define LOCK_SEL_MASK BORDOISILA_BIT(29)
+#define CLKE_MASK BORDOISILA_BIT(11)
+#define RST_MASK BORDOISILA_BIT(9)
+#define BYPASS_MASK BORDOISILA_BIT(4)
+
+
+struct imx_pll14xx_rate_table {
+ unsigned int rate;
+ unsigned int pdiv;
+ unsigned int mdiv;
+ unsigned int sdiv;
+ unsigned int kdiv;
+};
+
+
+extern void imx8mp_pll_init();
+
+/**
+ * @brief imx8mp_pll_recalc_rate -- recalculate pll rate
+ * @param pllbase -- pll base source or entry
+ * @param parent_rate -- clock rate, if the target root is high powered
+ * device, it uses osc_24m sel otherwise osc_32k is used for low powered
+ * device
+ */
+extern unsigned long imx8mp_pll_recalc_rate(uint64_t pllbase, unsigned long parent_rate);
+
+
+extern uint32_t imx8mp_pll_get_parent_rate(uint64_t pll_base);
+
+#endif
diff --git a/BaseHdr/Cap/capability.h b/BaseHdr/Cap/capability.h
new file mode 100644
index 000000000..7efc814bb
--- /dev/null
+++ b/BaseHdr/Cap/capability.h
@@ -0,0 +1,71 @@
+#ifndef CAPABILITY_H
+#define CAPABILITY_H
+
+
+
+#include
+#include
+#include
+//#include
+
+
+
+#define CAP_READ (1 << 0)
+#define CAP_WRITE (1 << 1)
+
+#define CAP_EXECUTE (1 << 2)
+#define CAP_SEEK (1 << 3)
+#define CAP_IOCTL (1 << 4)
+
+#define CAP_DUP (1 << 5)
+
+#define CAP_TRANSFER (1 << 6)
+
+#define CAP_RIGHTS_NONE 0
+
+#define CAP_FILE_RIGHTS_MASK (CAP_READ | CAP_WRITE | CAP_SEEK | CAP_IOCTL | CAP_DUP | CAP_TRANSFER)
+
+/* Return codes */
+#define CAP_OK 0
+#define CAP_ERR_INVALID -1
+#define CAP_ERR_PERM -2
+
+#define CAP_OBJ_FILE 1
+
+#define CAP_FLAG_NONE 0
+
+#define CAP_FLAG_NO_INHERIT (1 << 0)
+
+
+
+/* Capability entry */
+typedef struct _au_capability_ {
+
+ void* object;
+
+
+ uint8_t object_type;
+
+
+ CapRights rights;
+
+
+ UID_NUM owner;
+
+
+ uint16_t flags;
+
+
+ unsigned char valid;
+}AuCapability;
+
+extern int BordoisilaCapCreate(void* proc, int fd, void* object, uint8_t type, CapRights rights);
+extern AuCapability* BordoisilaCapLookup(void* proc, int fd);
+extern bool BordoisilaCapCheckRights(void* proc, int fd, CapRights required);
+extern int BordoisilaCapDup(void* proc, int oldfd, int newfd);
+extern int BordoisilaCapRestrict(void* proc, int fd, CapRights new_rights);
+extern void BordoisilaCapDestroy(void* proc, int fd);
+extern void BordoisilaCapCleanupProcess(void* proc);
+extern void BordoisilaCapInheritTable(void* parent, void* child);
+
+#endif
diff --git a/BaseHdr/Drivers/core.h b/BaseHdr/Drivers/core.h
new file mode 100644
index 000000000..6ab8558c8
--- /dev/null
+++ b/BaseHdr/Drivers/core.h
@@ -0,0 +1,134 @@
+/**
+* @file core.h
+*
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#ifndef __CORE_H__
+#define __CORE_H__
+
+#include
+#include
+
+/* core system with all device driver registration
+ * and data structures
+ */
+
+#define BORDOISILA_DRIVER_RES_CLK 0
+#define BORDOISILA_DRIVER_RES_GATE 1
+#define BORDOISILA_DRIVER_RES_POWER 2
+#define BORDOISILA_DRIVER_RES_REGULATOR 3
+#define BORDOISILA_DRIVER_RES_PIN 4
+#define BORDOISILA_DRIVER_RES_BUS 5
+
+#define BORDOISILA_DRIVER_ALREADY_REGISTERED -2
+
+typedef struct _bordoisila_drvcore_res_ {
+ const char* name;
+ uint8_t res_type;
+ void* data;
+ int ref_count;
+ bool is_running;
+ struct _bordoisila_drvcore_res_* next;
+}BordoisilaDriverResource;
+
+#define B_DRIVER_STATE_PROBED 0
+#define B_DRIVER_STATE_FAILED 1
+#define B_DRIVER_STATE_UNBOUND 2
+
+enum driver_type {
+ BORDOISILA_DRIVER_NORMAL,
+ BORDOISILA_DRIVER_BUS_I2C,
+ BORDOISILA_DRIVER_BUS_SPI,
+ BORDOISILA_DRIVER_BUS_USB,
+};
+
+
+typedef struct _bordoisila_driver_ {
+ const char* name;
+ const char* compat; //match list in DT/acpi bindings
+ BordoisilaDriverResource* resources;
+ int num_resource;
+ enum driver_type type;
+
+ /* Ops*/
+ int (*scan)(struct _bordoisila_driver_* dev);
+ int (*probe)(struct _bordoisila_driver_* dev);
+ int (*remove)(struct _bordoisila_driver_* dev);
+ int (*suspend)(struct _bordoisila_driver_* dev);
+ int (*resume)(struct _bordoisila_driver_* dev);
+
+ void* priv;
+ uint8_t driver_state;
+ int refcount;
+ struct _bordoisila_driver_* parent;
+ struct _bordoisila_driver_* next;
+}BordoisilaDriver;
+
+
+/**
+ * @brief BordoisilaDriverRegister -- register a driver
+ * to core registry
+ */
+AU_EXTERN AU_EXPORT int BordoisilaDriverRegister(BordoisilaDriver* driver);
+
+/**
+ * @brief BordoisilaGetDriverByCompat -- match a driver by its
+ * compat string
+ * @param compat -- compatibility string, matches to DT/ACPI bindings
+ */
+AU_EXTERN AU_EXPORT BordoisilaDriver* BordoisilaGetDriverByCompat(char* compat);
+
+/**
+ * @brief BordoisilaGetDriverByName -- match a driver by its name
+ * @param name - name of the driver
+ */
+AU_EXTERN AU_EXPORT BordoisilaDriver* BordoisilaGetDriverByName(char* name);
+
+/**
+ * @brief BordoisilaDriverProbeAll -- start probing all driver registered
+ */
+extern void BordoisilaDriverProbeAll();
+
+/**
+ * @brief BordoisilaDriverScan -- scan a bus, only applicable
+ * if the driver is a bus
+ * @param driver -- pointer to driver
+ */
+AU_EXTERN AU_EXPORT int BordoisilaDriverScan(BordoisilaDriver* driver);
+
+AU_EXTERN AU_EXPORT int BordoisilaDriverProbe(BordoisilaDriver* driver);
+
+AU_EXTERN AU_EXPORT int BordoisilaDriverRemove(BordoisilaDriver* driver);
+
+AU_EXTERN AU_EXPORT int BordoisilaDriverSuspend(BordoisilaDriver* driver);
+
+AU_EXTERN AU_EXPORT int BordoisilaDriverResume(BordoisilaDriver* driver);
+
+
+#endif
diff --git a/BaseHdr/Drivers/res.h b/BaseHdr/Drivers/res.h
new file mode 100644
index 000000000..d2e24685b
--- /dev/null
+++ b/BaseHdr/Drivers/res.h
@@ -0,0 +1,85 @@
+/**
+* @file res.h
+*
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#ifndef __RESOURCE_H__
+#define __RESOURCE_H__
+
+#include
+#include
+#include
+
+
+typedef struct _clk_ {
+ BordoisilaDriverResource res;
+ uint64_t rate_hz;
+
+ int (*enable)(struct _clk_* clk);
+ int (*disable)(struct _clk_* clk);
+ int (*set_rate)(struct _clk_* clk);
+ uint64_t(*get_rate)(struct _clk_* clk);
+}BordoisilaClk;
+
+
+typedef struct _regulator_ {
+ BordoisilaDriverResource res;
+
+ uint32_t microvoltz;
+ int (*enable)(struct _regulator_* reg);
+ int (*disable)(struct _regulator_* r);
+ int (*set_volt)(struct _regulator_* r, uint32_t mv);
+ int (*get_volt)(struct _regulator_* r);
+}BordoisilaRegulator;
+
+
+typedef struct _pmdomain_ {
+ BordoisilaDriverResource res;
+ int (*power_on)(struct _pmdomain_* pmd);
+ int (*power_down)(struct _pmdomain_* pmd);
+ BordoisilaClk* clk[100];
+ BordoisilaRegulator* regulators[100];
+};
+
+
+/**
+ * @brief BordoisilaDriverResourceRegister -- register a resource driver
+ * @param res_ -- pointer to resource driver struct
+ */
+AU_EXTERN AU_EXPORT int BordoisilaDriverResourceRegister(BordoisilaDriverResource* res_);
+
+/**
+ * @brief BordoisilaGetDriverResource -- get a driver resource from global resource
+ * list
+ * @param name -- resource name coresponding to DT/ACPI name
+ * @param type -- type of the resource
+ */
+AU_EXTERN AU_EXPORT BordoisilaDriverResource* BordoisilaGetDriverResource(const char* name, uint8_t type);
+
+#endif
\ No newline at end of file
diff --git a/BaseHdr/Drivers/uart.h b/BaseHdr/Drivers/uart.h
index 1f3309429..5453ed4d5 100644
--- a/BaseHdr/Drivers/uart.h
+++ b/BaseHdr/Drivers/uart.h
@@ -30,6 +30,11 @@
#ifndef __UART_H__
#define __UART_H__
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
#include
#include
#include
diff --git a/BaseHdr/Drivers/virtio.h b/BaseHdr/Drivers/virtio.h
index 2df7f642a..565330743 100644
--- a/BaseHdr/Drivers/virtio.h
+++ b/BaseHdr/Drivers/virtio.h
@@ -126,6 +126,7 @@ typedef struct _virtio_net_hdr_ {
uint16_t gso_size;
uint16_t csum_start;
uint16_t csum_offset;
+ uint16_t padding;
}virtio_net_hdr_t;
diff --git a/BaseHdr/Fs/Ext2/ext2.h b/BaseHdr/Fs/Ext2/ext2.h
index cfbd86c91..91587c68b 100644
--- a/BaseHdr/Fs/Ext2/ext2.h
+++ b/BaseHdr/Fs/Ext2/ext2.h
@@ -213,4 +213,10 @@ typedef struct _ext2_fs_ {
*/
AuVFSNode* Ext2Initialise(AuVDisk* vdisk, char* mountname);
+uint32_t Ext2ReadBlockIndex(Ext2Fs* fs, uint32_t block_id, uint32_t index);
+
+uint32_t Ext2FindEntry(Ext2Fs* fs, Ext2Inode* dir_inode, const char* name);
+
+AuVFSNode* Ext2Open(AuVFSNode* fsys, char* path);
+
#endif
\ No newline at end of file
diff --git a/BaseHdr/Fs/Ext2/ext2dir.h b/BaseHdr/Fs/Ext2/ext2dir.h
new file mode 100644
index 000000000..455cf0b3a
--- /dev/null
+++ b/BaseHdr/Fs/Ext2/ext2dir.h
@@ -0,0 +1,4 @@
+#include
+#include
+
+AuVFSNode* Ext2CreateDir(AuVFSNode* parent, char* name);
\ No newline at end of file
diff --git a/BaseHdr/Fs/Ext2/ext2file.h b/BaseHdr/Fs/Ext2/ext2file.h
new file mode 100644
index 000000000..f9a55f2b7
--- /dev/null
+++ b/BaseHdr/Fs/Ext2/ext2file.h
@@ -0,0 +1,12 @@
+#include
+#include
+
+size_t Ext2Write(AuVFSNode* node, AuVFSNode* file, uint64_t* buffer, uint32_t length);
+
+void Ext2FlushSuperblock(Ext2Fs* fs);
+
+void Ext2FlushBgdt(Ext2Fs* fs);
+
+uint32_t Ext2AllocBlock(Ext2Fs* fs);
+
+int Ext2InodeWrite(Ext2Fs* fs, uint32_t inode_num, Ext2Inode* inode);
\ No newline at end of file
diff --git a/BaseHdr/Fs/vfs.h b/BaseHdr/Fs/vfs.h
index 900dc2404..8ee179661 100644
--- a/BaseHdr/Fs/vfs.h
+++ b/BaseHdr/Fs/vfs.h
@@ -101,7 +101,7 @@ typedef struct __VFS_NODE__ {
uint8_t eof;
uint32_t pos;
uint32_t parent_block;
- uint64_t first_block;
+ uint32_t first_block;
uint64_t current;
uint16_t flags;
uint8_t status;
diff --git a/BaseHdr/Hal/AA64/aa64cpu.h b/BaseHdr/Hal/AA64/aa64cpu.h
index 85f915b88..32c995172 100644
--- a/BaseHdr/Hal/AA64/aa64cpu.h
+++ b/BaseHdr/Hal/AA64/aa64cpu.h
@@ -34,6 +34,7 @@
#include
#include
+#include
#define CPU_IMPLEMENTER_ARM 0x41
#define CPU_IMPLEMENTER_BROADCOM 0x42
@@ -112,4 +113,13 @@ AU_EXTERN AU_EXPORT void AA64SleepMS(uint32_t ms);
* @param regs -- Register information passed by sync_exception
*/
extern void AuAA64SyscallHandler(AA64Registers* regs);
+
+/**
+ * @brief aa64_calculate_ticks -- calculate the number of ticks from given milliseconds
+ * @param seconds -- amount of seconds
+ * @param out_milliseconds -- where to store the number of ticks
+ */
+extern void aa64_calculate_ticks(uint64_t seconds, uint64_t subsec, uint64_t* out_seconds, uint64_t* out_subsec);
+
+extern uint64_t AA64CPUGetFreqencyHz();
#endif
diff --git a/BaseHdr/Hal/AA64/aa64lowlevel.h b/BaseHdr/Hal/AA64/aa64lowlevel.h
index f292897c4..c9ec4d891 100644
--- a/BaseHdr/Hal/AA64/aa64lowlevel.h
+++ b/BaseHdr/Hal/AA64/aa64lowlevel.h
@@ -140,6 +140,7 @@ extern void set_cntp_ctl_el0(uint64_t val);
extern void setupTimerIRQ();
extern void suspendTimer();
+extern void resetTimer();
extern uint64_t readTimerCtl();
extern uint64_t read_spsr_el1();
diff --git a/BaseHdr/Hal/AA64/sched.h b/BaseHdr/Hal/AA64/sched.h
index b4b3690e8..8288001b4 100644
--- a/BaseHdr/Hal/AA64/sched.h
+++ b/BaseHdr/Hal/AA64/sched.h
@@ -41,6 +41,9 @@
#define THREAD_STATE_BLOCKED 3
#define THREAD_STATE_SLEEP 4
#define THREAD_STATE_KILLABLE 5
+#define THREAD_STATE_LEFT_IN_KERNEL 6
+#define THREAD_STATE_PENDING_SIGNAL 7
+#define THREAD_STATE_RUNNING 8
//! Thread levels =========================================================
//! THREAD_LEVEL_KERNEL -- This bit is set when the thread given is kernel mode
@@ -59,13 +62,30 @@ typedef struct _uentry_ {
uint64_t cs;
uint64_t ss;
int num_args;
- uint64_t argvaddr;
+ uint64_t argvaddr; /* user-space VA of argv[] page (for crt0 via stack) */
+ uint64_t argvkernel; /* kernel-space VA of argv[] page (for EL1 writes) */
char** argvs;
uint64_t stackBase;
}AuUserEntry;
//#pragma pack(pop)
+#define MAX_SIGNAL_ENTRY 10
+
+
+typedef struct _gp_context_ {
+ uint64_t x[31];
+ uint64_t sp_el0;
+ uint64_t elr_el1;
+ uint64_t spsr_el1;
+}_gp_context_t;
+
+typedef struct _signal_frame_ {
+ AA64Registers regs;
+ uint64_t elr_el1;
+ uint64_t sigret_address;
+}_signal_frame_t;
+
//#pragma pack(push,1)
typedef struct _aa64_task_ {
@@ -110,10 +130,15 @@ typedef struct _aa64_task_ {
uint64_t fpcr;
uint64_t fpsr;
uint32_t syscallNum;
+ uint64_t sig_pending;
+ _signal_frame_t signal;
+ uint64_t start_time_us;
+ uint64_t* sigs[21];
struct _aa64_task_* next;
struct _aa64_task_* prev;
}AA64Thread;
+
//#pragma pack(pop)
extern void AuSchedulerInitialize();
extern uint64_t AuCreateKernelStack(uint64_t* pml);
@@ -127,7 +152,9 @@ AU_EXTERN AU_EXPORT AA64Thread* AuCreateKthread(void(*entry) (uint64_t),uint64_t
* @return Pointer to newly created thread
*/
AU_EXTERN AU_EXPORT AA64Thread* AuCreateSubKthread(void(*entry) (uint64_t), uint64_t stack, uint64_t* pml, char* name);
+
extern void AuScheduleThread(AA64Registers*regs);
+extern void AuScheduleNext();
extern void AuSchedulerStart();
extern AA64Thread* AuGetIdleThread();
extern AA64Thread* AuGetCurrentThread();
@@ -190,6 +217,19 @@ extern void AuThreadCleanTrash(AA64Thread* t);
*/
extern uint64_t AuGetSystemTimerTick();
+/**
+ * @brief AuHandleSleepThreads -- handle sleep thread,
+ * rearrange all sleep threads
+ */
+extern void AuHandleSleepThreads();
+
+/**
+ * @brief AuThreadMakeReady -- make a thread forcefully
+ * ready for next
+ * @param thread -- pointer to thread struct
+ */
+extern void AuThreadMakeReady(AA64Thread* thread);
+
#endif
#endif
\ No newline at end of file
diff --git a/BaseHdr/Hal/basicacpi.h b/BaseHdr/Hal/basicacpi.h
index 86e4cb625..1631ccac7 100644
--- a/BaseHdr/Hal/basicacpi.h
+++ b/BaseHdr/Hal/basicacpi.h
@@ -32,6 +32,11 @@
#include
#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
//APIC structure types
#define ACPI_APICTYPE_LAPIC 0
diff --git a/BaseHdr/Hal/x86_64_gdt.h b/BaseHdr/Hal/x86_64_gdt.h
index fbf797a32..cfef95060 100644
--- a/BaseHdr/Hal/x86_64_gdt.h
+++ b/BaseHdr/Hal/x86_64_gdt.h
@@ -31,7 +31,7 @@
#define __X86_64_GDT_H__
#include
-
+#include
#define GDT_ENTRY_NULL 0
#define GDT_ENTRY_KERNEL_CODE 1
diff --git a/BaseHdr/Ipc/postbox.h b/BaseHdr/Ipc/postbox.h
index 20bfbc7f1..4b9b02fab 100644
--- a/BaseHdr/Ipc/postbox.h
+++ b/BaseHdr/Ipc/postbox.h
@@ -33,6 +33,11 @@
#define __POSTBOX_H__
#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
#ifdef ARCH_X64
#include
#elif ARCH_ARM64
diff --git a/BaseHdr/Log/_print.h b/BaseHdr/Log/_print.h
new file mode 100644
index 000000000..7d2e6c54a
--- /dev/null
+++ b/BaseHdr/Log/_print.h
@@ -0,0 +1,50 @@
+/**
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#ifndef __PRINT_H__
+#define __PRINT_H__
+
+#include
+
+/**
+ * @brief _xeprint -- copied from XEClib implementation
+ * @param output -- pointer to memory buffer, where to put formatted
+ * string
+ * @param outputLen -- output len
+ * @param format -- formatted string
+ * @param list -- pointer to variable argument list
+ */
+extern int _xeprint(char* output, int outputlen, const char* format, va_list list);
+
+extern int _vsnprintf(char* output, size_t sz, const char* format, va_list ap);
+
+extern int _sprintf(char* output, const char* format, ...);
+
+extern int _snprintf(char* output, size_t sz, const char* format, ...);
+#endif
\ No newline at end of file
diff --git a/BaseHdr/Log/klog.h b/BaseHdr/Log/klog.h
new file mode 100644
index 000000000..9c446503b
--- /dev/null
+++ b/BaseHdr/Log/klog.h
@@ -0,0 +1,62 @@
+/**
+* BSD 2-Clause License
+*
+* Copyright (c) 2023-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#ifndef __KERNEL_LOG_H__
+#define __KERNEL_LOG_H__
+
+#include
+#include
+
+#define BORDOISILA_DEBUG_LEVEL_COUNT 5
+/**
+ * Loggin level of bordoisila
+ */
+typedef enum {
+ BORDOISILA_EMERG = 0,
+ BORDOISILA_ERROR,
+ BORDOISILA_WARN,
+ BORDOISILA_INFO,
+ BORDOISILA_DEBUG,
+}BLogLevel;
+
+typedef void (*BLogSinkFunc)(const char* data, uint32_t len, void* ctx);
+
+/**
+ * @brief B_KLogInit -- initialize bordoisila
+ * logging system
+ */
+extern void B_KLogInit();
+/**
+ * @brief BPrintK -- print formatted string to circular buffer
+ * @param level -- logging level
+ * @param fmt -- formatted string
+ */
+AU_EXTERN AU_EXPORT void BPrintK(BLogLevel level, const char* fmt, ...);
+
+#endif
diff --git a/BaseHdr/Mm/kmalloc.h b/BaseHdr/Mm/kmalloc.h
index a1d49b37a..d903e17b2 100644
--- a/BaseHdr/Mm/kmalloc.h
+++ b/BaseHdr/Mm/kmalloc.h
@@ -31,6 +31,11 @@
#define _KMALLOC_H
#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
#include
diff --git a/BaseHdr/Mm/vmmngr.h b/BaseHdr/Mm/vmmngr.h
index 6ab58bdd6..bc343c05f 100644
--- a/BaseHdr/Mm/vmmngr.h
+++ b/BaseHdr/Mm/vmmngr.h
@@ -40,6 +40,11 @@
*/
#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
#include
#ifdef ARCH_X64
diff --git a/BaseHdr/Net/udp.h b/BaseHdr/Net/udp.h
index 7f515c4c1..dcd9c4d95 100644
--- a/BaseHdr/Net/udp.h
+++ b/BaseHdr/Net/udp.h
@@ -63,4 +63,6 @@ extern void UDPProtocolInstall();
*/
extern list_t* UDPProtocolGetSockList();
+extern void UDPHandlePacket(char* packet);
+
#endif
\ No newline at end of file
diff --git a/BaseHdr/Serv/sysserv.h b/BaseHdr/Serv/sysserv.h
index 081b98c2c..67af9b304 100644
--- a/BaseHdr/Serv/sysserv.h
+++ b/BaseHdr/Serv/sysserv.h
@@ -32,10 +32,12 @@
#include
#include
+#include
#include
#ifdef ARCH_ARM64
#include
+#include
#endif
#ifdef ARCH_X64
@@ -44,7 +46,7 @@
#include
/* maximum supported system calls */
-#define AURORA_MAX_SYSCALL 58
+//#define AURORA_MAX_SYSCALL 58
#define AURORA_SYSCALL_MAGIC 0x15062023
/* ==========================================
@@ -122,6 +124,13 @@ extern void SignalReturn(int num);
* @param handler -- handler to register
*/
extern int SetSignal(int signo, AuSigHandler handler);
+#elif ARCH_ARM64
+/*
+* SetSignal -- register a signal handler
+* @param signo -- signal number
+* @param handler -- handler to register
+*/
+extern int SetSignal(int signo, AuSignalHandler handler);
#endif
/**
* @brief CreateSharedMem -- create a shared memory chunk
@@ -292,6 +301,7 @@ extern int StopTimer(int threadID);
*/
extern int DestroyTimer(int threadID);
+
/**
* @brief ProcessGetFileDesc -- Searches all process file
* descriptor entries for
@@ -333,6 +343,16 @@ extern int NetListen(int sockfd, int backlog);
*/
extern size_t GetEnvironmenBlock();
+/**
+ * @brief Alarm -- schedules a timer for next one-shot
+ * @param seconds -- amount of second to consider
+ */
+extern int Alarm(uint64_t seconds);
+
+extern int SetITimer(int which, const itimerval_t* new_value, itimerval_t* old_value);
+
+extern int GetITimer(int which, const itimerval_t* curr_value);
+
#ifdef ARCH_ARM64
extern AA64Registers* AA64GetCurrentRegCtx();
#endif
diff --git a/BaseHdr/aucon.h b/BaseHdr/aucon.h
index ede1e6267..74de1b5e1 100644
--- a/BaseHdr/aucon.h
+++ b/BaseHdr/aucon.h
@@ -31,6 +31,11 @@
#define __AU_CONSOLE_H__
#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
#define SCREEN_SETMODE 200
#define SCREEN_GETWIDTH 201
@@ -67,6 +72,19 @@ extern void AuConsoleInitialize(PKERNEL_BOOT_INFO info, bool early);
*/
extern void AuConsolePostInitialise(PKERNEL_BOOT_INFO info);
+
+/**
+ * @brief Prints string to console output
+ * @param str -- string to print
+ */
+extern void AuPutS(char* str);
+
+/**
+ * @brief Prints string to console output
+ * @param str -- string to print
+ * @param col -- foreground color
+ */
+extern void AuPutS_Color(char* str, uint32_t color);
/*
* AuTextOut -- standard text printing function
* for entire kernel
diff --git a/BaseHdr/audrv.h b/BaseHdr/audrv.h
index 1b9b2d262..369dadf5e 100644
--- a/BaseHdr/audrv.h
+++ b/BaseHdr/audrv.h
@@ -31,6 +31,11 @@
#define __AU_DRV_H__
#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
#ifdef ARCH_X64
#include
#include
diff --git a/BaseHdr/aurora.h b/BaseHdr/aurora.h
index 509293f4e..9a323cd01 100644
--- a/BaseHdr/aurora.h
+++ b/BaseHdr/aurora.h
@@ -30,7 +30,6 @@
#ifndef __AURORA_H__
#define __AURORA_H__
-
#include
@@ -56,6 +55,7 @@
#define AU_EXTERN extern
#endif
+typedef uint32_t CapRights;
#ifdef ARCH_X64
#define KERNEL_STACK_LOCATION 0xFFFFFB0000000000
@@ -65,6 +65,17 @@
#define KERNEL_STACK_SIZE 40960//16384 //16KiB
+// macro for llvm compatibility
+#ifndef ALIGNED
+#if defined(_MSC_VER)
+ #define ALIGNED(x) __declspec(align(x))
+#elif defined(__GNUC__) || defined(__clang__)
+ #define ALIGNED(x) __attribute__((aligned(x)))
+#else
+ #define ALIGNED(x)
+#endif
+#endif
+
typedef struct _lbprotocol_ {
uint64_t initrd_start;
diff --git a/BaseHdr/bordoisila_bits.h b/BaseHdr/bordoisila_bits.h
new file mode 100644
index 000000000..1b92441f9
--- /dev/null
+++ b/BaseHdr/bordoisila_bits.h
@@ -0,0 +1,61 @@
+/**
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#ifndef __BORDOISILA_BITS_H__
+#define __BORDOISILA_BITS_H__
+
+#include
+
+#define BITS_PER_BYTE 8
+#define BITS_PER_LONG (sizeof(long) * BITS_PER_BYTE)
+
+#define BORDOISILA_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
+#define BITS_TO_LONGS(nr) BORDOISILA_DIV_ROUND_UP(nr, BITS_PER_LONG)
+#define BORDOISILA_BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE)
+
+
+#define BORDOISILA_BIT(nr) (1UL << (nr))
+#define BORDOISILA_GENMASK(h, l) (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h))))
+
+static inline int __bf_shf(uint32_t mask) {
+ if (mask == 0) return 0;
+ int shift = 0;
+ while ((mask & 1) == 0) {
+ mask >>= 1;
+ shift++;
+ }
+ return shift;
+}
+
+#define BORDOISILA_GET_FIELD(_mask, _reg) (((_reg) & (_mask)) >> __bf_shf(_mask))
+
+#define BORDOISILA_PREP_FIELD(_mask, _val) \
+ (((_val) << __bf_shf(_mask)) & (_mask))
+
+#endif
\ No newline at end of file
diff --git a/BaseHdr/bordoisila_io.h b/BaseHdr/bordoisila_io.h
new file mode 100644
index 000000000..db814857b
--- /dev/null
+++ b/BaseHdr/bordoisila_io.h
@@ -0,0 +1,113 @@
+/**
+* @file bordoisila_io.h
+*
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#ifndef __BORDOISILA_IO_H__
+#define __BORDOISILA_IO_H__
+
+#include
+#include
+#include
+#include
+
+#define _bordoisila_readb(addr) (*(volatile uint8_t*)(addr))
+#define _bordoisila_writeb(val, addr) \
+ (*(volatile uint8_t*)(addr) = (val));\
+ dsb_sy_barrier(); \
+ dsb_ish();\
+ isb_flush();
+
+#define _bordoisila_readw(addr) (*(volatile uint16_t*)(addr))
+#define _bordoisila_writew(addr) \
+ (*(volatile uint16_t*)(addr) = (val));\
+ dsb_sy_barrier(); \
+ dsb_ish();\
+ isb_flush();
+
+#define _bordoisila_readl(addr) (*(volatile uint32_t*)(addr))
+#define _bordoisila_writel(val,addr) (*(volatile uint32_t*)(addr) = (val));\
+ dsb_sy_barrier(); \
+ dsb_ish();\
+ isb_flush();
+
+
+static inline int _bordoisila_readl_poll_timeout(uintptr_t addr, uint32_t* val,
+ uint32_t sleep_us, uint32_t timeout_us) {
+ uint32_t elapsed = 0;
+ volatile uint32_t* reg = (volatile uint32_t*)addr;
+ for (;;) {
+ *val = *reg;
+ if (timeout_us && elapsed >= timeout_us) {
+ return -1;
+ }
+
+ if (sleep_us) {
+ AuAA64BoardSleepUS(sleep_us);
+ elapsed += sleep_us;
+ }
+ else {
+ elapsed++;
+ }
+ }
+}
+
+static inline void _bordoisila_update_bits(uintptr_t addr, uint32_t mask, uint32_t val) {
+ uint32_t current_val = *(volatile uint32_t*)addr;
+ current_val &= ~mask;
+ current_val |= (val & mask);
+ *(volatile uint32_t*)addr = current_val;
+}
+
+
+#define _bordoisila_read_poll_timeout(addr, val, cond, sleep_us, timeout_us) ({\
+ uint32_t __timeout_us = (timeout_us);\
+ uint32_t __elapsed_us = 0; \
+ int __ret = 0; \
+ while(1){ \
+ (val) = *(volatile uint32_t*)(addr);\
+ if (cond)\
+ break;\
+ if (__elapsed_us >= __timeout_us) {\
+ __ret = -1; \
+ break;\
+ } \
+ if (sleep_us) { \
+ AuAA64BoardSleepUS(sleep_us); \
+ __elapsed_us += (sleep_us); \
+ }else {\
+ __elapsed_us++; \
+ }\
+ }\
+ __ret; \
+})
+
+
+
+#endif
diff --git a/BaseHdr/circbuf.h b/BaseHdr/circbuf.h
index 4fb5caf27..6d1684e37 100644
--- a/BaseHdr/circbuf.h
+++ b/BaseHdr/circbuf.h
@@ -32,7 +32,7 @@
#include
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__clang__)
#include
#ifndef __cplusplus
#include
diff --git a/BaseHdr/dtb.h b/BaseHdr/dtb.h
index 2d3683d36..18ac3c704 100644
--- a/BaseHdr/dtb.h
+++ b/BaseHdr/dtb.h
@@ -114,6 +114,13 @@ AU_EXTERN AU_EXPORT uint64_t AuDeviceTreeGetRegAddress(uint32_t* node, uint32_t
* @param sizeCell -- value of size cell
*/
AU_EXTERN AU_EXPORT uint64_t AuDeviceTreeGetRegSize(uint32_t* node, uint32_t addressCell, uint32_t sizeCell);
+
+AU_EXTERN AU_EXPORT uint32_t AuDeviceTreeGetU32Property(uint32_t* node, const char* property, uint32_t default_val);
+
+AU_EXTERN AU_EXPORT uint32_t* AuDeviceTreeGetPropCells(uint32_t* node, const char* property, uint32_t* out_num_cells);
+
+extern void AuDeviceTreeDumpAll();
+extern void AuDeviceTreeDumpAllProps(const char* node_name);
/**
* @brief AuDeviceTreeInitialize -- initialize the device tree
* @param fdt_address -- device tree address passed by
diff --git a/BaseHdr/pcie.h b/BaseHdr/pcie.h
index f98e2c6cb..05cf4aa2e 100644
--- a/BaseHdr/pcie.h
+++ b/BaseHdr/pcie.h
@@ -33,6 +33,11 @@
#include
#include
#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
#define PCI_VENDOR_ID 0x00
diff --git a/BaseHdr/pe.h b/BaseHdr/pe.h
index 10f000efb..e7cc5577d 100644
--- a/BaseHdr/pe.h
+++ b/BaseHdr/pe.h
@@ -32,8 +32,7 @@
#include
-
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__clang__)
#ifndef __cplusplus
#include
#endif
diff --git a/BaseHdr/process.h b/BaseHdr/process.h
index f6f08b5b1..7dce1a414 100644
--- a/BaseHdr/process.h
+++ b/BaseHdr/process.h
@@ -30,11 +30,16 @@
#ifndef __PROCESS_H__
#define __PROCESS_H__
-
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
#include
#include
#include
#include
+#include
#ifdef ARCH_ARM64
#include
@@ -100,6 +105,21 @@ typedef struct _au_proc_cred_ {
uint16_t num_sgid;
}AuProcCredentials;
+/**
+ * _sys_proc_list -- a way to report current status
+ * of information about all processes
+ */
+typedef struct _sys_proc_list_ {
+ int proc_id;
+ char name[16];
+ uint64_t total_runtime_us;
+ uint64_t window_runtime_us;
+ uint32_t num_threads;
+ uint32_t num_file_opened;
+ uint32_t cpu_usage;
+}AuProcessList;
+
+
//#pragma pack(push,1)
typedef struct _au_proc_ {
char name[16];
@@ -115,7 +135,11 @@ typedef struct _au_proc_ {
size_t _user_stack_index_;
size_t _kstack_index_;
uint64_t _envp_block_;
-
+ uint64_t total_runtime_us;
+ uint64_t window_runtime_us;
+ uint32_t cpu_usage;
+ uint64_t prev_sample_runtime_us;
+ uint64_t prev_sample_time_us;
#ifdef ARCH_X64
/* threading section */
AuThread* main_thread;
@@ -134,6 +158,8 @@ typedef struct _au_proc_ {
/* file descriptors */
AuVFSNode* fds[FILE_DESC_PER_PROCESS];
+ /* capability table -- parallel to fds[]*/
+ AuCapability caps[FILE_DESC_PER_PROCESS];
/*loader related data*/
AuVFSNode *file;
AuVFSNode *fsys;
@@ -279,7 +305,7 @@ extern int AuProcessGetFileDesc(AuProcess* proc);
* @param pid -- pid of the process, if -1 then any child
* process
*/
-extern void AuProcessWaitForTermination(AuProcess *proc, int pid);
+extern int AuProcessWaitForTermination(AuProcess *proc, int pid);
#ifdef ARCH_X64
extern AuMutex* AuProcessGetMutex();
@@ -311,4 +337,18 @@ extern uint64_t* CreateSubUserStack(AuProcess* proc, uint64_t* cr3);
*/
extern int AuCreateUserthread(AuProcess* proc, void(*entry) (), char *name);
+/**
+ * @brief AuProcGetNumProcessCount -- returns the total number
+ * of process created
+ */
+extern int AuProcGetNumProcessCount();
+
+/**
+ * @brief AuProcessFetch -- fetch current process table
+ * status
+ * @param list -- Pointer to AuProcessList
+ * @param num_proc_count -- number of process count
+ */
+extern int AuProcessFetch(AuProcessList* list, int num_proc_count);
+
#endif
\ No newline at end of file
diff --git a/BaseHdr/signal.h b/BaseHdr/signal.h
new file mode 100644
index 000000000..4f0ad59f9
--- /dev/null
+++ b/BaseHdr/signal.h
@@ -0,0 +1,95 @@
+/**
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#ifndef __SIGNAL_H__
+#define __SIGNAL_H__
+
+#include
+#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
+
+typedef enum _signal_num_ {
+ SIGHUP = 1, /* Terminal closed or hangup*/
+ SIGINT, /* Interrupt (CTRL+C) */
+ SIGQUIT, /* Quit (CTRL+), generate core dump */
+ SIGILL, /* Illegal instruction*/
+ SIGTRAP, /* Breakpoint or trace trap */
+ SIGABRT, /* Abort a process */
+ SIGBUS, /* Bus error */
+ SIGFPE, /* Floating-point exception */
+ SIGKILL, /* Forcefully terminate */
+ SIGUSR1, /* User-defined signal 1*/
+ SIGSEGV, /* Invalid memory access (segmentation fault) */
+ SIGUSR2, /* user-defined signal 2*/
+ SIGPIPE, /* Write to a broken pipe */
+ SIGALRM, /* Alarm timer expired */
+ SIGTERM, /* Graceful termination request */
+ SIGCHLD = 17, /*Child process stopped or exited */
+ SIGCONT, /* Continue a stopped process */
+ SIGSTOP, /* Stop process */
+ SIGTSTP, /* Terminal stop */
+ SIGTTIN, /* Background process attempted terminal input */
+ SIGTTOU, /* Background process attempted terminal output */
+}AuSignalNumber;
+
+typedef void(*AuSignalHandler)(int signum);
+/**
+ * @brief AuAllocSignal -- allocate a signal onto the
+ * signal queue of thread
+ * @param thread -- Pointer to destination thread
+ * @param sigNum -- signal number
+ */
+extern int AuAllocSignal(AA64Thread* thread, int sigNum);
+
+
+/**
+ * @brief AuSignalDeliver -- deliver the current thread's
+ * signal
+ * @param current_thread -- pointer to thread
+ */
+extern bool AuSignalDeliver(AA64Thread* current_thread);
+
+/**
+ * @brief AuSignalDispatch -- dispatch a signal
+ * @param thr -- pointer to thread
+ */
+extern int AuSignalDispatch(AA64Thread* thr);
+
+/**
+ * @brief AuSignalInitializeTrampoline -- installs
+ * return trampoline code to threads sig return address
+ * @param t -- pointer to thread struct
+ */
+extern void AuSignalInitializeTrampoline(AA64Thread* t);
+
+#endif
diff --git a/BaseHdr/stack.h b/BaseHdr/stack.h
index ef292263b..710dec007 100644
--- a/BaseHdr/stack.h
+++ b/BaseHdr/stack.h
@@ -40,6 +40,7 @@ typedef struct _stack_item_ {
typedef struct _stack_{
AuStackItem* top;
+ AuStackItem* bottom;
int itemCount;
}AuStack;
diff --git a/BaseHdr/stdarg.h b/BaseHdr/stdarg.h
index c7766635b..167dd9aa4 100644
--- a/BaseHdr/stdarg.h
+++ b/BaseHdr/stdarg.h
@@ -38,8 +38,12 @@ extern "C"
#endif
+#ifdef __GNUC__
+ typedef __builtin_va_list va_list;
+#else
/* va list parameter list */
typedef unsigned char* va_list;
+#endif
/* width of stack == width of int */
@@ -51,7 +55,7 @@ extern "C"
((sizeof(TYPE)+sizeof(STACKITEM)-1) \
& ~(sizeof(STACKITEM)-1))
-#ifdef ARCH_X64
+#if defined(ARCH_X64) || defined(__x86_64__)
/* &(LASTARG) points to the LEFTMOST argument of the function call
(before the ...) */
#define va_start(AP, LASTARG) \
@@ -62,7 +66,12 @@ extern "C"
#define va_arg(AP, TYPE) \
(AP += VA_SIZE(TYPE), *((TYPE *)(AP - VA_SIZE(TYPE))))
-#elif ARCH_ARM64
+#elif defined(ARCH_ARM64) || defined(__aarch64__)
+#ifdef __GNUC__
+#define va_start(ap, last) __builtin_va_start(ap, last)
+#define va_arg(ap, type) __builtin_va_arg(ap, type)
+#define va_end(ap) __builtin_va_end(ap)
+#else
#define va_start(ap,last) \
((ap) = (va_list)(&(last)) + 8)
@@ -72,6 +81,7 @@ extern "C"
#define va_end(ap) \
((ap) = (va_list)0)
#endif
+#endif
#ifdef __cplusplus
}
diff --git a/BaseHdr/stdbool.h b/BaseHdr/stdbool.h
new file mode 100644
index 000000000..b95f73f73
--- /dev/null
+++ b/BaseHdr/stdbool.h
@@ -0,0 +1,43 @@
+/**
+* BSD 2-Clause License
+*
+* Copyright (c) 2023-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#ifndef __STDBOOL_H__
+#define __STDBOOL_H__
+
+#ifndef __cplusplus
+
+#define bool _Bool
+#define true 1
+#define false 0
+
+#endif
+
+#define __bool_true_false_are_defined 1
+
+#endif
\ No newline at end of file
diff --git a/BaseHdr/stddef.h b/BaseHdr/stddef.h
new file mode 100644
index 000000000..9d1058e94
--- /dev/null
+++ b/BaseHdr/stddef.h
@@ -0,0 +1,44 @@
+/**
+* BSD 2-Clause License
+*
+* Copyright (c) 2023-2025, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#ifndef __STDDEF_H__
+#define __STDDEF_H__
+
+#include <_null.h>
+#include
+
+
+typedef int64_t ptrdiff_t;
+typedef int64_t ssize_t;
+typedef unsigned int wint_t;
+
+#if !defined(__cplusplus)
+typedef unsigned wchar_t;
+#endif
+#endif
diff --git a/BaseHdr/stdint.h b/BaseHdr/stdint.h
index 2f25b6ef7..3bb0bd5c2 100644
--- a/BaseHdr/stdint.h
+++ b/BaseHdr/stdint.h
@@ -38,9 +38,7 @@ typedef unsigned char BOOL;
#ifdef ARCH_ARM64
#if !defined(bool)
-#define bool BOOL
-#define true 1
-#define false 0
+#include
#endif
#endif
@@ -88,12 +86,11 @@ typedef unsigned int uint_fast32_t;
typedef long long int_fast64_t;
typedef unsigned long long uint_fast64_t;
-/* 7.18.1.4 Integer types capable of holding object pointers */
-typedef int intptr_t;
-
-#if defined(ARCH_ARM64) || defined(ARCH_X64)
-typedef __int64 uintptr_t;
+#if defined(ARCH_ARM64) || defined(__aarch64__) || defined(ARCH_X64) || defined(__x86_64__)
+typedef long long intptr_t;
+typedef unsigned long long uintptr_t;
#else
+typedef int intptr_t;
typedef unsigned int uintptr_t;
#endif
@@ -101,8 +98,11 @@ typedef unsigned int uintptr_t;
typedef long long intmax_t;
typedef unsigned long long uintmax_t;
+#ifdef __SIZE_TYPE__
+typedef __SIZE_TYPE__ size_t;
+#else
typedef uint64_t size_t;
-
+#endif
/* 7.18.2 Limits of specified-width integer types */
#if defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
@@ -171,9 +171,13 @@ object pointers */
#define SIG_ATOMIC_MIN INT32_MIN
#define SIG_ATOMIC_MAX INT32_MAX
-
-#define SIZE_MAX 0xFFFFF //UINT32_MAX
-
+#ifndef SIZE_MAX
+#if defined(ARCH_ARM64) || defined(__aarch64__) || defined(ARCH_X64) || defined(__x86_64__)
+#define SIZE_MAX UINT64_MAX
+#else
+#define SIZE_MAX UINT32_MAX
+#endif
+#endif
#ifndef WCHAR_MIN /* also in wchar.h */
#define WCHAR_MIN 0
#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */
@@ -235,4 +239,50 @@ extern "C++" {
#define ALIGN_UP(x, y) (DIV_ROUND_UP(x,y)*y)
+#ifndef do_div
+#define do_div(n, base) { \
+ uint64_t __base = (base); \
+ uint64_t __rem = n % __base; \
+ n = n / __base; \
+ __rem; \
+ }
+#endif
+
+#define clamp_t(type, val, lo, hi) \
+ ((type)(val) < (type)(lo) ? (type)(lo) : ((type)(val) > (type)(hi)? (type)(hi) : (type)(val)))
+
+static inline int64_t div_round_closest_s64(int64_t x, int64_t divisor) {
+ if ((x > 0) == (divisor > 0))
+ return (x + divisor / 2) / divisor;
+ else
+ return (x - divisor / 2) / divisor;
+}
+
+static inline uint64_t div_round_closest_u64(uint64_t x, uint64_t divisor) {
+ return (x + divisor / 2) / divisor;
+}
+
+static inline int32_t div_round_closest_s32(int32_t x, int32_t divisor) {
+ if ((x > 0) == (divisor > 0))
+ return (x + divisor / 2) / divisor;
+ else
+ return (x - divisor / 2) / divisor;
+}
+
+
+static inline uint32_t div_round_closest_u32(uint32_t x, uint32_t divisor) {
+ return (x + divisor / 2) / divisor;
+}
+
+#define DIV_ROUND_CLOSEST(x, divisor) _Generic((x), \
+ int64_t: div_round_closest_s64, \
+ uint64_t: div_round_closest_u64, \
+ int32_t: div_round_closest_s32, \
+ uint32_t: div_round_closest_u32, \
+ default: div_round_closest_s32 \
+)(x,divisor)
+
+#define CLAMP(val, lo, hi) ((val) < (lo) ? (lo) : ((val) > (hi) ? (hi) : (val)))
+
+#define ABS(x) ((x) < 0 ? -(x) : (x))
#endif
\ No newline at end of file
diff --git a/BaseHdr/string.h b/BaseHdr/string.h
index 19711266f..c1a6ab048 100644
--- a/BaseHdr/string.h
+++ b/BaseHdr/string.h
@@ -37,6 +37,7 @@
AU_EXTERN{
#endif
+
/*
* Global Functions !!
*/
@@ -47,10 +48,11 @@ AU_EXTERN{
AU_EXPORT int strncmp(const char* s1, const char *s2, size_t n);
AU_EXPORT char *strncpy(char *destString, const char* sourceString, size_t maxLength);
AU_EXPORT char* strchr(char* str, int character);
+ AU_EXPORT char* strrchr(const char* str, int c);
AU_EXPORT char *strcat(char *destString, const char *sourceString);
AU_EXPORT char *strncat(char *destString, const char *sourceString, size_t maxLength);
AU_EXPORT void memset(void *targ, int val, uint32_t len);
- AU_EXPORT void memcpy(void *targ, void *src, size_t len);
+ AU_EXPORT void* memcpy(void *targ, void *src, size_t len);
AU_EXPORT int memcmp(const void *first, const void *second, size_t length);
AU_EXPORT void* memmove(void*, const void*, size_t);
AU_EXPORT char* strdup(const char* c);
diff --git a/BaseHdr/timer.h b/BaseHdr/timer.h
index 08bbb9a88..32aab266a 100644
--- a/BaseHdr/timer.h
+++ b/BaseHdr/timer.h
@@ -33,6 +33,12 @@
#define __TIMER_H__
#include
+#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
typedef void (*AuroraTimerCallback)(void* param);
@@ -42,6 +48,7 @@ typedef struct _kernel_timer_ {
AuroraTimerCallback handler;
void* param;
uint8_t active;
+ AA64Thread* owner;
}AuKernelTimer;
#define AURORA_MAX_TIMER 32
@@ -92,5 +99,34 @@ AU_EXTERN AU_EXPORT uint64_t AuGetCurrentMS();
AU_EXTERN AU_EXPORT uint64_t AuGetCurrentUS();
+/**
+ * @brief AuTimerCalculateAlarm -- schedule a timer to one-shot mode
+ * respective to given seconds
+ * @param thr -- pointer to thread which requires one-shot timer
+ * @param seconds -- amount of second to wait
+ */
+extern int AuTimerCalculateAlarm(AA64Thread* thr, uint64_t seconds);
+
+/* POSIX Timer API */
+typedef struct _itimerval_ {
+ timeval it_interval;
+ timeval it_value;
+}itimerval_t;
+
+typedef struct _timeval_t_ {
+ long tv_sec;
+ long tv_usec;
+}timeval_t;
+
+
+
+/**
+ *@brief AuTimerSetITimer -- posix standard implementation of
+ * setting periodic timer
+ */
+extern int AuTimerSetITimer(AA64Thread* thr, int which, const itimerval_t* newval, itimerval_t* oldval);
+extern int AuTimerGetITimer(AA64Thread* thr, int which, itimerval_t* curr_value);
+extern void AuSetWalltime(int64_t sec, int64_t nsec);
+extern void AuGetWalltime(int64_t* out_sec, int64_t* out_ns);
#endif
diff --git a/BaseHdr/va_list.h b/BaseHdr/va_list.h
index 3ff4f2c75..872247e85 100644
--- a/BaseHdr/va_list.h
+++ b/BaseHdr/va_list.h
@@ -50,6 +50,7 @@ extern "C"
#endif
+#ifndef __GNUC__
#define STACKITEM int
#define VA_SIZE(TYPE) \
@@ -63,6 +64,7 @@ extern "C"
#define va_arg(AP, TYPE) \
(AP += VA_SIZE(TYPE), *((TYPE *)(AP - VA_SIZE(TYPE))))
+#endif
#endif
diff --git a/Boot/Boot.vcxproj b/Boot/Boot.vcxproj
index d76ba94d9..17e2590dc 100644
--- a/Boot/Boot.vcxproj
+++ b/Boot/Boot.vcxproj
@@ -187,7 +187,7 @@
efi_main
- copy "$(SolutionDir)Build\EFI\BOOT\$(TargetName).efi" M:\EFI\BOOT\$(TargetName).efi"
+ if exist M:\ ( copy "$(SolutionDir)Build\EFI\BOOT\$(TargetName).efi" "M:\EFI\BOOT\$(TargetName).efi" ) else ( echo M: drive not found, skipping copy )
diff --git a/BootAA64/BootAA64.vcxproj b/BootAA64/BootAA64.vcxproj
index 0257ccbb4..56a389313 100644
--- a/BootAA64/BootAA64.vcxproj
+++ b/BootAA64/BootAA64.vcxproj
@@ -220,7 +220,7 @@
false
- copy "$(SolutionDir)Build\EFI\BOOT\$(TargetName).efi" "M:\EFI\BOOT\$(TargetName).efi"
+ if exist M:\ ( copy "$(SolutionDir)Build\EFI\BOOT\$(TargetName).efi" "M:\EFI\BOOT\$(TargetName).efi" ) else ( echo M: drive not found, skipping copy )
diff --git a/BootAA64/Makefile b/BootAA64/Makefile
index 219b704f4..4b3306a48 100644
--- a/BootAA64/Makefile
+++ b/BootAA64/Makefile
@@ -2,8 +2,13 @@
TARGET_EFI = BOOTAA64.efi
TARGET_SO = BOOTAA64.so
-# Setting OBJCOPY
-OBJCOPY = aarch64-linux-gnu-objcopy
+# Default toolchain is GCC
+TOOLCHAIN ?= gcc
+
+# Triggered when you run "make llvm"
+.PHONY: all clean llvm
+llvm:
+ @$(MAKE) TOOLCHAIN=llvm all
# Source files
CPP_SRCS = clib.cpp devicetree.cpp file.cpp mem.cpp paging.cpp pe.cpp physm.cpp uart0.cpp vector.cpp video.cpp xnldr.cpp xnout.cpp
@@ -26,23 +31,6 @@ else
BOARD_FLAG = -D__TARGET_BOARD_QEMU_VIRT__
endif
-# Compiler flags
-CXXFLAGS = -Wno-error=pragmas -fPIE \
- -Wall -Wextra -funsigned-char -fshort-wchar \
- -fno-strict-aliasing -ffreestanding -fno-stack-protector -fno-stack-check \
- -fno-merge-all-constants -std=c++17 -DGNU_EFI_USE_MS_ABI $(BOARD_FLAG) $(INCLUDES)
-
-# GNU-EFI link setup
-LDSCRIPT = ${GNU_EFI_DIR}/gnuefi/elf_aarch64_efi.lds
-CRT0 = ${GNU_EFI_DIR}/aarch64/gnuefi/crt0-efi-aarch64.o
-LIBS = -lgnuefi -lefi
-LIBDIRS = -L${GNU_EFI_DIR}/aarch64/gnuefi -L${GNU_EFI_DIR}/aarch64/lib
-
-# Tools
-CXX = aarch64-linux-gnu-g++
-CC = aarch64-linux-gnu-gcc
-LD = aarch64-linux-gnu-ld
-
# Output paths
SO_OUTPUT = $(TARGET_SO)
EFI_OUTPUT = Build/EFI/BOOT/$(TARGET_EFI)
@@ -52,11 +40,49 @@ CPP_OBJS = $(patsubst %.cpp,$(OBJDIR)/%.o,$(CPP_SRCS))
ASM_OBJS = $(patsubst %.s,$(OBJDIR)/%.o,$(ASM_SRCS))
OBJS = $(CPP_OBJS) $(ASM_OBJS)
-.PHONY: all clean
+ifeq ($(TOOLCHAIN),llvm)
+
+#* llvm configuration
+ CC =clang
+ CXX =clang++
+
+ LLVM_TARGET = -target aarch64-unknown-windows
+
+ CXXFLAGS = $(LLVM_TARGET) -Wno-error=pragmas \
+ -Wall -Wextra -funsigned-char -fshort-wchar \
+ -ffreestanding -fno-stack-protector \
+ -std=c++17 $(BOARD_FLAG) $(INCLUDES)
+
+ LDFLAGS = $(LLVM_TARGET) -fuse-ld=lld -nostdlib -Wl,-entry:efi_main -Wl,-subsystem:efi_application
+else
+
+#* original gcc configuration
+ CC = aarch64-linux-gnu-gcc
+ CXX = aarch64-linux-gnu-g++
+ LD = aarch64-linux-gnu-ld
+ OBJCOPY = aarch64-linux-gnu-objcopy
+
+ CXXFLAGS = -Wno-error=pragmas -fPIE \
+ -Wall -Wextra -funsigned-char -fshort-wchar \
+ -fno-strict-aliasing -ffreestanding -fno-stack-protector -fno-stack-check \
+ -fno-merge-all-constants -std=c++17 -DGNU_EFI_USE_MS_ABI $(BOARD_FLAG) $(INCLUDES)
+
+ LDSCRIPT = ${GNU_EFI_DIR}/gnuefi/elf_aarch64_efi.lds
+ CRT0 = ${GNU_EFI_DIR}/aarch64/gnuefi/crt0-efi-aarch64.o
+ LIBS = -lgnuefi -lefi
+ LIBDIRS = -L${GNU_EFI_DIR}/aarch64/gnuefi -L${GNU_EFI_DIR}/aarch64/lib
+endif
+
+# build rules
all: $(EFI_OUTPUT)
-# Link aarch64 EFI binary
+ifeq ($(TOOLCHAIN), llvm)
+$(EFI_OUTPUT): $(OBJS)
+ @mkdir -p $(dir $@)
+ $(CXX) $(LDFLAGS) $(OBJS) -o $@
+else
+# Original GCC compilation
$(SO_OUTPUT): $(CRT0) $(OBJS)
$(LD) -nostdlib --warn-common --no-undefined --build-id=sha1 -z noexecstack -z max-page-size=4096 \
-shared -Bsymbolic $(LIBDIRS) -T$(LDSCRIPT) $(CRT0) $(OBJS) -o $@ $(LIBS)
@@ -64,8 +90,9 @@ $(SO_OUTPUT): $(CRT0) $(OBJS)
$(EFI_OUTPUT): $(SO_OUTPUT)
@mkdir -p $(dir $@)
$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .rodata -j .rel -j .rela \
- -j .rel.* -j .rela.* -j .rel* -j .rela* -j .areloc \
+ -j .rel.* -j .rela.* -j .rel* -j .rela* -j .areloc \
-j .reloc --target=efi-app-aarch64 --subsystem=10 $< $@
+endif
# Compile C++ source files
$(OBJDIR)/%.o: %.cpp
@@ -78,4 +105,4 @@ $(OBJDIR)/%.o: %.s
$(CC) $(CXXFLAGS) -c $< -o $@
clean:
- rm -rf $(OBJDIR) Build $(SO_OUTPUT) $(EFI_OUTPUT)
+ rm -rf $(OBJDIR) Build $(TARGET_SO)
\ No newline at end of file
diff --git a/BootAA64/clib.cpp b/BootAA64/clib.cpp
index 1038064cc..1ada31d47 100644
--- a/BootAA64/clib.cpp
+++ b/BootAA64/clib.cpp
@@ -31,36 +31,47 @@
#include "clib.h"
-void memset(void* targ, uint8_t val, uint32_t len) {
- uint8_t* t = (uint8_t*)targ;
- while (len--)
- *t++ = val;
-}
+#ifdef _MSC_VER
+#pragma function(memcpy, memset, strlen)
+#endif
-void _memcpy(void* targ, void* src, uint32_t len) {
- uint8_t* t = (uint8_t*)targ;
- uint8_t* s = (uint8_t*)src;
- if (len > 0) {
- // check to see if target is in the range of src and if so, do a memmove() instead
- if ((t > s) && (t < (s + len))) {
- t += (len - 1);
- s += (len - 1);
- while (len--)
- *t-- = *s++;
- }
- else {
- while (len--)
- *t++ = *s++;
+
+extern "C" {
+ void* memset(void* targ, uint8_t val, uint32_t len) {
+ uint8_t* t = (uint8_t*)targ;
+ while (len--)
+ *t++ = val;
+ return targ;
+ }
+
+ void* _memcpy(void* targ, void* src, uint32_t len) {
+ uint8_t* t = (uint8_t*)targ;
+ uint8_t* s = (uint8_t*)src;
+ if (len > 0) {
+ // check to see if target is in the range of src and if so, do a memmove() instead
+ if ((t > s) && (t < (s + len))) {
+ t += (len - 1);
+ s += (len - 1);
+ while (len--)
+ *t-- = *s--;
+ }
+ else {
+ while (len--)
+ *t++ = *s++;
+ }
}
+ return targ;
}
-}
-void memcpy(void* targ, void* src, uint32_t len) {
-#ifdef EFI_1_10_SYSTEM_TABLE_REVISION
- gBS->CopyMem(targ, src, len);
-#else
- _memcpy(targ, src, len);
-#endif
+ void* memcpy(void* targ, void* src, uint32_t len) {
+ return _memcpy(targ, src, len);
+ }
+
+ size_t strlen(const char* s) {
+ size_t l = 0;
+ while (*s++)++l;
+ return l;
+ }
}
wchar_t* wstrchr(wchar_t* s, int c) {
@@ -122,10 +133,3 @@ char* sztoa(size_t value, char* str, int base) {
}
return str;
}
-
-
-size_t strlen(const char* s) {
- size_t l = 0;
- while (*s++)++l;
- return l;
-}
diff --git a/BootAA64/clib.h b/BootAA64/clib.h
index a5e08b6a8..0812adb64 100644
--- a/BootAA64/clib.h
+++ b/BootAA64/clib.h
@@ -32,21 +32,24 @@
#include
-#include
+//#include
#ifdef __cplusplus
extern "C"
{
#endif
+void* memset(void* targ, uint8_t val, uint32_t len);
+void* memcpy(void* targ, void* src, uint32_t len);
+size_t strlen(const char* s);
#ifdef __cplusplus
}
#endif
-extern void memset(void* targ, uint8_t val, uint32_t len);
-extern void memcpy(void* targ, void* src, uint32_t len);
+// extern void memset(void* targ, uint8_t val, uint32_t len);
+// extern void memcpy(void* targ, void* src, uint32_t len);
extern wchar_t* wstrchr(wchar_t* s, int c);
extern int wstrlen(wchar_t* s);
extern uint32_t wstrsize(wchar_t* s);
@@ -54,7 +57,7 @@ extern int to_upper(int c);
extern int to_lower(int c);
extern int is_digit(int c);
extern char* sztoa(size_t value, char* str, int base);
-extern size_t strlen(const char* s);
+// extern size_t strlen(const char* s);
#endif
diff --git a/BootAA64/file.cpp b/BootAA64/file.cpp
index 511adf045..338be3fd8 100644
--- a/BootAA64/file.cpp
+++ b/BootAA64/file.cpp
@@ -111,26 +111,26 @@ XEFile* XEOpenAndReadFile(EFI_HANDLE ImageHandle, CHAR16* Filename) {
XEGuiPrint("Failed to locate image handle \n");
return 0;
}
-
-
+
+
Status = gBS->HandleProtocol(loadedImage->DeviceHandle, &sfsprotocol, (VOID**)&SimpleFileSystem);
if (EFI_ERROR(Status)) {
XEGuiPrint("Failed to locate file system protocol \n");
return 0;
}
-
+
Status = SimpleFileSystem->OpenVolume(SimpleFileSystem, &Root);
if (EFI_ERROR(Status)) {
XEGuiPrint("Failed to open the root directory \n");
return 0;
}
-
+
Status = Root->Open(Root, &File, Filename, EFI_FILE_MODE_READ, 0);
if (EFI_ERROR(Status)) {
XEGuiPrint("Failed to open file \n");
return 0;
}
-
+
Status = File->GetInfo(File, &GenericFileInfo, &FileInfoSize, NULL);
if (Status == EFI_BUFFER_TOO_SMALL) {
Status = gBS->AllocatePool(EfiBootServicesData, FileInfoSize, (VOID**)&FileInfo);
@@ -140,7 +140,7 @@ XEFile* XEOpenAndReadFile(EFI_HANDLE ImageHandle, CHAR16* Filename) {
return 0;
}
}
-
+
Status = File->GetInfo(File, &GenericFileInfo, &FileInfoSize, FileInfo);
if (EFI_ERROR(Status)) {
XEGuiPrint("Failed to get file metadata \n");
@@ -148,7 +148,6 @@ XEFile* XEOpenAndReadFile(EFI_HANDLE ImageHandle, CHAR16* Filename) {
File->Close(File);
return 0;
}
-
FileSize = FileInfo->FileSize;
gBS->FreePool(FileInfo);
diff --git a/BootAA64/lowlevel.s b/BootAA64/lowlevel.s
index 6449fa668..3bf40da2a 100644
--- a/BootAA64/lowlevel.s
+++ b/BootAA64/lowlevel.s
@@ -159,9 +159,9 @@ callKernel:
//x1 -- stack
//x2 -- stacksz
//x3 -- entry
- add x1, x1, x2
- bic x1, x1, #15 //align it to 16-byte boundary
- mov sp, x1
+ //add x1, x1, x2
+ //bic x1, x1, #15 //align it to 16-byte boundary
+ //mov sp, x1
//sub sp, sp, #0x28
stp x29, x30, [sp, #-16]!
diff --git a/BootAA64/paging.cpp b/BootAA64/paging.cpp
index 4c3b6a435..7491cd1eb 100644
--- a/BootAA64/paging.cpp
+++ b/BootAA64/paging.cpp
@@ -87,10 +87,8 @@ void XEPagingInitialize() {
else
previousBase = read_ttbr0_el2();
- XEGuiPrint("ttbr0: %x \n", previousBase);
bool required_sctrl = 0;
l0_table_base = (uint64_t*)previousBase;
- XEGuiPrint("el value : %d \r\n", _getCurrentEL());
if (previousBase == 0) {
previousBase = XEPmmngrAllocate();
XEGuiPrint("pREVIOUS Base : %x \r\n", previousBase);
diff --git a/BootAA64/pe.cpp b/BootAA64/pe.cpp
index 3477f16af..4700ea9e3 100644
--- a/BootAA64/pe.cpp
+++ b/BootAA64/pe.cpp
@@ -105,4 +105,4 @@ void XEPELoadImage(void* filebuff) {
if (sectionHeader[i].VirtualSize > sectionHeader[i].SizeOfRawData)
zero_mem(raw_offset(sect_addr, sectionHeader[i].SizeOfRawData), sectionHeader[i].VirtualSize - sectionHeader[i].SizeOfRawData);
}
-}
+}
\ No newline at end of file
diff --git a/BootAA64/pe.h b/BootAA64/pe.h
index 67657fdee..075ef60f5 100644
--- a/BootAA64/pe.h
+++ b/BootAA64/pe.h
@@ -56,7 +56,7 @@ typedef struct _IMAGE_DOS_HEADER_ {
uint16_t e_oemid;
uint16_t e_oeminfo;
uint16_t e_res2[10];
- uint16_t e_lfanew;
+ uint32_t e_lfanew;
} IMAGE_DOS_HEADER, * PIMAGE_DOS_HEADER;
typedef struct _IMAGE_NT_HEADERS_PE32_ IMAGE_NT_HEADERS_PE32, * PIMAGE_NT_HEADERS_PE32;
diff --git a/BootAA64/physm.cpp b/BootAA64/physm.cpp
index 888410178..5fac63046 100644
--- a/BootAA64/physm.cpp
+++ b/BootAA64/physm.cpp
@@ -58,9 +58,10 @@ void XEInitialisePmmngr(const struct EfiMemoryMap memmap, void* buffer, size_t b
bufsize /= 2;
allocatedPtr = allocatedStack = raw_offset(buffer, bufsize);
allocatedCount = 1;
+
EFI_MEMORY_DESCRIPTOR* current = memmap.memmap;
- while (raw_diff(current, memmap.memmap) < memmap.MemMapSize)
+ while ((size_t)raw_diff(current, memmap.memmap) < memmap.MemMapSize)
{
ramSize += current->NumberOfPages * 4096;
diff --git a/BootAA64/uart0.cpp b/BootAA64/uart0.cpp
index 48ee30a6b..f876ff018 100644
--- a/BootAA64/uart0.cpp
+++ b/BootAA64/uart0.cpp
@@ -28,6 +28,7 @@
**/
#include "uart0.h"
+#include
#include "rpi3b/mbox.h"
#include "clib.h"
#include
diff --git a/BootAA64/video.cpp b/BootAA64/video.cpp
index 8186508e3..a1bee8c94 100644
--- a/BootAA64/video.cpp
+++ b/BootAA64/video.cpp
@@ -79,7 +79,7 @@ EFI_STATUS XEInitialiseGraphics(EFI_GRAPHICS_OUTPUT_PROTOCOL* GraphicsOutput) {
pixel.Green = 115;
pixel.Red = 0;
- // GraphicsOutput->Blt(GraphicsOutput, &pixel, EfiBltVideoFill, 0, 0, 0, 0, info->HorizontalResolution, info->VerticalResolution, 0);
+ //GraphicsOutput->Blt(GraphicsOutput, &pixel, EfiBltVideoFill, 0, 0, 0, 0, info->HorizontalResolution, info->VerticalResolution, 0);
// QEMU ramfb Blt can be buggy, so manually fill the framebuffer with the background color
uint32_t bg_color = RGB(0, 115, 164);
diff --git a/BootAA64/video.h b/BootAA64/video.h
index d7a6fd7fd..e8a2dad55 100644
--- a/BootAA64/video.h
+++ b/BootAA64/video.h
@@ -38,16 +38,16 @@
#define RGB(r, g, b) \
- ((r & 0xFF) | ((g << 8)&0xFF00) | ((b << 16)&0xFF0000))
+ (((b) & 0xFF) | (((g) << 8) & 0xFF00) | (((r) << 16) & 0xFF0000)) // ((r & 0xFF) | ((g << 8)&0xFF00) | ((b << 16)&0xFF0000))
#define RED(col)\
- (col & 0xFF)
+ ((col >> 16) & 0xFF)
#define GREEN(col)\
((col>>8) & 0xFF)
#define BLUE(col) \
- ((col>>16) & 0xFF)
+ (col & 0xFF)
/*
* XEInitialiseGraphics -- Initialise the screen and store graphics
diff --git a/BootAA64/xnldr.cpp b/BootAA64/xnldr.cpp
index ca3f6f869..df4842b83 100644
--- a/BootAA64/xnldr.cpp
+++ b/BootAA64/xnldr.cpp
@@ -128,9 +128,6 @@ MENU_ITEM MenuItem[] = {
* @param SystemTable -- Pointer to EFI SYSTEM TABLE
*/
int XEGetScreenResolutionMode(EFI_SYSTEM_TABLE* SystemTable) {
-#ifdef __TARGET_BOARD_QEMU_VIRT__
- return 1;
-#endif
EFI_STATUS Status;
UINTN SelectedIndex = 0;
EFI_INPUT_KEY Key;
@@ -142,7 +139,7 @@ int XEGetScreenResolutionMode(EFI_SYSTEM_TABLE* SystemTable) {
XEPrintf(const_cast(L"Copyright (C) Manas Kamal Choudhury 2020-2025 \r\n"));
XEPrintf(const_cast(L"Select a screen resolution:\r\n"));
XEPrintf(const_cast(L"\r\n"));
- for (UINTN i = 0; i < MENU_SIZE; i++) {
+ for (UINTN i = 0; i < 4; i++) {
if (i == SelectedIndex) {
SystemTable->ConOut->SetAttribute(SystemTable->ConOut, EFI_WHITE | EFI_BACKGROUND_BLUE);
}
@@ -195,15 +192,19 @@ UINTN XESetGraphicsMode(EFI_SYSTEM_TABLE* SystemTable, int index) {
switch (index) {
case 1:
+ XEPrintf(const_cast(L"index 1 selected \r\n"));
dwidth = 1024, dheight = 768;
break;
case 2:
+ XEPrintf(const_cast(L"index 2 selected \r\n"));
dwidth = 1280, dheight = 1024;
break;
case 3:
+ XEPrintf(const_cast(L"index 3 selected \r\n"));
dwidth = 1920, dheight = 1080;
break;
default:
+ XEPrintf(const_cast(L"index 0 selected \r\n"));
dwidth = 640, dheight = 480;
break;
}
@@ -219,11 +220,12 @@ UINTN XESetGraphicsMode(EFI_SYSTEM_TABLE* SystemTable, int index) {
MaxMode = GraphicsOutput->Mode->MaxMode;
XEPrintf(const_cast(L"Available Screen Resolution:\r\n"));
for (UINTN i = 0; i < MaxMode; i++) {
- EFI_GRAPHICS_OUTPUT_MODE_INFORMATION* Info;
+ EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
UINTN Size;
Status = GraphicsOutput->QueryMode(GraphicsOutput, i, &Size, &Info);
- if (Info->HorizontalResolution == dwidth && Info->VerticalResolution == dheight)
+ if (Info->HorizontalResolution == dwidth && Info->VerticalResolution == dheight) {
Mode = i;
+ }
}
Status = GraphicsOutput->SetMode(GraphicsOutput, Mode);
@@ -356,10 +358,11 @@ extern "C" EFI_STATUS efi_main(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE* SystemT
XEGuiPrint("Copyright (C) Manas Kamal Choudhury 2020-2025\n");
XEGuiPrint("Loading system files.. please wait !! \n");
-
+
+
uint64_t adddr = 0x50000000;
EFI_CONFIGURATION_TABLE* configuration_tables = SystemTable->ConfigurationTable;
-
+
/* load all important files */
XEFile* krnl = XEOpenAndReadFile(ImageHandle, (CHAR16*)L"\\EFI\\XENEVA\\xnkrnl.exe");
uint8_t* alignedKBuf = (uint8_t*)krnl->kBuffer;
diff --git a/BootAA64/xnldr.h b/BootAA64/xnldr.h
index 805f48279..3e1a33b8a 100644
--- a/BootAA64/xnldr.h
+++ b/BootAA64/xnldr.h
@@ -1,4 +1,3 @@
-
/**
* BSD 2-Clause License
*
@@ -35,6 +34,14 @@
#include
#include
#include
+#ifndef SIZE_MAX
+#if defined(ARCH_ARM64) || defined(ARCH_X64) || defined(_M_AMD64) || defined(_M_ARM64) || defined(__x86_64__) || defined(__aarch64__)
+#define SIZE_MAX 0xFFFFFFFFFFFFFFFFULL
+#else
+#define SIZE_MAX 0xFFFFFFFFULL
+#endif
+#endif
+//#include
#define SIZE_MAX 0xFFFFFFFF
diff --git a/BootAA64/xnout.cpp b/BootAA64/xnout.cpp
index 69d629ab5..700a5cee5 100644
--- a/BootAA64/xnout.cpp
+++ b/BootAA64/xnout.cpp
@@ -88,14 +88,25 @@ void XEPutChar(const int ch) {
#include
+#ifdef _MSC_VER
+extern "C" void store_x0_x7(uint64_t * buff);
+#endif
+
/*
* XEPrintf -- print function that will
* show output to the screen
* @param fmt -- format to print
*/
int XEPrintf(wchar_t* fmt, ...) {
+
+#if defined(__GNUC__) || defined(__GNUG__)
va_list vl;
va_start(vl, fmt);
+#elif defined(_MSC_VER)
+ uint64_t buffer[7];
+ store_x0_x7(buffer);
+ va_list vl = (va_list)buffer;
+#endif
unsigned short out[256];
int o = 0;
@@ -288,12 +299,12 @@ int XEPrintf(wchar_t* fmt, ...) {
if (c != 'd') {
if (lmodifier == 'H')
v = (uint8_t)v;
- else if (lmodifier = 'h')
+ else if (lmodifier == 'h')
v = (unsigned short)v;
sign = 0;
}
else {
- if (lmodifier = 'H')
+ if (lmodifier == 'H')
v = (signed char)v;
else if (lmodifier == 'h')
v = (short)v;
@@ -377,8 +388,16 @@ void XEGuiPrint(const char* format, ...) {
XEUARTPrint(format);
return;
}
+
+#if defined(__GNUC__) || defined(__GNUG__)
va_list args;
va_start(args, format);
+#elif defined(_MSC_VER)
+ uint64_t buffer[7];
+ store_x0_x7(buffer);
+ va_list args = (va_list)buffer;
+#endif
+
//va_start(args, format);
while (*format != '\0') {
if (*format == '%') {
diff --git a/DCL/includes/linux/bitmap.h b/DCL/includes/linux/bitmap.h
new file mode 100644
index 000000000..add994602
--- /dev/null
+++ b/DCL/includes/linux/bitmap.h
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_BITMAP_H_
+#define _LINUX_BITMAP_H_
+
+#include
+#include
+
+#define set_bit(nr, addr) \
+ ((addr)[(nr) / BITS_PER_LONG] |= (1UL << ((nr) % BITS_PER_LONG)))
+
+#define clear_bit(nr, addr) \
+ ((addr)[(nr) / BITS_PER_LONG] &= ~(1UL << ((nr) % BITS_PER_LONG)))
+
+#define test_bit(nr, addr) \
+ (!!((addr)[(nr) / BITS_PER_LONG] & (1UL << ((nr) % BITS_PER_LONG))))
+
+#define test_and_set_bit(nr, addr) \
+ ({int __old = test_bit(nr, addr); set_bit(nr, addr); __old; })
+
+#define test_and_clear_bit(nr,addr) \
+ ({ int __old = test_bit(nr, addr); clear_bit(nr,addr); __old;})
+
+#define bitmap_zero(dst, nbits) \
+ memset(dst, 0, BITS_TO_LONGS(nbits) * sizeof(unsigned long))
+
+#define bitmap_copy(dst, src, nbits) \
+ memcpy(dst, src, BITS_TO_LONGS(nbits) * sizeof(unsigned long))
+
+
+ #endif
\ No newline at end of file
diff --git a/DCL/includes/linux/bitops.h b/DCL/includes/linux/bitops.h
new file mode 100644
index 000000000..c89225592
--- /dev/null
+++ b/DCL/includes/linux/bitops.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef _LINUX_BITOPS_H_
+#define _LINUX_BITOPS_H_
+
+#include
+#include
+
+
+#define BITS_TO_LONGS(nr) BORDOISILA_DIV_ROUND_UP(nr, BORDOISILA_BITS_PER_TYPE(long))
+#define BITS_TO_U64(nr) BORDOISILA_DIV_ROUND_UP(nr, BORDOISILA_BITS_PER_TYPE(uint64_t))
+#define BITS_TO_U32(nr) BORDOISILA_DIV_ROUND_UP(nr, BORDOISILA_BITS_PER_TYPE(uint32_t))
+#define BITS_TO_BYTES(nr) BORDOISILA_DIV_ROUND_UP(nr, BORDOISILA_BITS_PER_TYPE(char))
+#define BYTES_TO_BITS(nb) ((nb)* BITS_PER_BYTE)
+
+#endif
\ No newline at end of file
diff --git a/DCL/includes/linux/types.h b/DCL/includes/linux/types.h
new file mode 100644
index 000000000..8ad25468c
--- /dev/null
+++ b/DCL/includes/linux/types.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef _LINUX_TYPES_H_
+#define _LINUX_TYPES_H_
+
+#define DECLARE_BITMAP(name,bits) \
+ unsigned long name[BITS_TO_LONGS(bits)]
+
+
+
+
+#endif
\ No newline at end of file
diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 000000000..4a9084330
--- /dev/null
+++ b/Directory.Build.props
@@ -0,0 +1,13 @@
+
+
+
+ $(SolutionDir)Build\
+ $(SolutionDir)Build\Intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
+
+
+
+
+ $(SolutionDir)Build\;%(AdditionalLibraryDirectories)
+
+
+
diff --git a/Docs/BuildInstructions(ARM64).md b/Docs/BuildInstructions(ARM64).md
index caacc7ee6..d3db699d1 100644
--- a/Docs/BuildInstructions(ARM64).md
+++ b/Docs/BuildInstructions(ARM64).md
@@ -42,6 +42,9 @@ format M: /FS:FAT32 /A:4096 /Q /V:BOOTIMG /Y
- Now that the image is usable, you can build XenevaOS projects directly, which will copy the required files to _M:_ automatically.
+> [!NOTE]
+> The MSVC project configurations (e.g., `Boot`, `BootAA64`, `XELoader`) utilize post-build copy scripts to deploy binaries to `M:\`. To prevent build failures on machines without a mounted `M:` drive, these copy steps are defensively guarded using conditional checks (`if exist M:\ ...`). Building the solutions will succeed regardless of whether the drive is mounted.
+
## Directory Structure of XenevaOS
XenevaOS follows a fixed boot directory structure:
Your Boot partition :
diff --git a/Docs/BuildInstructions(Linux).md b/Docs/BuildInstructions(Linux).md
index 0a16565f0..38e21d11f 100644
--- a/Docs/BuildInstructions(Linux).md
+++ b/Docs/BuildInstructions(Linux).md
@@ -5,6 +5,18 @@ To build XenevaOS natively on Linux without relying on MSVC, ensure you have the
- For x86_64 Kernel: `g++` and `make` (multilib support may be required).
- For ARM64 (KernelAA64): `aarch64-linux-gnu-gcc` and `aarch64-linux-gnu-binutils`.
+## Compiling GNU-EFI (Required for Bootloader)
+The `BootAA64` bootloader relies on `gnu-efi` libraries and object files. Because this directory is ignored in `.gitignore`, you must manually clone and build it first.
+1. Navigate to the root of the `XenevaOS` repository.
+2. Clone the official `gnu-efi` repository:
+ `git clone https://github.com/vathpela/gnu-efi.git`
+3. Build the library for AArch64:
+ ```bash
+ cd gnu-efi
+ make ARCH=aarch64 CROSS_COMPILE=aarch64-linux-gnu-
+ cd ..
+ ```
+
## Building the ARM64 Kernel (KernelAA64)
1. Open a terminal and navigate to the `KernelAA64/` directory.
2. Run `make clean` to clear any old MSVC objects or stale binaries.
diff --git a/Docs/Contributing.md b/Docs/Contributing.md
index 4a9f44fde..b35bf42d7 100644
--- a/Docs/Contributing.md
+++ b/Docs/Contributing.md
@@ -15,7 +15,7 @@ XenevaOS historically used Microsoft Visual Studio as the primary development pl
- Always test kernel modifications in a controlled environment like QEMU or VirtualBox before pushing changes.
-- Follow memory management, system calls and other subsystem guidelines as outlined in the documentation.
+- Follow memory management, system calls, and other subsystem guidelines as outlined in the documentation. For details on virtual filesystem development, refer to the [Virtual File System Guide](Kernel/VirtualFileSystem.md).
- Before making major changes, open an issue or discussion in the repository or on Discord to align with the project's direction and avoid duplicate work.
@@ -32,24 +32,33 @@ The XenevaOS project follows a consistent coding style to maintain readability a
### *Cross-Platform & GCC Compatibility*
To ensure that XenevaOS remains portable across Windows (MSVC) and Linux (GCC) environments, all contributors must adhere to strict C/C++ ISO standards.
- **Explicit Headers:** Do not rely on implicit headers. Always explicitly include standard headers (e.g., `#include ` for `size_t` and `#include ` for `bool` in C).
+- **Compiler-Provided Definitions:** Prefer using compiler-provided or standard-library-provided macro definitions (such as standard constants like `SIZE_MAX` or NEON/SIMD built-ins) where available. However, when project-specific or custom definitions are required for target platforms or freestanding environments (such as UEFI bootloader paths on MSVC), define them defensively using `#ifndef` guards to prevent macro redefinition conflicts under GCC.
- **Include Path Formatting (Forward Slashes):** Never use Windows-style backslashes (`\`) in include paths. Always use forward slashes (`/`) for cross-platform compatibility (e.g., `#include "BaseHdr/aurora.h"`).
- **Case-Sensitive Include Paths:** Unlike Windows/MSVC, Linux/GCC is strictly case-sensitive. The casing in your `#include` statement must exactly match the actual folder and file names (e.g., use `Fs/` instead of `fs/`).
-- **Variadic Arguments (`va_list`):** Never use manual pointer arithmetic to parse variadic arguments. Always use the standard `` macros (`va_start`, `va_arg`, `va_end`) to ensure compatibility with AAPCS (ARM64) and GCC.
+- **Variadic Arguments (`va_list`):** Never use manual pointer arithmetic to parse variadic arguments. Always use the standard `` macros (`va_start`, `va_arg`, `va_end`) to ensure compatibility with AAPCS (ARM64) and GCC.
- **Strict Data Typing:** GCC is highly explicit about data types. Avoid MSVC-specific quirks.
- **Variable Shadowing:** Do not name a structure member the same as a `typedef` in the same scope, as GCC strictly rejects this (`-Wchanges-meaning`).
- **Standard Syntax:** Avoid MSVC-specific calling conventions like `__cdecl` directly in source code; use custom macros if needed. Ensure scope resolutions are standard (e.g., `operator new` instead of `::operator new`).
- **Strict Returns:** Every non-void function must explicitly return a value. Missing returns result in undefined behavior under GCC.
- **Pragma Packing:** Always mathematically balance `#pragma pack(push, 1)` with `#pragma pack(pop)`.
- **Export Macros:** Do not hardcode `__declspec(dllexport)`. Always use cross-platform macros (e.g., `AU_EXPORT` and `AU_IMPORT`).
+- **Minimal Fixes & TODO Offloading:** When fixing GCC/LLVM compatibility issues, apply only the strict minimum changes required to successfully compile and run the code without panics. Do not implement optional safeguards or heavy defensive guardrails immediately, as this expands the diff and risks breaking MSVC compatibility. Instead, defer these improvements by leaving a clear, capitalized `// TODO:` comment. This keeps PRs small and offloads non-critical enhancements to future contributors.
Code modifications must be verified for GCC compatibility before being merged.
### *Bug Reports & Feature Requests*
-- Open an issue to report bugs or suggest new features.
+- Open an issue to report bugs or suggest new features using the provided GitHub Issue templates.
- When reporting a bug, provide clear details about the issue, including system debug messages from the serial terminal, the processor state, and register values. If possible, describe the conditions under which the bug occurs.
- Mention your testing environment.
- For feature requests, explain the purpose and potential benefits to the project.
+## Pull Request (PR) Guidelines
+To ensure code quality and maintainability, all contributors must format their Pull Requests using the repository's standardized layout. A template is automatically provided on GitHub when opening a PR, and requires:
+1. **Summary:** A concise explanation of the PR's high-level objectives.
+2. **Changes:** A detailed bulleted list of modified modules, specifying exactly **Before** (previous behavior or issue), **What** changed, and **Why** it was changed.
+3. **Compatibility:** Verification checkboxes indicating that the changes do not break MSVC/Windows and GCC/Linux builds or cause runtime regressions.
+4. **Related:** Reference to any corresponding issue numbers (e.g., `Part of #44`).
+
### *Conclusion*
Thank you for your interest in contributing to XenevaOS! Your contributions — whether in code, documentation, bug reports, or discussions — help shape the future of this project. If you have any questions or need guidance, feel free to open an issue or join the discussions on GitHub or Discord. Let's work together to make a powerful and efficient operating system!
diff --git a/Docs/Development/ProjectArchitecture(MSVC).md b/Docs/Development/ProjectArchitecture(MSVC).md
new file mode 100644
index 000000000..8129d30d0
--- /dev/null
+++ b/Docs/Development/ProjectArchitecture(MSVC).md
@@ -0,0 +1,41 @@
+# Project Architecture (MSVC)
+XenevaOS codebase is compatible with both GCC and MSVC toolchain. Although both toochain uses different build style and build artifact but build the same Operating System. This document will try to provide the project dependency, build outputs and importance of one project to build the other.
+
+By understanding this architecture, developers can:
+- Identify the responsibility of each project.
+- Understand how projects depend on one another
+- Locate the generated build artifacts.
+- Modify or extend existing components without breaking the build process
+
+# Kernel vs KernelAA64
+"Kernel" is targeted for x86_64 architecture but "KernelAA64" is targeted for ARM64 architecture.
+
+# .lib vs .exe/.dll artifact
+When a project is built within the solution, Visual Studio typically generates two output artifaces: the executable binary ('.exe'/'.dll') and an import library ('.lib').
+For example, the 'KernelAA64' project produces both 'xnkrnl.exe' and 'xnkrnl.lib'. The executable contains the actual kernel image, while the import library provides symbol information required by other projects during the linking stage.
+
+Kernel-mode drivers and other components that depend on kernel-exported functions link against 'xnkrnl.lib (or 'Kernel.lib') to resolve external symbols at build time. At runtime, symbol resolution is performed by the XenevaOS kernel loader, which parses the import and export tables of loaded binaries and establishes the required symbol bindings.
+
+
+# Binary output and their Dependencies table
+
+| Project Name | Build Output | Dependency |
+|--------------|--------------|-------------|
+| Boot | .efi /.lib | _None_ |
+| BootAA64 | .efi/.lib | _None_ |
+| Kernel | xnkrnl.exe/Kernel.lib | _None_ |
+| KernelAA64 | xnkrnl.exe/xnkrnl.lib | _None_ |
+| AHCI(Driver) | .dll/.lib | _xnkrnl.lib/Kernel.lib_ |
+| E1000(Driver) | .dll/.lib | _xnkrnl.lib/Kernel.lib_ |
+| All Drivers.. | .dll/.lib | _xnkrnl.lib/Kernel.lib_ |
+| init | .exe/.lib | _None (static binary)_ |
+| DeodhaiXR | .exe/.lib | _chlkha.lib/ftype.lib/xecrt.lib/xeclib.lib_|
+|Glimpse | .exe/.lib | _chlkha.lib/ftype.lib/xecrt.lib/xeclib.lib_|
+| Chitralekha(Userspace Library) | .dll/.lib| _xecrt.lib/xeclib.lib_|
+| XEClib(Userspace Clibrary) | .dll/.lib | _None_ |
+| XECrt(Userspace static library) | .lib | _None_ |
+
+## Static Library vs Dynamic Library in XenevaOS
+Both static and dynamic library has important role in XenevaOS runtime environment. Static libraries are mostly used for standalone binary build while Dynamic libraries are used for Dynamically linked binary and can be used as shared library among all binaries that depend on the same library.
+
+
diff --git a/Docs/Index.md b/Docs/Index.md
new file mode 100644
index 000000000..a8d3f758c
--- /dev/null
+++ b/Docs/Index.md
@@ -0,0 +1,37 @@
+# Welcome to XenevaOS Documentation
+
+Welcome to the official documentation for **XenevaOS**, a modern operating system built from scratch. This documentation portal provides all the resources needed to understand the OS architecture, compile the source code, set up virtual machines, and contribute to both kernel and user-space development.
+
+Use the Table of Contents below to navigate through the project's documentation.
+
+---
+
+## Getting Started
+- [**Introduction**](Introduction.md) — An overview of XenevaOS, its architecture, and its primary goals.
+- [**Contributing Guidelines**](Contributing.md) — Rules and procedures for contributing to the repository.
+- [**Preprocessor Macros**](Development/PreprocessorMacros.md) — Important compiler flags and definitions used across the codebase.
+
+## ️ Build & Setup
+- [**Build Instructions (Windows/MSVC)**](BuildInstructions.md) — How to build XenevaOS on Windows using Visual Studio.
+- [**Build Instructions (Linux/GCC)**](BuildInstructions(Linux).md) — How to compile the OS on Linux environments.
+- [**Build Instructions (ARM64)**](BuildInstructions(ARM64).md) — Specific instructions for cross-compiling the ARM64 port.
+- [**Populating Config**](PopulatingConfig.md) — Setting up the bootloader and kernel configuration files.
+- [**VM Setup**](VMSetup.md) — Guide to configuring VirtualBox, VMWare, or QEMU manually.
+- [**QEMU Automation**](QemuAutomation.md) — Using scripts for automated boot and testing on QEMU.
+- [**Serial Terminal Attach**](SerialTerminalAttach.md) — How to attach to UART for low-level kernel debugging.
+
+## Kernel Internals
+- [**About Kernel**](Kernel/AboutKernel.md) — Deep dive into the core architecture of the XenevaOS kernel.
+- [**Boot Process**](Kernel/BootProcess.md) — Explanation of the hardware boot flow from UEFI to Kernel main.
+- [**Memory Management**](Kernel/MemoryMangement.md) — Details on Physical, Virtual, and Heap memory allocation.
+- [**Kernel Services (SCI)**](Kernel/KernelServices.md) — Overview of the System Call Interface (SCI) for user-space bridging.
+- [**Virtual File System (VFS)**](Kernel/VirtualFileSystem.md) — Abstraction layer for file access, FAT32, and initrd parsing.
+- [**Threads & Processes**](Kernel/Thread.md) — Internal workings of kernel threads and user processes.
+- [**Drivers Subsystem**](Kernel/Drivers.md) — Core principles of the XenevaOS hardware driver model.
+- [**USB Stack**](Kernel/usb.md) — How USB buses and controllers are initialized.
+
+## Development & User-Space
+- [**XELoader (Dynamic Linker)**](XELoader.md) — The XenevaOS user-space PE linker and dynamic loading mechanism.
+- [**Application Development**](Development/ApplicationDevelopment.md) — Writing user-space applications (GUI, Terminal) for XenevaOS.
+- [**Driver Development**](Development/DriverDevelopment.md) — Developing dynamic drivers and interacting with kernel APIs.
+- [**Project Architecture(MSVC)**](Development/ProjectArchitecture(MSVC).md)- Discusses various artifacts and project inter dependencies.
diff --git a/Docs/Introduction.md b/Docs/Introduction.md
index f5679fbb1..ea1544efe 100644
--- a/Docs/Introduction.md
+++ b/Docs/Introduction.md
@@ -49,4 +49,4 @@ __Components__ :
__Development__ :
- [Writing Drivers for XenevaOS](Development/DriverDevelopment.md)
- [Writing User Applications for XenevaOS](Development/ApplicationDevelopment.md)
-
+- [Project Architecture (MSVC)](Development/ProjectArchitecture(MSVC).md)
diff --git a/Docs/Kernel/MemoryMangement.md b/Docs/Kernel/MemoryMangement.md
index a51fbb7b0..54fe4e069 100644
--- a/Docs/Kernel/MemoryMangement.md
+++ b/Docs/Kernel/MemoryMangement.md
@@ -18,7 +18,7 @@ For each process, an entirely new virtual address space is created. The kernel c
__Clearing the Lower Half Section__: Clearing the lower half is only safe if the kernel is using linear addresses for allocating physical memory. For example, if a driver allocates physical memory through the `AuPmmngrAlloc` function, the function must use a linear address to allocate the physical block. When the Virtual Memory Manager initializes itself, it stores whether the memory manager has linearly mapped all physical memory. This helps the Physical Memory Manager decide whether to allocate a physical block from linear or non-linear space. If a physical block is allocated from non-linear space, clearing the lower half would cause an immediate crash.
The `AuVmmngrBootFree` function clears out the lower half section and loads the new paging structure into the CR3 register.
-__MMIO Memory Area__: The Virtual Address starting from _0xFFFFFF1000000000_. This region is reserved for Hardware to map its device registers into the virtual address space. This region is also marked as non-cacheable region. The __'AuMapMMIO'__ function is used to map device memories into _MMIO Region_.
+__MMIO Memory Area__: The Virtual Address starting from _0xFFFFFF1000000000_. This region is reserved for Hardware to map its device registers into the virtual address space. This region is also marked as non-cacheable region. The __'AuMapMMIO'__ function is used to map device memories into _MMIO Region_. *Note: Redundant and unused MMIO mappings have been removed from the AArch64 kernel core to reduce translation table walk overhead and minimize boot latency.*
__The External Functions of Virtual Memory Manager__: External functions in Virtual Memory Manager are marked with _'Ex'_ suffix with their function name. There are only two external function currently available, __AuMapPageEx__ and __AuGetPhysicalAddressEx__.
__External Functions of the Virtual Memory Manager__: External functions in the Virtual Memory Manager are suffixed with `Ex`. There are currently two external functions available: `AuMapPageEx` and `AuGetPhysicalAddressEx`.
diff --git a/Docs/Kernel/Thread.md b/Docs/Kernel/Thread.md
index c9f5e39c9..624c3db87 100644
--- a/Docs/Kernel/Thread.md
+++ b/Docs/Kernel/Thread.md
@@ -1,7 +1,54 @@
-# Threading in XenevaOS
+# Threading and Processes in XenevaOS
-In XenevaOS, multitasking is entirely built on the concept of threads. XenevaOS does not identify processes or user applications directly; instead, it only schedules and executes individual threads using CPU resources. In simple terms, a thread is the smallest unit of execution in XenevaOS. The scheduler is the heart of XenevaOS and is responsible for managing threads, handling creation, blocking/unblocking (synchronization), context switching, and terminating threads when required.
+In XenevaOS, multitasking is entirely built on the concept of threads. XenevaOS does not identify processes or user applications directly; instead, it schedules and executes individual threads using CPU resources. The scheduler is the heart of XenevaOS and is responsible for managing threads, handling creation, blocking/unblocking (synchronization), context switching, and terminating threads when required.
-Each thread is defined by a structure that stores its current CPU registers/state, stack pointer, memory information, and scheduling state.
+---
-_coming soon_...
\ No newline at end of file
+## Thread Representation in Kernel
+
+Each thread is represented by the `AA64Thread` structure (under AArch64) or `AuThread` structure (under x86_64), which stores:
+- **Thread Context:** Saved CPU registers (e.g., `x19-x30`, `sp`, `elr_el1`, `spsr_el1` for AArch64).
+- **Scheduling State:** Ready, Blocked, Sleep, or Killable.
+- **Execution Level:** Kernel-mode thread (`THREAD_LEVEL_KERNEL`) or User-mode thread (`THREAD_LEVEL_USER`).
+- **User Mode Reference:** A pointer to the `AuUserEntry` structure (if the thread belongs to a user-space process).
+
+---
+
+## User Mode Entry & Transitions (`AuUserEntry`)
+
+When a thread is scheduled to execute in user mode (EL0), the kernel uses the `AuUserEntry` structure to pass execution context, stack pointers, and command-line arguments to the user program's entry runtime (`crt0`).
+
+### The `AuUserEntry` Structure
+```c
+typedef struct _uentry_ {
+ uint64_t entrypoint; /* EL0 entry point address */
+ uint64_t rsp; /* User-space stack pointer */
+ uint64_t cs; /* Code segment descriptor / EL0 selector */
+ uint64_t ss; /* Stack segment descriptor / EL0 selector */
+ int num_args; /* Number of arguments (argc) */
+ uint64_t argvaddr; /* User-space VA of the argv[] page (for crt0) */
+ uint64_t argvkernel; /* Kernel-space VA of the same argv[] page (for EL1 writes) */
+ char** argvs; /* Raw string pointers array */
+ uint64_t stackBase; /* Bottom of the user stack */
+} AuUserEntry;
+```
+
+---
+
+## Argument Passing Architecture (`argvaddr` vs `argvkernel`)
+
+A critical challenge during process creation is writing the command-line arguments (like `/calc.exe --debug`) from kernel space (EL1) into the newly created user-space process space (EL0) stack or data page.
+
+### The Problem
+During process setup (e.g., in `AuLoadExecToProcess`), the CPU is running in EL1, using the kernel's active translation tables (TTBR1). The user-space virtual mapping (specified by `argvaddr`, e.g., `0x0000_xxxx_xxxx`) is defined in the target process's page tables (TTBR0).
+- If the kernel attempts to write directly to `argvaddr`, it will fail with a page fault or a translation fault because the kernel is either not operating under the target process's address space context yet, or the user pages are marked with restrictions.
+
+### The Solution: Double Mapping
+To bypass this limitation, XenevaOS uses a double-mapping scheme:
+1. **Physical Page Allocation:** The kernel allocates a physical memory page to host the arguments.
+2. **User-Space Mapping (`argvaddr`):** This physical page is mapped to a virtual address in the target process's user-space virtual memory (e.g., `0x0000_xxxx_xxxx`). This address is stored in `argvaddr` and is passed to `crt0` so user-space can read the arguments.
+3. **Kernel-Space Alias (`argvkernel`):** The same physical page is simultaneously mapped to a virtual address in the kernel's higher-half address space (e.g., `0xFFFF_xxxx_xxxx`). This virtual address is stored in `argvkernel`.
+4. **Writing Arguments:** The kernel safely writes the argument strings and the array of pointers using `argvkernel`. Since it is mapped to the same physical backing memory, the data is written directly to the page that the user process will access.
+5. **Control Hand-off:** When the thread enters user mode (EL0) and switches to the process's page tables, it reads the arguments using `argvaddr` natively.
+
+This decoupled memory mapping design eliminates dependency on EL0 page table accessibility during process initialization, ensuring robust and crash-safe process bringup.
\ No newline at end of file
diff --git a/Docs/Kernel/VirtualFileSystem.md b/Docs/Kernel/VirtualFileSystem.md
index 8dd7c2360..929a47f5a 100644
--- a/Docs/Kernel/VirtualFileSystem.md
+++ b/Docs/Kernel/VirtualFileSystem.md
@@ -41,7 +41,7 @@ typedef struct __VFS_NODE__ {
| ``parent_block`` | Used in files, describes the parent block address of the file, for example - directory cluster of the file in FAT32 fs |
| ``first_block`` | Used in files, describes the very first block address of the file, for example - first cluster of the file in FAT32 fs |
| ``current`` | Used in files, describes the current block address of the file, for example - current read cluster of the file in FAT32 fs |
-| ``flags`` | Used both in files and file systems, describing the type of File or file system |
+| ``flags`` | Node flags defining the node type and properties. See the **Node Flags** section below for details. |
| ``status`` | Used in files, describing current condition of the file |
| ``device`` | Used both in files and filesystems, used for pointing file system's private data structure or file's private data structure |
| ``fileCopyCount`` | Used in files; describes the total copies of this file. The file is not closed until this reaches zero. |
@@ -58,9 +58,36 @@ typedef struct __VFS_NODE__ {
| ``get_blockfor`` | Used in filesystems; retrieves the desired block address corresponding to a given file position in bytes. |
| ``iocontrol`` | Used both in filesystems and files for controlling the filesystem or file |
+### Node Flags (`flags`)
+Ensure you set the appropriate flags so the VFS handles the node correctly. The following are the available VFS node flags:
+* `FS_FLAG_DIRECTORY` `(1<<1)` : Indicates the node is a directory. (Temporary/Freeable)
+* `FS_FLAG_GENERAL` `(1<<2)` : General purpose file node. (Temporary/Freeable)
+* `FS_FLAG_DEVICE` `(1<<3)` : Virtual device node (e.g., inside `/dev`). (Permanent/Non-freeable)
+* `FS_FLAG_DELETED` `(1<<4)` : State flag indicating the node has been deleted.
+* `FS_FLAG_INVALID` `(1<<5)` : State flag indicating the node is invalid.
+* `FS_FLAG_FILE_SYSTEM` `(1<<6)` : Indicates a file system mount node. (Permanent/Non-freeable). **Mainly needed when registering a file system module.**
+* `FS_FLAG_PIPE` `(1<<7)` : Inter-process communication pipe. (Temporary/Freeable)
+* `FS_FLAG_TTY` `(1<<8)` : Teletype/terminal node. (Temporary/Freeable with count)
+* `FS_FLAG_SOCKET` `(1<<9)` : Network socket node. (Temporary/Freeable)
+* `FS_FLAG_FILE_SYSTEM_GENERAL` `(1<<10)` : Identifies a standard general-purpose block file system. Can be used in conjunction with `FS_FLAG_FILE_SYSTEM`.
+* `FS_FLAG_CACHED` `(1<<11)` : Indicates that the file is being cached and has been added to the file cache manager.
+
+## VFS Mount Point Rules
+XenevaOS differentiates between **General (Block-based) Filesystems** (such as FAT32, Ext2) and **Virtual/Memory-based Filesystems** (such as `/dev`, `/proc`, `/tty`).
+
+### Mount Point Letter Reservation
+For general, block-backed filesystems that require mounting to a specific drive/volume hierarchy:
+* **Function:** Always call `AuVFSReserveMountPointLetter()` during mounting to reserve a mount letter.
+* **Limitation:** This function is **only** applicable to general filesystems.
+* **Prohibition:** Do **NOT** use `AuVFSReserveMountPointLetter()` for virtual or memory-based filesystems like `/proc`, `/tty`, or `/dev`. These are mounted directly to fixed virtual paths within the VFS structure during early kernel boot and do not require volume letter mapping.
+
+
## Implementing File System Driver for XenevaOS
-In XenevaOS, filesystem drivers can be implemented in two ways: either as external kernel modules or built directly into the kernel code. However, the current version of the kernel lacks the mechanism to load filesystem drivers as external kernel modules. The current version of XenevaOS only uses a built-in FAT32 driver for the root filesystem. Supporting filesystem drivers from external modules is work in progress.
+In XenevaOS, filesystem drivers can be implemented in two ways: either as external kernel modules or built directly into the kernel code. However, the current version of the kernel lacks the mechanism to load filesystem drivers dynamically as external modules. Instead, the kernel includes built-in filesystem drivers for **FAT32** (typically used for the root boot filesystem) and **Ext2** (used for secondary storage access). Supporting filesystem drivers from dynamic external modules is work in progress.
+
+### Ext2 File System Support
+The Ext2 file system module integrates directly into the VFS layer by providing the standard filesystem callback handlers. It is registered during kernel initialization and allows standard operations such as finding, opening, and reading files and directories on Ext2 partitions.
### Mounting the file system during initialization
Mounting a new filesystem involves extracting all necessary information from the disk's root sector, creating the necessary data structures, and allocating a new `AuVFSNode` structure. Filesystem drivers can use the `AuVDisk` service to read disk sectors. XenevaOS first detects the storage medium using the appropriate driver, extracts the partition details, calls `AuCreateVDisk` to register a virtual disk, mounts it to the device filesystem, and finally mounts the target filesystem on it.
diff --git a/Docs/XELoader.md b/Docs/XELoader.md
index a4010e5c1..b0bcfaada 100644
--- a/Docs/XELoader.md
+++ b/Docs/XELoader.md
@@ -30,8 +30,8 @@ Transferring control to the main executable is only performed after the loading
XELoader uses the PE image format for executables and libraries (meaning it is currently limited to loading PE binaries). ELF format support could be added in the future. XELoader itself is a statically linked binary, meaning it does not depend on shared libraries; everything is built statically inside XELoader.
There are two levels of loaders built into XenevaOS:
-- The kernel-level loader (_Kernel-space static executable loader_)
-- The XELoader (_User-space dynamic linker and loader_)
+- The kernel-level loader (_Kernel-space static executable loader_): Loads pure static binaries directly (e.g., `init.exe`, `xeldr.exe`).
+- The XELoader (_User-space dynamic linker and loader_): Loads dynamically linked binaries (e.g., terminals, GUI applications) and shares libraries using the Copy-On-Write (COW) mechanism.
Whenever XenevaOS encounters the system call _```_KeProcessLoadExec```_ with the executable file path and name, it immediately loads the executable and verifies that it is a PE-formatted executable and not a library. The kernel-level loader is only capable of loading statically linked executable files, not dynamically linked executables or libraries. If it is an executable file, the loader checks if it is dynamically or statically linked. Static executable files are executed directly by the kernel-level loader, which maps each section of the executable to the process's address space and transfers control to the entry point. For dynamically linked files, XELoader acts as an intermediary. The kernel-level loader loads XELoader (_which is statically linked_), populates its argument list with the desired filename and path, and transfers control to it. XELoader then runs in user space, starts loading the executable provided by the kernel, and resolves external symbols by loading and linking the required shared libraries.
For example here are the steps how it works:
diff --git a/Drivers/AHCI/AHCI.vcxproj b/Drivers/AHCI/AHCI.vcxproj
index ebfd632d3..6698d781b 100644
--- a/Drivers/AHCI/AHCI.vcxproj
+++ b/Drivers/AHCI/AHCI.vcxproj
@@ -133,7 +133,7 @@
Nativefalse..\..\Build\ahci.dll
- ..\..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\..\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
@@ -150,7 +150,7 @@
- copy "..\..\Build\$(TargetName).dll" "M:\$(TargetName).dll"
+ if exist M:\ ( copy "..\..\Build\$(TargetName).dll" "M:\$(TargetName).dll" ) else ( echo M: drive not found, skipping copy )
diff --git a/Drivers/Clock/Clock.sln b/Drivers/Clock/Clock.sln
new file mode 100644
index 000000000..aa8e8ad55
--- /dev/null
+++ b/Drivers/Clock/Clock.sln
@@ -0,0 +1,37 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.36107.64
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imx", "Clock\Clock.vcxproj", "{27361F54-5EF1-4E07-922F-C1CC8EB38ACA}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM64 = Debug|ARM64
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|ARM64 = Release|ARM64
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {27361F54-5EF1-4E07-922F-C1CC8EB38ACA}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {27361F54-5EF1-4E07-922F-C1CC8EB38ACA}.Debug|ARM64.Build.0 = Debug|ARM64
+ {27361F54-5EF1-4E07-922F-C1CC8EB38ACA}.Debug|x64.ActiveCfg = Debug|x64
+ {27361F54-5EF1-4E07-922F-C1CC8EB38ACA}.Debug|x64.Build.0 = Debug|x64
+ {27361F54-5EF1-4E07-922F-C1CC8EB38ACA}.Debug|x86.ActiveCfg = Debug|ARM64
+ {27361F54-5EF1-4E07-922F-C1CC8EB38ACA}.Debug|x86.Build.0 = Debug|ARM64
+ {27361F54-5EF1-4E07-922F-C1CC8EB38ACA}.Release|ARM64.ActiveCfg = Release|ARM64
+ {27361F54-5EF1-4E07-922F-C1CC8EB38ACA}.Release|ARM64.Build.0 = Release|ARM64
+ {27361F54-5EF1-4E07-922F-C1CC8EB38ACA}.Release|x64.ActiveCfg = Release|x64
+ {27361F54-5EF1-4E07-922F-C1CC8EB38ACA}.Release|x64.Build.0 = Release|x64
+ {27361F54-5EF1-4E07-922F-C1CC8EB38ACA}.Release|x86.ActiveCfg = Release|Win32
+ {27361F54-5EF1-4E07-922F-C1CC8EB38ACA}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {117A1BAF-DB42-47EC-9B4C-BC2ED91F7328}
+ EndGlobalSection
+EndGlobal
diff --git a/Drivers/Clock/Clock/Clock.vcxproj b/Drivers/Clock/Clock/Clock.vcxproj
new file mode 100644
index 000000000..891722d46
--- /dev/null
+++ b/Drivers/Clock/Clock/Clock.vcxproj
@@ -0,0 +1,214 @@
+
+
+
+
+ Debug
+ ARM64
+
+
+ Debug
+ Win32
+
+
+ Release
+ ARM64
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 16.0
+ Win32Proj
+ {27361f54-5ef1-4e07-922f-c1cc8eb38aca}
+ Clock
+ 10.0
+ imx
+
+
+
+ Application
+ true
+ v142
+ Unicode
+
+
+ Application
+ false
+ v142
+ true
+ Unicode
+
+
+ Application
+ true
+ v142
+ Unicode
+
+
+ Application
+ true
+ v142
+ Unicode
+
+
+ Application
+ false
+ v142
+ true
+ Unicode
+
+
+ Application
+ false
+ v142
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+ false
+
+
+ true
+
+
+ true
+
+
+ false
+
+
+ false
+
+
+
+ Level3
+ true
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ true
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ $(SolutionDir)..\..\BaseHdr
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ true
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Drivers/Clock/Clock/Clock.vcxproj.filters b/Drivers/Clock/Clock/Clock.vcxproj.filters
new file mode 100644
index 000000000..63839bade
--- /dev/null
+++ b/Drivers/Clock/Clock/Clock.vcxproj.filters
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Drivers/Clock/Clock/clk_imx8mp.c b/Drivers/Clock/Clock/clk_imx8mp.c
new file mode 100644
index 000000000..e69de29bb
diff --git a/Drivers/Clock/Clock/clk_imx_reg.h b/Drivers/Clock/Clock/clk_imx_reg.h
new file mode 100644
index 000000000..67f2c9640
--- /dev/null
+++ b/Drivers/Clock/Clock/clk_imx_reg.h
@@ -0,0 +1,62 @@
+/**
+* @file clk_imx8mp_reg.h
+*
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#ifndef __CLK_IMX_H__
+#define __CLK_IMX_H__
+
+enum imx_pllv1_type {
+ IMX_PLLV1_IMX1,
+ IMX_PLLV1_IMX21,
+ IMX_PLLV1_IMX25,
+ IMX_PLLV1_IMX27,
+ IMX_PLLV1_IMX31,
+ IMX_PLLV1_IMX35,
+};
+
+enum imx_sscg_pll_type {
+ SCCG_PLL1,
+ SCCG_PLL2,
+};
+
+enum imx_pll14xx_type {
+ PLL_1416X,
+ PLL_1443X,
+};
+
+enum imx_pllv4_type {
+ IMX_PLLV4_IMX7ULP,
+ IMX_PLLV4_IMX8ULP,
+ IMX_PLLV4_IMX8ULP_1GHZ,
+};
+
+
+
+#endif
diff --git a/Drivers/E1000/E1000.vcxproj b/Drivers/E1000/E1000.vcxproj
index d7cf662be..409f883b6 100644
--- a/Drivers/E1000/E1000.vcxproj
+++ b/Drivers/E1000/E1000.vcxproj
@@ -1,4 +1,4 @@
-
+
@@ -101,7 +101,7 @@
false..\..\Build\e1000.dll
- ..\..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\..\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
@@ -120,7 +120,7 @@
/ALIGN:512
- copy "..\..\Build\$(TargetName).dll" "M:\$(TargetName).dll
+ if exist M:\ ( copy "..\..\Build\$(TargetName).dll" "M:\$(TargetName).dll" ) else ( echo M: drive not found, skipping copy )
diff --git a/Drivers/GPU/virtiogpu/virtiogpu.vcxproj b/Drivers/GPU/virtiogpu/virtiogpu.vcxproj
index 6738b3ddc..531cc3efc 100644
--- a/Drivers/GPU/virtiogpu/virtiogpu.vcxproj
+++ b/Drivers/GPU/virtiogpu/virtiogpu.vcxproj
@@ -132,7 +132,7 @@
falseF:/vmware.dll
- E:\Xeneva Project\Aurora\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;E:\Xeneva Project\Aurora\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
@@ -170,7 +170,7 @@
false$(SolutionDir)\Build\$(TargetName).dll
- $(SolutionDir)\ARM64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;$(SolutionDir)\ARM64\Debug;%(AdditionalLibraryDirectories)xnkrnl.libtruefalse
@@ -187,7 +187,7 @@
false
- copy "$(SolutionDir)\Build\$(TargetName).dll" "M:\$(TargetName).dll"
+ if exist M:\ ( copy "$(SolutionDir)\Build\$(TargetName).dll" "M:\$(TargetName).dll" ) else ( echo M: drive not found, skipping copy )
diff --git a/Drivers/NVMe/NVMe.vcxproj b/Drivers/NVMe/NVMe.vcxproj
index e7b359318..75269cdc9 100644
--- a/Drivers/NVMe/NVMe.vcxproj
+++ b/Drivers/NVMe/NVMe.vcxproj
@@ -101,7 +101,7 @@
false..\..\Build\nvme.dll
- ..\..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\..\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
@@ -117,7 +117,7 @@
false
- copy "..\..\Build\$(TargetName).dll" "M:\$(TargetName).dll"
+ if exist M:\ ( copy "..\..\Build\$(TargetName).dll" "M:\$(TargetName).dll" ) else ( echo M: drive not found, skipping copy )
diff --git a/Drivers/Net/virtionet/virtionet.cpp b/Drivers/Net/virtionet/virtionet.cpp
index 1bdc026a8..48323b0c7 100644
--- a/Drivers/Net/virtionet/virtionet.cpp
+++ b/Drivers/Net/virtionet/virtionet.cpp
@@ -84,12 +84,14 @@ struct VirtioNetCfg {
uint32_t supportedTunnelTypes;
};
-typedef struct _ethernet_ {
+#pragma pack(push,1)
+__declspec(align(2)) typedef struct _ethernet_ {
uint8_t dest[6];
uint8_t src[6];
uint16_t typeLen;
uint8_t payload[];
}Ethernet;
+#pragma pack(pop)
#define ETHERNET_TYPE_IPV4 0x0800
#define ETHERNET_TYPE_ARP 0x0806
@@ -107,15 +109,27 @@ typedef struct _ethernet_ {
void AuVirtioNetHandler(int spiNum) {
uint16_t them = rxqueue->used.index;
for (; index < them; index++) {
+ UARTDebugOut("Index : %d, them : %d \r\n", index, them);
+ uint32_t ringSlot = index % RX_BUFFER_COUNT;
+
+ uint32_t trueBufferID = rxqueue->used.ring[ringSlot].index;
+ UARTDebugOut("True Buffer ID : %d \r\n", trueBufferID);
//dc_ivac((uint64_t)&rx_hdrs[index % queueSz]);
//dsb_sy_barrier();
- virtio_net_hdr_t* evt = &rx_hdrs[index % queueSz];
- Ethernet* eth = (Ethernet*)((uint8_t*)evt + sizeof(virtio_net_hdr_t) + 2);
+ uint8_t* buffer = (uint8_t*)rx_hdrs + (index % RX_BUFFER_COUNT) * RX_BUFFER_SIZE;
+ virtio_net_hdr_t* evt = (virtio_net_hdr_t*)buffer;
+ Ethernet* eth = (Ethernet*)((uint8_t*)evt + sizeof(virtio_net_hdr_t));
+ UARTDebugOut("[virtionet++]:ndev->ipvaddr: %x \r\n", ndev->ipv4addr);
+ UARTDebugOut("eth->typeLen: %x and destination mac : \r\n", ntohs(eth->typeLen));
+ UARTDebugOut("virtio buffer : %x, eth : %x \r\n", buffer, eth);
if (nic)
- AuEthernetHandle(eth, rxqueue->used.ring[index % queueSz].length, nic);
+ AuEthernetHandle(eth, rxqueue->used.ring[index % RX_BUFFER_COUNT].length, nic);
+ rxqueue->available.ring[rxqueue->available.index % RX_BUFFER_COUNT] = index;
isb_flush();
rxqueue->available.index++;
+ isb_flush();
+ dsb_ish();
}
}
/**
@@ -190,6 +204,10 @@ void AuVirtioNetRxinitialize(struct VirtioCommonCfg* common) {
uint16_t qsize = common->QueueSize;
queueSz = qsize;
UARTDebugOut("[aurora]: rx queue size : %d \r\n", qsize);
+ common->QueueSize = RX_BUFFER_COUNT;
+ isb_flush();
+ dsb_ish();
+
uint64_t queuePhys = (uint64_t)AuPmmngrAlloc();//AuPmmngrAllocBlocks(((sizeof(struct VirtioQueue) * queueSz)) / 0x1000);
rxqueue = (struct VirtioQueue*)AuMapMMIO(queuePhys, 1);
@@ -233,6 +251,9 @@ void AuVirtioNetTxinitialize(struct VirtioCommonCfg* common) {
dsb_ish();
uint16_t qsize = common->QueueSize;
UARTDebugOut("[aurora]: tx queue size : %d \r\n", qsize);
+ common->QueueSize = TX_BUFFER_COUNT;
+ isb_flush();
+ dsb_ish();
uint64_t queuePhys = (uint64_t)AuPmmngrAlloc();
txqueue = (struct VirtioQueue*)AuMapMMIO(queuePhys, 1);
common->QueueDesc = queuePhys;
@@ -253,7 +274,7 @@ void AuVirtioNetTxinitialize(struct VirtioCommonCfg* common) {
txqueue->buffers[i].Next = 0;
txqueue->available.ring[i] = i;
}
- txqueue->available.index = TX_BUFFER_COUNT;
+ txqueue->available.index = 0;
common->QueueEnable = 1;
dsb_ish();
@@ -281,19 +302,33 @@ void AuVirtioTransmit(void* packet, uint16_t len) {
hdr->gso_size = 0;
hdr->csum_start = 0;
hdr->csum_offset = 0;
- hdr->hdr_len = 0;
+ hdr->hdr_len = 0; //s sizeof(Ethernet) + 8;
+ UARTDebugOut("mem len : %d \r\n", len);
+ //memcpy(buff + (sizeof(virtio_net_hdr_t) + 2), packet, len);
memcpy(buff1, packet, len);
+ //aa64_data_cache_clean_range(buff, 2048);
+ //aa64_data_cache_clean_range(buff1, 2048);
+
+ Ethernet* eth = (Ethernet*)buff1;
+ for (int i = 0; i < 6; i++)
+ UARTDebugOut("%x ", eth->src[i]);
+ UARTDebugOut("\r\n");
+ for (int i = 0; i < 6; i++)
+ UARTDebugOut("%x ", eth->dest[i]);
+ UARTDebugOut("\r\n");
+ UARTDebugOut("EthernetTypeLen : %d \r\n", eth->typeLen);
+
uint16_t total_len = len + sizeof(virtio_net_hdr_t);
- txqueue->buffers[idx].Length = total_len;
+ txqueue->buffers[idx].Length = sizeof(virtio_net_hdr_t);
txqueue->buffers[idx].Flags = 1;
txqueue->buffers[idx].Next = idx1;
- txqueue->buffers[idx1].Length = total_len;
+ txqueue->buffers[idx1].Length = len;
txqueue->buffers[idx1].Flags = 0;
txqueue->buffers[idx1].Next = 0;
- txqueue->available.ring[idx % queueSz] = idx;
+ txqueue->available.ring[idx % TX_BUFFER_COUNT] = idx;
dsb_ish();
isb_flush();
@@ -303,12 +338,15 @@ void AuVirtioTransmit(void* packet, uint16_t len) {
isb_flush();
AuVirtioNetNotifyQueue(_cfg, 1);
- tx_index+= 2;
+ tx_index += 1;
}
AU_EXTERN AU_EXPORT size_t AuVirtioWrite(AuVFSNode* node, AuVFSNode* file, uint64_t* buffer, uint32_t len) {
UARTDebugOut("VirtioNetWrite \r\n");
+ /** here we need to have virtio_net_hdr, because this is called by
+ * raw sockets
+ */
AuVirtioTransmit(buffer, len);
return len;
}
@@ -352,6 +390,9 @@ AU_EXTERN AU_EXPORT int VirtioNetIOCtl(AuVFSNode* file, int code, void* arg) {
}
return 1;
}
+
+#define MAKE_IP(a,b,c,d) \
+ ((uint32_t)(d) << 24 | (uint32_t)(c) << 16 | (uint32_t)(b) << 8 | (uint32_t)(a))
/**
* @brief AuVirtioNetInitialize -- initialize the virtio network device
* @param device -- device address passed by PCIe
@@ -448,9 +489,14 @@ void AuVirtioNetInitialize(uint64_t device) {
ndev->type = NETDEV_TYPE_ETHERNET;
ndev->linkStatus = 1;
- AuTextOut("[aurora]: virtio-net-dev mac : ");
+
+
+ ndev->ipv4addr = MAKE_IP(10, 0, 2, 15);
+ UARTDebugOut("[aurora]: ndev->ipv4addr: %x \r\n", ndev->ipv4addr);
+
+ UARTDebugOut("[aurora]: virtio-net-dev mac : ");
for (int i = 0; i < 6; i++) {
- AuTextOut("%x::", netcfg->mac[i]);
+ UARTDebugOut("%x::", netcfg->mac[i]);
ndev->mac[i] = netcfg->mac[i];
}
diff --git a/Drivers/Net/virtionet/virtionet.vcxproj b/Drivers/Net/virtionet/virtionet.vcxproj
index 38edd910f..ab32bb241 100644
--- a/Drivers/Net/virtionet/virtionet.vcxproj
+++ b/Drivers/Net/virtionet/virtionet.vcxproj
@@ -134,7 +134,7 @@
false..\..\Build\$(TargetName).dll
- ..\..\..\ARM64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\..\..\ARM64\Debug;%(AdditionalLibraryDirectories)xnkrnl.libtruefalse
@@ -162,7 +162,7 @@
..\..\..\BaseHdr;%(AdditionalIncludeDirectories)true
- ARCH_X64;USE_APIC;%(PreprocessorDefinitions)
+ ARCH_ARM64;USE_APIC;%(PreprocessorDefinitions)truefalseDefault
@@ -175,7 +175,7 @@
false..\..\Build\$(TargetName).dll
- ..\..\..\ARM64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\..\..\ARM64\Debug;%(AdditionalLibraryDirectories)xnkrnl.libtruefalse
@@ -192,7 +192,7 @@
false
- copy "..\..\Build\$(TargetName).dll" "M:\$(TargetName).dll"
+ if exist M:\ ( copy "..\..\Build\$(TargetName).dll" "M:\$(TargetName).dll" ) else ( echo M: drive not found, skipping copy )
diff --git a/Drivers/Sound/IntelHDA/IntelHDA.vcxproj b/Drivers/Sound/IntelHDA/IntelHDA.vcxproj
index 6bdb64d6f..1e55c08bc 100644
--- a/Drivers/Sound/IntelHDA/IntelHDA.vcxproj
+++ b/Drivers/Sound/IntelHDA/IntelHDA.vcxproj
@@ -100,7 +100,7 @@
false..\..\..\Build\hda.dll
- ..\..\..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\..\..\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
@@ -119,7 +119,7 @@
/ALIGN:512
- copy "..\..\..\Build\$(TargetName).dll" "M:\$(TargetName).dll"
+ if exist M:\ ( copy "..\..\..\Build\$(TargetName).dll" "M:\$(TargetName).dll" ) else ( echo M: drive not found, skipping copy )
diff --git a/Drivers/Sound/virtiosnd/virtiosnd.vcxproj b/Drivers/Sound/virtiosnd/virtiosnd.vcxproj
index a28537215..50a8bba16 100644
--- a/Drivers/Sound/virtiosnd/virtiosnd.vcxproj
+++ b/Drivers/Sound/virtiosnd/virtiosnd.vcxproj
@@ -134,7 +134,7 @@
false..\..\Build\$(TargetName).dll
- ..\..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\..\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
@@ -175,7 +175,7 @@
false$(SolutionDir)Build\$(TargetName).dll
- $(SolutionDir)ARM64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;$(SolutionDir)ARM64\Debug;%(AdditionalLibraryDirectories)xnkrnl.lib;truefalse
@@ -192,7 +192,7 @@
false
- copy "$(SolutionDir)Build\$(TargetName).dll" "M:\$(TargetName).dll"
+ if exist M:\ ( copy "$(SolutionDir)Build\$(TargetName).dll" "M:\$(TargetName).dll" ) else ( echo M: drive not found, skipping copy )
diff --git a/Drivers/USB/dwc2-otg/dwc2-otg.vcxproj b/Drivers/USB/dwc2-otg/dwc2-otg.vcxproj
index c85f37317..0e0c61207 100644
--- a/Drivers/USB/dwc2-otg/dwc2-otg.vcxproj
+++ b/Drivers/USB/dwc2-otg/dwc2-otg.vcxproj
@@ -134,7 +134,7 @@
false..\..\Build\$(TargetName).dll
- ..\..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\..\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
@@ -157,7 +157,7 @@
Level3
- Disabled
+ MaxSpeed$(SolutionDir)\BaseHdr;%(AdditionalIncludeDirectories)
@@ -175,7 +175,7 @@
false$(SolutionDir)\Build\$(TargetName).dll
- $(SolutionDir)\ARM64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;$(SolutionDir)\ARM64\Debug;%(AdditionalLibraryDirectories)xnkrnl.libtruefalse
@@ -192,7 +192,7 @@
false
- copy "$(SolutionDir)\Build\$(TargetName).dll" "M:\$(TargetName).dll"
+ if exist M:\ ( copy "$(SolutionDir)\Build\$(TargetName).dll" "M:\$(TargetName).dll" ) else ( echo M: drive not found, skipping copy )
diff --git a/Drivers/USB/dwc2-uspi/dwc2-uspi.vcxproj b/Drivers/USB/dwc2-uspi/dwc2-uspi.vcxproj
index 171732bc0..0fed8f8ca 100644
--- a/Drivers/USB/dwc2-uspi/dwc2-uspi.vcxproj
+++ b/Drivers/USB/dwc2-uspi/dwc2-uspi.vcxproj
@@ -134,7 +134,7 @@
false..\..\Build\$(TargetName).dll
- ..\..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\..\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
@@ -175,7 +175,7 @@
true$(SolutionDir)\Build\$(TargetName).dll
- $(SolutionDir)\ARM64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;$(SolutionDir)\ARM64\Debug;%(AdditionalLibraryDirectories)xnkrnl.libtruefalse
@@ -192,7 +192,7 @@
false
- copy "$(SolutionDir)Build\$(TargetName).dll" "M:\$(TargetName).dll"
+ if exist M:\ ( copy "$(SolutionDir)Build\$(TargetName).dll" "M:\$(TargetName).dll" ) else ( echo M: drive not found, skipping copy )
diff --git a/Drivers/USB/hid/hid.vcxproj b/Drivers/USB/hid/hid.vcxproj
index 2f97f10bd..224914a8d 100644
--- a/Drivers/USB/hid/hid.vcxproj
+++ b/Drivers/USB/hid/hid.vcxproj
@@ -1,4 +1,4 @@
-
+
@@ -101,7 +101,7 @@
false..\..\Build\$(TargetName).dll
- ..\..\..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\..\..\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
@@ -118,7 +118,7 @@
/ALIGN:512 %(AdditionalOptions)
- copy "..\..\Build\$(TargetName).dll" "M:\$(TargetName).dll
+ if exist M:\ ( copy "..\..\Build\$(TargetName).dll" "M:\$(TargetName).dll" ) else ( echo M: drive not found, skipping copy )
diff --git a/Drivers/USB/msc/msc.vcxproj b/Drivers/USB/msc/msc.vcxproj
index 1efbd127a..9a1f15d14 100644
--- a/Drivers/USB/msc/msc.vcxproj
+++ b/Drivers/USB/msc/msc.vcxproj
@@ -1,4 +1,4 @@
-
+
@@ -101,7 +101,7 @@
false..\..\Build\$(TargetName).dll
- ..\..\..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\..\..\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
@@ -118,7 +118,7 @@
/ALIGN:512 %(AdditionalOptions)
- copy "..\..\Build\$(TargetName).dll" "M:\$(TargetName).dll
+ if exist M:\ ( copy "..\..\Build\$(TargetName).dll" "M:\$(TargetName).dll" ) else ( echo M: drive not found, skipping copy )
diff --git a/Drivers/USB/usbhci/usbhci.vcxproj b/Drivers/USB/usbhci/usbhci.vcxproj
index a7e498e6a..8b06e40dc 100644
--- a/Drivers/USB/usbhci/usbhci.vcxproj
+++ b/Drivers/USB/usbhci/usbhci.vcxproj
@@ -1,4 +1,4 @@
-
+
@@ -101,7 +101,7 @@
false..\..\Build\$(TargetName).dll
- ..\..\..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\..\..\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
@@ -118,7 +118,7 @@
/ALIGN:512 %(AdditionalOptions)
- copy "..\..\Build\$(TargetName).dll" "M:\$(TargetName).dll
+ if exist M:\ ( copy "..\..\Build\$(TargetName).dll" "M:\$(TargetName).dll" ) else ( echo M: drive not found, skipping copy )
diff --git a/Drivers/Usb3/Usb3.vcxproj b/Drivers/Usb3/Usb3.vcxproj
index 69c78447d..0874c0ebe 100644
--- a/Drivers/Usb3/Usb3.vcxproj
+++ b/Drivers/Usb3/Usb3.vcxproj
@@ -100,7 +100,7 @@
false..\..\Build\usb.dll
- ..\..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\..\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
diff --git a/Drivers/VMSvga/VMSvga.vcxproj b/Drivers/VMSvga/VMSvga.vcxproj
index 1742d44d2..dcf071804 100644
--- a/Drivers/VMSvga/VMSvga.vcxproj
+++ b/Drivers/VMSvga/VMSvga.vcxproj
@@ -100,7 +100,7 @@
falseF:/vmsvga.dll
- E:\Xeneva Project\Aurora\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;E:\Xeneva Project\Aurora\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
diff --git a/Drivers/fbset/lcdif/lcdif.vcxproj b/Drivers/fbset/lcdif/lcdif.vcxproj
index e8d8bcb32..485edac59 100644
--- a/Drivers/fbset/lcdif/lcdif.vcxproj
+++ b/Drivers/fbset/lcdif/lcdif.vcxproj
@@ -134,7 +134,7 @@
false..\..\Build\$(TargetName).dll
- ..\..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\..\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
@@ -175,7 +175,7 @@
false$(SolutionDir)\Build\$(TargetName).dll
- $(SolutionDir)\ARM64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;$(SolutionDir)\ARM64\Debug;%(AdditionalLibraryDirectories)xnkrnl.lib;truefalse
@@ -192,7 +192,7 @@
false
- copy "$(SolutionDir)\Build\$(TargetName).dll" "M:\$(TargetName).dll"
+ if exist M:\ ( copy "$(SolutionDir)\Build\$(TargetName).dll" "M:\$(TargetName).dll" ) else ( echo M: drive not found, skipping copy )
diff --git a/Drivers/hdmi/hdmi.vcxproj b/Drivers/hdmi/hdmi.vcxproj
index bd8908464..77b6eb02f 100644
--- a/Drivers/hdmi/hdmi.vcxproj
+++ b/Drivers/hdmi/hdmi.vcxproj
@@ -134,7 +134,7 @@
false..\..\Build\$(TargetName).dll
- ..\..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\..\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
@@ -175,7 +175,7 @@
false$(SolutionDir)\Build\$(TargetName).dll
- $(SolutionDir)\ARM64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;$(SolutionDir)\ARM64\Debug;%(AdditionalLibraryDirectories)xnkrnl.lib;truefalse
@@ -192,7 +192,7 @@
false
- copy "$(SolutionDir)\Build\$(TargetName).dll" "M:\$(TargetName).dll"
+ if exist M:\ ( copy "$(SolutionDir)\Build\$(TargetName).dll" "M:\$(TargetName).dll" ) else ( echo M: drive not found, skipping copy )
diff --git a/Drivers/virtioblk/virtioblk.vcxproj b/Drivers/virtioblk/virtioblk.vcxproj
index 607d77bd8..3b07a40aa 100644
--- a/Drivers/virtioblk/virtioblk.vcxproj
+++ b/Drivers/virtioblk/virtioblk.vcxproj
@@ -132,7 +132,7 @@
falseF:/vmware.dll
- E:\Xeneva Project\Aurora\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;E:\Xeneva Project\Aurora\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
@@ -170,7 +170,7 @@
false$(SolutionDir)Build\$(TargetName).dll
- $(SolutionDir)ARM64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;$(SolutionDir)ARM64\Debug;%(AdditionalLibraryDirectories)xnkrnl.lib;truefalse
@@ -187,7 +187,7 @@
false
- copy "$(SolutionDir)\Build\$(TargetName).dll" "M:\$(TargetName).dll"
+ if exist M:\ ( copy "$(SolutionDir)\Build\$(TargetName).dll" "M:\$(TargetName).dll" ) else ( echo M: drive not found, skipping copy )
diff --git a/Drivers/vmware/vmware.vcxproj b/Drivers/vmware/vmware.vcxproj
index 815da6360..067bbf746 100644
--- a/Drivers/vmware/vmware.vcxproj
+++ b/Drivers/vmware/vmware.vcxproj
@@ -100,7 +100,7 @@
falseF:/vmware.dll
- E:\Xeneva Project\Aurora\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;E:\Xeneva Project\Aurora\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
diff --git a/Drivers/xHCI/xHCI.vcxproj b/Drivers/xHCI/xHCI.vcxproj
index 2a08360ef..dffd47af4 100644
--- a/Drivers/xHCI/xHCI.vcxproj
+++ b/Drivers/xHCI/xHCI.vcxproj
@@ -102,7 +102,7 @@
false..\..\Build\$(TargetName).dll
- ..\..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\..\x64\Debug;%(AdditionalLibraryDirectories)Kernel.lib;truefalse
diff --git a/Kernel/Cap/capability.cpp b/Kernel/Cap/capability.cpp
new file mode 100644
index 000000000..173dc5f31
--- /dev/null
+++ b/Kernel/Cap/capability.cpp
@@ -0,0 +1,224 @@
+/**
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#include
+#include
+#include
+#include <_null.h>
+
+#ifdef ARCH_X64
+#include
+#elif defined(ARCH_ARM64)
+#include
+#endif
+
+/*
+ * NOTE on concurrency: every existing syscall entry point in
+ * Kernel/Serv/fileserv.cpp already runs with interrupts disabled
+ * (x64_cli()) for the duration of the call, and XenevaOS's
+ * multiprocessor scheduler is not active yet (see readme.md). That is
+ * the same assumption these functions rely on -- callers are expected
+ * to hold that same single-CPU-in-kernel invariant. Once SMP
+ * scheduling lands this table will need its own lock (Phase 8 of the
+ * roadmap calls this out explicitly under "race conditions" /
+ * "concurrent capability lookup/removal") and every function below
+ * should take it before touching proc->caps.
+ */
+
+/* internal helper: is `fd` a valid index into the capability table? */
+static unsigned char cap_slot_in_range(int rq) {
+ return (rq >= 0) && (rq < 63);
+}
+
+/* internal helper: slot pointer, or NULL if fd is out of range */
+static AuCapability* cap_slot(AuProcess* proc, int fd) {
+ if (!proc || !cap_slot_in_range(fd))
+ return NULL;
+ return &proc->caps[fd];
+}
+
+int BordoisilaCapCreate(AuProcess* proc, int fd, void* object, uint8_t type, CapRights rights) {
+ AuCapability* cap = cap_slot(proc, fd);
+ if (!cap)
+ return CAP_ERR_INVALID;
+ if (!object)
+ return CAP_ERR_INVALID;
+
+ cap->object = object;
+ cap->object_type = type;
+ /* a freshly minted capability may never exceed CAP_FILE_RIGHTS_MASK
+ * for the file object type in V0; this keeps a caller from handing
+ * in a bogus/garbage mask and getting more than the model allows */
+ if (type == CAP_OBJ_FILE)
+ cap->rights = rights & CAP_FILE_RIGHTS_MASK;
+ else
+ cap->rights = CAP_RIGHTS_NONE;
+
+ cap->owner = proc->creds.uid;
+ cap->flags = CAP_FLAG_NONE;
+ cap->valid = true;
+ return CAP_OK;
+}
+
+AuCapability* BordoisilaCapLookup(AuProcess* proc, int fd) {
+ AuCapability* cap = cap_slot(proc, fd);
+ if (!cap)
+ return NULL;
+ if (!cap->valid)
+ return NULL;
+ return cap;
+}
+
+bool BordoisilaCapCheckRights(AuProcess* proc, int fd, CapRights required) {
+ AuCapability* cap = BordoisilaCapLookup(proc, fd);
+
+ if (!cap) {
+#ifdef ARCH_X64
+ SeTextOut("[CAP] No capability fd=%d\r\n", fd);
+#elif defined(ARCH_ARM64)
+ UARTDebugOut("[CAP] No capability fd=%d\r\n", fd);
+#endif
+ return false;
+ }
+
+#ifdef ARCH_X64
+ SeTextOut("[CAP] Check fd=%d req=%x have=%x\r\n",
+ fd, required, cap->rights);
+#elif defined(ARCH_ARM64)
+ UARTDebugOut("[CAP] Check fd=%d req=%x have=%x\r\n",
+ fd, required, cap->rights);
+#endif
+
+ return (cap->rights & required) == required;
+}
+
+int BordoisilaCapDup(AuProcess* proc, int oldfd, int newfd) {
+
+ AuCapability* src = BordoisilaCapLookup(proc, oldfd);
+ if (!src)
+ return CAP_ERR_INVALID;
+
+ if (!cap_slot_in_range(newfd))
+ return CAP_ERR_INVALID;
+
+ if (proc->caps[newfd].valid)
+ return CAP_ERR_INVALID;
+
+ if (proc->fds[newfd])
+ return CAP_ERR_INVALID;
+
+ proc->fds[newfd] = proc->fds[oldfd];
+
+ if (proc->fds[newfd])
+ proc->fds[newfd]->fileCopyCount++;
+
+ AuCapability* dst = &proc->caps[newfd];
+
+ dst->object = src->object;
+ dst->object_type = src->object_type;
+ dst->rights = src->rights;
+ dst->owner = src->owner;
+ dst->flags = src->flags;
+ dst->valid = true;
+
+ return CAP_OK;
+}
+
+int BordoisilaCapRestrict(AuProcess* proc, int fd, CapRights new_rights) {
+ AuCapability* cap = BordoisilaCapLookup(proc, fd);
+ if (!cap)
+ return CAP_ERR_INVALID;
+
+ /* rights may only shrink: intersect rather than assign, so this
+ * can never be used to grant a bit the capability didn't already
+ * have (section 5: "rights can only become more restrictive") */
+ cap->rights = cap->rights & new_rights;
+ return CAP_OK;
+}
+
+void BordoisilaCapDestroy(AuProcess* proc, int fd) {
+ AuCapability* cap = cap_slot(proc, fd);
+ if (!cap || !cap->valid)
+ return;
+
+ cap->object = NULL;
+ cap->object_type = 0;
+ cap->rights = CAP_RIGHTS_NONE;
+ cap->owner = 0;
+ cap->flags = CAP_FLAG_NONE;
+ cap->valid = false;
+}
+
+void BordoisilaCapCleanupProcess(AuProcess* proc) {
+ if (!proc)
+ return;
+ for (int i = 0; i < FILE_DESC_PER_PROCESS; i++) {
+ AuCapability* cap = &proc->caps[i];
+ if (cap->valid) {
+ cap->object = NULL;
+ cap->object_type = 0;
+ cap->rights = CAP_RIGHTS_NONE;
+ cap->owner = 0;
+ cap->flags = CAP_FLAG_NONE;
+ cap->valid = false;
+ }
+ }
+}
+
+void BordoisilaCapInheritTable(AuProcess* parent, AuProcess* child) {
+ if (!parent || !child)
+ return;
+
+ /* NOTE: as of this writing AuCreateProcessSlot()/AuCreateProcess()
+ * zero-initialize fds[] rather than copying the parent's open
+ * files, so there is currently nothing for capabilities to mirror
+ * at fork/spawn time -- this mirrors section 7 of the design doc
+ * ("similar to how file descriptors are already inherited") for
+ * whenever fd inheritance itself is implemented. Until then this
+ * only matters for slots the caller populates manually. Flagging
+ * this gap for design review rather than papering over it. */
+ for (int i = 0; i < FILE_DESC_PER_PROCESS; i++) {
+ AuCapability* src = &parent->caps[i];
+ if (!src->valid)
+ continue;
+ if (src->flags & CAP_FLAG_NO_INHERIT)
+ continue;
+ if (!child->fds[i])
+ continue;
+
+ AuCapability* dst = &child->caps[i];
+ dst->object = src->object;
+ dst->object_type = src->object_type;
+ /* rights never increase across inheritance */
+ dst->rights = src->rights;
+ dst->owner = child->creds.uid;
+ dst->flags = src->flags;
+ dst->valid = true;
+ }
+}
\ No newline at end of file
diff --git a/Kernel/Kernel.vcxproj b/Kernel/Kernel.vcxproj
index eb8b9aa34..0d74dd64e 100644
--- a/Kernel/Kernel.vcxproj
+++ b/Kernel/Kernel.vcxproj
@@ -150,7 +150,7 @@
false
- ..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\x64\Debug;%(AdditionalLibraryDirectories)/filealign:0x1000 %(AdditionalOptions)
@@ -200,7 +200,7 @@
false
- ..\x64\Debug;%(AdditionalLibraryDirectories)
+ $(SolutionDir)Build\;..\x64\Debug;%(AdditionalLibraryDirectories)/filealign:0x1000 %(AdditionalOptions)
@@ -250,6 +250,7 @@
+
diff --git a/Kernel/Kernel.vcxproj.filters b/Kernel/Kernel.vcxproj.filters
index 18984cba0..a9ccd4ac8 100644
--- a/Kernel/Kernel.vcxproj.filters
+++ b/Kernel/Kernel.vcxproj.filters
@@ -551,6 +551,7 @@
Fs
+
diff --git a/Kernel/Serv/fileserv.cpp b/Kernel/Serv/fileserv.cpp
index 0de4c9303..7b071a30b 100644
--- a/Kernel/Serv/fileserv.cpp
+++ b/Kernel/Serv/fileserv.cpp
@@ -39,13 +39,14 @@
#include <_null.h>
#include
#include
+#include
/*
* OpenFile -- opens a file for user process
* @param file -- file path
* @param mode -- mode of the file
*/
-int OpenFile(char* filename, int mode) {
+int OpenFile(char* filename, int mode) { SeTextOut("<<<<<<<<<< OPENFILE HIT >>>>>>>>>>\r\n");
x64_cli();
AuThread* current_thr = AuGetCurrentThread();
if (!current_thr)
@@ -85,8 +86,33 @@ int OpenFile(char* filename, int mode) {
file->open(file, NULL);
current_proc->fds[fd] = file;
+
+ /*
+ * Bind a capability to the newly allocated fd.
+ */
+ CapRights rights = CAP_SEEK;
+
+ if (mode & FILE_OPEN_READ_ONLY)
+ rights |= CAP_READ;
+
+ if (mode & (FILE_OPEN_WRITE | FILE_OPEN_CREAT))
+ rights |= CAP_WRITE;
+
+ /* Preserve existing default behaviour. */
+ if (mode == 0)
+ rights |= CAP_READ;
+
+ BordoisilaCapCreate(
+ current_proc,
+ fd,
+ file,
+ CAP_OBJ_FILE,
+ rights);
+
+ SeTextOut("[CAP] Capability created fd=%d rights=%x\r\n", fd, rights);
+
return fd;
-}
+ }
/*
* FileSetOffset -- set a offset inorder to read the
@@ -151,9 +177,12 @@ size_t ReadFile(int fd, void* buffer, size_t length) {
//SeTextOut("Reading from file -> %d -> %x \r\n", fd, file);
if (!file)
- return 0;
- size_t ret_bytes = 0;
-
+ return 0;
+
+ if (!BordoisilaCapCheckRights(current_proc, fd, CAP_READ))
+ return 0;
+
+ size_t ret_bytes = 0;
/* every general file will contain its
* file system node as device */
AuVFSNode* fsys = (AuVFSNode*)file->device;
@@ -207,10 +236,12 @@ size_t WriteFile(int fd, void* buffer, size_t length) {
uint8_t* aligned_buffer = (uint8_t*)buffer;
if (!file)
return 0;
- size_t write_bytes = 0;
- size_t ret_bytes;
+
+ if (!BordoisilaCapCheckRights(current_proc, fd, CAP_WRITE))
+ return 0;
+
/* every general file will contain its
- * file system node as device */
+ * file system node as device */
AuVFSNode* fsys = (AuVFSNode*)file->device;
if (file->flags & FS_FLAG_GENERAL && !(file->flags & FS_FLAG_TTY)) {
@@ -308,9 +339,10 @@ int CloseFile(int fd) {
AuVFSNode* file = current_proc->fds[fd];
if (file->flags & FS_FLAG_FILE_SYSTEM){
- SeTextOut("Closing fs -> %s \r\n", file->filename);
- current_proc->fds[fd] = 0;
- return -1;
+ SeTextOut("Closing fs -> %s \r\n", file->filename);
+ BordoisilaCapDestroy(current_proc, fd);
+ current_proc->fds[fd] = 0;
+ return -1;
}
if (file->flags & FS_FLAG_GENERAL){
kfree(file);
@@ -326,6 +358,7 @@ int CloseFile(int fd) {
file->close(file, file);
}
+ BordoisilaCapDestroy(current_proc, fd);
current_proc->fds[fd] = 0;
return 0;
}
diff --git a/Kernel/process.cpp b/Kernel/process.cpp
index b529061e5..802068f59 100644
--- a/Kernel/process.cpp
+++ b/Kernel/process.cpp
@@ -275,7 +275,9 @@ AuProcess* AuCreateRootProc() {
proc->proc_mmap_len = 0;
proc->waitlist = initialize_list();
for (int i = 0; i < FILE_DESC_PER_PROCESS; i++)
- proc->fds[i] = 0;
+ proc->fds[i] = 0;
+ memset(proc->caps, 0, sizeof(proc->caps));
+
/* create the main thread after loading the
* image file to process, because just after
@@ -322,7 +324,14 @@ AuProcess* AuCreateProcessSlot(AuProcess* parent, char* name) {
proc->proc_mmap_len = 0;
proc->waitlist = initialize_list();
for (int i = 0; i < FILE_DESC_PER_PROCESS; i++)
- proc->fds[i] = 0;
+ proc->fds[i] = 0;
+
+ memset(proc->caps, 0, sizeof(proc->caps));
+
+ /*
+ * TODO: re-enable BordoisilaCapInheritTable(parent, proc)
+ * once fd inheritance is implemented.
+ */
proc->main_thread = NULL;
@@ -384,7 +393,7 @@ AuProcess* AuGetKillableProcess() {
* @param pid -- pid of the process, if -1 then any child
* process
*/
-void AuProcessWaitForTermination(AuProcess *proc, int pid) {
+int AuProcessWaitForTermination(AuProcess *proc, int pid) {
if (pid == -1) {
do {
AuProcess *killable = AuGetKillableProcess();
@@ -529,6 +538,8 @@ void AuProcessExit(AuProcess* proc, bool schedulable) {
}
}
+ BordoisilaCapCleanupProcess(proc);
+
for (int i = 0; i < proc->waitlist->pointer; i++) {
AuThread* thr = (AuThread*)list_remove(proc->waitlist, i);
if (thr) {
diff --git a/KernelAA64/Board/Rpi3bp/rpi3bpIRQ.c b/KernelAA64/Board/Rpi3bp/rpi3bpIRQ.c
index e92f29248..f2bde1446 100644
--- a/KernelAA64/Board/Rpi3bp/rpi3bpIRQ.c
+++ b/KernelAA64/Board/Rpi3bp/rpi3bpIRQ.c
@@ -65,12 +65,11 @@ void RPI3_IRQ_handler(AA64Registers* regs) {
UARTDebugOut("[aurora]:******* rpi3 timer irq++ %d\r\n", bit);
/* if (bit == 1)
for (;;);*/
- suspendTimer();
- setupTimerIRQ();
-
+ // suspendTimer();
+ // setupTimerIRQ();
+ resetTimer();
/** handle kernel expired kernel timers */
AuroraTimerTick();
-
AuScheduleThread(regs);
}
if (pending & INT_SRC_CNTPSIRQ) {
@@ -80,11 +79,11 @@ void RPI3_IRQ_handler(AA64Registers* regs) {
UARTDebugOut("[aurora]: rpi timer HPIRQ++ \r\n");
}
if (pending & (1ULL << 3)) {
- suspendTimer();
- setupTimerIRQ();
-
+ //suspendTimer();
+ //setupTimerIRQ();
+ resetTimer();
/** handle kernel's expired timers */
- AuroraTimerTick();
+ AuroraTimerTick();
AuScheduleThread(regs);
}
diff --git a/KernelAA64/Board/Rpi3bp/rpi_ili9486.c b/KernelAA64/Board/Rpi3bp/rpi_ili9486.c
index 5ea57bf7e..24c83cd72 100644
--- a/KernelAA64/Board/Rpi3bp/rpi_ili9486.c
+++ b/KernelAA64/Board/Rpi3bp/rpi_ili9486.c
@@ -27,7 +27,7 @@
*
**/
-#ifdef __TARGET_BOARD_RPI3__
+#if 0
#include
#include
diff --git a/KernelAA64/Board/Rpi3bp/vc4dsi.c b/KernelAA64/Board/Rpi3bp/vc4dsi.c
index 77f069f1b..778b49883 100644
--- a/KernelAA64/Board/Rpi3bp/vc4dsi.c
+++ b/KernelAA64/Board/Rpi3bp/vc4dsi.c
@@ -34,6 +34,8 @@
#include
#include
+#if 0 // __TARGET_BOARD_RPI3__
+
#define MAILBOX_BASE (RPI_MMIO_BASE + 0x00b880)
#define DSI0_BASE (RPI_MMIO_BASE + 0x209000)
#define DSI1_BASE (RPI_MMIO_BASE + 0x700000)
@@ -764,4 +766,6 @@ void AuVC4DSIInit() {
LCDPutPixel(30, 40, rgb_to_rgb565(255, 255, 255));
AuTextOut("[aurora]: VC4 DSI Display initialized \r\n");
-}
\ No newline at end of file
+}
+
+#endif
\ No newline at end of file
diff --git a/KernelAA64/Board/Virt/virt.c b/KernelAA64/Board/Virt/virt.c
index 01805cc39..f6a78496a 100644
--- a/KernelAA64/Board/Virt/virt.c
+++ b/KernelAA64/Board/Virt/virt.c
@@ -35,6 +35,7 @@
#include
#include
#include
+#include
#define VIRTIO_INPUT_KEYBOARD 1
#define VIRTIO_INPUT_TABLET 2
@@ -43,7 +44,14 @@ uint8_t AuVirtIOInputCheck(uint64_t device, int bus,int dev,int func) {
uint64_t barLo = AuPCIERead(device, PCI_BAR4, bus, dev, func);
uint64_t barHi = AuPCIERead(device, PCI_BAR5, bus, dev, func);
uint64_t bar = ((uint64_t)barHi << 32) | (barLo & ~0xFULL);
- uint64_t finalAddr = (uint64_t)AuMapMMIO(bar, 16);
+
+ /* we don't need to map the bar to MMIO range, because this function
+ * is temporary one, won't be used later in the system. We have
+ * long way to go when lower half address range is cleared. Till then
+ * kernel has lower half of address range present, so taking advantage
+ * of lower half till then
+ */
+ uint64_t finalAddr = bar;
struct VirtioDeviceConfig* cfg = (struct VirtioDeviceConfig*)(finalAddr + 0x2000);
cfg->select = 1;
cfg->subsel = 0;
@@ -78,7 +86,8 @@ void AuVirtIOInputInitialize() {
uint8_t sub_ClassCode = AuPCIERead(address, PCI_SUBCLASS, bus, dev, func);
uint16_t vendID = AuPCIERead(address, PCI_VENDOR_ID, bus, dev, func);
uint16_t devID = AuPCIERead(address, PCI_DEVICE_ID, bus, dev, func);
- UARTDebugOut("Vendor ID attached : %x devID : %x \r\n", vendID, devID);
+ // UARTDebugOut("Vendor ID attached : %x devID : %x \r\n", vendID, devID);
+ //UARTDebugOut("Vendor ID attached : %x devID : %x \r\n", vendID, devID);
if (vendID == 0x1AF4 && devID == 0x1052) {
uint8_t devType = AuVirtIOInputCheck(address, bus, dev, func);
if (devType == VIRTIO_INPUT_KEYBOARD) {
@@ -99,4 +108,15 @@ void AuVirtIOInputInitialize() {
}
}
UARTDebugOut("Virtio Input initialized \r\n");
+}
+
+#define GOOGLE_GOLDFISH_RTC_BASE 0x09010000
+#define RTC_TIME_LOW ((volatile uint32_t*)(GOOGLE_GOLDFISH_RTC_BASE + 0x00))
+#define RTC_TIME_HIGH ((volatile uint32_t*)(GOOGLE_GOLDFISH_RTC_BASE + 0x04))
+
+
+uint64_t AuVirtGetBootEpoch() {
+ uint32_t low = *RTC_TIME_LOW;
+ uint32_t high = *RTC_TIME_HIGH;
+ return (((uint64_t)high << 32) | low);
}
\ No newline at end of file
diff --git a/KernelAA64/Board/board.c b/KernelAA64/Board/board.c
index de5ed7715..e473406d3 100644
--- a/KernelAA64/Board/board.c
+++ b/KernelAA64/Board/board.c
@@ -30,11 +30,15 @@
**/
#include
#include
+#include
+#include
#include
#include
#include
#include
#include
+#include
+#include
extern void imx8mp_gpc_init();
@@ -42,6 +46,7 @@ extern void imx8mp_gpc_init();
#ifdef __TARGET_BOARD_QEMU_VIRT__
extern void virt_power_down(uint64_t code);
extern void virt_power_reboot(uint64_t code);
+extern uint64_t AuVirtGetBootEpoch();
#endif
@@ -55,7 +60,9 @@ void AuAA64BoardInitialize() {
#elif __TARGET_BOARD_IMX8MP_VERDIN_DAHLIA__ || (__TARGET_BOARD_IMX8MP_SOC__)
/** initialize the ccm module **/
imx8mp_gpc_init();
- imx8mp_ccm_init();
+ imx8mp_pll_init();
+ imx8mp_gate_init();
+ imx8mp_ccm_init();
#endif
}
@@ -64,8 +71,14 @@ void AuAA64BoardInitialize() {
*/
void AuAA64BoardSleepUS(uint32_t us) {
#ifdef __TARGET_BOARD_RPI3__
- AuRPI3DelayUS(us);
+ return AuRPI3DelayUS(us);
#endif
+ uint64_t freq = get_cntfrq_el0();
+ uint64_t ticks = (freq / 1000000ULL) * us;
+ uint64_t start = get_cntpct_el0();
+ while ((get_cntpct_el0() - start) < ticks) {
+ _wfi();
+ }
}
/**
@@ -76,6 +89,7 @@ void AuAA64BoardSleepMS(uint32_t ms) {
#ifdef __TARGET_BOARD_RPI3__
AuRPIDelayMS(ms);
#endif
+ AuAA64BoardSleepUS(ms * 1000ULL);
}
/**
@@ -96,4 +110,14 @@ void AuAA64BoardReboot() {
UARTDebugOut("[aurora]: restarting your system \r\n");
virt_power_reboot(0x84000009);
#endif
+}
+
+/**
+ * @brief AuAA64BoardGetBootEpoch -- returns the
+ * boot epoch time from board
+ */
+uint64_t AuAA64BoardGetBootEpoch() {
+#ifdef __TARGET_BOARD_QEMU_VIRT__
+ return AuVirtGetBootEpoch();
+#endif
}
\ No newline at end of file
diff --git a/KernelAA64/Board/imx8mp/imx8mp_clk.c b/KernelAA64/Board/imx8mp/imx8mp_clk.c
index 2c5214f7e..7b3a62f7a 100644
--- a/KernelAA64/Board/imx8mp/imx8mp_clk.c
+++ b/KernelAA64/Board/imx8mp/imx8mp_clk.c
@@ -35,9 +35,307 @@
#include
#include
#include
+#include
+#include
+#include <_null.h>
+#include
+#include
+#include
+#include
static uint64_t _ccm_base;
+typedef struct _clk_node_ {
+ char* name;
+ uint32_t(*recalc_rate)(struct _clk_node_* self);
+ int num_parent;
+ struct _clk_node_** parent;
+ uint32_t reg_offset;
+ uint32_t clk_slice;
+ uint32_t pre_podf;
+ uint32_t post_podf;
+ int is_composite;
+ uint32_t anatop_base;
+ bool _pll_read;
+ int current_parent_idx;
+}imx8mp_clk;
+
+typedef struct _dt_clk_bindings_ {
+ uint32_t clk_id;
+ int has_parent;
+ uint32_t parent_clk_id;
+ uint32_t rate_hz;
+}imx8mp_dt_clk;
+
+static imx8mp_clk _clk_node[100];
+static imx8mp_dt_clk _assigned_clk[100];
+static int _clk_node_count = 0;
+static int _assigned_clk_cnt = 0;
+
+static void imx8mp_write_target_root(uint32_t clk_root_idx, uint32_t offset,
+ uint32_t mux_val, uint32_t pre_podf, uint32_t post_podf);
+
+static imx8mp_clk* _imx8mp_clk_alloc(const char* name) {
+ if (_clk_node_count == 100) {
+ BPrintK(BORDOISILA_ERROR, "imx8mp failed to allocate clock, max clock exceeds \r\n");
+ return NULL;
+ }
+ imx8mp_clk* n = &_clk_node[_clk_node_count++];
+ n->name = name;
+ n->parent = NULL;
+ n->current_parent_idx = 0;
+ n->is_composite = 0;
+ return n;
+}
+
+
+
+static uint32_t _imx8mp_fixed_recalc(imx8mp_clk* clk) {
+ return clk->pre_podf;
+}
+
+static imx8mp_clk* imx8mp_clk_fixed(const char* name, uint32_t fixed_hz) {
+ imx8mp_clk* n = _imx8mp_clk_alloc(name);
+ n->recalc_rate = _imx8mp_fixed_recalc;
+ n->pre_podf = fixed_hz;
+ return n;
+}
+
+static uint32_t imx8mp_composite_recalc(imx8mp_clk* self) {
+ imx8mp_clk* parent = self->parent[self->current_parent_idx];
+ uint32_t parent_rate = parent->recalc_rate(parent);
+ uint32_t total_div = (self->pre_podf + 1) * (self->post_podf + 1);
+ return parent_rate / total_div;
+}
+
+static imx8mp_clk* imx8mp_clk_composite(const char* name, imx8mp_clk** parent, int n_parents) {
+ imx8mp_clk* n = _imx8mp_clk_alloc(name);
+ n->recalc_rate = imx8mp_composite_recalc;
+ n->num_parent = n_parents;
+ n->parent = parent;
+ n->is_composite = 1;
+ n->pre_podf = 0;
+ n->post_podf = 0;
+ n->anatop_base = 0;
+ n->_pll_read = 0;
+ return n;
+}
+
+
+static imx8mp_clk* imx8mp_clk_pll(const char* name, imx8mp_clk** parent, int n_parents, uint32_t anatop) {
+ imx8mp_clk* n = _imx8mp_clk_alloc(name);
+ n->recalc_rate = 0;
+ n->num_parent = n_parents;
+ n->parent = parent;
+ n->is_composite = 1;
+ n->pre_podf = 0;
+ n->post_podf = 0;
+ n->anatop_base = anatop;
+ n->_pll_read = 1;
+ return n;
+}
+
+static uint32_t AuDeviceTreeGetFixedClockRate(const char* node_name) {
+ uint32_t* node = AuDeviceTreeGetNode(node_name);
+ if (!node) {
+ BPrintK(BORDOISILA_ERROR, "imx8mp dtp node: %s not found \r\n", node_name);
+ return 0;
+ }
+
+ uint32_t rate = AuDeviceTreeGetU32Property(node, "clock-frequency", 0);
+ BPrintK(BORDOISILA_INFO, "clock rate for node : %s is %u \r\n", node_name, rate);
+ return rate;
+}
+
+
+#define IMX8MP_SYS_PLL1_RATE_HZ 800000000UL
+#define IMX8MP_SYS_PLL2_RATE_HZ 1000000000UL
+
+static imx8mp_clk* g_sys_pll1_40m;
+static imx8mp_clk* g_sys_pll1_80m;
+static imx8mp_clk* g_sys_pll1_100m;
+static imx8mp_clk* g_sys_pll1_133m;
+static imx8mp_clk* g_sys_pll1_160m;
+static imx8mp_clk* g_sys_pll1_200m;
+static imx8mp_clk* g_sys_pll1_266m;
+static imx8mp_clk* g_sys_pll1_400m;
+static imx8mp_clk* g_sys_pll1_800m;
+
+static imx8mp_clk* g_sys_pll2_50m;
+static imx8mp_clk* g_sys_pll2_100m;
+static imx8mp_clk* g_sys_pll2_125m;
+static imx8mp_clk* g_sys_pll2_166m;
+static imx8mp_clk* g_sys_pll2_200m;
+static imx8mp_clk* g_sys_pll2_250m;
+static imx8mp_clk* g_sys_pll2_333m;
+static imx8mp_clk* g_sys_pll2_500m;
+static imx8mp_clk* g_sys_pll2_1000m;
+static imx8mp_clk* g_osc_24m;
+
+static imx8mp_clk* g_clk_ext1;
+static imx8mp_clk* g_clk_ext2;
+static imx8mp_clk* g_clk_ext3;
+static imx8mp_clk* g_clk_ext4;
+
+static imx8mp_clk* g_video_pll1_out;
+static imx8mp_clk* g_audio_pll1_out;
+static imx8mp_clk* g_gpu_pll_out;
+
+static imx8mp_clk* g_audio_pll2_out;
+static imx8mp_clk* g_sys_pll3_out;
+
+static void imx8mp_config_fixed_clock() {
+ uint64_t parent = imx8mp_pll_get_parent_rate(__IMX8MP_SYS_PLL1_GEN_CTRL);
+
+ uint64_t pll1_rate = imx8mp_pll_recalc_rate(__IMX8MP_SYS_PLL1_GEN_CTRL, parent);
+ parent = imx8mp_pll_get_parent_rate(__IMX8MP_SYS_PLL2_GEN_CTRL);
+ uint64_t pll2_rate = imx8mp_pll_recalc_rate(__IMX8MP_SYS_PLL2_GEN_CTRL, parent);
+
+ parent = imx8mp_pll_get_parent_rate(__IMX8MP_SYS_PLL3_GEN_CTRL);
+ uint64_t pll3_rate = imx8mp_pll_recalc_rate(__IMX8MP_SYS_PLL3_GEN_CTRL, parent);
+ BPrintK(BORDOISILA_INFO, "imx8mp: configuring clock rate database, pll1 rate: %u, pll3 rate: %u \r\n",
+ pll1_rate, pll3_rate);
+
+ /**
+ * DO NOTE: video pll1 rate and audio pll1 rate are in P-O-R (Power on Reset) values
+ * maybe, we need to configure that using CCM analog base
+ */
+ parent = imx8mp_pll_get_parent_rate(__IMX8MP_VIDEO_PLL1_GEN_CTRL);
+ uint64_t video_pll1_rate = imx8mp_pll_recalc_rate(__IMX8MP_VIDEO_PLL1_GEN_CTRL, parent);
+
+ parent = imx8mp_pll_get_parent_rate(__IMX8MP_AUDIO_PLL1_GEN_CTRL);
+ uint64_t audio_pll1_rate = imx8mp_pll_recalc_rate(__IMX8MP_AUDIO_PLL1_GEN_CTRL, parent);
+
+ parent = imx8mp_pll_get_parent_rate(__IMX8MP_AUDIO_PLL2_GEN_CTRL);
+ uint64_t audio_pll2_rate = imx8mp_pll_recalc_rate(__IMX8MP_AUDIO_PLL2_GEN_CTRL, parent);
+
+ parent = imx8mp_pll_get_parent_rate(__IMX8MP_GPU_PLL_GEN_CTRL);
+ uint64_t gpu_pll_rate = imx8mp_pll_recalc_rate(__IMX8MP_GPU_PLL_GEN_CTRL, parent);
+
+ BPrintK(BORDOISILA_INFO, "imx8mp gpu pll rate : %u \r\n", gpu_pll_rate);
+
+ g_osc_24m = imx8mp_clk_fixed("osc_24m", 24000000);
+ g_sys_pll1_800m = imx8mp_clk_fixed("sys_pll1_800m", pll1_rate);
+ g_sys_pll1_400m = imx8mp_clk_fixed("sys_pll1_400m", pll1_rate / 2);
+ g_sys_pll1_266m = imx8mp_clk_fixed("sys_pll1_266m", pll1_rate / 3);
+ g_sys_pll1_200m = imx8mp_clk_fixed("sys_pll1_200m", pll1_rate / 4);
+ g_sys_pll1_160m = imx8mp_clk_fixed("sys_pll1_160m", pll1_rate / 5);
+ g_sys_pll1_133m = imx8mp_clk_fixed("sys_pll1_133m", pll1_rate / 6);
+ g_sys_pll1_100m = imx8mp_clk_fixed("sys_pll1_100m", pll1_rate / 8);
+ g_sys_pll1_80m = imx8mp_clk_fixed("sys_pll1_80m", pll1_rate / 10);
+ g_sys_pll1_40m = imx8mp_clk_fixed("sys_pll1_40m", pll1_rate / 20);
+
+ g_sys_pll2_1000m = imx8mp_clk_fixed("sys_pll2_1000m", pll2_rate / 1);
+ g_sys_pll2_500m = imx8mp_clk_fixed("sys_pll2_500m", pll2_rate / 2);
+ g_sys_pll2_333m = imx8mp_clk_fixed("sys_pll2_333m", pll2_rate / 3);
+ g_sys_pll2_250m = imx8mp_clk_fixed("sys_pll2_250m", pll2_rate / 4);
+ g_sys_pll2_200m = imx8mp_clk_fixed("sys_pll2_200m", pll2_rate / 5);
+ g_sys_pll2_166m = imx8mp_clk_fixed("sys_pll2_166m", pll2_rate / 6);
+ g_sys_pll2_125m = imx8mp_clk_fixed("sys_pll_125m", pll2_rate / 8);
+ g_sys_pll2_100m = imx8mp_clk_fixed("sys_pll2_100m", pll2_rate / 10);
+ g_sys_pll2_50m = imx8mp_clk_fixed("sys_pll2_50m", pll2_rate / 20);
+
+ uint32_t ext1_hz = AuDeviceTreeGetFixedClockRate("clock-ext1");
+ uint32_t ext2_hz = AuDeviceTreeGetFixedClockRate("clock-ext2");
+ uint32_t ext3_hz = AuDeviceTreeGetFixedClockRate("clock-ext3");
+ uint32_t ext4_hz = AuDeviceTreeGetFixedClockRate("clock-ext4");
+
+ g_clk_ext1 = imx8mp_clk_fixed("clk_ext1", ext1_hz);
+ g_clk_ext2 = imx8mp_clk_fixed("clk_ext2", ext2_hz);
+ g_clk_ext3 = imx8mp_clk_fixed("clk_ext3", ext3_hz);
+ g_clk_ext4 = imx8mp_clk_fixed("clk_ext4", ext4_hz);
+
+ g_audio_pll1_out = imx8mp_clk_fixed("audio_pll1_out", audio_pll1_rate);
+ g_video_pll1_out = imx8mp_clk_fixed("video_pll1_out", video_pll1_rate);
+ g_audio_pll2_out = imx8mp_clk_fixed("audio_pll2_out", audio_pll2_rate);
+ g_sys_pll3_out = imx8mp_clk_fixed("sys_pll3_out", pll3_rate);
+ g_gpu_pll_out = imx8mp_clk_fixed("gpu_pll_out", gpu_pll_rate);
+}
+
+
+static void imx8mp_clk_set_rate(imx8mp_clk* self, uint32_t target_hz) {
+ uint32_t best_err = UINT32_MAX;
+ int best_parent = 0, best_pre = 0, best_post = 0;
+
+ for (int p = 0; p < self->num_parent; p++) {
+ uint32_t parent_rate = self->parent[p]->recalc_rate(self->parent[p]);
+ for (uint32_t div = 1; div <= 512; div++) {
+ uint32_t rate = parent_rate / div;
+ uint32_t err = (rate > target_hz) ? rate - target_hz : target_hz - rate;
+ if (err < best_err) {
+ best_err = err;
+ best_parent = p;
+
+ for (uint32_t pre = 1; pre <= 8; pre++) {
+ if (div % pre == 0 && div / pre <= 64) {
+ best_pre = pre - 1;
+ best_post = (div / pre) - 1;
+ break;
+ }
+ }
+ if (err == 0) goto done;
+ }
+ }
+ }
+done:
+ self->current_parent_idx = best_parent;
+ self->pre_podf = best_pre;
+ self->post_podf = best_post;
+ BPrintK(BORDOISILA_INFO, "using parent index : %d for clock : %s \r\n", self->current_parent_idx, self->name);
+ BPrintK(BORDOISILA_INFO, "pre podf: %d, post podf : %d \r\n", self->pre_podf, self->post_podf);
+ imx8mp_write_target_root(self->clk_slice, 0x0, self->current_parent_idx, self->pre_podf, self->post_podf);
+
+}
+
+
+void imx8mp_parse_assigned_clk(const char* nodename) {
+ uint32_t* node = AuDeviceTreeGetNode(nodename);
+ if (!node) {
+ BPrintK(BORDOISILA_INFO, "imx8mp dtb node not found : %s \r\n", nodename);
+ return;
+ }
+
+ uint32_t n_clk, n_parent, n_rate;
+ uint32_t* clk_cells = AuDeviceTreeGetPropCells(node, "assigned-clocks", &n_clk);
+ uint32_t* parent_cells = AuDeviceTreeGetPropCells(node, "assigned-clock-parents", &n_parent);
+ uint32_t* rate_cells = AuDeviceTreeGetPropCells(node, "assigned-clock-rates", &n_rate);
+
+ if (!clk_cells) {
+ BPrintK(BORDOISILA_ERROR, "imx8mp assigned-clocks: property absent on : %s \r\n", nodename);
+ return;
+ }
+
+ uint32_t num_entries = n_clk / 2;
+ uint32_t parent_idx = 0, rate_idx = 0;
+
+ for (uint32_t i = 0; i < num_entries && i < 100; i++) {
+ imx8mp_dt_clk* e = &_assigned_clk[_assigned_clk_cnt];
+
+ e->clk_id = AuDTBSwap32(clk_cells[i * 2 + 1]);
+ e->rate_hz = (rate_idx < n_rate) ? AuDTBSwap32(rate_cells[rate_idx]) : 0;
+ rate_idx++;
+
+ if (parent_idx < n_parent) {
+ uint32_t first = AuDTBSwap32(parent_cells[parent_idx]);
+ if (first == 0) {
+ e->has_parent = 0;
+ parent_idx += 1;
+ }
+ else {
+ e->has_parent = 1;
+ e->parent_clk_id = AuDTBSwap32(parent_cells[parent_idx + 1]);
+ parent_idx += 2;
+ }
+ }
+ else {
+ e->has_parent = 0;
+ }
+
+ BPrintK(BORDOISILA_INFO, "assigned-clock[%u]: id=%u, parent=%s \r\n", i, e->clk_id, e->has_parent ? "yes" : "no");
+ BPrintK(BORDOISILA_INFO, "= parent id : %u, rate=%u Hz \r\n", e->parent_clk_id, e->rate_hz);
+ _assigned_clk_cnt++;
+ }
+}
/**
* imx8mp_hdmi_ccm_init -- initialize hdmi root clocks
*/
@@ -84,25 +382,182 @@ void imx8mp_lcdif_ccm_init() {
imx8mp_ccm_write(MEDIA_DISP2_CLK_ROOT, 0x00, setval);*/
}
+
+static bool is_imx8mp_clk_enabled(uint32_t clk_idx) {
+ volatile uint32_t* root = (volatile uint32_t*)CCM_ROOT_REG(_ccm_base, clk_idx);
+ bool is_true = false;
+ uint32_t rval = *root;
+ if ((rval & (1u << 28)) != 0)
+ is_true = true;
+
+ return is_true;
+}
+
+static uint32_t imx8mp_clk_get_mux(uint32_t clk_idx) {
+ volatile uint32_t* root = (volatile uint32_t*)CCM_ROOT_REG(_ccm_base, clk_idx);
+ uint32_t rval = *root;
+ return (rval >> 24) & 0x7u;
+}
+
+
+#define FORM_CLK_COMPOSITE(name,parent,n_parent) imx8mp_clk_composite(name,parent,n_parent)
+
+
/**
*imx8mp_void_ccm_init -- map the ccm module
*/
void imx8mp_ccm_init() {
AuTextOut("[imx8mp_board]: initializing clock control module (ccm) \r\n");
- _ccm_base = (uint64_t)AuMapMMIO(CCM_BASE, 16);
+ _ccm_base = (uint64_t)CCM_BASE; // AuMapMMIO(CCM_BASE, 16);
+ imx8mp_config_fixed_clock();
+
+ /**
+ * Reference: Linux source code, clk-imx8mp.c
+ */
+
+ static imx8mp_clk* media_axi_parents[8];
+ media_axi_parents[0] = g_osc_24m;
+ media_axi_parents[1] = g_sys_pll2_1000m;
+ media_axi_parents[2] = g_sys_pll1_800m;
+ media_axi_parents[3] = g_sys_pll3_out;
+ media_axi_parents[4] = g_sys_pll1_40m;
+ media_axi_parents[5] = g_audio_pll2_out;
+ media_axi_parents[6] = g_clk_ext1;
+ media_axi_parents[7] = g_sys_pll2_500m;
+ imx8mp_clk* media_axi_clk = FORM_CLK_COMPOSITE("media_axi_axi", media_axi_parents, 8);
+ media_axi_clk->clk_slice = MEDIA_AXI_CLK_ROOT;
+
+
+ static imx8mp_clk* media_apb_parents[8];
+ media_apb_parents[0] = g_osc_24m;
+ media_apb_parents[1] = g_sys_pll2_125m;
+ media_apb_parents[2] = g_sys_pll1_800m;
+ media_apb_parents[3] = g_sys_pll3_out;
+ media_apb_parents[4] = g_sys_pll1_40m;
+ media_apb_parents[5] = g_audio_pll2_out;
+ media_apb_parents[6] = g_clk_ext1;
+ media_apb_parents[7] = g_sys_pll1_133m;
+ imx8mp_clk* media_apb_clk = FORM_CLK_COMPOSITE("media_apb_axi", media_apb_parents, 8);
+ media_apb_clk->clk_slice = MEDIA_APB_CLK_ROOT;
+
+
+ static imx8mp_clk* gpu3d_sels[8];
+ gpu3d_sels[0] = g_osc_24m;
+ gpu3d_sels[1] = g_gpu_pll_out;
+ gpu3d_sels[2] = g_sys_pll1_800m;
+ gpu3d_sels[3] = g_sys_pll3_out;
+ gpu3d_sels[4] = g_sys_pll2_1000m;
+ gpu3d_sels[5] = g_audio_pll1_out;
+ gpu3d_sels[6] = g_video_pll1_out;
+ gpu3d_sels[7] = g_audio_pll2_out;
+ imx8mp_clk* gpu3d_clk = FORM_CLK_COMPOSITE("gpu3d_core", gpu3d_sels, 8);
+ gpu3d_clk->clk_slice = GPU3D_CORE_CLK_ROOT;
+
+
+ static imx8mp_clk* gpu3d_shader[8];
+ gpu3d_shader[0] = g_osc_24m;
+ gpu3d_shader[1] = g_gpu_pll_out;
+ gpu3d_shader[2] = g_sys_pll1_800m;
+ gpu3d_shader[3] = g_sys_pll3_out;
+ gpu3d_shader[4] = g_sys_pll2_1000m;
+ gpu3d_shader[5] = g_audio_pll1_out;
+ gpu3d_shader[6] = g_video_pll1_out;
+ gpu3d_shader[7] = g_audio_pll2_out;
+ imx8mp_clk* gpu3d_sel = FORM_CLK_COMPOSITE("gpu3d_shader", gpu3d_shader, 8);
+ gpu3d_sel->clk_slice = GPU3D_SHADER_CLK_ROOT;
+
+
+
/** by default let's only enable HDMI + LCDIF, because we need
* framebuffer output :)
*/
- imx8mp_hdmi_ccm_init();
- AuTextOut("[imx8mp_board]: hdmi apb and axi clock root enabled \r\n");
- imx8mp_lcdif_ccm_init();
+
+ // let's enable some clock roots by default, by setting mux/pre-podf/post-podf
+ if (is_imx8mp_clk_enabled(AHB_CLK_ROOT)) {
+ BPrintK(BORDOISILA_WARN, "ccm ahb clock root enabled mux: %d\r\n", imx8mp_clk_get_mux(AHB_CLK_ROOT));
+ }
+ else
+ BPrintK(BORDOISILA_WARN, "ccm ahb clock is not enabled \r\n");
+
+ if (is_imx8mp_clk_enabled(HDMI_APB_CLK_ROOT)) {
+ BPrintK(BORDOISILA_WARN, "hdmi apb clock root enabled, mux: %d \r\n", imx8mp_clk_get_mux(HDMI_APB_CLK_ROOT));
+ }
+ else
+ BPrintK(BORDOISILA_WARN, "hdmi apb clock is not enabled \r\n");
+
+ if (is_imx8mp_clk_enabled(GPU_AHB_CLK_ROOT)) {
+ BPrintK(BORDOISILA_WARN, "GPU ahb clock root enabled , mux: %d\r\n", imx8mp_clk_get_mux(GPU_AHB_CLK_ROOT));
+ }
+ else
+ BPrintK(BORDOISILA_WARN, "GPU AHB Clock is not enabled \r\n");
+
+ if (is_imx8mp_clk_enabled(GPU_AXI_CLK_ROOT)) {
+ BPrintK(BORDOISILA_WARN, "GPU AXI clock root enabled, mux: %d\r\n", imx8mp_clk_get_mux(GPU_AXI_CLK_ROOT));
+ }
+ else
+ BPrintK(BORDOISILA_WARN, "GPU AXI Clock not enabled\r\n");
+
+ if (is_imx8mp_clk_enabled(MEDIA_APB_CLK_ROOT)) {
+ BPrintK(BORDOISILA_WARN, "MEDIA APB clock root enabled, mux: %d \r\n", imx8mp_clk_get_mux(MEDIA_APB_CLK_ROOT));
+ }
+ else
+ BPrintK(BORDOISILA_WARN, "MEDIA APB clock not enabled \r\n");
+
+ if (is_imx8mp_clk_enabled(MEDIA_AXI_CLK_ROOT)) {
+ BPrintK(BORDOISILA_WARN, "MEDIA AXI clock enabled, mux : %d \r\n", imx8mp_clk_get_mux(MEDIA_AXI_CLK_ROOT));
+ }
+ else
+ BPrintK(BORDOISILA_WARN, "MEDIA AXI clock not enabled \r\n");
+
+
+ //and gate them
/** todo try setting the clr bits also */
- AuTextOut("[imx8mp_board]: ldcif clock root enabled \r\n");
- AuTextOut("[imx8mp_board]: clock control module (ccm) initialized \r\n");
+ imx8mp_clk_set_rate(media_axi_clk, 500000000);
+ imx8mp_clk_gate_enable(IMX8MP_CLK_MEDIA_AXI_ROOT);
}
+
+static void imx8mp_write_target_root(uint32_t clk_root_idx, uint32_t offset,
+ uint32_t mux_val, uint32_t pre_podf, uint32_t post_podf) {
+ volatile uint32_t* root = (volatile uint32_t*)(CCM_ROOT_REG(_ccm_base, clk_root_idx) + offset);
+
+ uint32_t val = *root;
+
+ val &= ~(1U << 28);
+ *root = val;
+
+ dsb_ish();
+ isb_flush();
+
+ val &= ~(0x7u << 24);
+ val |= (mux_val & 0x7u) << 24;
+ val &= ~(0x7u << 16);
+ val |= (pre_podf & 0x7u) << 16;
+ val &= ~(0x3Fu << 0);
+ val |= (post_podf & 0x3Fu) << 0;
+ *root = val;
+
+ // enable the clock
+ val |= (1u << 28);
+ *root = val;
+
+ dsb_ish();
+ isb_flush();
+
+ BPrintK(BORDOISILA_WARN, "imx8mp target root written successfully address : %x \r\n", root);
+ //for safety :-) hihi
+ for (int i = 0; i < 100; i++)
+ ;
+
+ uint32_t confirm = *root;
+ if (((confirm >> 24) & 0x7u) != mux_val ||
+ ((confirm >> 28) & 0x1u) != 1u) {
+ BPrintK(BORDOISILA_WARN, "imx8mp target root write mismatch at offset : %x, wanted mux = %x got = %x \r\n",
+ root, mux_val, ((confirm >> 24) & 0x7u));
+ }
+}
/**
* imx8mp_ccm_write -- write value to clock indexed register
*/
diff --git a/KernelAA64/Board/imx8mp/imx8mp_clk_gate.c b/KernelAA64/Board/imx8mp/imx8mp_clk_gate.c
new file mode 100644
index 000000000..d2fb58f2b
--- /dev/null
+++ b/KernelAA64/Board/imx8mp/imx8mp_clk_gate.c
@@ -0,0 +1,263 @@
+/**
+* @file imx8mp_clk_gate.c
+*
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#if defined(__TARGET_BOARD_IMX8MP_VERDIN_DAHLIA__) || defined(__TARGET_BOARD_IMX8MP_SOC__)
+
+
+#include
+#include
+#include <_null.h>
+#include
+#include
+#include
+
+static _imx8mp_gate_t _gate_registry[UINT8_MAX];
+
+/** we are ignoring GATE4 entries for DDR and other devices */
+#define GATE2_SET_ENTRY(n,_id,_offset) \
+ _gate_registry[n].root_id = _id; \
+ _gate_registry[n].base_addr = _offset; \
+ _gate_registry[n]._gate4 = 0;
+
+#define GATE4_SET_ENTRY(n,_id,_offset) \
+ _gate_registry[n].root_id = _id; \
+ _gate_registry[n].base_addr = _offset; \
+ _gate_registry[n]._gate4 = 1;
+
+
+/**
+ * @brief imx8mp_gate_init -- initialize gate data registry
+ */
+void imx8mp_gate_init() {
+ int n = 0;
+
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_DRAM1_ROOT, 0x4050);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_ECSPI1_ROOT, 0x4070);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_ECSPI3_ROOT, 0x4090);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_ENET1_ROOT, 0x40a0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_GPIO1_ROOT, 0x40b0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_GPIO2_ROOT, 0x40c0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_GPIO3_ROOT, 0x40d0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_GPIO4_ROOT, 0x40e0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_GPIO5_ROOT, 0x40f0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_GPT1_ROOT, 0x4100);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_GPT2_ROOT, 0x4110);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_GPT3_ROOT, 0X4120);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_GPT4_ROOT, 0x4130);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_GPT5_ROOT, 0x4140);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_I2C1_ROOT, 0x4170);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_I2C2_ROOT, 0x4180);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_I2C3_ROOT, 0x4190);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_I2C4_ROOT, 0x41a0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_MU_ROOT, 0x4210);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_OCOTP_ROOT, 0x4220);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_PCIE_ROOT, 0x4250);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_PWM1_ROOT, 0x4280);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_PWM2_ROOT, 0x4290);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_PWM3_ROOT, 0x42a0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_PWM4_ROOT, 0x42b0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_QOS_ROOT, 0x42c0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_QOS_ENET_ROOT, 0x42e0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_QSPI_ROOT, 0x42f0);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_NAND_ROOT, 0x4300); //shared
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_NAND_USDHC_BUS_RAWNAND_CLK, 0x4300); //shared2
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_I2C5_ROOT, 0x4330); //shared
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_I2C6_ROOT, 0x4340); //shared
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_CAN1_ROOT, 0x4350); //shared
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_CAN2_ROOT, 0x4360); //shared
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_SDMA1_ROOT, 0x43a0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_SIM_ENET_ROOT, 0x4400);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_ENET_QOS_ROOT, 0x43b0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_GPU2D_ROOT, 0x4450);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_GPU3D_ROOT, 0x4460);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_UART1_ROOT, 0x4490);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_UART2_ROOT, 0x44a0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_UART3_ROOT, 0x44b0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_UART4_ROOT, 0x44c0);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_USB_ROOT, 0x44d0);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_USB_SUSP, 0x44d0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_USB_PHY_ROOT, 0x44f0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_USDHC1_ROOT, 0x4510);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_USDHC2_ROOT, 0x4520);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_WDOG1_ROOT, 0x4530);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_WDOG2_ROOT, 0x4540);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_WDOG3_ROOT, 0x4550);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_VPU_G1_ROOT, 0x4560);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_GPU_ROOT, 0x4570);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_VPU_VC8KE_ROOT, 0x4590);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_VPU_G2_ROOT, 0x45a0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_NPU_ROOT, 0x45b0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_HSIO_ROOT, 0x45c0);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_MEDIA_APB_ROOT, 0x45d0);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_MEDIA_AXI_ROOT, 0x45d0);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_MEDIA_CAM1_PIX_ROOT, 0x45d0);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_MEDIA_CAM2_PIX_ROOT, 0x45d0);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_MEDIA_DISP1_PIX_ROOT, 0x45d0);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_MEDIA_DISP2_PIX_ROOT, 0x45d0);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_MEDIA_MIPI_PHY1_REF_ROOT, 0x45d0);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_MEDIA_LDB_ROOT, 0x45d0);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_MEDIA_ISP_ROOT, 0x45d0);
+ n++;
+
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_USDHC3_ROOT, 0x45e0);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_HDMI_ROOT, 0x45f0);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_TSENSOR_ROOT, 0x4620);
+ n++;
+ GATE4_SET_ENTRY(n, IMX8MP_CLK_VPU_ROOT, 0x4630);
+ n++;
+
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_AUDIO_AHB_ROOT, 0x4650);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_AUDIO_AXI_ROOT, 0x4650);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_SAI1_ROOT, 0x4650);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_SAI2_ROOT, 0x4650);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_SAI3_ROOT, 0x4650);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_SAI5_ROOT, 0x4650);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_SAI6_ROOT, 0x4650);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_SAI7_ROOT, 0x4650);
+ n++;
+ GATE2_SET_ENTRY(n, IMX8MP_CLK_PDM_ROOT, 0x4650);
+
+ BPrintK(BORDOISILA_INFO,"gate registry initialized \r\n");
+}
+
+_imx8mp_gate_t* imx8mp_find_gate(uint32_t id) {
+ for (int i = 0; i < UINT8_MAX; i++) {
+ if (_gate_registry[i].root_id == id) {
+ return &_gate_registry[i];
+ }
+ }
+ return NULL;
+}
+
+#define CGC_MASK 0x3;
+
+int imx8mp_clk_gate_enable(uint32_t clk_root_id) {
+ _imx8mp_gate_t* gate = imx8mp_find_gate(clk_root_id);
+ if (!gate) {
+ AuTextOut("[imx8mp clk-gate]: didn't find dedicated gate to enable root : %d \r\n", clk_root_id);
+ return -1;
+ }
+
+ uintptr_t reg = CCM_BASE + gate->base_addr;
+ uint32_t val = _bordoisila_readl(reg);
+ val |= CGC_MASK;
+ _bordoisila_writel(val, reg);
+ BPrintK(BORDOISILA_INFO, "imx8mp clk gate enabled for root offset : %x \r\n", reg);
+}
+
+int imx8mp_clk_gate_disable(uint32_t clk_root_id) {
+ _imx8mp_gate_t* gate = imx8mp_find_gate(clk_root_id);
+ if (!gate) {
+ AuTextOut("[imx8mp clk-gate]: didn't find dedicated gate to enable root : %d \r\n", clk_root_id);
+ return -1;
+ }
+
+ uintptr_t reg = CCM_BASE + gate->base_addr;
+ uint32_t val = _bordoisila_readl(reg);
+ val &= ~CGC_MASK;
+ _bordoisila_writel(val, reg);
+}
+
+#endif
\ No newline at end of file
diff --git a/KernelAA64/Board/imx8mp/imx8mp_gpc.c b/KernelAA64/Board/imx8mp/imx8mp_gpc.c
index 1069285e0..f7883a0f4 100644
--- a/KernelAA64/Board/imx8mp/imx8mp_gpc.c
+++ b/KernelAA64/Board/imx8mp/imx8mp_gpc.c
@@ -29,39 +29,298 @@
*
**/
-#ifdef __TARGET_BOARD_IMX8MP_VERDIN_DAHLIA__ || (__TARGET_BOARD_IMX8MP_SOC__)
+#if defined(__TARGET_BOARD_IMX8MP_VERDIN_DAHLIA__) || defined(__TARGET_BOARD_IMX8MP_SOC__)
#include
+#include
#include
#include
#include
+#include
+#include
#include
+#include <_null.h>
+#include
static uint64_t _gpc_base;
#define GPC_BASE 0x303A0000UL
-#define GPC_PGC_CPU_MAPPING 0x1CC
-#define GPC_PU_PGC_SW_PUP_REQ 0x0F8
+#define IMX8MP_GPC_PGC_CPU_MAPPING 0x1CC
+#define IMX8MP_GPC_PU_PGC_SW_PUP_REQ 0x0D8
+#define IMX8MP_GPC_PU_PGC_SW_PDN_REQ 0x0E4
#define GPC_PGC_CTRL(n) (0x800 + n * 0x40)
#define GPC_PGC_SR(n) (GPC_PGC_CTRL(n) + 0x0C)
-#define IMX8MP_PGC_MEDIAMIX 22
#define IMX8MP_MEDIAMIX_A53_DOMAIN (1ul << 12)
+#define IMX8MP_PGC_NOC 9
+#define IMX8MP_PGC_MIPI1 12
+#define IMX8MP_PGC_PCIE 13
+#define IMX8MP_PGC_USB1 14
+#define IMX8MP_PGC_USB2 15
+#define IMX8MP_PGC_MLMIX 16
+#define IMX8MP_PGC_AUDIOMIX 17
+#define IMX8MP_PGC_GPU2D 18
+#define IMX8MP_PGC_GPUMIX 19
+#define IMX8MP_PGC_VPUMIX 20
+#define IMX8MP_PGC_GPU3D 21
+#define IMX8MP_PGC_MEDIAMIX 22
+#define IMX8MP_PGC_VPU_G1 23
+#define IMX8MP_PGC_VPU_G2 24
+#define IMX8MP_PGC_VPU_VC8000E 25
+#define IMX8MP_PGC_HDMIMIX 26
+#define IMX8MP_PGC_HDMI 27
+#define IMX8MP_PGC_MIPI2 28
+#define IMX8MP_PGC_HSIOMIX 29
+#define IMX8MP_PGC_MEDIA_ISP_DWP 30
+#define IMX8MP_PGC_DDRMIX 31
+
+#define IMX8MP_MEDIA_ISPDWP_A53_DOMAIN BORDOISILA_BIT(20)
+#define IMX8MP_HSIOMIX_A53_DOMAIN BORDOISILA_BIT(19)
+#define IMX8MP_MIPI_PHY2_A53_DOMAIN BORDOISILA_BIT(18)
+#define IMX8MP_HDMI_PHY_A53_DOMAIN BORDOISILA_BIT(17)
+
+
+/* SW Pup/Pdwn Request bits*/
+#define IMX8MP_DDRMIX_PXX_REQ BORDOISILA_BIT(19)
+#define IMX8MP_MEDIA_ISP_DWP_PXX_REQ BORDOISILA_BIT(18)
+#define IMX8MP_HSIOMIX_PXX_REQ BORDOISILA_BIT(17)
+#define IMX8MP_MIPI_PHY2_PXX_REQ BORDOISILA_BIT(16)
+#define IMX8MP_HDMI_PHY_PXX_REQ BORDOISILA_BIT(15)
+#define IMX8MP_HDMIMIX_PXX_REQ BORDOISILA_BIT(14)
+#define IMX8MP_VPU_VC8K_PXX_REQ BORDOISILA_BIT(13)
+#define IMX8MP_VPU_G2_PXX_REQ BORDOISILA_BIT(12)
+#define IMX8MP_VPU_G1_PXX_REQ BORDOISILA_BIT(11)
+#define IMX8MP_MEDIMIX_PXX_REQ BORDOISILA_BIT(10)
+#define IMX8MP_GPU_3D_PXX_REQ BORDOISILA_BIT(9)
+#define IMX8MP_VPU_MIX_SHARE_LOGIC_PXX_REQ BORDOISILA_BIT(8)
+#define IMX8MP_GPU_SHARE_LOGIC_PXX_REQ BORDOISILA_BIT(7)
+#define IMX8MP_GPU_2D_PXX_REQ BORDOISILA_BIT(6)
+#define IMX8MP_AUDIOMIX_PXX_REQ BORDOISILA_BIT(5)
+#define IMX8MP_MLMIX_PXX_REQ BORDOISILA_BIT(4)
+#define IMX8MP_USB2_PHY_PXX_REQ BORDOISILA_BIT(3)
+#define IMX8MP_USB1_PHY_PXX_REQ BORDOISILA_BIT(2)
+#define IMX8MP_PCIE_PHY_SW_PXX_REQ BORDOISILA_BIT(1)
+#define IMX8MP_MIPI_PHY1_SW_PXX_REQ BORDOISILA_BIT(0)
+
+#define IMX8MP_MEDIAMIX_PWRDNACKN BORDOISILA_BIT(30)
+#define IMX8MP_HDMIMIX_PWRDNACKN BORDOISILA_BIT(29)
+#define IMX8MP_HSIOMIX_PWRDNACKN BORDOISILA_BIT(28)
+#define IMX8MP_VPUMIX_PWRDNACKN BORDOISILA_BIT(26)
+#define IMX8MP_GPUMIX_PWRDNACKN BORDOISILA_BIT(25)
+#define IMX8MP_MLMIX_PWRDNACKN (BORDOISILA_BIT(23) | BORDOISILA_BIT(24))
+#define IMX8MP_AUDIOMIX_PWRDNACKN BORDOISILA_BIT(20) | BORDOISILA_BIT(31)
+#define IMX8MP_MEDIAMIX_PWRDNREQN BORDOISILA_BIT(14)
+#define IMX8MP_HDMIMIX_PWRDNREQN BORDOISILA_BIT(13)
+#define IMX8MP_HSIOMIX_PWRDNREQN BORDOISILA_BIT(12)
+#define IMX8MP_VPUMIX_PWRDNREQN BORDOISILA_BIT(10)
+#define IMX8MP_GPUMIX_PWRDNREQN BORDOISILA_BIT(9)
+#define IMX8MP_MLMIX_PWRDNREQN (BORDOISILA_BIT(7) | BORDOISILA_BIT(8))
+#define IMX8MP_AUDIOMIX_PWRDNREQN (BORDOISILA_BIT(4) | BORDOISILA_BIT(15))
+
+
+#define IMX8MP_MEDIA_ISPDWP_A53_DOMAIN BORDOISILA_BIT(20)
+#define IMX8MP_HSIOMIX_A53_DOMAIN BORDOISILA_BIT(19)
+#define IMX8MP_MIPI_PHY2_A53_DOMAIN BORDOISILA_BIT(18)
+#define IMX8MP_HDMI_PHY_A53_DOMAIN BORDOISILA_BIT(17)
+#define IMX8MP_HDMIMIX_A53_DOMAIN BORDOISILA_BIT(16)
+#define IMX8MP_VPU_VC8000E_A53_DOMAIN BORDOISILA_BIT(15)
+#define IMX8MP_VPU_G2_A53_DOMAIN BORDOISILA_BIT(14)
+#define IMX8MP_VPU_G1_A53_DOMAIN BORDOISILA_BIT(13)
+#define IMX8MP_MEDIAMIX_A53_DOMAIN BORDOISILA_BIT(12)
+#define IMX8MP_GPU3D_A53_DOMAIN BORDOISILA_BIT(11)
+#define IMX8MP_VPUMIX_A53_DOMAIN BORDOISILA_BIT(10)
+#define IMX8MP_GPUMIX_A53_DOMAIN BORDOISILA_BIT(9)
+#define IMX8MP_GPU2D_A53_DOMAIN BORDOISILA_BIT(8)
+#define IMX8MP_AUDIOMIX_A53_DOMAIN BORDOISILA_BIT(7)
+#define IMX8MP_MLMIX_A53_DOMAIN BORDOISILA_BIT(6)
+#define IMX8MP_USB2_PHY_A53_DOMAIN BORDOISILA_BIT(5)
+#define IMX8MP_USB1_PHY_A53_DOMAIN BORDOISILA_BIT(4)
+#define IMX8MP_PCIE_PHY_A53_DOMAIN BORDOISILA_BIT(3)
+#define IMX8MP_MIPI_PHY1_A53_DOMAIN BORDOISILA_BIT(2)
+
+
+#define GPC_PGC_CTRL_PCR BORDOISILA_BIT(0)
+
+typedef struct _gpc_pdomain_ {
+ uint8_t pdomain_id;
+ uint32_t pxx_req;
+ uint32_t map_mask;
+ uint32_t pgc_offset;
+}_imx8mp_gpc_pdomain_t;
+
+
#define GPC_WRITE(base, offset, val) (*(volatile uint32_t*)(base + offset) = val)
#define GPC_READ(base, offset) (*(volatile uint32_t*)(base + offset))
+static _imx8mp_gpc_pdomain_t _pdomains[32];
+
+
+#define IMX8MP_PDOMAIN_REGISTER(n,_id,_pxx_req, _map_mask, _pgc_offset) \
+ _pdomains[n].pdomain_id = _id; \
+ _pdomains[n].pxx_req = _pxx_req; \
+ _pdomains[n].map_mask = _map_mask; \
+ _pdomains[n].pgc_offset = _pgc_offset;
+
+
+/**
+ * @brief imx8mp_gpc_init -- register each power domain
+ * to the database
+ */
void imx8mp_gpc_init() {
- _gpc_base = (uint64_t)AuMapMMIO(GPC_BASE, 2);
- GPC_WRITE(_gpc_base, GPC_PGC_CTRL(IMX8MP_PGC_MEDIAMIX), 0x1);
- AuTextOut("Base offset : %x \r\n", (GPC_BASE + GPC_PGC_CTRL(IMX8MP_PGC_MEDIAMIX)));
+ int n = 0;
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_MIPI_PHY1,
+ IMX8MP_MIPI_PHY1_SW_PXX_REQ, IMX8MP_MIPI_PHY1_A53_DOMAIN, GPC_PGC_CTRL(IMX8MP_PGC_MIPI1));
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_PCIE_PHY,
+ IMX8MP_PCIE_PHY_SW_PXX_REQ,
+ IMX8MP_PCIE_PHY_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_PCIE));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_USB1_PHY,
+ IMX8MP_USB1_PHY_PXX_REQ,
+ IMX8MP_USB1_PHY_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_USB1));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_USB2_PHY,
+ IMX8MP_USB2_PHY_PXX_REQ,
+ IMX8MP_USB2_PHY_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_USB2));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_MLMIX,
+ IMX8MP_MLMIX_PXX_REQ,
+ IMX8MP_MLMIX_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_MLMIX));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_AUDIOMIX,
+ IMX8MP_AUDIOMIX_PXX_REQ,
+ IMX8MP_AUDIOMIX_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_AUDIOMIX));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_GPU2D,
+ IMX8MP_GPU_2D_PXX_REQ,
+ IMX8MP_GPU2D_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_GPU2D));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_GPUMIX,
+ IMX8MP_GPU_SHARE_LOGIC_PXX_REQ,
+ IMX8MP_GPUMIX_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_GPUMIX));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_VPUMIX,
+ IMX8MP_VPU_MIX_SHARE_LOGIC_PXX_REQ,
+ IMX8MP_VPUMIX_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_VPUMIX));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_GPU3D,
+ IMX8MP_GPU_3D_PXX_REQ,
+ IMX8MP_GPU3D_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_GPU3D));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_MEDIAMIX,
+ IMX8MP_MEDIMIX_PXX_REQ,
+ IMX8MP_MEDIAMIX_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_MEDIAMIX));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_VPU_G1,
+ IMX8MP_VPU_G1_PXX_REQ,
+ IMX8MP_VPU_G1_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_VPU_G1));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_VPU_G2,
+ IMX8MP_VPU_G2_PXX_REQ,
+ IMX8MP_VPU_G2_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_VPU_G2));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_VPU_VC8000E,
+ IMX8MP_VPU_VC8K_PXX_REQ,
+ IMX8MP_VPU_VC8000E_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_VPU_VC8000E));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_HDMIMIX,
+ IMX8MP_HDMIMIX_PXX_REQ,
+ IMX8MP_HDMIMIX_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_HDMIMIX));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_HDMI_PHY,
+ IMX8MP_HDMI_PHY_PXX_REQ,
+ IMX8MP_HDMI_PHY_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_HDMI));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_MIPI_PHY2,
+ IMX8MP_MIPI_PHY2_PXX_REQ,
+ IMX8MP_MIPI_PHY2_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_MIPI2));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_HSIOMIX,
+ IMX8MP_HSIOMIX_PXX_REQ,
+ IMX8MP_HSIOMIX_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_HSIOMIX));
+
+ n++;
+
+ IMX8MP_PDOMAIN_REGISTER(n, IMX8MP_POWER_DOMAIN_MEDIAMIX_ISPDWP,
+ IMX8MP_MEDIA_ISP_DWP_PXX_REQ,
+ IMX8MP_MEDIA_ISPDWP_A53_DOMAIN,
+ GPC_PGC_CTRL(IMX8MP_PGC_MEDIA_ISP_DWP));
+
+ BPrintK(BORDOISILA_INFO, "gpc registry initialized \r\n");
+}
+
+
+static _imx8mp_gpc_pdomain_t *imx8mp_pdomain_find(uint8_t id) {
+ for (int i = 0; i < 32; i++) {
+ if (_pdomains[i].pdomain_id == id)
+ return &_pdomains[i];
+ }
+
+ return NULL;
+}
+
+int imx8mp_gpc_powerup(uint8_t id) {
- GPC_WRITE(_gpc_base, GPC_PGC_CPU_MAPPING, IMX8MP_MEDIAMIX_A53_DOMAIN);
+ _imx8mp_gpc_pdomain_t* domain = imx8mp_pdomain_find(id);
+ if (!domain)
+ return -1;
- GPC_WRITE(_gpc_base, GPC_PU_PGC_SW_PUP_REQ, (1ULL << (IMX8MP_PGC_MEDIAMIX - 8)));
+ /**TODO: we need to enable parent clock in CCM **/
- while (GPC_READ(_gpc_base, GPC_PGC_SR(IMX8MP_PGC_MEDIAMIX)) & 0x2)
- ;
- AuTextOut("[imx8mp_board]: gpc powered up mediamix \r\n");
+ //set the cpu mapping
+ _bordoisila_update_bits(GPC_BASE + IMX8MP_GPC_PGC_CPU_MAPPING, domain->map_mask, domain->map_mask);
+ _bordoisila_update_bits(GPC_BASE + domain->pgc_offset, GPC_PGC_CTRL_PCR, GPC_PGC_CTRL_PCR);
+ _bordoisila_update_bits(GPC_BASE + IMX8MP_GPC_PU_PGC_SW_PUP_REQ, domain->pxx_req, domain->pxx_req);
}
#endif
\ No newline at end of file
diff --git a/KernelAA64/Board/imx8mp/imx8mp_pll.c b/KernelAA64/Board/imx8mp/imx8mp_pll.c
new file mode 100644
index 000000000..27bc4f5fb
--- /dev/null
+++ b/KernelAA64/Board/imx8mp/imx8mp_pll.c
@@ -0,0 +1,456 @@
+/**
+* @file imx8mp_pll.h
+*
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#include
+#include
+#include
+#include <_null.h>
+#include
+
+#if defined(__TARGET_BOARD_IMX8MP_VERDIN_DAHLIA__) || defined(__TARGET_BOARD_IMX8MP_SOC__)
+
+#define PLL_1443X_RATE(_rate, _m, _p, _d, _k)\
+ { (_rate), (_m), (_p), (_s), (_k)}
+
+#define PLL_1416X_RATE(_rate, _m, _p, _s) \
+{ (_rate), (_m), (_p), (_s), 0}
+
+#define DIV_CTL0 0x4
+#define DIV_CTL1 0x8
+#define GNRL_CTL 0x0
+#define KDIV_MIN INT16_MIN
+#define KDIV_MAX INT16_MAX
+
+/* hardcoded clock source */
+#define IMX8MP_CLK_OSC_24M 24000000UL
+/* low powered devices use this oscillation */
+#define IMX8MP_CLK_OSC_32K 32768UL
+
+#define LOCK_TIMEOUT_US 10000
+
+enum plltype {
+ IMX_1416_PLL,
+ IMX_1443_PLL,
+ IMX_1443_DRAM_PLL
+};
+
+struct imx_pll14xx_rate_table _imx_pll1416x_tbl[14];
+struct imx_pll14xx_rate_table _imx_pll1443x_tbl[4];
+
+#define _IMX_PLL1416X_FILLUP(n, _rate, _pdiv, _mdiv, _sdiv, _kdiv) \
+ _imx_pll1416x_tbl[n].rate = _rate; \
+ _imx_pll1416x_tbl[n].pdiv = _pdiv; \
+ _imx_pll1416x_tbl[n].mdiv = _mdiv; \
+ _imx_pll1416x_tbl[n].sdiv = _sdiv; \
+ _imx_pll1416x_tbl[n].kdiv = _kdiv;
+
+#define _IMX_PLL1443X_FILLUP(n, _rate, _pdiv, _mdiv, _sdiv, _kdiv) \
+ _imx_pll1443x_tbl[n].rate = _rate; \
+ _imx_pll1443x_tbl[n].pdiv = _pdiv; \
+ _imx_pll1443x_tbl[n].mdiv = _mdiv; \
+ _imx_pll1443x_tbl[n].sdiv = _sdiv; \
+ _imx_pll1443x_tbl[n].kdiv = _kdiv;
+
+
+/**
+ * @brief _imx_pll14xx_fill_table -- fill up predefined
+ * values, @reference uboot, linux
+ */
+void _imx_pll14xx_fill_table() {
+
+ _IMX_PLL1416X_FILLUP(0, 1800000000U, 225, 3, 0, 0);
+ _IMX_PLL1416X_FILLUP(1, 1600000000U, 200, 3, 0, 0);
+ _IMX_PLL1416X_FILLUP(2, 1500000000U, 375, 3, 1, 0);
+ _IMX_PLL1416X_FILLUP(3, 1400000000U, 350, 3, 1, 0);
+ _IMX_PLL1416X_FILLUP(4, 1200000000U, 300, 3, 1, 0);
+ _IMX_PLL1416X_FILLUP(5, 1000000000U, 250, 3, 1, 0);
+ _IMX_PLL1416X_FILLUP(6, 800000000U, 200, 3, 1, 0);
+ _IMX_PLL1416X_FILLUP(7, 750000000U, 250, 2, 2, 0);
+ _IMX_PLL1416X_FILLUP(8, 700000000U, 350, 3, 2, 0);
+ _IMX_PLL1416X_FILLUP(9, 640000000U, 320, 3, 2, 0);
+ _IMX_PLL1416X_FILLUP(10, 600000000U, 300, 3, 2, 0);
+ _IMX_PLL1416X_FILLUP(11, 416000000U, 208, 3, 2, 0);
+ _IMX_PLL1416X_FILLUP(12, 320000000U, 160, 3, 2, 0);
+ _IMX_PLL1416X_FILLUP(13, 208000000U, 208, 3, 3, 0);
+
+
+ _IMX_PLL1443X_FILLUP(0, 1039500000U, 173, 2, 1, 16384);
+ _IMX_PLL1443X_FILLUP(1, 650000000U, 325, 3, 2, 0);
+ _IMX_PLL1443X_FILLUP(2, 594000000U, 198, 2, 2, 0);
+ _IMX_PLL1443X_FILLUP(3, 519750000U, 13, 2, 2, 16384);
+}
+
+
+void imx8mp_pll_init() {
+ _imx_pll14xx_fill_table();
+ BPrintK(BORDOISILA_INFO, "PLL registry initialized can be used for manual configuration of PLLs \r\n");
+}
+
+/**
+ * @brief imx8mp_get_pll_type -- hard coded pll type values,
+ * nxp imx8mp soc uses two type of PLL for precised value.
+ * this function take the pll entry and return which type
+ * of pll it uses.
+ * @reference : linux source tree
+ */
+uint8_t imx8mp_get_pll_type(uint64_t pllbase) {
+ switch (pllbase) {
+ case __IMX8MP_AUDIO_PLL1_GEN_CTRL:
+ return IMX_1443_PLL;
+ case __IMX8MP_AUDIO_PLL2_GEN_CTRL:
+ return IMX_1443_PLL;
+ case __IMX8MP_VIDEO_PLL1_GEN_CTRL:
+ return IMX_1443_PLL;
+ case __IMX8MP_DRAM_PLL_GEN_CTRL:
+ return IMX_1443_DRAM_PLL;
+ case __IMX8MP_GPU_PLL_GEN_CTRL:
+ return IMX_1416_PLL;
+ case __IMX8MP_VPU_PLL_GEN_CTRL:
+ return IMX_1416_PLL;
+ case __IMX8MP_SYS_PLL1_GEN_CTRL:
+ return IMX_1416_PLL;
+ case __IMX8MP_SYS_PLL2_GEN_CTRL:
+ return IMX_1416_PLL;
+ case __IMX8MP_SYS_PLL3_GEN_CTRL:
+ return IMX_1416_PLL;
+ }
+}
+
+static struct imx_pll14xx_rate_table * imx_get_pll_settings(uint64_t base, unsigned long rate) {
+ uint8_t type = imx8mp_get_pll_type(base);
+ if (type == IMX_1416_PLL) {
+ for (int i = 0; i < 14; i++) {
+ if (rate == _imx_pll1416x_tbl[i].rate)
+ return &_imx_pll1416x_tbl[i];
+ }
+ }
+ else {
+ for (int i = 0; i < 4; i++) {
+ if (rate == _imx_pll1443x_tbl[i].rate)
+ return &_imx_pll1443x_tbl[i];
+ }
+ }
+ return NULL;
+}
+
+
+static long imx8mp_pll14xx_calc_rate(int mdiv, int pdiv, int sdiv, int kdiv, unsigned long prate) {
+ uint64_t fout = prate;
+
+ fout *= (mdiv * 65536 + kdiv);
+ pdiv *= 65536;
+
+ do_div(fout, pdiv << sdiv);
+
+ return fout;
+}
+
+static long imx8mp_pll1443x_calc_kdiv(int mdiv, int pdiv, int sdiv, unsigned long rate, unsigned long prate) {
+ long kdiv;
+ kdiv = ((rate * ((pdiv * 65536) << sdiv) + prate / 2) / prate) - (mdiv * 65536);
+ return clamp_t(short, kdiv, KDIV_MIN, KDIV_MAX);
+}
+
+/**
+ * @brief imx8mp_pll_recalc_rate -- recalculate pll rate
+ * @param pllbase -- pll base source or entry
+ * @param parent_rate -- clock rate, if the target root is high powered
+ * device, it uses osc_24m sel otherwise osc_32k is used for low powered
+ * device
+ */
+unsigned long imx8mp_pll_recalc_rate(uint64_t pllbase, unsigned long parent_rate) {
+ uint32_t mdiv, pdiv, sdiv, plldiv, plldiv_ctl1, kdiv;
+
+ plldiv = _bordoisila_readl(pllbase + DIV_CTL0);
+ mdiv = BORDOISILA_GET_FIELD(IMX8MP_PLL14XX_MDIV_MASK, plldiv);
+ pdiv = BORDOISILA_GET_FIELD(IMX8MP_PLL14XX_PDIV_MASK, plldiv);
+ sdiv = BORDOISILA_GET_FIELD(IMX8MP_PLL14XX_SDIV_MASK, plldiv);
+
+ uint8_t type = imx8mp_get_pll_type(pllbase);
+ if (type == IMX_1443_PLL) {
+ plldiv_ctl1 = _bordoisila_readl(pllbase + DIV_CTL1);
+ kdiv = (int16_t)BORDOISILA_GET_FIELD(IMX8MP_PLL14XX_KDIV_MASK, plldiv_ctl1);
+ }
+ else
+ kdiv = 0;
+
+ return imx8mp_pll14xx_calc_rate(mdiv, pdiv, sdiv, kdiv, parent_rate);
+
+}
+
+
+static inline bool imx8mp_pll14xx_mp_change(const struct imx_pll14xx_rate_table* rate, uint32_t plldiv) {
+ uint32_t old_mdiv, old_pdiv;
+
+ old_mdiv = BORDOISILA_GET_FIELD(IMX8MP_PLL14XX_MDIV_MASK, plldiv);
+ old_pdiv = BORDOISILA_GET_FIELD(IMX8MP_PLL14XX_PDIV_MASK, plldiv);
+
+ return rate->mdiv != old_mdiv || rate->pdiv != old_pdiv;
+}
+
+static void imx_pll14xx_calc_settings(uint64_t base, unsigned long rate, unsigned long prate, struct imx_pll14xx_rate_table* t) {
+ uint32_t pll_div_ctl0, pll_div_ctl1;
+ int mdiv, pdiv, sdiv, kdiv;
+
+ long fout, rate_min, rate_max, dist, best = INT64_MAX;
+
+ const struct imx_pll14xx_rate_table* tt;
+ tt = imx_get_pll_settings(base, rate);
+ if (tt) {
+ AuTextOut("[imx_pll14xx_calc_settings]: in=%d, want = %d, using pll settings from table \r\n",
+ prate, rate);
+ t->rate = tt->rate;
+ t->mdiv = tt->mdiv;
+ t->pdiv = tt->pdiv;
+ t->sdiv = tt->sdiv;
+ t->kdiv = tt->kdiv;
+ return;
+ }
+
+ pll_div_ctl0 = _bordoisila_readl(base + DIV_CTL0);
+ mdiv = BORDOISILA_GET_FIELD(IMX8MP_PLL14XX_MDIV_MASK, pll_div_ctl0);
+ pdiv = BORDOISILA_GET_FIELD(IMX8MP_PLL14XX_PDIV_MASK, pll_div_ctl0);
+ sdiv = BORDOISILA_GET_FIELD(IMX8MP_PLL14XX_SDIV_MASK, pll_div_ctl0);
+ pll_div_ctl1 = _bordoisila_readl(base + DIV_CTL1);
+
+ rate_min = imx8mp_pll14xx_calc_rate(mdiv, pdiv, sdiv, KDIV_MIN, prate);
+ rate_max = imx8mp_pll14xx_calc_rate(mdiv, pdiv, sdiv, KDIV_MAX, prate);
+
+ if (rate >= rate_min && rate <= rate_max) {
+ kdiv = imx8mp_pll1443x_calc_kdiv(mdiv, pdiv, sdiv, rate, prate);
+ fout = imx8mp_pll14xx_calc_rate(mdiv, pdiv, sdiv, kdiv, prate);
+ t->rate = (unsigned int)fout;
+ t->mdiv = mdiv;
+ t->pdiv = pdiv;
+ t->sdiv = sdiv;
+ t->kdiv = kdiv;
+ return;
+ }
+
+ /* finally calculate best values */
+ for (pdiv = 1; pdiv <= 63; pdiv++) {
+ for (sdiv = 0; sdiv <= 6; sdiv++) {
+ mdiv = DIV_ROUND_CLOSEST(rate * (pdiv << sdiv), prate);
+ mdiv = CLAMP(mdiv, 64, 1023);
+
+ kdiv = imx8mp_pll1443x_calc_kdiv(mdiv, pdiv, sdiv, rate, prate);
+ fout = imx8mp_pll14xx_calc_rate(mdiv, pdiv, sdiv, kdiv, prate);
+
+ dist = ABS((long)rate - (long)fout);
+ if (dist < best) {
+ best = dist;
+ t->rate = (unsigned int)fout;
+ t->mdiv = mdiv;
+ t->pdiv = pdiv;
+ t->sdiv = sdiv;
+ t->kdiv = kdiv;
+
+ if (!dist)
+ goto found;
+ }
+ }
+ }
+found:
+ AuTextOut("imx8mp_pll1416x rate found \r\n");
+
+}
+
+int imx8mp_pll1416x_determine_rate(uint64_t base, unsigned long rate) {
+ uint8_t type = imx8mp_get_pll_type(base);
+ if (type == IMX_1416_PLL) {
+ for (int i = 0; i < 14; i++) {
+ if (rate >= _imx_pll1416x_tbl[i].rate) {
+ rate = _imx_pll1416x_tbl[i].rate;
+ return rate;
+ }
+ }
+ rate = _imx_pll1416x_tbl[14 - 1].rate;
+ return rate;
+ }
+ else {
+ for (int i = 0; i < 4; i++) {
+ if (rate >= _imx_pll1443x_tbl[i].rate) {
+ rate = _imx_pll1443x_tbl[i].rate;
+ return 0;
+ }
+ }
+
+ rate = _imx_pll1443x_tbl[14 - 1].rate;
+ return rate;
+ }
+ return 0;
+}
+
+int imx8mp_pll1416x_set_rate(uint64_t base, unsigned long drate, unsigned long prate) {
+ uint32_t tmp, div_val;
+
+ struct imx_pll14xx_rate_table* rate = imx_get_pll_settings(base, drate);
+ if (!rate) {
+ AuTextOut("[bordoisila]: imx8mp pll invalid rate %d \r\n", drate);
+ return;
+ }
+
+ tmp = _bordoisila_readl(base + DIV_CTL0);
+
+ if (!imx8mp_pll14xx_mp_change(rate, tmp)) {
+ tmp &= ~IMX8MP_PLL14XX_SDIV_MASK;
+ tmp |= BORDOISILA_PREP_FIELD(IMX8MP_PLL14XX_SDIV_MASK, rate->sdiv);
+ _bordoisila_writel(tmp, base + DIV_CTL0);
+ return 0;
+ }
+
+ /* bypass clock and set lock to pll output lock*/
+ tmp = _bordoisila_readl(base + GNRL_CTL);
+ tmp |= LOCK_SEL_MASK;
+ _bordoisila_writel(tmp, base + GNRL_CTL);
+
+ /* enable RST */
+ tmp &= ~RST_MASK;
+ _bordoisila_writel(tmp, base + GNRL_CTL);
+
+ /* enable bypass*/
+ tmp |= BYPASS_MASK;
+ _bordoisila_writel(tmp, base + GNRL_CTL);
+
+ div_val = BORDOISILA_PREP_FIELD(IMX8MP_PLL14XX_MDIV_MASK, rate->mdiv) | BORDOISILA_PREP_FIELD(IMX8MP_PLL14XX_PDIV_MASK, rate->pdiv) |
+ BORDOISILA_PREP_FIELD(IMX8MP_PLL14XX_SDIV_MASK, rate->sdiv);
+ _bordoisila_writel(div_val, base + DIV_CTL0);
+
+ AuAA64BoardSleepUS(3);
+
+ /* disable RST */
+ tmp |= RST_MASK;
+ _bordoisila_writel(tmp, base + GNRL_CTL);
+
+ int ret = imx8mp_wait_lock(base);
+ if (ret)
+ return ret;
+
+ tmp &= ~BYPASS_MASK;
+ _bordoisila_writel(tmp, base + GNRL_CTL);
+
+ return 0;
+}
+
+int imx8mp_pll1443x_set_rate(uint64_t base, unsigned long drate, unsigned long prate) {
+ struct imx_pll14xx_rate_table rate;
+ uint32_t gnrl_ctl, div_ctl0;
+ imx_pll14xx_calc_settings(base, drate, prate, &rate);
+
+ div_ctl0 = _bordoisila_readl(base + DIV_CTL0);
+
+ if (!imx8mp_pll14xx_mp_change(&rate, div_ctl0)) {
+ div_ctl0 &= ~IMX8MP_PLL14XX_SDIV_MASK;
+ div_ctl0 |= BORDOISILA_PREP_FIELD(IMX8MP_PLL14XX_SDIV_MASK, rate.sdiv);
+ _bordoisila_writel(div_ctl0, base + DIV_CTL0);
+ _bordoisila_writel(BORDOISILA_PREP_FIELD(IMX8MP_PLL14XX_KDIV_MASK, rate.kdiv), base + DIV_CTL1);
+ return 0;
+ }
+
+ /* enable rst */
+ gnrl_ctl = _bordoisila_readl(base + GNRL_CTL);
+ gnrl_ctl &= ~RST_MASK;
+ _bordoisila_writel(gnrl_ctl, base + GNRL_CTL);
+
+ /* enable bypass */
+ gnrl_ctl |= BYPASS_MASK;
+ _bordoisila_writel(gnrl_ctl, base + GNRL_CTL);
+
+ div_ctl0 = BORDOISILA_PREP_FIELD(IMX8MP_PLL14XX_MDIV_MASK, rate.mdiv) |
+ BORDOISILA_PREP_FIELD(IMX8MP_PLL14XX_PDIV_MASK, rate.pdiv) |
+ BORDOISILA_PREP_FIELD(IMX8MP_PLL14XX_SDIV_MASK, rate.sdiv);
+ _bordoisila_writel(div_ctl0, base + DIV_CTL0);
+
+ _bordoisila_writel(BORDOISILA_PREP_FIELD(IMX8MP_PLL14XX_KDIV_MASK, rate.kdiv), base + DIV_CTL0);
+
+ AuAA64BoardSleepUS(3);
+
+ /* disable rst*/
+ gnrl_ctl |= RST_MASK;
+ _bordoisila_writel(gnrl_ctl, base + GNRL_CTL);
+
+ int ret = imx8mp_wait_lock(base);
+ if (ret)
+ return ret;
+
+ /* bypass */
+ gnrl_ctl &= ~BYPASS_MASK;
+ _bordoisila_writel(gnrl_ctl, base + GNRL_CTL);
+
+ return 0;
+
+}
+
+#define PLL_REF_SEL_MASK 0x3
+#define PLL_REF_SEL_SHIFT 0
+
+uint32_t imx8mp_pll_get_parent_rate(uint64_t pll_base) {
+ uint32_t gnrl_ctl = _bordoisila_readl(pll_base + GNRL_CTL);
+ uint32_t ref_sel = BORDOISILA_GET_FIELD(PLL_REF_SEL_MASK, gnrl_ctl);
+
+ switch (ref_sel) {
+ case 0:
+ return IMX8MP_CLK_OSC_24M;
+ default:
+ BPrintK(BORDOISILA_WARN, "imx8mp pll_ref selection unexpected value : %u for base : %x \r\n",
+ ref_sel, pll_base);
+ return IMX8MP_CLK_OSC_24M;
+ }
+}
+
+int imx8mp_wait_lock(uint64_t base){
+ uint32_t val;
+ return _bordoisila_readl_poll_timeout(base + GNRL_CTL, val, val & LOCK_STATUS, 0, LOCK_TIMEOUT_US);
+}
+
+void imx8mp_pll_prepare(uint64_t base) {
+ uint32_t val;
+
+ val = _bordoisila_readl(base + GNRL_CTL);
+ if (val & RST_MASK) {
+ AuTextOut("[aurora]: imx8mp_pll_prepare: reset mask is already set for base : %x \r\n", base);
+ return;
+ }
+ val |= BYPASS_MASK;
+ _bordoisila_writel(val, base + GNRL_CTL);
+ val |= RST_MASK;
+ _bordoisila_writel(val, base + GNRL_CTL);
+
+ // wait lock
+ imx8mp_wait_lock(base);
+
+ val &= ~BYPASS_MASK;
+ _bordoisila_writel(val, base + GNRL_CTL);
+}
+
+
+
+#endif
\ No newline at end of file
diff --git a/KernelAA64/Board/imx8mp/imx8mp_uart.c b/KernelAA64/Board/imx8mp/imx8mp_uart.c
index dcee5f833..2efe9104a 100644
--- a/KernelAA64/Board/imx8mp/imx8mp_uart.c
+++ b/KernelAA64/Board/imx8mp/imx8mp_uart.c
@@ -29,7 +29,7 @@
*
**/
-#ifdef __TARGET_BOARD_IMX8MP_VERDIN_DAHLIA__ || (__TARGET_BOARD_IMX8MP_SOC__)
+#if defined(__TARGET_BOARD_IMX8MP_VERDIN_DAHLIA__) || defined(__TARGET_BOARD_IMX8MP_SOC__)
#include
diff --git a/KernelAA64/Cap/capability.c b/KernelAA64/Cap/capability.c
new file mode 100644
index 000000000..e00fbbfdb
--- /dev/null
+++ b/KernelAA64/Cap/capability.c
@@ -0,0 +1,222 @@
+/**
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#include
+#include
+#include
+#include
+#include <_null.h>
+#include
+#include
+
+/*
+ * NOTE on concurrency: every existing syscall entry point in
+ * Kernel/Serv/fileserv.cpp already runs with interrupts disabled
+ * (x64_cli()) for the duration of the call, and XenevaOS's
+ * multiprocessor scheduler is not active yet (see readme.md). That is
+ * the same assumption these functions rely on -- callers are expected
+ * to hold that same single-CPU-in-kernel invariant. Once SMP
+ * scheduling lands this table will need its own lock (Phase 8 of the
+ * roadmap calls this out explicitly under "race conditions" /
+ * "concurrent capability lookup/removal") and every function below
+ * should take it before touching proc->caps.
+ */
+
+ /* internal helper: is `fd` a valid index into the capability table? */
+static unsigned char cap_slot_in_range(int rq) {
+ return (rq >= 0) && (rq < FILE_DESC_PER_PROCESS);
+}
+
+/* internal helper: slot pointer, or NULL if fd is out of range */
+static AuCapability* cap_slot(AuProcess* proc, int fd) {
+ if (!proc || !cap_slot_in_range(fd))
+ return NULL;
+ return &proc->caps[fd];
+}
+
+int BordoisilaCapCreate(void* procptr, int fd, void* object, uint8_t type, CapRights rights) {
+ AuProcess* proc = (AuProcess*)procptr;
+ AuCapability* cap = cap_slot(proc, fd);
+ if (!cap)
+ return CAP_ERR_INVALID;
+ if (!object)
+ return CAP_ERR_INVALID;
+
+ cap->object = object;
+ cap->object_type = type;
+ /* a freshly minted capability may never exceed CAP_FILE_RIGHTS_MASK
+ * for the file object type in V0; this keeps a caller from handing
+ * in a bogus/garbage mask and getting more than the model allows */
+ if (type == CAP_OBJ_FILE)
+ cap->rights = rights & CAP_FILE_RIGHTS_MASK;
+ else
+ cap->rights = CAP_RIGHTS_NONE;
+
+ cap->owner = proc->creds.uid;
+ cap->flags = CAP_FLAG_NONE;
+ cap->valid = true;
+ return CAP_OK;
+}
+
+AuCapability* BordoisilaCapLookup(void* procptr, int fd) {
+ AuProcess* proc = (AuProcess*)procptr;
+ AuCapability* cap = cap_slot(proc, fd);
+ if (!cap)
+ return NULL;
+ if (!cap->valid)
+ return NULL;
+ return cap;
+}
+
+bool BordoisilaCapCheckRights(void* procptr, int fd, CapRights required) {
+ AuProcess* proc = (AuProcess*)procptr;
+ AuCapability* cap = BordoisilaCapLookup(proc, fd);
+
+ if (!cap)
+ return false;
+
+
+ /*AuTextOut("[CAP] Check fd=%d req=%x have=%x\r\n",
+ fd, required, cap->rights);*/
+ //UARTDebugOut("[CAP] Check fd=%d req=%x have=%x \r\n", fd, required, cap->rights);
+
+ return (cap->rights & required) == required;
+}
+
+int BordoisilaCapDup(void* procptr, int oldfd, int newfd) {
+ AuProcess* proc = (AuProcess*)procptr;
+ AuCapability* src = BordoisilaCapLookup(proc, oldfd);
+ if (!src)
+ return CAP_ERR_INVALID;
+
+ if (!cap_slot_in_range(newfd))
+ return CAP_ERR_INVALID;
+
+ if (proc->caps[newfd].valid)
+ return CAP_ERR_INVALID;
+
+ if (proc->fds[newfd])
+ return CAP_ERR_INVALID;
+
+ proc->fds[newfd] = proc->fds[oldfd];
+
+ if (proc->fds[newfd])
+ proc->fds[newfd]->fileCopyCount++;
+
+ AuCapability* dst = &proc->caps[newfd];
+
+ dst->object = src->object;
+ dst->object_type = src->object_type;
+ dst->rights = src->rights;
+ dst->owner = src->owner;
+ dst->flags = src->flags;
+ dst->valid = true;
+
+ return CAP_OK;
+}
+
+int BordoisilaCapRestrict(void* procptr, int fd, CapRights new_rights) {
+ AuProcess* proc = (AuProcess*)procptr;
+ AuCapability* cap = BordoisilaCapLookup(proc, fd);
+ if (!cap)
+ return CAP_ERR_INVALID;
+
+ /* rights may only shrink: intersect rather than assign, so this
+ * can never be used to grant a bit the capability didn't already
+ * have (section 5: "rights can only become more restrictive") */
+ cap->rights = cap->rights & new_rights;
+ return CAP_OK;
+}
+
+void BordoisilaCapDestroy(void* procptr, int fd) {
+ AuProcess* proc = (AuProcess*)procptr;
+
+ AuCapability* cap = cap_slot(proc, fd);
+ if (!cap || !cap->valid)
+ return;
+
+ cap->object = NULL;
+ cap->object_type = 0;
+ cap->rights = CAP_RIGHTS_NONE;
+ cap->owner = 0;
+ cap->flags = CAP_FLAG_NONE;
+ cap->valid = false;
+}
+
+void BordoisilaCapCleanupProcess(void* procptr) {
+ AuProcess* proc = (AuProcess*)procptr;
+ if (!proc)
+ return;
+ for (int i = 0; i < FILE_DESC_PER_PROCESS; i++) {
+ AuCapability* cap = &proc->caps[i];
+ if (cap->valid) {
+ cap->object = NULL;
+ cap->object_type = 0;
+ cap->rights = CAP_RIGHTS_NONE;
+ cap->owner = 0;
+ cap->flags = CAP_FLAG_NONE;
+ cap->valid = false;
+ }
+ }
+}
+
+void BordoisilaCapInheritTable(void* parentptr , void* childptr) {
+
+ if (!parentptr || !childptr)
+ return;
+ AuProcess* parent = (AuProcess*)parentptr;
+ AuProcess* child = (AuProcess*)childptr;
+
+ /* NOTE: as of this writing AuCreateProcessSlot()/AuCreateProcess()
+ * zero-initialize fds[] rather than copying the parent's open
+ * files, so there is currently nothing for capabilities to mirror
+ * at fork/spawn time -- this mirrors section 7 of the design doc
+ * ("similar to how file descriptors are already inherited") for
+ * whenever fd inheritance itself is implemented. Until then this
+ * only matters for slots the caller populates manually. Flagging
+ * this gap for design review rather than papering over it. */
+ for (int i = 0; i < FILE_DESC_PER_PROCESS; i++) {
+ AuCapability* src = &parent->caps[i];
+ if (!src->valid)
+ continue;
+ if (src->flags & CAP_FLAG_NO_INHERIT)
+ continue;
+ if (!child->fds[i])
+ continue;
+
+ AuCapability* dst = &child->caps[i];
+ dst->object = src->object;
+ dst->object_type = src->object_type;
+ /* rights never increase across inheritance */
+ dst->rights = src->rights;
+ dst->owner = child->creds.uid;
+ dst->flags = src->flags;
+ dst->valid = true;
+ }
+}
\ No newline at end of file
diff --git a/KernelAA64/Drivers/core.c b/KernelAA64/Drivers/core.c
new file mode 100644
index 000000000..546b73e19
--- /dev/null
+++ b/KernelAA64/Drivers/core.c
@@ -0,0 +1,211 @@
+/**
+* @file core.c
+*
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#include
+#include
+#include <_null.h>
+#include
+
+/* must also contain locking/unlocking */
+static BordoisilaDriver* _bdrivers;
+
+/**
+ * @brief BordoisilaDriverGetStateString -- return the driver state
+ * in string
+ * @param driver -- pointer to driver struct
+ */
+static char* BordoisilaDriverGetStateString(BordoisilaDriver* driver) {
+ switch (driver->driver_state) {
+ case B_DRIVER_STATE_UNBOUND:
+ return "UNBOUND";
+ case B_DRIVER_STATE_PROBED:
+ return "PROBED";
+ case B_DRIVER_STATE_FAILED:
+ return "FAILED";
+ default:
+ return "NULL";
+ }
+}
+
+
+/**
+ * @brief BordoisilaDriverRegister -- register a driver
+ * to core registry
+ */
+int BordoisilaDriverRegister(BordoisilaDriver* driver) {
+ if (!driver)
+ return 1;
+ /** check for pre-registered driver with same compat string */
+ if (BordoisilaGetDriverByCompat(driver->compat)) {
+ BPrintK(BORDOISILA_WARN, "driver : %s is already registered, current state : %s \r\n", driver->name,
+ BordoisilaDriverGetStateString(driver));
+ return BORDOISILA_DRIVER_ALREADY_REGISTERED;
+ }
+ driver->driver_state = B_DRIVER_STATE_UNBOUND;
+ driver->next = _bdrivers;
+ _bdrivers = driver;
+ return 0;
+}
+
+/**
+ * @brief BordoisilaGetDriverByCompat -- match a driver by its
+ * compat string
+ * @param compat -- compatibility string, matches to DT/ACPI bindings
+ */
+BordoisilaDriver* BordoisilaGetDriverByCompat(char* compat) {
+ for (BordoisilaDriver* drv = _bdrivers; drv != NULL; drv = drv->next)
+ if (strcmp(drv->compat, compat) == 0)
+ return drv;
+
+ return NULL;
+}
+
+
+/**
+ * @brief BordoisilaGetDriverByName -- match a driver by its name
+ * @param name - name of the driver
+ */
+BordoisilaDriver* BordoisilaGetDriverByName(char* name) {
+ for (BordoisilaDriver* drv = _bdrivers; drv != NULL; drv = drv->next) {
+ if (strcmp(drv->name, name) == 0)
+ return drv;
+ }
+
+ return NULL;
+}
+
+/**
+ * @brief BordoisilaDriverProbeAll -- start probing all driver registered
+ */
+void BordoisilaDriverProbeAll() {
+ int ret = 0;
+ for (BordoisilaDriver* drv = _bdrivers; drv != NULL; drv = drv->next) {
+ if (drv->driver_state != B_DRIVER_STATE_UNBOUND)
+ continue;
+
+ if (drv->probe) {
+ BPrintK(BORDOISILA_INFO, "probing bordoisila driver : %s, compat : %s \r\n", _bdrivers->name, _bdrivers->compat);
+ ret = drv->probe(drv);
+ BPrintK(BORDOISILA_WARN, "driver %s probe completed with return value : %d \r\n",_bdrivers->name, ret);
+ }
+ }
+}
+
+/**
+* ===================================================
+ * Interface
+ * ==================================================
+ */
+
+/**
+ * @brief BordoisilaDriverScan -- scan a bus, only applicable
+ * if the driver is a bus
+ * @param driver -- pointer to driver
+ */
+int BordoisilaDriverScan(BordoisilaDriver* driver) {
+ if (!driver)
+ return 1;
+ if (driver->type == BORDOISILA_DRIVER_NORMAL)
+ return -1;
+
+ int rc = 0;
+ if (driver->scan)
+ rc = driver->scan(driver);
+
+ return rc;
+
+}
+
+
+int BordoisilaDriverProbe(BordoisilaDriver* driver) {
+ if (!driver)
+ return 1;
+ if (driver->probe)
+ return driver->probe(driver);
+ return 0;
+
+}
+
+/**
+ * @brief BordoisilaDriverRemove -- remove a driver doesn't mean
+ *it could be removed from memory, calling remove cleans up
+ * driver's allocated resources, and decreaments internal
+ * reference count of driver resources it was using like
+ * (Clk, Regulator, Pin etc), also if the driver is
+ * shared between different module, before calling remove
+ * just decrement reference count
+ */
+int BordoisilaDriverRemove(BordoisilaDriver* driver) {
+ if (!driver)
+ return 1;
+
+ if (driver->driver_state != B_DRIVER_STATE_PROBED)
+ return -1;
+
+ /* check if reference count is already more than zero */
+ bool ref = (driver->refcount > 0) ? 1 : 0;
+
+ if (ref) {
+ driver->refcount--;
+ return 0;
+ }
+
+
+ int ret = 0;
+ if (driver->remove)
+ ret = driver->remove(driver);
+
+ if (ret == 0) driver->driver_state = B_DRIVER_STATE_UNBOUND;
+
+ return 0;
+}
+
+int BordoisilaDriverSuspend(BordoisilaDriver* driver) {
+ if (!driver)
+ return 1;
+
+ if (driver->driver_state != B_DRIVER_STATE_PROBED)
+ return -1;
+
+ if (driver->suspend)
+ return driver->suspend(driver);
+ return 0;
+}
+
+int BordoisilaDriverResume(BordoisilaDriver* driver) {
+ if (!driver)
+ return 1;
+ if (driver->driver_state != B_DRIVER_STATE_PROBED)
+ return -1;
+ if (driver->resume)
+ return driver->resume(driver);
+ return 0;
+}
\ No newline at end of file
diff --git a/KernelAA64/Drivers/res.c b/KernelAA64/Drivers/res.c
new file mode 100644
index 000000000..8c3796f24
--- /dev/null
+++ b/KernelAA64/Drivers/res.c
@@ -0,0 +1,65 @@
+/**
+* @file res.c
+*
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#include
+#include
+#include <_null.h>
+#include
+
+static BordoisilaDriverResource* _gres;
+
+/**
+ * @brief BordoisilaDriverResourceRegister -- register a resource driver
+ * @param res_ -- pointer to resource driver struct
+ */
+int BordoisilaDriverResourceRegister(BordoisilaDriverResource* res_) {
+ for (BordoisilaDriverResource* res = _gres; res != NULL; res = res->next)
+ if (strcmp(res->name, res_->name) == 0)
+ return 1;
+
+ res_->next = _gres;
+ _gres = res_;
+ return 0;
+}
+
+/**
+ * @brief BordoisilaGetDriverResource -- get a driver resource from global resource
+ * list
+ * @param name -- resource name coresponding to DT/ACPI name
+ * @param type -- type of the resource
+ */
+BordoisilaDriverResource* BordoisilaGetDriverResource(const char* name, uint8_t type) {
+ for (BordoisilaDriverResource* res = _gres; res != NULL; res = res->next)
+ if ((strcmp(res->name, name) == 0) && res->res_type == type)
+ return res;
+
+ return NULL;
+}
\ No newline at end of file
diff --git a/KernelAA64/Drivers/uart.c b/KernelAA64/Drivers/uart.c
index b878570ec..fbca8591a 100644
--- a/KernelAA64/Drivers/uart.c
+++ b/KernelAA64/Drivers/uart.c
@@ -29,6 +29,11 @@
*
**/
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
#include
#include
#include
diff --git a/KernelAA64/Drivers/virtiokbd.c b/KernelAA64/Drivers/virtiokbd.c
index 01ee8aad9..b223350fa 100644
--- a/KernelAA64/Drivers/virtiokbd.c
+++ b/KernelAA64/Drivers/virtiokbd.c
@@ -39,6 +39,7 @@
#include
#include
#include
+#include
struct VirtioQueue* queue;
@@ -92,7 +93,12 @@ void AuVirtioKbdHandler(int spinum) {
AuDevWriteKybrd(&msg);
}
else if (ext_key_map[evt.code]) {
- uint32_t scancode = (0xE0 & 0xFF) << 16 | (ext_key_map[evt.code] & 0xFF) << 8 | (((evt.value == 0) ? 0x80 : 0) & 0xFF);
+ uint8_t make_code = ext_key_map[evt.code] & 0xFF;
+
+ if (evt.value == 0) {
+ make_code |= 0x80;
+ }
+ uint32_t scancode = (0xE0 << 8) | make_code;
// 0xE0 (extended code) upper 16 bits | key code middle 8 bits | value: 0x80 for release, 0 press
/* write to xeneva key input msg box */
AuInputMessage msg;
@@ -100,7 +106,6 @@ void AuVirtioKbdHandler(int spinum) {
msg.type = AU_INPUT_KEYBOARD;
msg.code = scancode;
AuDevWriteKybrd(&msg);
- UARTDebugOut("Extended key press \n");
}
else {
UARTDebugOut("virtio-kybrd: unmapped key code : %d \n", evt.code);
@@ -113,6 +118,9 @@ void AuVirtioKbdHandler(int spinum) {
}
void AuVirtioKbdDown() {
+ if (!_kybrdCfg)
+ return;
+
/* Reset the device */
_kybrdCfg->DeviceStatus = 0;
@@ -184,6 +192,7 @@ void AuVirtioKbdInitialize(uint64_t device) {
dsb_ish();
struct VirtioCommonCfg* common = (struct VirtioCommonCfg*)finalAddr;
+ _kybrdCfg = common;
common->DeviceStatus = 0;
isb_flush();
diff --git a/KernelAA64/Drivers/virtionet.c b/KernelAA64/Drivers/virtionet.c
index f83067567..389c38620 100644
--- a/KernelAA64/Drivers/virtionet.c
+++ b/KernelAA64/Drivers/virtionet.c
@@ -210,6 +210,7 @@ void AuVirtioNetTxinitialize(struct VirtioCommonCfg* common) {
*/
void AuVirtioNetInitialize(uint64_t device) {
UARTDebugOut("[aurora]: virtio network device found \r\n");
+ UARTDebugOut("ok\r\n");
int bus = 0;
int func = 0;
int dev = 0;
diff --git a/KernelAA64/Drivers/virtiotablet.c b/KernelAA64/Drivers/virtiotablet.c
index 5148eb98f..378bad208 100644
--- a/KernelAA64/Drivers/virtiotablet.c
+++ b/KernelAA64/Drivers/virtiotablet.c
@@ -39,6 +39,7 @@
#include
#include
#include
+#include
struct VirtioQueue* TabletQueue;
uint16_t tabletIndex;
@@ -73,7 +74,7 @@ void AuVirtioTabletHandler(int spiNum) {
uint16_t them = TabletQueue->used.index;
for (; tabletIndex < them; tabletIndex++) {
- dc_ivac(&TabletInput[tabletIndex % tabletQueueSz]);
+ dc_ivac((uint64_t)&TabletInput[tabletIndex % tabletQueueSz]);
dsb_sy_barrier();
struct VirtioInputEvent evt = TabletInput[tabletIndex % tabletQueueSz];
while (evt.type == 0xFF) {
@@ -128,6 +129,9 @@ void AuVirtioTabletHandler(int spiNum) {
}
void AuVirtioTabletDown() {
+ if (!_tabletCfg)
+ return;
+
/* Reset the device */
_tabletCfg->DeviceStatus = 0;
@@ -152,7 +156,7 @@ void AuVirtioTabletInitialize(uint64_t device) {
int func = 0;
int dev = 0;
if (device == 0xFFFFFFFF)
- return 1;
+ return;
uint16_t command = AuPCIERead(device, PCI_COMMAND, bus, dev, func);
command |= 4;
@@ -211,6 +215,7 @@ void AuVirtioTabletInitialize(uint64_t device) {
GICRegisterSPIHandler(&AuVirtioTabletHandler, spiID);
struct VirtioCommonCfg* common = (struct VirtioCommonCfg*)finalAddr;
+ _tabletCfg = common;
common->DeviceStatus = 0;
isb_flush();
diff --git a/KernelAA64/Fs/Dev/devfs.c b/KernelAA64/Fs/Dev/devfs.c
index d4627490b..7346963e4 100644
--- a/KernelAA64/Fs/Dev/devfs.c
+++ b/KernelAA64/Fs/Dev/devfs.c
@@ -28,7 +28,7 @@
**/
#include
-//#include
+#include
#include
#include
#include
diff --git a/KernelAA64/Fs/Ext2/Ext2.c b/KernelAA64/Fs/Ext2/Ext2.c
index 8fa55aafe..dbfc993ed 100644
--- a/KernelAA64/Fs/Ext2/Ext2.c
+++ b/KernelAA64/Fs/Ext2/Ext2.c
@@ -1,11 +1,13 @@
#include
-#include
+#include
#include
#include
#include
#include
#include
-#include
+#include
+#include
+#include
#include <_null.h>
/**
@@ -15,7 +17,11 @@
* @param name -- the target string we are matching
*/
uint32_t Ext2FindEntry(Ext2Fs* fs, Ext2Inode* dir_inode, const char* name) {
- if (!fs || !dir_inode || !name) return 0;
+ if (!fs || !dir_inode || !name) {
+ const char* missing = !fs ? "fs" : !dir_inode ? "dir_inode" : "name";
+ AuTextOut("[Ext2]: %s parameter missing for directory scanning.\r\n", missing);
+ return 0;
+ }
uint32_t block_size = fs->block_size;
uint32_t sector_per_block = block_size / 512;
@@ -23,7 +29,7 @@ uint32_t Ext2FindEntry(Ext2Fs* fs, Ext2Inode* dir_inode, const char* name) {
uint64_t* buffer = (uint64_t*)P2V((uint64_t)AuPmmngrAlloc());
if (!buffer) {
- UARTDebugOut("[ext2]: out of memory during directory scanning.\r\n");
+ AuTextOut("[Ext2]: out of memory during directory scanning.\r\n");
return 0;
}
@@ -41,10 +47,12 @@ uint32_t Ext2FindEntry(Ext2Fs* fs, Ext2Inode* dir_inode, const char* name) {
while (current_pos < block_size) {
Ext2Dir* entry = (Ext2Dir*)((uint8_t*)buffer + current_pos);
- if (entry->rec_len == 0) return 0;
-
+ if (entry->rec_len == 0) {
+ AuPmmngrFree((void*)V2P((uint64_t)buffer));
+ return 0;
+ }
if (entry->inode != 0 && entry->name_len == target_len) {
- if (strncmp(entry->name, name, entry->name_len)) {
+ if (strncmp(entry->name, name, entry->name_len)==0) {
uint32_t found_inode = entry->inode;
AuPmmngrFree((void*)V2P((uint64_t)buffer));
return found_inode;
@@ -67,7 +75,16 @@ uint32_t Ext2FindEntry(Ext2Fs* fs, Ext2Inode* dir_inode, const char* name) {
* @param out_inode -- inode to place the readings
*/
int Ext2ReadInode(Ext2Fs* fs, uint32_t inode_num, Ext2Inode* out_inode) {
- if (!fs || !out_inode || inode_num == 0) return -1;
+ if (!fs || !out_inode) {
+ const char* missing = !fs ? "fs" : "out_inode";
+ AuTextOut("[Ext2]: %s parameter missing for inode reading.\r\n", missing);
+ return -1;
+ }
+
+ if (inode_num == 0) {
+ AuTextOut("[Ext2]: inode number is zero");
+ return -1;
+ }
Ext2Superblock* sb = fs->superblock;
@@ -84,7 +101,7 @@ int Ext2ReadInode(Ext2Fs* fs, uint32_t inode_num, Ext2Inode* out_inode) {
uint64_t* buffer = (uint64_t*)P2V((uint64_t)AuPmmngrAlloc());
if (!buffer) {
- UARTDebugOut("[ext2]: Inode is out of physical memory pages.\r\n");
+ AuTextOut("[Ext2]: out of memory during inode reading.\r\n");
return -1;
}
@@ -100,16 +117,63 @@ int Ext2ReadInode(Ext2Fs* fs, uint32_t inode_num, Ext2Inode* out_inode) {
return 0;
};
+/**
+* Ext2ReadBlockIndex -- reads the block index from a given block
+* @param fs -- the filesystem
+* @param block_id -- the block id to read from
+* @param index -- the index within the block to read
+*/
+uint32_t Ext2ReadBlockIndex(Ext2Fs* fs, uint32_t block_id, uint32_t index) {
+ if (!fs) {
+ AuTextOut("[Ext2]: fs missing for block index reading.\r\n");
+ return 0;
+ }
+
+ if (block_id == 0) {
+ AuTextOut("[Ext2]: block_id is zero");
+ }
+
+ uint32_t sector_per_block = fs->block_size / 512;
+ uint64_t target_lba = (uint64_t)block_id * sector_per_block;
+
+ uint32_t* buffer = (uint32_t*)P2V((uint64_t)AuPmmngrAlloc());
+ if (!buffer) {
+ AuTextOut("[Ext2]: out of memory during block index reading.\r\n");
+ return 0;
+ }
+ memset(buffer, 0, 4096);
+
+ AuVDiskRead((AuVDisk*)fs->vdisk, target_lba, sector_per_block, (uint64_t*)buffer);
+ uint32_t resolved_physical_block = buffer[index];
+
+ AuPmmngrFree((void*)V2P((uint64_t)buffer));
+
+ return resolved_physical_block;
+};
+
+/**
+* Ext2Read -- reads data from a file in the ext2 filesystem
+* @param node -- the filesystem node
+* @param file -- the file node to read from
+* @param buffer -- the buffer to store read data
+* @param length -- the number of bytes to read
+*/
size_t Ext2Read(AuVFSNode* node, AuVFSNode* file, uint64_t* buffer, uint32_t length) {
- if (!node || !file || !buffer || !length) return 0;
+ if (!node || !file || !buffer || !length) {
+ const char* missing = !node ? "node" : !file ? "file" : !buffer ? "buffer" : "length";
+ AuTextOut("[Ext2]: %s parameter missing for file reading.\r\n", missing);
+ return 0;
+ }
Ext2Fs* fs = (Ext2Fs*)node->device;
Ext2Inode* inode = (Ext2Inode*)file->private_data;
uint64_t current_pos = file->pos;
- if (current_pos >= file->size) return 0;
-
+ if (current_pos >= file->size) {
+ AuTextOut("[Ext2]: System reached EOF.\r\n");
+ return 0;
+ }
if (current_pos + length > file->size) length = file->size - current_pos;
uint32_t block_size = fs->block_size;
@@ -117,7 +181,10 @@ size_t Ext2Read(AuVFSNode* node, AuVFSNode* file, uint64_t* buffer, uint32_t len
uint32_t bytes_read = 0;
uint64_t* bounce_page = (uint64_t*)P2V((uint64_t)AuPmmngrAlloc());
- if (!bounce_page)return 0;
+ if (!bounce_page) {
+ AuTextOut("[Ext2]: out of memory during file reading.\r\n");
+ return 0;
+ }
while (bytes_read < length) {
uint64_t current_pos_offset = current_pos + bytes_read;
@@ -127,9 +194,42 @@ size_t Ext2Read(AuVFSNode* node, AuVFSNode* file, uint64_t* buffer, uint32_t len
uint32_t physical_block = 0;
if (logical_block < 12) physical_block = inode->block[logical_block];
+ else if (logical_block < (12 + fs->pointers_per_block)) {
+ uint32_t singly_block_id = inode->block[12];
+ if (singly_block_id == 0) physical_block = 0;
+ else {
+ uint32_t single_index = logical_block - 12;
+ physical_block = Ext2ReadBlockIndex(fs, singly_block_id, single_index);
+ }
+ }
+ else if(logical_block < (12 + fs->pointers_per_block + (fs->pointers_per_block * fs->pointers_per_block))) {
+ uint32_t doubly_block_id = inode->block[13];
+ if (doubly_block_id == 0) physical_block = 0;
+ else {
+ uint32_t double_index = logical_block - (12 + fs->pointers_per_block);
+ uint32_t first_level_index = double_index / fs->pointers_per_block;
+ uint32_t second_level_index = double_index % fs->pointers_per_block;
+ uint32_t first_level_physical = Ext2ReadBlockIndex(fs, doubly_block_id, first_level_index);
+ if (first_level_physical == 0) physical_block = 0;
+ else physical_block = Ext2ReadBlockIndex(fs, first_level_physical, second_level_index);
+ }
+ }
else {
- // @TODO: indirect table routines
- break;
+ uint32_t triply_block_id = inode->block[14];
+ if (triply_block_id == 0) physical_block = 0;
+ else {
+ uint32_t triple_index = logical_block - (12 + fs->pointers_per_block + (fs->pointers_per_block * fs->pointers_per_block));
+ uint32_t first_level_index = triple_index / (fs->pointers_per_block * fs->pointers_per_block);
+ uint32_t second_level_index = (triple_index / fs->pointers_per_block) % fs->pointers_per_block;
+ uint32_t third_level_index = triple_index % fs->pointers_per_block;
+ uint32_t first_level_physical = Ext2ReadBlockIndex(fs, triply_block_id, first_level_index);
+ if (first_level_physical == 0) physical_block = 0;
+ else {
+ uint32_t second_level_physical = Ext2ReadBlockIndex(fs, first_level_physical, second_level_index);
+ if (second_level_physical == 0) physical_block = 0;
+ else physical_block = Ext2ReadBlockIndex(fs, second_level_physical, third_level_index);
+ }
+ }
}
if (physical_block == 0) {
@@ -163,14 +263,22 @@ size_t Ext2Read(AuVFSNode* node, AuVFSNode* file, uint64_t* buffer, uint32_t len
* @param path -- path to the file
*/
AuVFSNode* Ext2Open(AuVFSNode* fsys, char* path) {
- if (!fsys || !path) return NULL;
-
+ if (!fsys || !path) {
+ const char* missing = !fsys ? "fsys" : "path";
+ AuTextOut("[Ext2]: %s parameter missing for file opening.\r\n", missing);
+ return NULL;
+ }
+
Ext2Fs* fs = (Ext2Fs*)fsys->device;
// edge case opening root directory
if (strlen(path) == 0 || strcmp(path, "/") == 0) {
AuVFSNode* root_session = (AuVFSNode*)kmalloc(sizeof(AuVFSNode));
+ if (!root_session) {
+ AuTextOut("[Ext2]: out of memory during root directory opening.\r\n");
+ return NULL;
+ }
memset(root_session, 0, sizeof(AuVFSNode));
strcpy(root_session->filename, fsys->filename);
@@ -178,63 +286,72 @@ AuVFSNode* Ext2Open(AuVFSNode* fsys, char* path) {
root_session->first_block = 2;
root_session->size = 0;
root_session->pos = 0;
- root_session->read = NULL;
+ root_session->read = Ext2Read;
root_session->device = fs;
root_session->private_data = NULL;
return root_session;
}
uint32_t current_inode_number = 2;
-
Ext2Inode current_inode;
char path_local[256];
- strncpy(path_local, path, 256);
- path_local[256] = '\0';
+ strncpy(path_local, path, sizeof(path_local) - 1);
+ path_local[sizeof(path_local) - 1] = '\0';
+
char* token = path_local;
char* nxt_token = NULL;
while (token && *token != '\0') {
+ while (*token == '/') token++;
+ if (*token == '\0') break;
nxt_token = strchr(token, '/');
if (nxt_token) {
*nxt_token = '\0';
nxt_token++;
}
- if (strlen(token)) {
- token = nxt_token;
- continue;
- }
if (Ext2ReadInode(fs, current_inode_number, ¤t_inode) != 0) {
- UARTDebugOut("[ext2]: failed to read the inode sector during path sweep.\r\n");
+ AuTextOut("[Ext2]: failed to read the inode sector during path sweep.\r\n");
return NULL;
}
if (!(current_inode.mode & EXT2_S_IFDIR)) {
- UARTDebugOut("[ext2]: path element is not a directory container.\r\n");
+ AuTextOut("[Ext2]: path element is not a directory container.\r\n");
return NULL;
}
uint32_t found_inode_num = Ext2FindEntry(fs, ¤t_inode, token);
- if (found_inode_num == 0) return NULL;
+ if (found_inode_num == 0) {
+ AuTextOut("[Ext2]: path element not found in directory.\r\n");
+ return NULL;
+ }
current_inode_number = found_inode_num;
token = nxt_token;
}
- if (Ext2ReadInode(fs, current_inode_number, ¤t_inode) != 0) return NULL;
+ if (Ext2ReadInode(fs, current_inode_number, ¤t_inode) != 0) {
+ AuTextOut("[Ext2]: failed to read the final inode sector during path sweep.\r\n");
+ return NULL;
+ }
AuVFSNode* file_session = (AuVFSNode*)kmalloc(sizeof(AuVFSNode));
- if (!file_session) return NULL;
+ if (!file_session) {
+ AuTextOut("[Ext2]: out of memory during file session creation.\r\n");
+ return NULL;
+ }
memset(file_session, 0, sizeof(AuVFSNode));
file_session->first_block = current_inode_number;
file_session->size = current_inode.size;
- char* raw_filename = strchr(path, '/');
- strcpy(file_session->filename, raw_filename ? (raw_filename + 1) : path);
+ char* raw_filename = strrchr(path, '/');
+ char* final_name = raw_filename ? (raw_filename + 1) : path;
+ strncpy(file_session->filename, final_name, 31);
+ file_session->filename[31] = '\0';
if (current_inode.mode & EXT2_S_IFDIR) file_session->flags |= FS_FLAG_DIRECTORY;
else if (current_inode.mode & EXT2_S_IFREG)file_session->flags |= FS_FLAG_GENERAL;
@@ -269,17 +386,27 @@ AuVFSNode* Ext2Initialise(AuVDisk* vdisk, char* mountname) {
AuVDiskRead(vdisk, 2, 2, buffer);
Ext2Fs* fs = (Ext2Fs*)kmalloc(sizeof(Ext2Fs));
+ if (!fs) {
+ AuTextOut("[ext2]: out of memory during file system initialization.\r\n");
+ kfree(fs);
+ return NULL;
+ }
memset(fs, 0, sizeof(Ext2Fs));
- fs->vdisk = (AuVFSNode*)vdisk;
+ fs->vdisk = vdisk;
fs->superblock = (Ext2Superblock*)kmalloc(sizeof(Ext2Superblock));
+ if (!fs->superblock) {
+ AuTextOut("[ext2]: out of memory during superblock allocation.\r\n");
+ kfree(fs->superblock);
+ return NULL;
+ }
memcpy(fs->superblock, buffer, sizeof(Ext2Superblock));
if (fs->superblock->magic != EXT2_SUPER_BLOCK_MAGIC) {
AuPmmngrFree((void*)V2P((uint64_t)buffer));
kfree(fs->superblock);
kfree(fs);
- UARTDebugOut("[ext2]: EXT2 magic mismatch \n");
+ AuTextOut("[ext2]: EXT2 magic mismatch \n");
for (;;);
return NULL;
}
@@ -332,8 +459,8 @@ AuVFSNode* Ext2Initialise(AuVDisk* vdisk, char* mountname) {
fsys->read = Ext2Read;
fsys->read_dir = NULL;
- fsys->write = NULL;
- fsys->create_dir = NULL;
+ fsys->write = Ext2Write;
+ fsys->create_dir = Ext2CreateDir;
fsys->create_file = NULL;
vdisk->fsys = fsys;
diff --git a/KernelAA64/Fs/Ext2/ext2dir.c b/KernelAA64/Fs/Ext2/ext2dir.c
new file mode 100644
index 000000000..e197eb18a
--- /dev/null
+++ b/KernelAA64/Fs/Ext2/ext2dir.c
@@ -0,0 +1,233 @@
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include <_null.h>
+
+
+#define EXT2_DIR_REC_LEN(name_len) (((8 + (name_len)) + 3) & ~3)
+
+
+uint32_t Ext2AllocInode(Ext2Fs* fs) {
+ if (!fs || !fs->superblock) return 0;
+
+ if (fs->superblock->free_inodes_count == 0) {
+ AuTextOut("[Ext2]: no free inodes available on volume.\r\n");
+ return 0;
+ }
+
+ uint32_t block_size = fs->block_size;
+ uint32_t sector_per_block = block_size / 512;
+ uint32_t group_count = fs->block_group_count;
+
+ uint8_t* bitmap_buffer = (uint8_t*)P2V((uint64_t)AuPmmngrAlloc());
+ if (!bitmap_buffer) return 0;
+
+ uint32_t allocated_inode_id = 0;
+ uint32_t target_group = 0;
+
+ for (uint32_t g = 0; g < group_count; g++) {
+ if (fs->block_desc->free_inodes_count == 0) continue;
+
+ uint32_t bitmap_block = fs->block_desc->inode_bitmap;
+ uint32_t bitmap_lba = (uint64_t)bitmap_block * sector_per_block;
+
+ memset(bitmap_buffer, 0, block_size);
+ AuVDiskRead((AuVDisk*)fs->vdisk, bitmap_lba, sector_per_block, (uint64_t*)bitmap_buffer);
+
+ uint32_t bytes_to_scan = fs->inodes_per_group / 8;
+ if (bytes_to_scan > block_size) bytes_to_scan = block_size;
+
+ for (uint32_t byte_index = 0; byte_index < bytes_to_scan; byte_index++) {
+ if (bitmap_buffer[byte_index] == 0xFF) continue;
+ for (uint8_t bit_index = 0; bit_index < 8; bit_index++) {
+ if (!(bitmap_buffer[byte_index] & (1 << bit_index))) {
+ uint32_t relative_inode = (byte_index * 8) + bit_index + 1;
+ allocated_inode_id = (g * fs->inodes_per_group) + relative_inode;
+
+ bitmap_buffer[byte_index] |= (1 << bit_index);
+
+ AuVDiskWrite((AuVDisk*)fs->vdisk, bitmap_lba, sector_per_block, (uint64_t*)bitmap_buffer);
+ target_group = g;
+ goto success;
+ }
+ }
+ }
+ }
+success:
+ AuPmmngrFree((void*)V2P((uint64_t)bitmap_buffer));
+
+ if (allocated_inode_id == 0) return 0;
+
+ // Update metadata counters
+ fs->superblock->free_inodes_count--;
+ fs->block_desc[target_group].free_inodes_count--;
+
+ Ext2FlushSuperblock(fs);
+ Ext2FlushBgdt(fs);
+
+ return allocated_inode_id;
+};
+
+int Ext2AddDirEntry(Ext2Fs* fs, Ext2Inode* parent_inode, uint32_t parent_inode_num, uint32_t child_inode_num, const char* child_name, uint8_t file_type) {
+ if (!fs || !parent_inode || !child_name) return -1;
+
+ uint32_t block_size = fs->block_size;
+ uint32_t sector_per_block = block_size / 512;
+ uint32_t name_len = strlen(child_name);
+ uint16_t required_rec_len = EXT2_DIR_REC_LEN(name_len);
+
+ uint8_t* block_buf = (uint8_t*)P2V((uint64_t)AuPmmngrAlloc());
+ if (!block_buf) return -1;
+
+ for (uint32_t i = 0; i < 12; i++) {
+ uint32_t physical_block = parent_inode->block[i];
+
+ if (physical_block == 0) {
+ physical_block = Ext2AllocBlock(fs);
+ if (physical_block == 0) {
+ AuPmmngrFree((void*)V2P((uint64_t)block_buf));
+ return -1;
+ }
+
+ parent_inode->block[i] = physical_block;
+ parent_inode->size += block_size;
+ parent_inode->blocks = (parent_inode->size + 511) / 512;
+ Ext2InodeWrite(fs, parent_inode_num, parent_inode);
+
+ memset(block_buf, 0, block_size);
+ Ext2Dir* new_entry = (Ext2Dir*)block_buf;
+ new_entry->inode = child_inode_num;
+ new_entry->rec_len = block_size;
+ new_entry->name_len = name_len;
+ new_entry->file_type = file_type;
+ memcpy(new_entry->name, (void*)child_name, name_len);
+
+ AuVDiskWrite((AuVDisk*)fs->vdisk, (uint64_t)physical_block * sector_per_block, sector_per_block, (uint64_t*)block_buf);
+ AuPmmngrFree((void*)V2P((uint64_t)block_buf));
+ return 0;
+ }
+
+ uint64_t target_lba = (uint64_t)physical_block * sector_per_block;
+ memset(block_buf, 0, block_size);
+ AuVDiskRead((AuVDisk*)fs->vdisk, target_lba, sector_per_block, (uint64_t*)block_buf);
+
+ uint32_t current_pos = 0;
+ while (current_pos < block_size) {
+ Ext2Dir* entry = (Ext2Dir*)(block_buf + current_pos);
+
+ if (entry->rec_len == 0) break;
+
+ uint16_t actual_rec_len = EXT2_DIR_REC_LEN(entry->name_len);
+
+ if (entry->rec_len - actual_rec_len >= required_rec_len) {
+ uint16_t old_rec_len = entry->rec_len;
+
+ entry->rec_len = actual_rec_len;
+
+ Ext2Dir* new_entry = (Ext2Dir*)(block_buf + current_pos + actual_rec_len);
+ new_entry->inode = child_inode_num;
+ new_entry->rec_len = old_rec_len - actual_rec_len;
+ new_entry->name_len = name_len;
+ new_entry->file_type = file_type;
+ memcpy(new_entry->name, (void*)child_name, name_len);
+
+ AuVDiskWrite((AuVDisk*)fs->vdisk, target_lba, sector_per_block, (uint64_t*)block_buf);
+ AuPmmngrFree((void*)V2P((uint64_t)block_buf));
+ return 0;
+ }
+
+ current_pos += entry->rec_len;
+ }
+ }
+
+ AuPmmngrFree((void*)V2P((uint64_t)block_buf));
+ return -1;
+};
+
+int Ext2Mkdir(AuVFSNode* parent_node, const char* name, uint16_t permissions) {
+ if (!parent_node || !name) return -1;
+
+ Ext2Fs* fs = (Ext2Fs*)parent_node->device;
+ Ext2Inode* parent_inode = (Ext2Inode*)parent_node->private_data;
+
+ if (!fs || !parent_inode) return -1;
+
+ if (!(parent_node->flags & FS_FLAG_DIRECTORY)) {
+ AuTextOut("[Ext2 Mkdir]: Parent node is not a directory.\r\n");
+ return -1;
+ }
+
+ if (Ext2FindEntry(fs, parent_inode, name) != 0) {
+ AuTextOut("[Ext2 Mkdir]: Directory entry already exists.\r\n");
+ return -1;
+ }
+
+ uint32_t new_inode_num = Ext2AllocInode(fs);
+ if (new_inode_num == 0) return -1;
+
+ uint32_t new_block_num = Ext2AllocBlock(fs);
+ if (new_block_num == 0) return -1;
+
+ uint32_t block_size = fs->block_size;
+ uint32_t sector_per_block = block_size / 512;
+
+ uint8_t* dir_block = (uint8_t*)P2V((uint64_t)AuPmmngrAlloc());
+ if (!dir_block) return -1;
+
+ memset(dir_block, 0, block_size);
+
+ Ext2Dir* dot = (Ext2Dir*)dir_block;
+ dot->inode = new_inode_num;
+ dot->rec_len = 12;
+ dot->name_len = 1;
+ dot->file_type = 2;
+ dot->name[0] = '.';
+
+ Ext2Dir* dotdot = (Ext2Dir*)(dir_block + 12);
+ dotdot->inode = parent_node->first_block;
+ dotdot->rec_len = block_size - 12;
+ dotdot->name_len = 2;
+ dotdot->file_type = 2;
+ dotdot->name[0] = '.';
+ dotdot->name[1] = '.';
+
+ AuVDiskWrite((AuVDisk*)fs->vdisk, (uint64_t)new_block_num * sector_per_block, sector_per_block, (uint64_t*)dir_block);
+ AuPmmngrFree((void*)V2P((uint64_t)dir_block));
+
+ Ext2Inode new_inode;
+ memset(&new_inode, 0, sizeof(Ext2Inode));
+
+ new_inode.mode = EXT2_S_IFDIR | (permissions & 0x0FFF);
+ new_inode.size = block_size;
+ new_inode.links_count = 2;
+ new_inode.blocks = block_size / 512;
+ new_inode.block[0] = new_block_num;
+
+ if (Ext2InodeWrite(fs, new_inode_num, &new_inode) != 0) return -1;
+
+ if (Ext2AddDirEntry(fs, parent_inode, parent_node->first_block, new_inode_num, name, 2) != 0) return -1;
+
+ parent_inode->links_count++;
+ Ext2InodeWrite(fs, parent_node->first_block, parent_inode);
+
+ uint32_t group = (new_inode_num - 1) / fs->inodes_per_group;
+ fs->block_desc[group].used_dirs_count++;
+ Ext2FlushBgdt(fs);
+
+ return 0;
+}
+
+AuVFSNode* Ext2CreateDir(AuVFSNode* parent, char* name) {
+ if (!parent || !name) return NULL;
+
+ if (Ext2Mkdir(parent, name, 0755) != 0) {
+ AuTextOut("[Ext2]: Failed to create directory on disk.\r\n");
+ return NULL;
+ }
+
+ return Ext2Open(parent, name);
+}
\ No newline at end of file
diff --git a/KernelAA64/Fs/Ext2/ext2file.c b/KernelAA64/Fs/Ext2/ext2file.c
new file mode 100644
index 000000000..ab59b03cf
--- /dev/null
+++ b/KernelAA64/Fs/Ext2/ext2file.c
@@ -0,0 +1,341 @@
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+void Ext2FlushSuperblock(Ext2Fs* fs) {
+ if (!fs || !fs->superblock) return;
+
+ int8_t* buffer = (uint8_t*)P2V((uint64_t)AuPmmngrAlloc());
+ if (!buffer) return;
+
+ memset(buffer, 0, 4096);
+
+ AuVDiskRead((AuVDisk*)fs->vdisk, 2, 2, (uint64_t*)buffer);
+ memcpy(buffer, fs->superblock, sizeof(Ext2Superblock));
+ AuVDiskWrite((AuVDisk*)fs->vdisk, 2, 2, (uint64_t*)buffer);
+
+ AuPmmngrFree((void*)V2P((uint64_t)buffer));
+};
+
+void Ext2FlushBgdt(Ext2Fs* fs) {
+ if (!fs || !fs->block_desc) return;
+
+ uint32_t bgd_start_block = (fs->block_size == 1024) ? 2 : 1;
+ uint32_t sector_per_block = fs->block_size / 512;
+ uint64_t bgd_lba = (uint64_t)bgd_start_block * sector_per_block;
+
+ uint32_t bgd_table_size = fs->block_group_count * sizeof(Ext2BlockDescriptor);
+ uint32_t blocks_needed = (bgd_table_size + fs->block_size - 1) / fs->block_size;
+
+ uint8_t* buffer = (uint8_t*)P2V((uint64_t)AuPmmngrAlloc());
+ if (!buffer) return;
+
+ memset(buffer, 0, fs->block_size);
+ memcpy(buffer, fs->block_desc, bgd_table_size);
+
+ AuVDiskWrite((AuVDisk*)fs->vdisk, bgd_lba, blocks_needed * sector_per_block, (uint64_t*)buffer);
+
+ AuPmmngrFree((void*)V2P((uint64_t)buffer));
+};
+
+uint32_t Ext2AllocBlock(Ext2Fs* fs) {
+ if (!fs || !fs->superblock) {
+ AuTextOut("[Ext2]: Invalid filesystem handle.\r\n");
+ return 0;
+ }
+
+ if (fs->superblock->free_blocks_count == 0) {
+ AuTextOut("[Ext2]: Filesystem is completely full!\r\n");
+ return 0;
+ }
+
+ uint32_t block_size = fs->block_size;
+ uint32_t sector_per_block = block_size / 512;
+ uint32_t group_count = fs->block_group_count;
+
+ uint8_t* buffer = (uint8_t*)P2V((uint8_t)AuPmmngrAlloc());
+ if (!buffer) {
+ AuTextOut("[Ext2]: Out of memory allocating bitmap buffer.\r\n");
+ return 0;
+ }
+
+ uint32_t allocated_block_id = 0;
+ uint32_t target_group = 0;
+
+ for (uint32_t i = 0; iblock_desc->free_blocks_count == 0) continue;
+
+ uint32_t bitmap_block = fs->block_desc->block_bitmap;
+ uint64_t bitmap_lba = (uint64_t)bitmap_block * sector_per_block;
+
+ memset(buffer, 0, block_size);
+ AuVDiskRead((AuVDisk*)fs->vdisk, bitmap_lba, sector_per_block, (uint64_t*)buffer);
+
+ for (uint32_t byte = 0; byte < block_size; byte++) {
+ if (buffer[byte] == 0xFF) continue;
+ for (uint8_t bit = 0; bit < 8; bit++) {
+ if (!(buffer[byte] & (1 << bit))) {
+ uint32_t relative_block = (byte * 8) + bit;
+ allocated_block_id = (i * fs->block_group_count) + relative_block + fs->superblock->free_data_block;
+ buffer[byte] |= (1 << bit);
+ AuVDiskWrite((AuVDisk*)fs->vdisk, bitmap_lba, sector_per_block, (uint64_t*)buffer);
+ target_group = i;
+ goto success;
+ }
+ }
+ }
+ }
+success:
+ AuPmmngrFree((void*)V2P((uint64_t)buffer));
+ if (allocated_block_id == 0) {
+ AuTextOut("[Ext2]: failed to locate a free bit in bitmap.\r\n");
+ return 0;
+ }
+
+ fs->superblock->free_blocks_count--;
+ fs->block_desc->free_blocks_count--;
+
+ Ext2FlushSuperblock(fs);
+ Ext2FlushBgdt(fs);
+
+ return allocated_block_id;
+};
+
+int Ext2InodeWrite(Ext2Fs* fs, uint32_t inode_num, Ext2Inode* inode) {
+ if (!fs || !inode || inode_num == 0) return -1;
+
+ uint32_t group = (inode_num - 1) / fs->inodes_per_group;
+ uint32_t index = (inode_num - 1) % fs->inodes_per_group;
+
+ uint32_t inode_table_block = fs->block_desc->inode_table;
+ uint32_t inode_size = fs->inode_size;
+ uint32_t byte_offset = index * inode_size;
+
+ uint32_t block_offset = byte_offset / fs->block_size;
+ uint32_t internal_offset = byte_offset % fs->block_size;
+
+ uint32_t target_block = inode_table_block + block_offset;
+ uint32_t sector_per_block = fs->block_size / 512;
+ uint64_t target_lba = (uint64_t)target_block * sector_per_block;
+
+ uint8_t* buffer = (uint8_t*)P2V((uint64_t)AuPmmngrAlloc());
+ if (!buffer) return -1;
+
+ AuVDiskRead((AuVDisk*)fs->vdisk, target_lba, sector_per_block, (uint64_t*)buffer);
+ memcpy(buffer + internal_offset, inode, inode_size);
+ AuVDiskWrite((AuVDisk*)fs->vdisk, target_lba, sector_per_block, (uint64_t*)buffer);
+
+ AuPmmngrFree((void*)V2P((uint64_t)buffer));
+
+ return 0;
+};
+
+static uint32_t Ext2AssignTable(Ext2Fs* fs, uint32_t table_block_id, uint32_t index) {
+ if(table_block_id == 0) return 0;
+ uint32_t sector_per_block = fs->block_size / 512;
+
+ uint32_t* table_buffer = (uint32_t*)P2V((uint64_t)AuPmmngrAlloc());
+ if (!table_buffer) return 0;
+
+ AuVDiskRead((AuVDisk*)fs->vdisk, (uint64_t)table_block_id * sector_per_block, sector_per_block, (uint64_t*)table_buffer);
+ uint32_t target_block = table_buffer[index];
+
+ if (target_block == 0) {
+ target_block = Ext2AllocBlock(fs);
+ if (target_block != 0) {
+ table_buffer[index] = target_block;
+
+ AuVDiskWrite((AuVDisk*)fs->vdisk, (uint64_t)table_block_id * sector_per_block, sector_per_block, (uint64_t*)table_buffer);
+
+ uint32_t* zero_buffer = (uint32_t*)P2V((uint64_t)AuPmmngrAlloc());
+ if (zero_buffer) {
+ memset(zero_buffer, 0, fs->block_size);
+ AuVDiskWrite((AuVDisk*)fs->vdisk, (uint64_t)table_block_id * sector_per_block, sector_per_block, (uint64_t*)zero_buffer);
+ AuPmmngrFree((void*)V2P((uint64_t)zero_buffer));
+ }
+ }
+ }
+
+ AuPmmngrFree((void*)V2P((uint64_t)table_buffer));
+ return target_block;
+};
+
+/**
+ * Ext2GetBlock -- check for blocks if not allocated it allocates them
+ */
+static uint32_t Ext2GetBlock(Ext2Fs* fs, Ext2Inode* inode, uint32_t inode_num, uint32_t logical_block) {
+ uint32_t sector_per_block = fs->block_size / 512;
+
+ if (logical_block < 12) {
+ if (inode->block[logical_block] !=0 ) return inode->block[logical_block];
+ uint32_t new_block = Ext2AllocBlock(fs);
+ if (new_block == 0) return 0;
+
+ inode->block[logical_block] = new_block;
+ Ext2InodeWrite(fs, inode_num, inode);
+ return new_block;
+ }
+
+ if (logical_block < (12 + fs->pointers_per_block)) {
+ uint32_t single_index = logical_block - 12;
+
+ if (inode->block[12] == 0) {
+ uint32_t new_table_block = Ext2AllocBlock(fs);
+ if (new_table_block == 0) return 0;
+
+ inode->block[12] = new_table_block;
+ Ext2InodeWrite(fs, inode_num, inode);
+
+
+ uint8_t* buffer = (uint8_t*)P2V((uint64_t)AuPmmngrAlloc());
+ memset(buffer, 0, fs->block_size);
+ AuVDiskWrite((AuVDisk*)fs->vdisk, (uint64_t)new_table_block * sector_per_block, sector_per_block, (uint64_t*)buffer);
+ AuPmmngrFree((void*)V2P((uint64_t)buffer));
+ }
+
+ return Ext2AssignTable(fs, inode->block[12], single_index);
+ }
+
+ if (logical_block < (12 + fs->pointers_per_block + (fs->pointers_per_block * fs->pointers_per_block))) {
+ uint64_t double_index = logical_block - (12 + fs->pointers_per_block);
+ uint32 lvl1_index = double_index / fs->pointers_per_block;
+ uint32 lvl2_index = double_index % fs->pointers_per_block;
+
+ if (inode->block[13] == 0) {
+ uint32_t new_table_block = Ext2AllocBlock(fs);
+ if (new_table_block == 0) return 0;
+
+ inode->block[13] = new_table_block;
+ Ext2InodeWrite(fs, inode_num, inode);
+
+
+ uint8_t* buffer = (uint8_t*)P2V((uint64_t)AuPmmngrAlloc());
+ memset(buffer, 0, fs->block_size);
+ AuVDiskWrite((AuVDisk*)fs->vdisk, (uint64_t)new_table_block * sector_per_block, sector_per_block, (uint64_t*)buffer);
+ AuPmmngrFree((void*)V2P((uint64_t)buffer));
+ }
+
+ uint32 single_table = Ext2AssignTable(fs, inode->block[13], lvl1_index);
+ if (single_table == 0) return 0;
+
+ return Ext2AssignTable(fs, single_table, lvl2_index);
+ }
+
+ if (logical_block < (12 + fs->pointers_per_block + (fs->pointers_per_block * fs->pointers_per_block) + (fs->pointers_per_block * fs->pointers_per_block * fs->pointers_per_block))) {
+ uint64_t triple_index = logical_block - (12 + fs->pointers_per_block + (fs->pointers_per_block * fs->pointers_per_block));
+ uint32_t lvl1_index = triple_index / (fs->pointers_per_block);
+ uint32_t lvl2_index = (triple_index / fs->pointers_per_block) % fs->pointers_per_block;
+ uint32_t lvl3_index = triple_index % fs->pointers_per_block;
+
+ if (inode->block[14] == 0){
+ uint32_t new_table_block = Ext2AllocBlock(fs);
+ if (new_table_block == 0) return 0;
+
+ inode->block[14] = new_table_block;
+ Ext2InodeWrite(fs, inode_num, inode);
+
+ uint8_t* zero_buffer = (uint8_t*)P2V((uint64_t)AuPmmngrAlloc());
+ memset(zero_buffer, 0, fs->block_size);
+ AuVDiskWrite((AuVDisk*)fs->vdisk, (uint64_t)new_table_block * sector_per_block, sector_per_block, (uint64_t*)zero_buffer);
+ AuPmmngrFree((void*)V2P((uint64_t)zero_buffer));
+ }
+
+ uint32 double_table = Ext2AssignTable(fs, inode->block[14], lvl1_index);
+ if (double_table == 0) return 0;
+
+ uint32_t single_table = Ext2AssignTable(fs, double_table, lvl2_index);
+ if (single_table) return 0;
+
+ return Ext2AssignTable(fs, single_table, lvl3_index);
+ }
+
+ AuTextOut("[Ext2]: Logical block exceeds maximum supported Ext2 file boundary.\r\n");
+ return 0;
+};
+
+/**
+ * Ext2Wrtie -- writes data to a file in the ext2 filesystem
+ * @param node -- the filesystem node
+ * @param file -- the file node to write to
+ * @param buffer -- the buffer to store write data
+ * @param length -- the number of bytes to write
+ */
+size_t Ext2Write(AuVFSNode* node, AuVFSNode* file, uint64_t* buffer, uint32_t length){
+ if (!node || !file || !buffer || !length){
+ const char* missing = !node ? "node" : !file ? "file" : !buffer ? "buffer" : "length";
+ AuTextOut("[Ext2]: %s parameter missing for file writing.\r\n", missing);
+ return 0;
+ }
+
+ if (length <= 0) {
+ AuTextOut("[Ext2]: lenght is zero or smaller");
+ return 0;
+ }
+
+ Ext2Fs* fs = (Ext2Fs*)node->device;
+ Ext2Inode* inode = (Ext2Inode*)file->private_data;
+
+ uint64_t current_pos = file->pos;
+
+ uint32_t block_size = fs->block_size;
+ uint32_t sector_per_block = block_size / 512;
+ uint32_t bytes_written = 0;
+
+ if (current_pos >= file->size) {
+ AuTextOut("[Ext2]: System reached EOF.\r\n");
+ return 0;
+ }
+
+ uint64_t* bounce_page = (uint64_t*)P2V((uint64_t)AuPmmngrAlloc());
+ if (!bounce_page) {
+ AuTextOut("[Ext2]: out of memory during file write.\r\n");
+ return 0;
+ }
+
+ while (bytes_written < length) {
+ uint64_t current_pos_offset = current_pos + bytes_written;
+ uint64_t logical_block = current_pos_offset / block_size;
+ uint32_t internal_offset = current_pos_offset % block_size;
+
+ uint32_t chunk = block_size - internal_offset;
+ if (chunk > (length - bytes_written)) chunk = length - bytes_written;
+
+ uint32_t physical_block = Ext2GetBlock(fs, inode, file->first_block, logical_block);
+ if (physical_block == 0) {
+ AuTextOut("[Ext2 Write Error]: Failed to allocate or resolve physical block.\r\n");
+ break;
+ }
+
+ uint64_t target_lba = (uint64_t)physical_block * sector_per_block;
+
+ if (internal_offset != 0 || chunk < block_size) {
+ memset(bounce_page, 0, block_size);
+ AuVDiskRead((AuVDisk*)fs->vdisk, target_lba, sector_per_block, (uint64_t*)bounce_page);
+ } else {
+ memset(bounce_page, 0, block_size);
+ }
+
+ memcpy(bounce_page + internal_offset, ((uint8_t*)buffer) + bytes_written, chunk);
+ AuVDiskWrite((AuVDisk*)fs->vdisk, target_lba, sector_per_block, (uint64_t*)bounce_page);
+
+ bytes_written += chunk;
+ }
+ AuPmmngrFree((void*)V2P((uint64_t)bounce_page));
+
+ if ((current_pos + bytes_written) > file->size) {
+ file->size = current_pos + bytes_written;
+ inode->size = file->size;
+ }
+
+ inode->blocks = (inode->size + 511) / 512;
+
+ Ext2InodeWrite(fs, file->first_block, inode);
+
+ file->pos += bytes_written;
+
+ return bytes_written;
+};
\ No newline at end of file
diff --git a/KernelAA64/Fs/Fat/Fat.c b/KernelAA64/Fs/Fat/Fat.c
index 784ab2853..adb3992b7 100644
--- a/KernelAA64/Fs/Fat/Fat.c
+++ b/KernelAA64/Fs/Fat/Fat.c
@@ -301,7 +301,7 @@ size_t FatRead(AuVFSNode* fsys, AuVFSNode* file, uint64_t* buf) {
if (file->current == (FAT_EOC_MARK & 0x0FFFFFFF))
return 0;
- auto lba = FatClusterToSector32(fs, file->current);
+ uint32 lba = FatClusterToSector32(fs, file->current);
AuVDiskRead(vdisk, lba, fs->__SectorPerCluster, buf);
uint32_t value = FatReadFAT(fsys, file->current);
diff --git a/KernelAA64/Fs/initrd.c b/KernelAA64/Fs/initrd.c
index 287010bee..d0149696e 100644
--- a/KernelAA64/Fs/initrd.c
+++ b/KernelAA64/Fs/initrd.c
@@ -76,7 +76,7 @@ void AuRamdiskRead(uint64_t lba, size_t count, uint8_t* buffer) {
}
const uint8_t* src = (const uint8_t*)(ramdisk_start + offset);
- memcpy(buffer, src, bytes_to_read);
+ memcpy(buffer, (void*)src, bytes_to_read);
/*for (int i = 0; i < RAMDISK_SECTOR_SIZE * count; i++)
buffer[i] = src[i];*/
}
diff --git a/KernelAA64/Fs/tty.c b/KernelAA64/Fs/tty.c
index 868ada10d..a78c3a0ac 100644
--- a/KernelAA64/Fs/tty.c
+++ b/KernelAA64/Fs/tty.c
@@ -45,9 +45,9 @@
/** @brief master_count -- internal count value of total
* master tty
*/
-size_t master_count = 0;
+static size_t master_count = 0;
/** @brief slave_count -- internal slave tty count */
-size_t slave_count = 0;
+static size_t slave_count = 0;
TTY* root = NULL;
TTY* last = NULL;
@@ -239,13 +239,15 @@ size_t AuTTYSlaveWrite(AuVFSNode* fsys, AuVFSNode* file, uint64_t* buffer, uint3
TTY* tty = (TTY*)file->device;
if (!tty)
return 0;
- if (len > 512)
- len = 512;
+ if (len > 1024)
+ len = 1024;
if (CircBufFull(tty->masterbuf)) {
- AA64Registers* regs = AA64GetCurrentRegCtx();
- AuScheduleThread(regs);
+ /*AA64Registers* regs = AA64GetCurrentRegCtx();
+ AuScheduleThread(regs);*/
+ AuSleepThread(curr_th, 10);
+ AuScheduleNext();
return 0;
}
@@ -257,15 +259,17 @@ size_t AuTTYSlaveWrite(AuVFSNode* fsys, AuVFSNode* file, uint64_t* buffer, uint3
/* little bit slow down the slave process,
* it's too fast
*/
- //AuSleepThread(curr_th, );
+ //AuSleepThread(curr_th,10);
//AuScheduleThread(AA64GetCurrentRegCtx());
+ //AuScheduleNext();
return len;
}
int AuTTYSlaveClose(AuVFSNode* fs, AuVFSNode* file) {
AuVFSNode* _fs = AuVFSFind("/dev");
if (!_fs)
- return 0;
+ return 1;
+ return 0;
}
int AuTTYMasterClose(AuVFSNode* fs, AuVFSNode* file) {
@@ -334,7 +338,7 @@ AuVFSNode* AuTTYCreateMaster(TTY* tty) {
sztoa(master_count, name + 4, 10);
strcpy(node->filename, name);
- node->size = 512;
+ node->size = 1024;
node->flags |= FS_FLAG_TTY;
node->device = tty;
node->uid = 0;
@@ -366,7 +370,7 @@ AuVFSNode* AuTTYCreateSlave(TTY* tty) {
sztoa(slave_count, name + 4, 10);
strcpy(node->filename, name);
- node->size = 512;
+ node->size = 1024;
node->flags |= FS_FLAG_TTY;
node->device = tty;
node->read = AuTTYSlaveRead;
@@ -400,13 +404,13 @@ int AuTTYCreate(int* master_fd, int* slave_fd) {
TTY* tty = (TTY*)kmalloc(sizeof(TTY));
memset(tty, 0, sizeof(TTY));
- void* inbuffer = kmalloc(512);
- memset(inbuffer, 0, 512);
- void* outbuffer = kmalloc(512);
- memset(outbuffer, 0, 512);
+ void* inbuffer = kmalloc(1024);
+ memset(inbuffer, 0, 1024);
+ void* outbuffer = kmalloc(1024);
+ memset(outbuffer, 0, 1024);
- tty->masterbuf = AuCircBufInitialise((uint8_t*)inbuffer, 512);
- tty->slavebuf = AuCircBufInitialise((uint8_t*)outbuffer, 512);
+ tty->masterbuf = AuCircBufInitialise((uint8_t*)inbuffer, 1024);
+ tty->slavebuf = AuCircBufInitialise((uint8_t*)outbuffer, 1024);
tty->id = slave_count;
tty->master_written = 0;
@@ -432,18 +436,24 @@ int AuTTYCreate(int* master_fd, int* slave_fd) {
slave->uid = proc->creds.uid;
slave->gid = proc->creds.gid;
+ CapRights rights;
+ rights = CAP_READ | CAP_WRITE;
+
int fd = AuProcessGetFileDesc(proc);
if (fd == -1)
return 0;
proc->fds[fd] = master;
*master_fd = fd;
+ BordoisilaCapCreate(proc, fd, master, CAP_OBJ_FILE, rights);
+
fd = AuProcessGetFileDesc(proc);
if (fd == -1)
return 0;
proc->fds[fd] = slave;
*slave_fd = fd;
-
+
+ BordoisilaCapCreate(proc, fd, slave, CAP_OBJ_FILE, rights);
return 1;
}
diff --git a/KernelAA64/Fs/vdisk.c b/KernelAA64/Fs/vdisk.c
index 87ddb320b..839c53ddf 100644
--- a/KernelAA64/Fs/vdisk.c
+++ b/KernelAA64/Fs/vdisk.c
@@ -41,7 +41,8 @@
#include
#include
#include
-#include
+#include
+#include
AuVDisk* VdiskArray[MAX_VDISK_DEVICES];
int _vdisk_num_;
@@ -101,6 +102,7 @@ uint8_t AuVDiskGetIndex() {
if (!VdiskArray[i])
return i;
}
+ return UINT8_MAX;
}
@@ -156,11 +158,12 @@ void AuVDiskRegisterPartition(AuVDisk* vdisk) {
memset(buffer, 0, 4096);
if (!vdisk->Read)
return;
+
vdisk->Read(vdisk, 1, 1, buffer);
uint8_t* aligned_buf = (uint8_t*)buffer;
GPTHeader* header = (GPTHeader*)aligned_buf;
-
+
/* check if it's Efi partition */
if (strcmp(header->sig, "EFI PART") != 0) {
AuTextOut("[aurora]: vdisk %s doesn't have valid GPT partition \r\n", vdisk->diskname);
@@ -212,7 +215,7 @@ void AuVDiskRegisterPartition(AuVDisk* vdisk) {
AuTextOut("\r\n");
AuPmmngrFree(buffer);
-
+
}
/**
@@ -231,6 +234,7 @@ void AuVDiskRegister(AuVDisk* disk) {
disk->__VDiskID = _index;
/* Register a partition and initialise the file system*/
+
AuVDiskRegisterPartition(disk);
aurora_fs_type type = AuProbeFileSystem(disk);
@@ -245,7 +249,7 @@ void AuVDiskRegister(AuVDisk* disk) {
char* mpt = AuVFSReserveMountPointLetter();
/** make letter /a reserved for root '/' **/
- if (strcmp(mpt, "/a") == 0)
+ if (strcmp(mpt, "a") == 0)
FatInitialise(disk, "/");
else
FatInitialise(disk, mpt);
@@ -255,7 +259,8 @@ void AuVDiskRegister(AuVDisk* disk) {
break;
case AURORA_FS_EXT2:
AuTextOut("[aurora]: vdisk : %s has Ext2 file system \r\n", disk->diskname);
- Ext2Initialise(disk, "b");
+ mpt = AuVFSReserveMountPointLetter();
+ Ext2Initialise(disk, mpt);
break;
}
}
diff --git a/KernelAA64/Fs/vfs.c b/KernelAA64/Fs/vfs.c
index 3827b4302..50efb291c 100644
--- a/KernelAA64/Fs/vfs.c
+++ b/KernelAA64/Fs/vfs.c
@@ -32,6 +32,7 @@
#include
#include
#include <_null.h>
+#include
#include
#include
#include
@@ -42,6 +43,7 @@
#include
#include
#include
+#include
AuVFSContainer* __RootContainer;
AuVFSNode* __RootFS;
@@ -210,7 +212,7 @@ AU_EXTERN AU_EXPORT AuVFSNode* AuVFSOpen(char* path) {
dsb_ish();
}
pathname[i] = 0;
- aa64_data_cache_clean_range(&pathname, 16);
+ //aa64_data_cache_clean_range(&pathname, 16);
/* skip the fs filename, from the path
* and just pass the required path */
@@ -218,7 +220,6 @@ AU_EXTERN AU_EXPORT AuVFSNode* AuVFSOpen(char* path) {
next += i;
dsb_ish();
dsb_sy_barrier();
-
if (fs->open) {
//AA64SleepUS(600);
Returnable = fs->open(fs, next);
@@ -227,7 +228,7 @@ AU_EXTERN AU_EXPORT AuVFSNode* AuVFSOpen(char* path) {
//AA64SleepUS(600);
}
}
- data_cache_flush(Returnable);
+ data_cache_flush((uint64_t*)Returnable);
return Returnable;
}
@@ -359,6 +360,8 @@ int AuVFSRemoveDir(AuVFSNode* fsys, AuVFSNode* file) {
return -1;
if (fsys->remove_dir && (file->flags & FS_FLAG_DIRECTORY))
return fsys->remove_dir(fsys, file);
+
+ return 0;
}
diff --git a/KernelAA64/Hal/aa64cpu.c b/KernelAA64/Hal/aa64cpu.c
index d123972d3..c02ddb7f9 100644
--- a/KernelAA64/Hal/aa64cpu.c
+++ b/KernelAA64/Hal/aa64cpu.c
@@ -44,6 +44,7 @@
uint64_t basisTime;
uint64_t cpuFrequency;
+uint64_t bootTime;
uint64_t AA64GetPhysicalTimerCount() {
uint64_t val = get_cntpct_el0();
@@ -69,6 +70,7 @@ void AA64ClockInitialize() {
cpuFrequency = val / 10000;
basisTime = AA64GetPhysicalTimerCount() / cpuFrequency;
+ bootTime = AuAA64BoardGetBootEpoch();
AuTextOut("[aurora]: using %d mHZ \r\n", cpuFrequency);
}
@@ -163,6 +165,64 @@ void AA64CPUImplementer(uint32_t midr) {
//AuTextOut("CPU Architecture: ARMv8-A(%x) \r\n", arch);
}
+#define SUBSECONDS_PER_SECOND 1000000
+
+void updateTicks(uint64_t ticks, uint64_t* timerTick, uint64_t* timerSubticks) {
+ *timerSubticks = ticks - basisTime;
+ *timerTick = *timerSubticks / SUBSECONDS_PER_SECOND;
+ *timerSubticks = *timerSubticks % SUBSECONDS_PER_SECOND;
+}
+
+int aa64_gettimeofday(timeval* t) {
+ uint64_t cur_cnt = AA64GetPhysicalTimerCount();
+ uint64_t timer_ticks, timer_subticks;
+ updateTicks(cur_cnt / cpuFrequency, &timer_ticks, &timer_subticks);
+ t->tv_sec = bootTime + timer_ticks;
+ t->tv_usec = timer_subticks;
+ return 0;
+}
+
+uint64_t aa64_now() {
+ timeval t;
+ aa64_gettimeofday(&t);
+ return t.tv_sec;
+}
+
+int aa64_settimeofday(timeval* t) {
+ if (!t) return -1;
+ if (t->tv_sec < 0 || t->tv_usec < 0 || t->tv_usec > 1000000) return -1;
+
+ //atomic lock
+ uint64_t clock = aa64_now();
+ bootTime += t->tv_sec - clock;
+ //atomic unlock
+ return 0;
+}
+
+/*
+ * aa64_calculate_ticks -- calculate the number of ticks from given milliseconds
+ * @param seconds -- amount of seconds
+ * @param out_milliseconds -- where to store the number of ticks
+ */
+void aa64_calculate_ticks(uint64_t seconds, uint64_t subsec, uint64_t* out_seconds, uint64_t* out_subsec) {
+ if (bootTime == 0) {
+ *out_seconds = 0;
+ *out_subsec = 0;
+ return;
+ }
+
+ uint64_t curr = AA64GetPhysicalTimerCount();
+ uint64_t timer_ticks, timer_subticks;
+ updateTicks(curr / cpuFrequency, &timer_ticks, &timer_subticks);
+ if (subsec + timer_subticks >= SUBSECONDS_PER_SECOND) {
+ *out_seconds = timer_ticks + seconds + (subsec + timer_subticks) / SUBSECONDS_PER_SECOND;
+ *out_subsec = (subsec + timer_subticks) % SUBSECONDS_PER_SECOND;
+ }
+ else {
+ *out_seconds = timer_ticks + seconds;
+ *out_subsec = timer_subticks + subsec;
+ }
+}
/**
* @brief AA64SleepUS -- sleep for sometimes
* @param us -- microseconds to sleep
@@ -243,13 +303,17 @@ void AA64CPUPostInitialize(KERNEL_BOOT_INFO* info) {
suspendTimer();
GICInitialize();
AA64TimerSetup();
-
+
//PS/2 Enable
-
+
uint32_t id = read_midr();
AA64CPUImplementer(id);
AA64PCIeInitialize();
AuTextOut("[aurora]: cpu post initialized \r\n");
//AuPL031RTCInit();
//mask_irqs();
+}
+
+uint64_t AA64CPUGetFreqencyHz() {
+ return cpuFrequency;
}
\ No newline at end of file
diff --git a/KernelAA64/Hal/aa64lowlevel.s b/KernelAA64/Hal/aa64lowlevel.s
index a4beb56af..8f7b80710 100644
--- a/KernelAA64/Hal/aa64lowlevel.s
+++ b/KernelAA64/Hal/aa64lowlevel.s
@@ -39,6 +39,30 @@ store_x0_x7:
str x7, [x0, #48]
ret
+.global store_x2_x7
+store_x2_x7:
+ stp x2, x3, [x0, #0]
+ stp x4, x5, [x0, #16]
+ stp x6, x7, [x0, #32]
+
+ stp q0, q1, [x0, #64]
+ stp q2, q3, [x0, #96]
+ stp q4, q5, [x0, #128]
+ stp q6,q7, [x0, #160]
+ ret
+
+.global store_x3_x7
+store_x3_x7:
+ stp x3, x4, [x0, #0]
+ stp x5, x6, [x0, #16]
+ str x7, [x0, #32]
+
+ stp q0, q1, [x0, #64]
+ stp q2, q3, [x0, #96]
+ stp q4, q5, [x0, #128]
+ stp q6, q7, [x0, #160]
+ ret
+
.global _getCurrentEL
_getCurrentEL:
mrs x0, CurrentEL
@@ -235,7 +259,7 @@ mask_irqs:
.global setupTimerIRQ
setupTimerIRQ:
mrs x0, CNTFRQ_EL0 //mrs x0, CTPCT_EL0
- mov x1, 1000 //mov x1,1000
+ mov x1, 1000 //mov x1,1000
udiv x0, x0, x1 //add x0, x0, x1
msr CNTV_TVAL_EL0, x0 //msr CNTV_CVAL_EL0, x0
mov x0,1
@@ -248,6 +272,14 @@ suspendTimer:
msr CNTV_CTL_EL0, x0
ret
+.global resetTimer
+resetTimer:
+ mrs x0, CNTFRQ_EL0
+ mov x1, 1000
+ udiv x0, x0, x1
+ msr CNTV_TVAL_EL0,x0
+ ret
+
.global readTimerCtl
readTimerCtl:
mrs x0,CNTV_CTL_EL0
@@ -493,3 +525,10 @@ aa64_clean_invalidate_dcache:
dsb sy
isb
ret
+
+.global aa64_invalidate_icache
+aa64_invalidate_icache:
+ ic ialluis
+ dsb ish
+ isb
+ ret
diff --git a/KernelAA64/Hal/aa64switch.s b/KernelAA64/Hal/aa64switch.s
index 1527e72b7..b2b8661d8 100644
--- a/KernelAA64/Hal/aa64switch.s
+++ b/KernelAA64/Hal/aa64switch.s
@@ -283,28 +283,29 @@ aa64_store_fp:
str q0, [x0, #(0*16)]
str q1, [x0, #(1*16)]
str q2, [x0, #(2*16)]
- str q4, [x0, #(3*16)]
- str q5, [x0, #(4*16)]
- str q6, [x0, #(5*16)]
- str q7, [x0, #(6*16)]
- str q8, [x0, #(7*16)]
- str q9, [x0, #(8*16)]
- str q10, [x0, #(9*16)]
- str q11, [x0, #(10*16)]
- str q12, [x0, #(11*16)]
- str q13, [x0, #(12*16)]
- str q14, [x0, #(13*16)]
- str q15, [x0, #(14*16)]
- str q16, [x0, #(15*16)]
- str q17, [x0, #(16*16)]
- str q18, [x0, #(17*16)]
- str q19, [x0, #(18*16)]
- str q20, [x0, #(19*16)]
- str q21, [x0, #(20*16)]
- str q22, [x0, #(21*16)]
- str q23, [x0, #(22*16)]
- str q24, [x0, #(23*16)]
- str q25, [x0, #(24*16)]
+ str q3, [x0, #(3*16)]
+ str q4, [x0, #(4*16)]
+ str q5, [x0, #(5*16)]
+ str q6, [x0, #(6*16)]
+ str q7, [x0, #(7*16)]
+ str q8, [x0, #(8*16)]
+ str q9, [x0, #(9*16)]
+ str q10, [x0, #(10*16)]
+ str q11, [x0, #(11*16)]
+ str q12, [x0, #(12*16)]
+ str q13, [x0, #(13*16)]
+ str q14, [x0, #(14*16)]
+ str q15, [x0, #(15*16)]
+ str q16, [x0, #(16*16)]
+ str q17, [x0, #(17*16)]
+ str q18, [x0, #(18*16)]
+ str q19, [x0, #(19*16)]
+ str q20, [x0, #(20*16)]
+ str q21, [x0, #(21*16)]
+ str q22, [x0, #(22*16)]
+ str q23, [x0, #(23*16)]
+ str q24, [x0, #(24*16)]
+ str q25, [x0, #(25*16)]
str q26, [x0, #(26*16)]
str q27, [x0, #(27*16)]
str q28, [x0, #(28*16)]
@@ -354,4 +355,117 @@ aa64_restore_fp:
ret
+.global aa64_schedule_init
+aa64_schedule_init:
+ stp x29, x30, [sp, #-208]!
+ stp x27, x28, [sp, #16]
+ stp x25, x26, [sp, #32]
+ stp x23, x24, [sp, #48]
+ stp x21, x22, [sp, #64]
+ stp x19, x20, [sp, #80]
+ stp x17, x18, [sp, #96]
+ stp x15, x16, [sp, #112]
+ stp x13, x14, [sp, #128]
+ stp x11, x12, [sp, #144]
+ stp x9, x10, [sp, #160]
+ stp x7, x8, [sp, #176]
+ stp x5, x6, [sp, #192]
+ str x4, [sp, #200]
+
+ add x3, sp, #208
+ mov x3, sp
+ bic x3, x3, #15
+ str x3,[x0,#96]
+
+ mrs x3,ELR_EL1
+ str x3,[x0, #104]
+ mrs x3, spsr_el1
+ str x3, [x0,#112]
+
+ msr ttbr0_el1, x2
+ //msr ttbr1_el1, x0
+ isb sy
+ dsb ishst
+ tlbi vmalle1is
+ dsb ish
+ isb
+
+ ldp x19,x20,[x1, #0]
+ ldp x21,x22,[x1,#16]
+ ldp x23,x24,[x1,#32]
+ ldp x25,x26,[x1,#48]
+ ldp x27, x28,[x1,#64]
+ ldp x29,x30, [x1,#80]
+
+ ldr x2, [x1, #96]
+ /* directly load the original stack
+ * which is top of the stack
+ */
+ bic x2, x2, #15
+ mov sp, x2
+ ldr x2,[x1,#104]
+ msr ELR_EL1,x2
+ ldr x2, [x1,#112]
+ msr SPSR_EL1,x2
+
+ ldrb w2, [x1,#121]
+ cmp w2, #2
+ b.ne _skip_comp_sn
+ ldrb w3, [x1,#206]
+ cmp w3, #1
+ b.ne _skip_comp_sn
+ mov x30, 0
+_skip_comp_sn:
+ /* We must clear the IRQ bit from daifclr manually,
+ * because when exception is taken DAIF bits are masked */
+ ldp x2,x3, [x1,#136]
+ ldp x4,x5, [x1,#152]
+ ldp x6,x7,[x1,#168]
+ ldr x8, [x1,#184]
+ // msr daifclr, #0x2
+ isb
+ mov x0, 1
+ ret
+
+.global aa64_restore_sp
+aa64_restore_sp:
+ ldr x2, [x0,#96]
+ bic x2, x2, #15
+ mov sp, x2
+
+ ldr x4, [sp, #200]
+ ldp x5, x6, [sp, #192]
+ ldp x7, x8, [sp, #176]
+ ldp x9, x10, [sp, #160]
+ ldp x11, x12, [sp, #144]
+ ldp x13, x14, [sp, #128]
+ ldp x15, x16, [sp, #112]
+ ldp x17, x18, [sp, #96]
+ ldp x19, x20, [sp, #80]
+ ldp x21, x22, [sp, #64]
+ ldp x23, x24, [sp, #48]
+ ldp x25, x26, [sp, #32]
+ ldp x27, x28, [sp, #16]
+ ldp x29, x30, [sp], #208
+ mov x2, sp
+ bic x2, x2, #15
+ str x2, [x0, #96]
+
+
+ ldr x2,[x0,#104]
+ msr ELR_EL1,x2
+ ldr x2, [x0,#112]
+ msr SPSR_EL1,x2
+ ret
+
+.global aa64_signal_return
+aa64_signal_return:
+ mov x16, 24
+ svc #0
+ mov x0, x6
+ ret
+
+
+
+
\ No newline at end of file
diff --git a/KernelAA64/Hal/basicacpi.c b/KernelAA64/Hal/basicacpi.c
index 032586e49..d99383c56 100644
--- a/KernelAA64/Hal/basicacpi.c
+++ b/KernelAA64/Hal/basicacpi.c
@@ -5,6 +5,13 @@
#include
#include
#include
+#include
+#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
AuroraBasicACPI* __AuroraBasicAcpi;
diff --git a/KernelAA64/Hal/gic.c b/KernelAA64/Hal/gic.c
index 295d45e00..44b3847dd 100644
--- a/KernelAA64/Hal/gic.c
+++ b/KernelAA64/Hal/gic.c
@@ -41,32 +41,34 @@
#include
GIC __gic;
-uint32_t* gic_regs;
-uint32_t* gicc_regs;
+volatile uint32_t* gic_regs;
+volatile uint32_t* gicc_regs;
typedef void (*irq_callback)(int spi);
/** distributor registers */
-#define GICD(n) (n.gicDMMIO)
+#define GICD(n) ((uint8_t*)(n.gicDMMIO))
#define GICD_CTLR 0x0000
#define GICD_TYPER 0x0004
#define GICD_IIDR 0x0008
#define GICD_TYPER2 0x000C
-#define GICD_PIDR2 0xFFE8
-#define GICD_PIDR2_ARCHREV(x) (((x) >> 4) & 0xF)
+#define GICD_PIDR2 0xFFE8
+#define GICD_PIDR2_ARCHREV(x) (((x) >> 4) & 0xF)
#define GIC_VERSION_1 0x1
#define GIC_VERSION_2 0x2
#define GIC_VERSION_3 0x3
#define GIC_VERSION_4 0x4
-#define GICD_ISENABLER(n) (*(volatile uint32_t*)(GICD(__gic) + 0x100 + 4*(n)))
+
+// All of these macros will now automatically calculate the exact correct byte offsets!
+#define GICD_ISENABLER(n) (*(volatile uint32_t*)(GICD(__gic) + 0x100 + 4*(n)))
#define GICD_IPRIORITYR(n) (0x400 + (n))
-#define GICD_IGROUPR(n) (*(volatile uint32_t*)(GICD(__gic) + 0x080 + 4*(n)))
-#define GICD_ICENABLE(n) (*(volatile uint32_t*)(GICD(__gic) + 0x180 + (n*4)))
-#define GICD_ICFGR(n) (*(volatile uint32_t*)(GICD(__gic) + 0x0C00 + (n*4)))
-#define GICD_ITARGETSR(n) (*(volatile uint32_t*)(GICD(__gic) + 0x0800 + (n*4)))
-#define GICD_IROUTER(n) (0x6000 + 8*(n))
-#define GICD_ICPENDR(n) (0x280 + (n/32)*4)
-#define ISPENDING0 0x200
+#define GICD_IGROUPR(n) (*(volatile uint32_t*)(GICD(__gic) + 0x080 + 4*(n)))
+#define GICD_ICENABLE(n) (*(volatile uint32_t*)(GICD(__gic) + 0x180 + (n*4)))
+#define GICD_ICFGR(n) (*(volatile uint32_t*)(GICD(__gic) + 0x0C00 + (n*4)))
+#define GICD_ITARGETSR(n) (*(volatile uint32_t*)(GICD(__gic) + 0x0800 + (n*4)))
+#define GICD_IROUTER(n) (0x6000 + 8*(n))
+#define GICD_ICPENDR(n) (0x280 + (n/32)*4)
+#define ISPENDING0 0x200
/** cpu registers offsets */
@@ -423,16 +425,16 @@ void GICInitialize() {
/* writing 0xff means accepting all types of priority 0x0 -- 0xFF */
if (_need_cpu_interface) {
gic_outl_((uint64_t*)__gic.gicCMMIO, GICC_PMR, 0x1ff);
- gic_outl_(__gic.gicCMMIO, GICC_CTLR, 0x3);
+ gic_outl_((uint64_t*)__gic.gicCMMIO, GICC_CTLR, 0x3);
isb_flush();
}
/* enable the distributor interface */
if (__gic.version >= GIC_VERSION_3) {
- gic_outl_(__gic.gicDMMIO, GICD_CTLR, (1u << 5) | (1u << 1));
+ gic_outl_((uint64_t*)__gic.gicDMMIO, GICD_CTLR, (1u << 5) | (1u << 1));
}
else {
- gic_outl_(__gic.gicDMMIO, GICD_CTLR, 0x3);
+ gic_outl_((uint64_t*)__gic.gicDMMIO, GICD_CTLR, 0x3);
isb_flush();
}
@@ -451,17 +453,17 @@ void GICInitialize() {
void GICREnablePPI(uint32_t cpu, uint32_t intid) {
size_t sgi = GICR(__gic) + (cpu * GICR_STRIDE) + GICR_SGI_BASE;
- gic_outl_(sgi, 0x100, (1u << intid));
+ gic_outl_((uint64_t*)sgi, 0x100, (1u << intid));
}
void GICRSetPPIPriority(uint32_t cpu, uint32_t intid, uint8_t prio) {
size_t sgi = GICR(__gic) + (cpu * GICR_STRIDE) + GICR_SGI_BASE;
uint32_t reg = intid / 4;
uint32_t shift = (intid % 4) * 8;
- uint32_t val = gic_inl_(sgi, 0x400 + reg * 4);
+ uint32_t val = gic_inl_((uint64_t*)sgi, 0x400 + reg * 4);
val &= ~(0xFFu << shift);
val |= ((uint32_t)prio << shift);
- gic_outl_(sgi, 0x400 + reg * 4, val);
+ gic_outl_((uint64_t*)sgi, 0x400 + reg * 4, val);
}
/** @briefGICEnableIRQ -- enable an IRQ
@@ -553,7 +555,7 @@ void GICEnableSPIIRQ(uint32_t irq) {
if (__gic.version >= GIC_VERSION_3) {
/** route it to cpu0 **/
- gic_outqw(GICD(__gic), 0x6000 + irq * 8, 0ULL);
+ gic_outqw((uint64_t*)GICD(__gic), 0x6000 + irq * 8, 0ULL);
}
*(volatile uint8_t*)(GICD(__gic) + GICD_IPRIORITYR(irq)) = 0x80;
@@ -670,14 +672,14 @@ void GICCallSPIHandler(int spi) {
* @brief GICDisable -- disable the GIC
*/
void GICDisable() {
- gic_outl_(__gic.gicDMMIO, GICD_CTLR, 0);
+ gic_outl_((uint64_t*)__gic.gicDMMIO, GICD_CTLR, 0);
dsb_sy_barrier();
isb_flush();
if (__gic.version < GIC_VERSION_3) {
- gic_outl_(__gic.gicCMMIO, GICC_CTLR, 0);
- gic_outl_(__gic.gicCMMIO, GICC_PMR, 0xFF);
+ gic_outl_((uint64_t*)__gic.gicCMMIO, GICC_CTLR, 0);
+ gic_outl_((uint64_t*)__gic.gicCMMIO, GICC_PMR, 0xFF);
dsb_sy_barrier();
isb_flush();
UARTDebugOut("[aurora]: GIC version 2 disabling \r\n");
diff --git a/KernelAA64/Hal/sched.c b/KernelAA64/Hal/sched.c
index 08207dc09..c921f632b 100644
--- a/KernelAA64/Hal/sched.c
+++ b/KernelAA64/Hal/sched.c
@@ -43,10 +43,14 @@
#include
#include
#include
+#include
+#include
extern void aa64_store_context(AA64Thread* thr);
extern void store_syscall(AA64Thread* thr);
extern bool aa64_restore_context(AA64Thread* thr);
+extern void aa64_restore_sp(AA64Thread* thr);
+extern void aa64_schedule_init(AA64Thread* current, AA64Thread* init, uint64_t va);
extern void ret_from_syscall(AA64Thread* thr);
extern void first_time_sex(AA64Thread* thr);
@@ -67,6 +71,7 @@ AA64Thread* _idle_thr;
uint64_t thread_id;
bool _scheduler_initialized;
uint64_t scheduler_tick;
+static uint64_t _global_idle_time;
/**
* @brief AuThreadInsert -- insert a thread into thread list
@@ -254,28 +259,10 @@ void AuThreadDeleteSleep(AA64Thread* thread) {
void AA64NextThread() {
AA64Thread* thread = current_thread;
- bool _run_idle = false;
-run:
- do {
- thread = thread->next;
-
- if (!thread) {
- thread = thread_list_head;
- }
-
- if (thread == _idle_thr) {
- thread = thread->next;
- }
- if (!thread) {
- _run_idle = true;
- break;
- }
- } while (thread->state != THREAD_STATE_READY);
-end:
- if (_run_idle)
+ thread = thread->next;
+ if (!thread)
thread = _idle_thr;
-
current_thread = thread;
}
@@ -306,10 +293,12 @@ AA64Thread* AuCreateKthread(void(*entry) (uint64_t),uint64_t* pml, char* name){
t->thread_id = thread_id++;
t->fpsr = 0;
t->fpcr = 0;
+ AuSignalInitializeTrampoline(t);
AuThreadInsert(t);
return t;
}
+
/**
* @brief AuCreateSubKthread -- create sub kernel thread of parent
* kthread
@@ -335,6 +324,7 @@ AA64Thread* AuCreateSubKthread(void(*entry) (uint64_t),uint64_t stack, uint64_t*
t->thread_id = thread_id++;
t->fpsr = 0;
t->fpcr = 0;
+ //AuSignalInitializeTrampoline(t);
AuThreadInsert(t);
return t;
}
@@ -350,24 +340,21 @@ void AuIdleThread(uint64_t ctx) {
mask_irqs();
UARTDebugOut("Idle thread running \r\n");
AuTextOut("Starting up Xeneva please wait...\r\n");
- //uint64_t sp = read_sp();
- //UARTDebugOut("SP : %x \r\n", sp);
- UARTDebugOut("Current sp sel : %d \r\n", read_spsel());
- uint64_t el = _getCurrentEL();
- UARTDebugOut("IDLE CurrentEl : %d \n", el);
+ _idle_thr->start_time_us = AuGetCurrentUS();
enable_irqs();
while (1) {
enable_irqs();
- //
- //UARTDebugOut("IDLE \r\n");
+ _wfi();
}
}
extern void resume_user(AA64Thread* thr,void* ksp);
+
+
void AuResumeUserThread() {
AA64Thread* thr = current_thread;
thr->x30 = thr->elr_el1;
- resume_user(thr, thr->sp);
+ resume_user(thr, (void*)thr->sp);
//aa64_enter_user(thr->sp, thr->elr_el1);
while (1) {}
}
@@ -389,7 +376,8 @@ void AuHandleSleepThreads() {
sleep_thr->sleepQuanta--;
if (sleep_thr->sleepQuanta == 0){
//settimerdebug();
- sleep_thr->state = THREAD_STATE_READY;
+ if (sleep_thr->state != THREAD_STATE_LEFT_IN_KERNEL)
+ sleep_thr->state = THREAD_STATE_READY;
AuThreadDeleteSleep(sleep_thr);
AuThreadInsert(sleep_thr);
}
@@ -414,9 +402,9 @@ void AuThreadSafeReturn(uint64_t rcx) {
while (1) {}
}
-extern void AuPrintStack(uint64_t st) {
- UARTDebugOut("storing sp : %x \r\n", st);
-}
+
+
+
/**
* @brief AuScheduleThread -- the core of multi-tasking. It schedules
* threads next to be runned
@@ -429,51 +417,70 @@ void AuScheduleThread(AA64Registers* regs) {
}
AA64Thread* runThr = current_thread;
- //if (runThr->returnFromSyscall) {
- // UARTDebugOut("System call interrupted for thread : %s %d\r\n", runThr->name, runThr->syscallNum);
- // store_syscall(runThr);
- // goto sched;
- //}
- //else {
- aa64_store_context(runThr);
- runThr->sp = (uint64_t)regs;
- //}
+ aa64_store_context(runThr);
+ runThr->sp = (uint64_t)regs;
+
sched:
- //AuTextOut("Schedule thread upto here sp: %x \r\n", regs->EL0SP);
- aa64_store_fp(&runThr->fp_regs, &runThr->fpcr, &runThr->fpsr);
+ aa64_store_fp(&runThr->fp_regs,(uint64_t*)&runThr->fpcr, (uint64_t*)&runThr->fpsr);
- //AuTextOut("Stored fp \r\n");
if (regs) {
runThr->x0 = regs->x0;
runThr->x1 = regs->x1;
runThr->x30 = regs->x30;
runThr->x29 = regs->x29;
}
- //AuTextOut("Registered stored \r\n");
+
+ uint64_t now = AuGetCurrentUS();
+ uint64_t delta = now - runThr->start_time_us;
+
+ if (runThr->procSlot != NULL) {
+ AuProcess* proc = (AuProcess*)runThr->procSlot;
+ proc->total_runtime_us += delta;
+ proc->window_runtime_us += delta;
+ }
+ else {
+ _global_idle_time += delta;
+ }
+
+ /** change thread's running state to ready state */
+ if (runThr->state == THREAD_STATE_RUNNING)
+ runThr->state = THREAD_STATE_READY;
+
scheduler_tick++;
AuHandleSleepThreads();
AA64NextThread();
+
+ current_thread->start_time_us = now;
+
+ /* mark this thread as running */
+ if (current_thread->state == THREAD_STATE_READY)
+ current_thread->state = THREAD_STATE_RUNNING;
+
write_both_ttbr(V2P(current_thread->pml));
+
+
//tlb_flush_vmalle1is();
- aa64_restore_fp(¤t_thread->fp_regs, ¤t_thread->fpcr, ¤t_thread->fpsr);
+ aa64_restore_fp(¤t_thread->fp_regs, (uint64_t*)¤t_thread->fpcr, (uint64_t*)¤t_thread->fpsr);
dsb_sy_barrier();
- uint64_t sp = read_sp();
- /*UARTDebugOut("Scheduler sp : %x \r\n", sp);*/
- /*if (debug) {
- UARTDebugOut("next thread : %s \r\n", current_thread->name);
- }*/
- /*if (current_thread->returnFromSyscall) {
- current_thread->justStored = 0;
- ret_from_syscall(current_thread);
- goto ret;
- }*/
+
+ /** check if the thread was left somewhere in kernel space **/
+ if (current_thread->state == THREAD_STATE_LEFT_IN_KERNEL) {
+ current_thread->state = THREAD_STATE_READY;
+ aa64_restore_sp(current_thread);
+ /* should not reach here */
+ for (;;);
+ }
+
+
+ AuSignalDeliver(current_thread);
+
if ((current_thread->threadType & THREAD_LEVEL_USER) && current_thread->first_run == 1) {
uint64_t sp = current_thread->sp;
//current_thread->sp = current_thread->originalKSp;
- resume_user(current_thread,sp);
+ resume_user(current_thread,(void*)sp);
}
@@ -486,6 +493,21 @@ void AuScheduleThread(AA64Registers* regs) {
return;
}
+/**
+ * @brief AuScheduleNext -- forcefully schedule
+ * to idle thread
+ */
+void AuScheduleNext() {
+ if (_scheduler_initialized == 0)
+ return;
+
+ current_thread->state = THREAD_STATE_LEFT_IN_KERNEL;
+ AA64Thread* storeThr = current_thread;
+ aa64_store_fp(&storeThr->fp_regs, &storeThr->fpcr, &storeThr->fpsr);
+ current_thread = _idle_thr;
+ aa64_schedule_init(storeThr, current_thread, V2P(current_thread->pml));
+}
+
static int ke_stack_idx;
/**
@@ -496,12 +518,11 @@ static int ke_stack_idx;
*/
uint64_t AuCreateKernelStack(uint64_t* pml) {
uint64_t location = KERNEL_STACK_LOCATION;
- location += ke_stack_idx * KERNEL_STACK_SIZE;
- UARTDebugOut("Creating kernel stack : %x %d\r\n", location, ke_stack_idx);
+ location += (uint64_t)ke_stack_idx * KERNEL_STACK_SIZE;
for (int i = 0; i < (KERNEL_STACK_SIZE) / 0x1000; i++) {
uint64_t addr = (uint64_t)P2V((uint64_t)AuPmmngrAlloc());
- memset(addr, 0, PAGE_SIZE);
- AuMapPage(V2P(addr), (location + i * 4096), PTE_AP_RW | PTE_NORMAL_MEM);
+ memset((void*)addr, 0, PAGE_SIZE);
+ AuMapPage(V2P(addr), (location + (uint64_t)i * 4096), PTE_AP_RW | PTE_NORMAL_MEM);
}
ke_stack_idx += 2;
return (location + KERNEL_STACK_SIZE);
@@ -516,10 +537,9 @@ uint64_t AuCreateKernelStack(uint64_t* pml) {
uint64_t AuCreateSubKernelStack(AuProcess* proc, uint64_t* pml) {
uint64_t location = KERNEL_STACK_LOCATION;
location += proc->_kstack_index_ * KERNEL_STACK_SIZE;
- UARTDebugOut("Creating Sub kernel stack : %d, %x \r\n", proc->_kstack_index_, location);
for (int i = 0; i < (KERNEL_STACK_SIZE) / 0x1000; i++) {
uint64_t addr = (uint64_t)P2V((uint64_t)AuPmmngrAlloc());
- memset(addr, 0, PAGE_SIZE);
+ memset((void*)addr, 0, PAGE_SIZE);
AuMapPage(V2P(addr), (location + i * 4096), PTE_AP_RW | PTE_NORMAL_MEM);
}
@@ -556,7 +576,7 @@ void AuSchedulerStart() {
#endif
tlb_flush_vmalle1is();
write_both_ttbr(V2P(idle->pml));
- aa64_restore_fp(&idle->fp_regs, &idle->fpcr, &idle->fpsr);
+ aa64_restore_fp(&idle->fp_regs, (uint64_t*)&idle->fpcr,(uint64_t*)&idle->fpsr);
suspendTimer();
setupTimerIRQ();
first_time_sex(idle);
@@ -575,8 +595,7 @@ AA64Thread* AuGetCurrentThread() {
* to switch next thread
*/
void AuForceScheduler() {
- AuScheduleThread(NULL);
-// UARTDebugOut("Back to force scheduler \n");
+ AuScheduleNext();
}
/**
@@ -595,7 +614,8 @@ void AuBlockThread(AA64Thread* thread) {
* @param t -- pointer to thread
*/
void AuUnblockThread(AA64Thread* thread) {
- thread->state = THREAD_STATE_READY;
+ if (thread->state != THREAD_STATE_LEFT_IN_KERNEL)
+ thread->state = THREAD_STATE_READY;
bool found_ = false;
AA64Thread* thr = NULL;
for (thr = blocked_thr_head; thr != NULL; thr = thr->next) {
@@ -616,13 +636,27 @@ void AuUnblockThread(AA64Thread* thread) {
* @param thread -- Pointer to AA64 Thread
*/
void AuSleepThread(AA64Thread* thread, uint64_t ms) {
- //UARTDebugOut("Inserting thread to sleep list : %s \n", thread->name);
thread->state = THREAD_STATE_SLEEP;
thread->sleepQuanta = ms;
AuThreadDelete(thread);
AuThreadInsertSleep(thread);
}
+/**
+ * @brief AuThreadMakeReady -- make a thread forcefully
+ * ready for next
+ * @param thread -- pointer to thread struct
+ */
+void AuThreadMakeReady(AA64Thread* thread) {
+ if (thread->state == THREAD_STATE_SLEEP) {
+ thread->sleepQuanta = 0;
+ AuThreadDeleteSleep(thread);
+ AuThreadInsert(thread);
+ thread->state = THREAD_STATE_READY;
+ }
+ else if (thread->state == THREAD_STATE_BLOCKED)
+ AuUnblockThread(thread);
+}
/**
* @brief AuThreadFindByID -- finds a thread by its id from
* ready queue
@@ -704,4 +738,5 @@ uint64_t AuGetSystemTimerTick() {
*/
void AuSetIdleThread(AA64Thread* thr) {
_idle_thr = thr;
-}
\ No newline at end of file
+}
+
diff --git a/KernelAA64/Hal/systable.c b/KernelAA64/Hal/systable.c
index 2bc5288f9..fe926f042 100644
--- a/KernelAA64/Hal/systable.c
+++ b/KernelAA64/Hal/systable.c
@@ -52,7 +52,7 @@
#include
#include
-#define AURORA_MAX_SYSCALL 72
+#define AURORA_MAX_SYSCALL 79
AA64Registers* svcCurrentRegs;
@@ -104,8 +104,8 @@ static void* syscalls[AURORA_MAX_SYSCALL] = {
FileIoControl, //21
FileStat, //22
ProcessSleep, //23
- 0, //24
- 0, //25
+ SignalReturn, //24
+ SetSignal, //25
AuGetSystemTimerTick, //26
AuFTMngrGetFontID, //27
AuFTMngrGetNumFonts, //28
@@ -115,7 +115,7 @@ static void* syscalls[AURORA_MAX_SYSCALL] = {
CreateUserThread, //32
SetFileToProcess, //33
ProcessHeapUnmap, //34
- 0, //35
+ SendSignal, //35
0, //36
OpenDir, //37
ReadDir, //38
@@ -152,6 +152,13 @@ static void* syscalls[AURORA_MAX_SYSCALL] = {
AuPowerReset, //69
AuGetCurrentUS, //70
AuGetCurrentMS, //71
+ Alarm, //72
+ SetITimer, //73
+ GetITimer, //74
+ AuProcGetNumProcessCount, //75
+ AuProcessFetch, //76
+ AuSetWalltime, //77
+ AuGetWalltime, //78
};
#ifdef __KERNEL_PROFILER_ON__
@@ -228,6 +235,9 @@ static char* syscall_name[AURORA_MAX_SYSCALL] = {
"AuPowerReset", //69
"AuGetCurrentUS", //70
"AuGetCurrentMS", //71
+ "Alarm", //72
+ "AuProcGetNumProcessCount", //75
+ "AuProcessFetch", //76
};
#endif
@@ -270,7 +280,7 @@ void AuAA64SyscallHandler(AA64Registers* regs) {
PROFILE_END(syscall_name[vector]);
skip_2:
#endif
- return 0;
+ return ;
}
retcode = func(regs->x0, regs->x1, regs->x2, regs->x3, regs->x4, regs->x5);
@@ -284,6 +294,5 @@ void AuAA64SyscallHandler(AA64Registers* regs) {
PROFILE_END(syscall_name[vector]);
skip_3:
#endif
- return 0;
-
+ return;
}
\ No newline at end of file
diff --git a/KernelAA64/Hal/vector.c b/KernelAA64/Hal/vector.c
index 4dcf641f3..709021660 100644
--- a/KernelAA64/Hal/vector.c
+++ b/KernelAA64/Hal/vector.c
@@ -116,7 +116,7 @@ void sync_el1_handler(AA64Registers *regs) {
// AuTextOut("SP_EL0 : %x \r\n", regs->EL0SP);
UARTDebugOut("Current SPSel : %d \r\n", read_spsel());
UARTDebugOut("EC class : %x \r\n", ec);
- for (;;);
+
/** check if the fault occured on drivers **/
AuDriver* drv = AuDrvManagerCheckFault(read_elr_el1());
if (drv) {
@@ -161,23 +161,23 @@ void sync_el1_handler(AA64Registers *regs) {
dfsc = esr & 0x3F;
- /* switch (dfsc) {
- case 0b000000: AuTextOut("Address size, fault level 0 \r\n"); break;
- case 0b000001: AuTextOut("Address Size, fault level 1 \r\n"); break;
- case 0b000010: AuTextOut("Address size, fault level 2 \r\n"); break;
- case 0b000011: AuTextOut("Address size, fault level 3 \r\n"); break;
- case 0b000100: AuTextOut("translation, fault level 0 \r\n"); break;
- case 0b000101: AuTextOut("translation, fault level 1 \r\n"); break;
- case 0b000110: AuTextOut("translation, fault level 2 \r\n"); break;
- case 0b000111: AuTextOut("translation, fault level 3 \r\n"); break;
- case 0b001001: AuTextOut("access flag, fault level 1 \r\n"); break;
- case 0b001010: AuTextOut("access flag, fault level 2 \r\n"); break;
- case 0b001011: AuTextOut("access flag, fault level 3 \r\n"); break;
- case 0b001101: AuTextOut("permission fault, level 1 \r\n"); break;
- case 0b001110: AuTextOut("permission fault, level 2 \r\n"); break;
- case 0b001111: AuTextOut("permission fault, level 3 \r\n"); break;
- default: AuTextOut("Unknown fault code \r\n"); break;
- }*/
+ switch (dfsc) {
+ case 0b000000: UARTDebugOut("Address size, fault level 0 \r\n"); break;
+ case 0b000001: UARTDebugOut("Address Size, fault level 1 \r\n"); break;
+ case 0b000010: UARTDebugOut("Address size, fault level 2 \r\n"); break;
+ case 0b000011: UARTDebugOut("Address size, fault level 3 \r\n"); break;
+ case 0b000100: UARTDebugOut("translation, fault level 0 \r\n"); break;
+ case 0b000101: UARTDebugOut("translation, fault level 1 \r\n"); break;
+ case 0b000110: UARTDebugOut("translation, fault level 2 \r\n"); break;
+ case 0b000111: UARTDebugOut("translation, fault level 3 \r\n"); break;
+ case 0b001001: UARTDebugOut("access flag, fault level 1 \r\n"); break;
+ case 0b001010: UARTDebugOut("access flag, fault level 2 \r\n"); break;
+ case 0b001011: UARTDebugOut("access flag, fault level 3 \r\n"); break;
+ case 0b001101: UARTDebugOut("permission fault, level 1 \r\n"); break;
+ case 0b001110: UARTDebugOut("permission fault, level 2 \r\n"); break;
+ case 0b001111: UARTDebugOut("permission fault, level 3 \r\n"); break;
+ default: UARTDebugOut("Unknown fault code \r\n"); break;
+ }
while (1) {}
}
@@ -199,14 +199,14 @@ void irq_el1_handler(AA64Registers* regs) {
uint32_t irq = iar & 0x3FF;
if (irq < 1020) {
if (irq == 27) {
- suspendTimer(); //<--- suspecting this line
- setupTimerIRQ();
+ //suspendTimer(); //<--- suspecting this line
+ resetTimer();
+ // setupTimerIRQ();
GICSendEOI(iar);
GICCheckPending(irq);
/** handle expired timers **/
AuroraTimerTick();
-
AuScheduleThread(regs);
}
/*else if (irq == 27) {
@@ -284,5 +284,5 @@ void sync_el0_handler(AA64Registers* regs) {
extern char vectors[];
void AA64InitializeVectorTable() {
- set_vbar_el1(&vectors);
+ set_vbar_el1((uint64_t)&vectors);
}
\ No newline at end of file
diff --git a/KernelAA64/Ipc/postbox.c b/KernelAA64/Ipc/postbox.c
index 8f910f539..59d693616 100644
--- a/KernelAA64/Ipc/postbox.c
+++ b/KernelAA64/Ipc/postbox.c
@@ -42,6 +42,11 @@
#include
#include
#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
/**
* @brief
@@ -331,7 +336,6 @@ void AuIPCPostBoxInitialise() {
node2->iocontrol = PostBoxIOControl;
dsb_sy_barrier();
AuDevFSAddFile(dev, "/", node2);
- AuDevFSList(dev);
//aa64_data_cache_clean_range(node, sizeof(AuVFSNode));
pbox = node2;
diff --git a/KernelAA64/KernelAA64.lib b/KernelAA64/KernelAA64.lib
new file mode 100644
index 000000000..7f79ec09d
Binary files /dev/null and b/KernelAA64/KernelAA64.lib differ
diff --git a/KernelAA64/KernelAA64.vcxproj b/KernelAA64/KernelAA64.vcxproj
index ec4b64b58..2c004724a 100644
--- a/KernelAA64/KernelAA64.vcxproj
+++ b/KernelAA64/KernelAA64.vcxproj
@@ -70,7 +70,7 @@
Applicationfalsev142
- true
+ falseUnicode
@@ -116,6 +116,8 @@
false
+ xnkrnl
+ false
@@ -161,9 +163,9 @@
Level1true
- ARCH_ARM64;__TARGET_BOARD_QEMU_VIRT__;_USE_DLMALLOC;__STDC_LIMIT_MACROS;%(PreprocessorDefinitions)
+ ARCH_ARM64;__TARGET_BOARD_QEMU_VIRT__;_USE_DLMALLOC;__STDC_LIMIT_MACROSDefault
- ..\BaseHdr;..\Acpica\include;..\Acpica;%(AdditionalIncludeDirectories)
+ ..\BaseHdr;..\Acpica\include;..\Acpica;$(SolutionDir)DCL\includes;%(AdditionalIncludeDirectories)EditAndContinuetruetrue
@@ -175,6 +177,8 @@
StreamingSIMDExtensions2falseAssemblyAndSourceCode
+ stdc17
+ /Kernel %(AdditionalOptions)Native
@@ -199,7 +203,7 @@
/def:exports.def %(AdditionalOptions)
- copy "$(SolutionDir)Build\EFI\XENEVA\$(TargetName).exe" "M:\EFI\XENEVA\$(TargetName).exe"
+ copy "$(SolutionDir)Build\EFI\XENEVA\$(TargetName).exe" "F:\EFI\XENEVA\$(TargetName).exe"
@@ -220,26 +224,57 @@
- Level3
- true
- true
- true
- NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ Level2
+
+
+ false
+ false
+ ARCH_ARM64;__TARGET_BOARD_IMX8MP_VERDIN_DAHLIA__;_USE_DLMALLOC;__STDC_LIMIT_MACROStrue
+ ..\BaseHdr;..\Acpica\include;..\Acpica;$(SolutionDir)DCL\includes;%(AdditionalIncludeDirectories)
+ EditAndContinue
+ true
+ false
+
+ StreamingSIMDExtensions2
+ stdc11
+ false
+ /Oi- /QIfist /Kernel /Os %(AdditionalOptions)
+ Full
- Console
+ Nativetruetrue
- true
+ false
+ ..\Build\EFI\XENEVA\xnkrnl.exe
+ true
+ true
+ true
+ Driver
+ /def:exports.def %(AdditionalOptions)
+ _AuMain
+ 0xFFFFC00000000000
+
+
+ false
+
+ false
+
+ true
+
+ copy "$(SolutionDir)Build\EFI\XENEVA\$(TargetName).exe" "F:\EFI\XENEVA\$(TargetName).exe"
+
+
+
@@ -252,10 +287,13 @@
+
+
+
@@ -264,6 +302,7 @@
+
@@ -287,6 +326,8 @@
+
+
@@ -306,6 +347,7 @@
+
@@ -314,6 +356,7 @@
+
@@ -327,6 +370,10 @@
Documentclang --target=aarch64-windows-msvc -c -o "$(IntDir)%(Filename).obj" "%(FullPath)"$(IntDir)%(Filename).obj
+ clang --target=aarch64-windows-msvc -c -o "$(IntDir)%(Filename).obj" "%(FullPath)"
+ $(IntDir)%(Filename).obj
+ false
+ true
@@ -336,6 +383,10 @@
Documentclang --target=aarch64-windows-msvc -c -o "$(IntDir)%(Filename).obj" "%(FullPath)"$(IntDir)%(Filename).obj
+ clang --target=aarch64-windows-msvc -c -o "$(IntDir)%(Filename).obj" "%(FullPath)"
+ $(IntDir)%(Filename).obj
+ false
+ true
@@ -343,14 +394,21 @@
+
+
+
+
+
+
+
@@ -373,11 +431,16 @@
+
+
+
+
+ false
@@ -391,6 +454,10 @@
Documentclang --target=aarch64-windows-msvc -c -o "$(IntDir)%(Filename).obj" "%(FullPath)"$(IntDir)%(Filename).obj
+ clang --target=aarch64-windows-msvc -c -o "$(IntDir)%(Filename).obj" "%(FullPath)"
+ $(IntDir)%(Filename).obj
+ false
+ true
@@ -399,6 +466,10 @@
Documentclang --target=aarch64-windows-msvc -c -o "$(IntDir)%(Filename).obj" "%(FullPath)"$(IntDir)%(Filename).obj
+ clang --target=aarch64-windows-msvc -c -o "$(IntDir)%(Filename).obj" "%(FullPath)"
+ $(IntDir)%(Filename).obj
+ false
+ true
@@ -407,6 +478,10 @@
Documentclang --target=aarch64-windows-msvc -c -o "$(IntDir)%(Filename).obj" "%(FullPath)"$(IntDir)%(Filename).obj
+ false
+ true
+ clang --target=aarch64-windows-msvc -c -o "$(IntDir)%(Filename).obj" "%(FullPath)"
+ $(IntDir)%(Filename).obj
diff --git a/KernelAA64/KernelAA64.vcxproj.filters b/KernelAA64/KernelAA64.vcxproj.filters
index 63c843f9b..af61648e9 100644
--- a/KernelAA64/KernelAA64.vcxproj.filters
+++ b/KernelAA64/KernelAA64.vcxproj.filters
@@ -207,6 +207,34 @@
Fs
+
+ Fs\Ext2
+
+
+ Net
+
+
+
+ Board\imx8mp
+
+
+ Board\imx8mp
+
+
+ Cap
+
+
+ Log
+
+
+ Log
+
+
+ Drivers
+
+
+ Drivers
+
@@ -290,6 +318,18 @@
{ca328030-92be-464f-86c9-47904d473330}
+
+ {9e3c015e-2730-4f5a-b260-96fd6a826e4d}
+
+
+ {ff284144-c4ef-46a6-8a98-d6967d078115}
+
+
+ {7e4e816a-cb9c-4b76-946f-97145714be4a}
+
+
+ {a7372d49-db94-4f19-9769-96146f023dd9}
+
@@ -433,6 +473,42 @@
Include
+
+ Include\Hal
+
+
+ Include\Board\imx8mp
+
+
+ Include
+
+
+ Include\Board\imx8mp
+
+
+ Include\Board\imx8mp
+
+
+ Include\Board\imx8mp
+
+
+ Include
+
+
+ Include
+
+
+ Include\Log
+
+
+ Include\Log
+
+
+ Include\Drivers
+
+
+ Include\Drivers
+
diff --git a/KernelAA64/Log/_print.c b/KernelAA64/Log/_print.c
new file mode 100644
index 000000000..5293cea44
--- /dev/null
+++ b/KernelAA64/Log/_print.c
@@ -0,0 +1,897 @@
+/**
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+#include
+#include
+#include
+#include
+#include <_null.h>
+#include
+
+#define MAX_STRING_LENGTH 4095
+
+#define max(a, b) ((a) > (b) ? (a) : (b))
+#define min(a, b) ((a) < (b) ? (a) : (b))
+
+static double floor(double d) {
+ int i = (int)d;
+ return ((float)i);
+}
+
+static double pow(double x, double y) {
+ int count;
+
+ if ((x < 0) && (floor(y) != y))
+ return 0;
+
+ if (!y)
+ x = 1;
+ else
+ for (count = 1; count < y; count++)
+ x *= x;
+
+ return x;
+}
+static int _ldigits(unsigned long long num, int base, int sign) {
+ int digits = 1;
+ if (base < 2) {
+ return (digits = -1);
+ }
+
+ if (sign && ((long long)num < 0)) {
+ num = ((long long)num * -1);
+ digits += 1;
+ }
+
+ while (num >= (unsigned long long)base) {
+ digits += 1;
+ num /= (unsigned long long)base;
+ }
+
+ return (digits);
+}
+
+static int _digits(unsigned num, int base, int sign) {
+ int digits = 1;
+ if (base < 2)
+ return (digits = -1);
+
+ if (sign && ((int)num < 0)) {
+ num = ((int)num * -1);
+ digits += 1;
+ }
+
+ while (num >= (unsigned)base) {
+ digits += 1;
+ num /= (unsigned)base;
+ }
+
+ return digits;
+}
+
+static unsigned long long _str2num(const char* string, unsigned base, int sign, int* consumed) {
+ unsigned long long result = 0;
+ int64_t length = 0;
+ int64_t negative = 0;
+ int64_t count = 0;
+
+ if (!string) {
+ return 0;
+ }
+
+ length = strlen(string);
+
+ while ((count < length) && isspace(string[count]))
+ count += 1;
+
+ if (count >= length)
+ goto out;
+
+ if ((string[count] == '+') || (string[count] == '-'))
+ {
+ if (sign && (string[count] == '-'))
+ negative = 1;
+ count += 1;
+ }
+
+ if (count >= length) {
+ goto out;
+ }
+
+ if ((count < (length - 1)) && (!base || (base == 16))) {
+ if ((string[count] == '0') && (string[count + 1] == 'x')) {
+ base = 16;
+ count += 2;
+ }
+ }
+
+ if (count >= length) {
+ goto out;
+ }
+
+ if (!base) {
+ if (string[count] == '0') {
+ base = 8;
+ count += 1;
+ }
+ else {
+ base = 10;
+ }
+
+ }
+
+ if (count >= length)
+ goto out;
+
+ while (count < length) {
+ switch (base) {
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ if (!isdigit(string[count]) ||
+ ((string[count] - '0') >= (int)base)) {
+ goto out;
+ }
+ result *= base;
+ result += (string[count] - '0');
+ break;
+
+ case 16:
+ if (!isxdigit(string[count]))
+ goto out;
+ result *= base;
+ if ((string[count] >= '0') && (string[count] <= '9'))
+ result += (string[count] - '0');
+ else if ((string[count] >= 'a') && (string[count] <= 'f'))
+ result += ((string[count] - 'a') + 10);
+ else
+ result += ((string[count] - 'A') + 10);
+ break;
+
+ default:
+ goto out;
+ }
+ count += 1;
+ }
+
+out:
+ if (negative)
+ result = ((long long)result * -1);
+
+ if (consumed)
+ *consumed = count;
+
+ return result;
+}
+
+static void _lnum2str(unsigned long long num, char* string, int base, int sign)
+{
+ int digits = _ldigits(num, base, sign);
+ int charCount = 0;
+ unsigned long long place = 1;
+ unsigned long long rem = 0;
+ int count;
+
+ if (!string)
+ {
+ return;
+ }
+
+ // Negative?
+ if (sign && ((long long)num < 0))
+ {
+ string[charCount++] = '-';
+ num = ((long long)num * -1);
+ digits -= 1;
+ }
+
+ for (count = 0; count < (digits - 1); count++)
+ place *= (unsigned long long) base;
+
+ while (place)
+ {
+ rem = (num % place);
+ num = (num / place);
+
+ if (num < 10)
+ string[charCount++] = ('0' + num);
+ else
+ string[charCount++] = ('a' + (num - 10));
+ num = rem;
+ place /= (unsigned long long) base;
+ }
+
+ string[charCount] = '\0';
+
+ // Done
+ return;
+}
+
+
+
+static void _dbl2str(double num, char* string, int roundPlaces)
+{
+ int charCount = 0;
+ unsigned long long* u = NULL;
+ int sign = 0;
+ long long exponent = 0;
+ unsigned long long intPart = 0;
+ unsigned long long fractPart = 0;
+ unsigned long long place = 0;
+ unsigned long long outputFraction = 0;
+ unsigned long long rem = 0;
+ unsigned long long count;
+
+ if (!string)
+ {
+ return;
+ }
+
+ string[0] = '\0';
+
+ u = (unsigned long long*) & num;
+ sign = (int)(*u >> 63);
+ exponent = (((*u & (0x7FFULL << 52)) >> 52) - 1023);
+ intPart = 1;
+ fractPart = ((*u & 0x000FFFFFFFFFFFFFULL) << 12);
+
+ // Output the sign, if any
+ if (sign)
+ string[charCount++] = '-';
+
+ // Special case exponents
+ if (exponent == 0x7FF)
+ {
+ strcat((string + charCount), "Infinity");
+ return;
+ }
+
+ while (exponent)
+ {
+ if (exponent > 0)
+ {
+ intPart <<= 1;
+ if (fractPart & (0x1ULL << 63))
+ intPart |= 1;
+ fractPart <<= 1;
+ exponent -= 1;
+ }
+ else
+ {
+ fractPart >>= 1;
+ if (intPart & 0x1ULL)
+ fractPart |= (0x1ULL << 63);
+ intPart >>= 1;
+ exponent += 1;
+ }
+ }
+
+ // Output the whole number part
+ _lnum2str(intPart, (string + charCount), 10, 0);
+ charCount = strlen(string);
+
+ string[charCount++] = '.';
+
+ // Calculate the fraction part
+ place = 10000000000000000000ULL;
+ for (count = 2; fractPart; count *= 2)
+ {
+ if (!count)
+ break;
+
+ if (fractPart & (0x1ULL << 63))
+ outputFraction += (place / count);
+
+ fractPart <<= 1;
+ }
+
+ // Output the fraction part
+ place = 1000000000000000000ULL;
+ while (place)
+ {
+ rem = (outputFraction % place);
+ outputFraction = (outputFraction / place);
+
+ if (roundPlaces)
+ {
+ string[charCount++] = ('0' + outputFraction);
+ roundPlaces -= 1;
+ }
+ else
+ {
+ if ((string[charCount - 1] < '9') && (outputFraction > 4))
+ string[charCount - 1] += 1;
+ break;
+ }
+
+ outputFraction = rem;
+ place /= 10;
+ }
+
+ string[charCount] = '\0';
+ return;
+}
+
+static void _num2str(unsigned num, char* string, int base, int sign)
+{
+ int digits = _digits(num, base, sign);
+ int charCount = 0;
+ unsigned place = 1;
+ unsigned rem = 0;
+ int count;
+
+ if (!string)
+ return;
+
+ // Negative?
+ if (sign && ((int)num < 0))
+ {
+ string[charCount++] = '-';
+ num = ((int)num * -1);
+ digits -= 1;
+ }
+
+ for (count = 0; count < (digits - 1); count++)
+ place *= (unsigned)base;
+
+ while (place)
+ {
+ rem = (num % place);
+ num = (num / place);
+
+ if (num < 10)
+ string[charCount++] = ('0' + num);
+ else
+ string[charCount++] = ('a' + (num - 10));
+ num = rem;
+ place /= (unsigned)base;
+ }
+
+ string[charCount] = '\0';
+
+ //errno = 0;
+}
+
+static void _flt2str(float num, char* string, int roundPlaces)
+{
+ int charCount = 0;
+ unsigned* u = NULL;
+ int sign = 0;
+ int exponent = 0;
+ unsigned intPart = 0;
+ unsigned fractPart = 0;
+ unsigned place = 0;
+ unsigned outputFraction = 0;
+ unsigned rem = 0;
+ unsigned count;
+
+ if (!string)
+ {
+ return;
+ }
+
+ string[0] = '\0';
+
+ u = (unsigned*)#
+ sign = (*u >> 31);
+ exponent = (((*u & 0x7F800000) >> 23) - 127);
+ intPart = 1;
+ fractPart = ((*u & 0x007FFFFF) << 9);
+
+ // Output the sign, if any
+ if (sign)
+ string[charCount++] = '-';
+
+ // Special case exponents
+ if (exponent == 0xFF)
+ {
+ strcat((string + charCount), "Infinity");
+ return;
+ }
+
+ while (exponent)
+ {
+ if (exponent > 0)
+ {
+ intPart <<= 1;
+ if (fractPart & (0x1 << 31))
+ intPart |= 1;
+ fractPart <<= 1;
+ exponent -= 1;
+ }
+ else
+ {
+ fractPart >>= 1;
+ if (intPart & 0x01)
+ fractPart |= (0x1 << 31);
+ intPart >>= 1;
+ exponent += 1;
+ }
+ }
+
+ // Output the whole number part
+ _num2str(intPart, (string + charCount), 10, 0);
+ charCount = strlen(string);
+
+ string[charCount++] = '.';
+
+ // Calculate the fraction part
+ place = 1000000000;
+ for (count = 2; fractPart; count *= 2)
+ {
+ if (!count)
+ break;
+
+ if (fractPart & (0x1 << 31))
+ outputFraction += (place / count);
+
+ fractPart <<= 1;
+ }
+
+ // Output the fraction part
+ place = 100000000;
+ while (place)
+ {
+ rem = (outputFraction % place);
+ outputFraction = (outputFraction / place);
+
+ if (roundPlaces)
+ {
+ string[charCount++] = ('0' + outputFraction);
+ roundPlaces -= 1;
+ }
+ else
+ {
+ if ((string[charCount - 1] < '9') && (outputFraction > 4))
+ string[charCount - 1] += 1;
+ break;
+ }
+
+ outputFraction = rem;
+ place /= 10;
+ }
+
+ string[charCount] = '\0';
+ return;
+}
+
+static double strtod(const char* nptr, char** endptr) {
+ int sign = 1;
+ if (*nptr == '-') {
+ sign = -1;
+ nptr++;
+ }
+
+ long long decimal_part = 0;
+
+ while (*nptr && *nptr != '.') {
+ if (*nptr < '0' || *nptr > '9') {
+ break;
+ }
+ decimal_part *= 10LL;
+ decimal_part += (long long)(*nptr - '0');
+ nptr++;
+ }
+
+ double sub_part = 0;
+ double multiplier = 0.1;
+
+ if (*nptr == '.') {
+ nptr++;
+
+ while (*nptr) {
+ if (*nptr < '0' || *nptr > '9') {
+ break;
+ }
+
+ sub_part += multiplier * (*nptr - '0');
+ multiplier *= 0.1;
+ nptr++;
+ }
+ }
+
+ double expn = (double)sign;
+
+ if (*nptr == 'e' || *nptr == 'E') {
+ nptr++;
+
+ int exponent_sign = 1;
+
+ if (*nptr == '+') {
+ nptr++;
+ }
+ else if (*nptr == '-') {
+ exponent_sign = -1;
+ nptr++;
+ }
+
+ int64_t exponent = 0;
+
+ while (*nptr) {
+ if (*nptr < '0' || *nptr > '9') {
+ break;
+ }
+ exponent *= 10;
+ exponent += (*nptr - '0');
+ nptr++;
+ }
+
+ expn = pow(10.0, (double)(exponent * exponent_sign));
+ }
+
+ if (endptr) {
+ *endptr = (char*)nptr;
+ }
+ double result = ((double)decimal_part + sub_part) * expn;
+ return result;
+}
+
+static float strtof(const char* nptr, char** endptr) {
+ return strtod(nptr, endptr);
+}
+
+#define atou(string) ((unsigned) _str2num(string, 10, 0, NULL))
+#define atoull(string) _str2num(string, 10, 0, NULL)
+#define atoo(string) ((unsigned)_str2num(string, 8, 0, NULL))
+#define atooll(string) _str2num(string, 8, 0, NULL)
+#define dtoa(num, string, round) _dbl2str(num, string, round)
+#define ftoa(num, string) _flt2str(num, string, round)
+#define itoa(num, string) _num2str(num, string, 10, 1)
+#define itouo(num, string) _num2str(num,string, 10, 1)
+#define itoux(num,string) _num2str(num, string, 16,0);
+#define itox(num, string) _num2str(num, string, 16, 1)
+#define lltoa(num, string) _lnum2str(num, string, 10,1)
+#define lltouo(num, string) _lnum2str(num, string, 8, 0)
+#define lltoux(num, string) _lnum2str(num, string, 16,0)
+#define lltox(num, string) _lnum2str(num, string, 16, 1)
+#define xtoi(string) ((int)_str2num(string, 16, 1, NULL))
+#define xtoll(string) ((long long) _str2num(string, 16,1, NULL))
+#define ulltoa(num, string) _lnum2str(num, string, 10, 0)
+#define utoa(num, string) _num2str(num, string, 10, 0)
+
+/**
+ * @brief _xeprint -- copied from XEClib implementation
+ * @param output -- pointer to memory buffer, where to put formatted
+ * string
+ * @param outputLen -- output len
+ * @param format -- formatted string
+ * @param list -- pointer to variable argument list
+ */
+int _xeprint(char* output, int outputlen, const char* format, va_list list) {
+ int inCount = 0;
+ int64_t outCount = 0;
+ int formatLen = 0;
+ int zeroPad = 0;
+ int leftJust = 0;
+ int fieldWidth = 0;
+ int isLong = 0;
+ long long intArg = 0;
+ double doubleArg;
+ int digits = 0;
+
+ formatLen = strlen(format);
+ if (formatLen < 0) {
+ //errno = formatLen;
+ return (outCount = 0);
+ }
+
+ if (formatLen > outputlen)
+ return (outCount = 0);
+
+ formatLen = min(formatLen, MAX_STRING_LENGTH);
+
+ for (inCount = 0; ((inCount < formatLen) &&
+ (outCount < outputlen));)
+ {
+ if (format[inCount] != '%') {
+ output[outCount++] = format[inCount++];
+ continue;
+ }
+ else if ((format[inCount] == '%') && (format[inCount + 1] == '%')) {
+ output[outCount++] = format[inCount];
+ inCount += 2;
+ continue;
+ }
+
+ inCount += 1;
+ zeroPad = 0;
+ if (format[inCount] == '0') {
+ zeroPad = 1;
+ inCount += 1;
+ }
+
+ leftJust = 0;
+ if (format[inCount] == '-') {
+ leftJust = 1;
+ inCount += 1;
+ }
+
+ fieldWidth = 0;
+ if ((format[inCount] >= '1') && (format[inCount] <= '9')) {
+ fieldWidth = atoi(format + inCount);
+ while ((format[inCount] >= '0') && (format[inCount] <= '9'))
+ inCount++;
+ }
+
+ isLong = 0;
+ if (format[inCount] == 'l') {
+ inCount += 1;
+ if (format[inCount] == 'l') {
+ isLong = 1;
+ inCount += 1;
+ }
+ }
+
+ if (isLong) {
+ intArg = (long long)va_arg(list, unsigned);
+ intArg |= (((long long)va_arg(list, unsigned)) << 32);
+ }
+ else if ((format[inCount] == 'e') || (format[inCount] == 'E') ||
+ (format[inCount] == 'f') || (format[inCount] == 'F') ||
+ (format[inCount] == 'g') || (format[inCount] == 'G')) {
+
+ }
+ else {
+ intArg = va_arg(list, unsigned long long);
+ }
+ switch (format[inCount]) {
+ case 'd':
+ case 'i': {
+ if (fieldWidth) {
+ if (isLong)
+ digits = _ldigits(intArg, 10, 1);
+ else
+ digits = _digits(intArg, 10, 1);
+
+
+ if (!leftJust) {
+ while (digits++ < fieldWidth)
+ output[outCount++] = (zeroPad ? '0' : ' ');
+ }
+
+ }
+ if (isLong)
+ lltoa(intArg, (output + outCount));
+ else
+ itoa(intArg, (output + outCount));
+
+ outCount = strlen(output);
+
+ if (fieldWidth && leftJust) {
+ while (digits++ < fieldWidth) {
+ output[outCount++] = ' ';
+ }
+ }
+ break;
+ }
+
+ case 'u': {
+ if (fieldWidth) {
+ if (isLong)
+ digits = _ldigits(intArg, 10, 0);
+ else
+ digits = _digits(intArg, 10, 0);
+
+ if (!leftJust) {
+ while (digits++ < fieldWidth)
+ output[outCount++] = (zeroPad ? '0' : ' ');
+ }
+ }
+
+ if (isLong)
+ ulltoa(intArg, (output + outCount));
+ else
+ utoa(intArg, (output + outCount));
+
+ outCount = strlen(output);
+
+ if (fieldWidth && leftJust) {
+ while (digits++ < fieldWidth)
+ output[outCount++] = ' ';
+ }
+ break;
+ }
+ case 'c':
+ {
+ output[outCount++] = (unsigned char)intArg;
+ break;
+ }
+ case 's': {
+ const char* str = intArg ? (const char*)(uint64_t)intArg : "(NULL)";
+ int slen = strlen(str);
+ int pad = fieldWidth;
+
+ if (fieldWidth && !leftJust) {
+ while (pad-- > 0)
+ output[outCount++] = ' ';
+ }
+
+ strcpy(output + outCount, str);
+ outCount += slen;
+
+ if (fieldWidth && leftJust) {
+ while (pad-- > 0)
+ output[outCount++] = ' ';
+ }
+ break;
+ }
+ case 'p': {
+ output[outCount++] = '0';
+ output[outCount++] = 'x';
+ fieldWidth = (2 * sizeof(void*));
+
+ if (isLong)
+ digits = _ldigits(intArg, 16, 0);
+ else
+ digits = _digits(intArg, 16, 0);
+
+ if (!leftJust) {
+ while (digits++ < fieldWidth)
+ output[outCount++] = '0';
+ }
+
+ if (isLong)
+ lltoux(intArg, (output + outCount));
+ else
+ itoux(intArg, (output + outCount));
+
+ outCount = strlen(output);
+
+ if (fieldWidth && leftJust) {
+ while (digits++ < fieldWidth)
+ output[outCount++] = ' ';
+ }
+ break;
+ }
+ case 'o': {
+ if (fieldWidth) {
+ if (isLong)
+ digits = _ldigits(intArg, 8, 0);
+ else
+ digits = _digits(intArg, 8, 0);
+
+ if (!leftJust) {
+ while (digits++ < fieldWidth)
+ output[outCount++] = (zeroPad ? '0' : ' ');
+ }
+ }
+
+ if (isLong)
+ lltouo(intArg, (output + outCount));
+ else
+ itouo(intArg, (output + outCount));
+
+ outCount = strlen(output);
+
+ if (fieldWidth && leftJust) {
+ while (digits++ < fieldWidth)
+ output[outCount++] = ' ';
+ }
+ break;
+ }
+ case 'x':
+ case 'X':
+ {
+ if (fieldWidth) {
+ if (isLong)
+ digits = _ldigits(intArg, 16, 0);
+ else
+ digits = _digits(intArg, 16, 0);
+
+ if (!leftJust) {
+ while (digits++ < fieldWidth)
+ output[outCount++] = (zeroPad ? '0' : ' ');
+ }
+ }
+
+ if (isLong)
+ lltoux(intArg, (output + outCount));
+ else
+ itoux(intArg, (output + outCount));
+
+ outCount = strlen(output);
+
+ if (fieldWidth && leftJust) {
+ while (digits++ < fieldWidth)
+ output[outCount++] = ' ';
+ }
+ break;
+ }
+
+ case 'e':
+ case 'E':
+ case 'f':
+ case 'F':
+ case 'g':
+ case 'G': {
+ doubleArg = (double)va_arg(list, double);
+ list += sizeof(int);
+
+ if (fieldWidth)
+ dtoa(doubleArg, (output + outCount), fieldWidth);
+ else
+ dtoa(doubleArg, (output + outCount), 6);
+
+ outCount = strlen(output);
+ break;
+ }
+ default: {
+ output[outCount++] = format[inCount - 1];
+ output[outCount++] = format[inCount];
+ break;
+ }
+ }
+ inCount += 1;
+ }
+ output[outCount] = '\0';
+ return (outCount);
+}
+
+
+int _vsnprintf(char* output, size_t sz, const char* format, va_list ap) {
+ int len = 0;
+ sz = min(sz, MAX_STRING_LENGTH);
+
+ memset(output, 0, sz);
+
+ len = _xeprint(output, sz, format, ap);
+ return len;
+}
+
+extern void store_x2_x7(uint8_t* buffer);
+extern void store_x3_x7(uint8_t* buffer);
+
+int _sprintf(char* output, const char* format, ...) {
+ va_list list;
+ uint8_t buffer[192];
+ store_x2_x7(buffer);
+ list = (va_list)buffer;
+ int len = 0;
+ len = _xeprint(output, MAX_STRING_LENGTH, format, list);
+ va_end(list);
+ return len;
+}
+
+int _snprintf(char* output, size_t sz, const char* format, ...) {
+ va_list list;
+ uint8_t buffer[192];
+ store_x3_x7(buffer);
+ list = (va_list)buffer;
+ int len = 0;
+ memset(output, 0, sz);
+ len = _xeprint(output, MAX_STRING_LENGTH, format, list);
+ va_end(list);
+ return len;
+}
+
diff --git a/KernelAA64/Log/klog.c b/KernelAA64/Log/klog.c
new file mode 100644
index 000000000..fc3aff9fa
--- /dev/null
+++ b/KernelAA64/Log/klog.c
@@ -0,0 +1,210 @@
+/**
+* BSD 2-Clause License
+*
+* Copyright (c) 2023-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define LOG_BUFFER_SIZE (128*1024)
+#define LOG_LINE_MAX 256
+
+typedef struct _blog_ring_ {
+ char buffer[LOG_BUFFER_SIZE];
+ uint32_t head;
+ uint32_t tail;
+ uint32_t len;
+ uint64_t seq;
+ //lock
+}BLogRing;
+
+static bool _Blog_use_uart;
+
+/** level tags */
+static const char* level_tag[BORDOISILA_DEBUG_LEVEL_COUNT] = {
+ "EMERG",
+ "ERROR",
+ "WARN",
+ "INFO",
+ "DEBUG"
+};
+
+
+static const uint32_t level_col[BORDOISILA_DEBUG_LEVEL_COUNT] = {
+ 0xFFFF3B30,
+ 0xFFD9534F,
+ 0xFFFFC107,
+ 0xFFE6E6E6,
+ 0xFF888888
+};
+
+
+static BLogRing _log_ring;
+BLogLevel _log_console_level = BORDOISILA_DEBUG;
+
+
+/**
+ * @brief B_KLogInit -- initialize bordoisila
+ * logging system
+ */
+void B_KLogInit() {
+ _log_ring.head = 0;
+ _log_ring.tail = 0;
+ _log_ring.len = 0;
+ _log_ring.seq = 0;
+ _Blog_use_uart = 0;
+}
+
+static void _BLog_Write_Locked(const char* data, uint32_t n) {
+ if (n >= LOG_BUFFER_SIZE) {
+ data += (n - (LOG_BUFFER_SIZE - 1));
+ n = LOG_BUFFER_SIZE - 1;
+ }
+
+ for (uint32_t i = 0; i < n; i++) {
+ _log_ring.buffer[_log_ring.head] = data[i];
+ _log_ring.head = (_log_ring.head + 1) % LOG_BUFFER_SIZE;
+
+ if (_log_ring.len < LOG_BUFFER_SIZE) {
+ _log_ring.len++;
+ }
+ else {
+ _log_ring.tail = (_log_ring.tail + 1) % LOG_BUFFER_SIZE;
+ }
+ }
+
+ _log_ring.seq++;
+}
+
+static void _BlogRingWrite(const char* data, uint32_t n) {
+ //spinlock
+ _BLog_Write_Locked(data, n);
+ //spin unlock
+}
+
+void BlogDump(BLogSinkFunc sink, void* ctx) {
+ if (!sink) return;
+
+ //lock
+
+ uint32_t pos = _log_ring.tail;
+ uint32_t left = _log_ring.len;
+
+ char snapshot[512];
+ //unlock
+
+ while (left > 0) {
+ uint32_t chunk = left < sizeof(snapshot) ? left : sizeof(snapshot);
+
+ //lock
+ for (uint32_t i = 0; i < chunk; i++) {
+ snapshot[i] = _log_ring.buffer[(pos + i) % LOG_BUFFER_SIZE];
+ }
+
+ //unlock
+
+ sink(snapshot, chunk, ctx);
+
+ pos = (pos + chunk) % LOG_BUFFER_SIZE;
+
+ left -= chunk;
+ }
+}
+
+static inline void _blog_get_uptime(uint64_t* sec, uint32_t* usec) {
+ uint64_t cntpct = get_cntpct_el0();
+ uint64_t cntfrq = get_cntfrq_el0();
+
+ if (cntfrq == 0) {
+ *sec = 0;
+ *usec = 0;
+ return;
+ }
+
+ *sec = cntpct / cntfrq;
+ *usec = (uint32_t)(((cntpct % cntfrq) * 1000000ULL) / cntfrq);
+}
+
+extern void store_x2_x7(uint8_t* buffer);
+
+/**
+ * @brief BPrintK -- print formatted string to circular buffer
+ * @param level -- logging level
+ * @param fmt -- formatted string
+ */
+void BPrintK(BLogLevel level, const char* fmt, ...) {
+ uint8_t buffer[192];
+ store_x2_x7(buffer);
+
+ char line[LOG_LINE_MAX];
+
+
+ uint64_t sec;
+ uint32_t usec;
+
+ if (level >= BORDOISILA_DEBUG_LEVEL_COUNT)
+ level = BORDOISILA_DEBUG_LEVEL_COUNT;
+
+ _blog_get_uptime(&sec, &usec);
+
+ int prefix_len = _snprintf(line, sizeof(line), "[%d.%d] [%s] ",
+ (unsigned long long)sec, usec, level_tag[level]);
+
+ if (prefix_len < 0) prefix_len = 0;
+
+ if ((uint32_t)prefix_len >= sizeof(line)) prefix_len = sizeof(line) - 1;
+
+
+
+ va_list args = (va_list)buffer;
+ int body_len = _vsnprintf(line + prefix_len, sizeof(line) - prefix_len, fmt, args);
+ va_end(args);
+
+ if (body_len < 0) body_len = 0;
+ int total = prefix_len + body_len;
+ if (total >= (int)sizeof(line)) {
+ total = sizeof(line) - 1;
+ }
+
+ if (total == 0 || line[total - 1] != '\n') {
+ line[total++] = '\n';
+ }
+
+ _BlogRingWrite(line, (uint32_t)total);
+
+ if (!_Blog_use_uart)
+ AuPutS_Color(line, level_col[level]);
+ else
+ uartPuts(line);
+}
\ No newline at end of file
diff --git a/KernelAA64/Makefile b/KernelAA64/Makefile
index 1a1435518..d43929072 100644
--- a/KernelAA64/Makefile
+++ b/KernelAA64/Makefile
@@ -1,28 +1,59 @@
-# XenevaOS KernelAA64 Makefile (GCC Build)
+# XenevaOS KernelAA64 Makefile
TARGET = KernelAA64.elf
-CROSS_COMPILE ?= aarch64-linux-gnu-
+OBJDIR = obj
+
+# Default toolchain is GCC
+TOOLCHAIN ?= gcc
-CC = $(CROSS_COMPILE)gcc
-LD = $(CROSS_COMPILE)ld
+# Triggered when you run "make llvm"
+.PHONY: all clean llvm
+llvm:
+ @$(MAKE) TOOLCHAIN=llvm all
# Target Board selection (Default: qemu_virt)
BOARD ?= qemu_virt
ifeq ($(BOARD), rpi3)
- BOARD_FLAG = -D__TARGET_BOARD_RPI3__
+ BOARD_FLAG = -D__TARGET_BOARD_RPI3__
else
- BOARD_FLAG = -D__TARGET_BOARD_QEMU_VIRT__
+ BOARD_FLAG = -D__TARGET_BOARD_QEMU_VIRT__
endif
-INCLUDES = -I../BaseHdr -I../Acpica/include -I../Acpica
-CFLAGS = -Wall -Wextra -ffreestanding -fno-stack-protector -fno-stack-check -fno-strict-aliasing \
- -O2 \
- -DARCH_ARM64 $(BOARD_FLAG) -D_USE_DLMALLOC -D__STDC_LIMIT_MACROS \
- $(INCLUDES)
+INCLUDES = -I../BaseHdr -I../Acpica/include -I../Acpica -I.
+
+
+ifeq ($(TOOLCHAIN), llvm)
+ # llvm configuration
+ CC = clang
+ LD = ld.lld
+ OBJCOPY = llvm-objcopy
+
+ LLVM_TARGET = -target aarch64-unknown-windows
+
+ CFLAGS = -Wall -Wextra -ffreestanding -fno-stack-protector -fno-stack-check -fno-strict-aliasing \
+ -O2 $(LLVM_TARGET) -fno-builtin \
+ -DARCH_ARM64 $(BOARD_FLAG) -D_USE_DLMALLOC -D__STDC_LIMIT_MACROS \
+ $(INCLUDES)
+
+ LDFLAGS = $(LLVM_TARGET) -fuse-ld=lld -nostdlib \
+ -Wl,-entry:_AuMain \
+ -Wl,-base:0xFFFFC00000000000 \
+ -Wl,-subsystem:native
+
+else
+ # original gcc configuration
+ CROSS_COMPILE ?= aarch64-linux-gnu-
+ CC = $(CROSS_COMPILE)gcc
+ LD = $(CROSS_COMPILE)ld
+ OBJCOPY = $(CROSS_COMPILE)objcopy
+
+ CFLAGS = -Wall -Wextra -ffreestanding -fno-stack-protector -fno-stack-check -fno-strict-aliasing \
+ -O2 \
+ -DARCH_ARM64 $(BOARD_FLAG) -D_USE_DLMALLOC -D__STDC_LIMIT_MACROS \
+ $(INCLUDES)
+endif
-OBJDIR = obj
-# Find all C and Assembly files recursively
C_SRCS_ALL = $(shell find . -name '*.c')
C_SRCS = $(filter-out ./Board/Rpi3bp/vc4dsi.c, $(C_SRCS_ALL))
S_SRCS = $(shell find . -name '*.s')
@@ -32,23 +63,33 @@ S_OBJS = $(patsubst %.s,$(OBJDIR)/%.o,$(S_SRCS))
OBJS = $(C_OBJS) $(S_OBJS)
-.PHONY: all clean
all: $(TARGET)
+ifeq ($(TOOLCHAIN), llvm)
+
$(TARGET): $(OBJS)
- @echo "Linking KernelAA64..."
+ @echo "Linking native PE32+ Kernel using LLVM..."
+ $(CC) $(LDFLAGS) $(OBJS) -o KernelAA64.exe
+ @touch $(TARGET)
+else
+
+$(TARGET): $(OBJS)
+ @echo "Linking KernelAA64 using GCC..."
$(LD) -nostdlib -T linker.ld $(OBJS) -o $@
@echo "Converting ELF to PE32+..."
- $(CROSS_COMPILE)objcopy -O pei-aarch64-little $@ KernelAA64.exe
+ $(OBJCOPY) -O pei-aarch64-little $@ KernelAA64.exe
+endif
+# Compile C source files
$(OBJDIR)/%.o: %.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
+# Assemble ASM source files
$(OBJDIR)/%.o: %.s
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
clean:
- rm -rf $(OBJDIR) $(TARGET)
+ rm -rf $(OBJDIR) $(TARGET) KernelAA64.exe
\ No newline at end of file
diff --git a/KernelAA64/Mm/dlmalloc.c b/KernelAA64/Mm/dlmalloc.c
index 2441b783d..9c90f6072 100644
--- a/KernelAA64/Mm/dlmalloc.c
+++ b/KernelAA64/Mm/dlmalloc.c
@@ -1568,6 +1568,7 @@ extern "C" {
#include /* for sbrk, sysconf */
#else /* LACKS_UNISTD_H */
#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
+typedef long ptrdiff_t;
extern void* sbrk(ptrdiff_t);
#endif /* FreeBSD etc */
#endif /* LACKS_UNISTD_H */
diff --git a/KernelAA64/Mm/dma.c b/KernelAA64/Mm/dma.c
index 2ad81cb03..6ae4d9dde 100644
--- a/KernelAA64/Mm/dma.c
+++ b/KernelAA64/Mm/dma.c
@@ -278,7 +278,7 @@ void AuDMAPoolDestroy(AuDMAPool* pool) {
while (page) {
AuDMAPage* next = page->next;
kfree(page->bitmap);
- AuPmmngrFree(page->phys);
+ AuPmmngrFree((void*)page->phys);
kfree(page);
page = next;
}
diff --git a/KernelAA64/Mm/kmalloc.c b/KernelAA64/Mm/kmalloc.c
index a8bef04c9..c68334dfd 100644
--- a/KernelAA64/Mm/kmalloc.c
+++ b/KernelAA64/Mm/kmalloc.c
@@ -30,6 +30,11 @@
#include
#include
#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
#include <_null.h>
#include
#include
diff --git a/KernelAA64/Mm/mmap.c b/KernelAA64/Mm/mmap.c
index 011d5a25a..c55be3587 100644
--- a/KernelAA64/Mm/mmap.c
+++ b/KernelAA64/Mm/mmap.c
@@ -41,6 +41,8 @@
#include
#include
#include
+#include
+#include
#define PROTECTION_FLAG_READONLY 1<<0
@@ -113,6 +115,7 @@ AuSharedMmapObject* AuSharedMmapObjectFindByName(char* name) {
return NULL;
}
+extern void aa64_schedule_init(AA64Thread* current, AA64Thread* init);
/**
* @brief CreateMemMapping -- Create a memory mapping of just memory, file or device
* @param address -- address from where mapping start, if null, kernel will
@@ -130,7 +133,6 @@ void* CreateMemMapping(void* address, size_t len, int prot, int flags, int fd,
if (!len)
return 0;
-
/* for now, memory mapping doesn't support lazy loading
* so everything works at pre-paging */
@@ -141,6 +143,8 @@ void* CreateMemMapping(void* address, size_t len, int prot, int flags, int fd,
if (!proc)
return NULL;
}
+
+
AuVFSNode* file = NULL;
AuVFSNode* fsys = NULL;
uint64_t startingPhysAddr = NULL;
@@ -265,7 +269,7 @@ void* CreateMemMapping(void* address, size_t len, int prot, int flags, int fd,
fb->numPageIndex++;
if (file->eof) {
- UARTDebugOut("File : %s , eof done : %d\r\n", file->filename, file->eof);
+ //UARTDebugOut("File : %s , eof done : %d\r\n", file->filename, file->eof);
}
}
diff --git a/KernelAA64/Mm/mmserv.c b/KernelAA64/Mm/mmserv.c
index 47b0b04f3..93fdbc6ca 100644
--- a/KernelAA64/Mm/mmserv.c
+++ b/KernelAA64/Mm/mmserv.c
@@ -37,6 +37,7 @@
#include
#include <_null.h>
#include
+#include
/* ============================================================
* Shared Memory
diff --git a/KernelAA64/Mm/pmmngr.c b/KernelAA64/Mm/pmmngr.c
index 46fda11ce..1aff40b3d 100644
--- a/KernelAA64/Mm/pmmngr.c
+++ b/KernelAA64/Mm/pmmngr.c
@@ -35,6 +35,8 @@
#include
#include
#include
+#include
+#include
#define PAGE_SHIFT 12
@@ -301,9 +303,8 @@ void AuPmmngrInitialize(KERNEL_BOOT_INFO* info) {
pageCount = (dtb_end - dtb_start) / 0x1000;
for (int i = 0; i < pageCount; i++) {
- uint64_t addr = dtb_start + (uint64_t)i * 0x1000; // ((uint64_t)Address - UsablePhysicalMemory);
- uint64_t Index = (addr - UsablePhysicalMemory);
- AuPmmngrLockPage(Index);
+ uint64_t addr = dtb_start + (uint64_t)i * 0x1000;
+ AuPmmngrLockPage(addr);
}
@@ -313,8 +314,7 @@ void AuPmmngrInitialize(KERNEL_BOOT_INFO* info) {
pageCount = (initrdEnd - initrdStart) / 0x1000;
for (int i = 0; i < pageCount; i++) {
uint64_t addr = initrdStart + (uint64_t)i * 0x1000;
- uint64_t Index = (addr - UsablePhysicalMemory);
- AuPmmngrLockPage(Index);
+ AuPmmngrLockPage(addr);
}
uint64_t lbStart = lb->littleBootStart;
@@ -324,8 +324,7 @@ void AuPmmngrInitialize(KERNEL_BOOT_INFO* info) {
for (int i = 0; i < pageCount; i++) {
uint64_t addr = lbStart + (uint64_t)i * 0x1000;
- uint64_t Index = (addr - UsablePhysicalMemory);
- AuPmmngrLockPage(Index);
+ AuPmmngrLockPage(addr);
}
AuTextOut("[aurora]: Pmmngr locked LittleBoot reserved memory\r\n");
}
diff --git a/KernelAA64/Mm/vmmngr.c b/KernelAA64/Mm/vmmngr.c
index 9bcd518ab..842db9762 100644
--- a/KernelAA64/Mm/vmmngr.c
+++ b/KernelAA64/Mm/vmmngr.c
@@ -39,6 +39,11 @@
#include <_null.h>
#include
#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
uint64_t* _RootPaging;
@@ -204,7 +209,8 @@ bool AuMapPage(uint64_t phys_addr, uint64_t virt_addr, uint8_t attrib) {
if (pml1[i1] & 1){
//AuPmmngrFree((void*)phys_addr);
- AuTextOut("[aurora]: vmmngr page already present : %x \r\n", virt_addr);
+ AuTextOut("[aurora]: vmmngr page already present : virt=%x phys=%x \r\n", virt_addr, (pml1[i1] & ~0xFFFULL));
+ UARTDebugOut("[aurora]: vmmngr page already present : virt=%x phys=%x \r\n", virt_addr, (pml1[i1] & ~0xFFFULL));
return false;
}
@@ -275,7 +281,8 @@ bool AuMapPageEx(uint64_t* pml4i, uint64_t phys_addr, uint64_t virt_addr, uint8_
if (pml1[i1] & 1)
{
//AuPmmngrFree((void*)phys_addr);
- AuTextOut("[aurora]: vmmngr page already present : %x \n", (pml1[i1] & ~0xFFFULL));
+ AuTextOut("[aurora]: vmmngr page already present : virt=%x phys=%x \n", virt_addr, (pml1[i1] & ~0xFFFULL));
+ UARTDebugOut("[aurora]: vmmngr page already present : virt=%x phys=%x \r\n", virt_addr, (pml1[i1] & ~0xFFFULL));
return false;
}
@@ -520,7 +527,7 @@ void AuUpdatePageFlags(uint64_t virt_addr, uint64_t flags) {
//AuTextOut("Your physical page is -> %x %x\n", page, V2P(page));
if (page) {
- pt[pt_index(virt_addr)] = (V2P(page) & ~0xFFFULL) | flags;
+ pt[pt_index(virt_addr)] = (V2P(*page) & ~0xFFFULL) | flags;
data_cache_flush(&pt[pt_index(virt_addr)]);
}
}
diff --git a/KernelAA64/Net/arp.c b/KernelAA64/Net/arp.c
index 1d23cfe94..08210f16c 100644
--- a/KernelAA64/Net/arp.c
+++ b/KernelAA64/Net/arp.c
@@ -125,11 +125,12 @@ void ARPHandlePacket(void* data, AuVFSNode* nic) {
}
}
if (ntohs(packet->operation) == 1) {
- char spa[17];
ip_ntoa(ntohl(packet->arp_data.arp_eth_ipv4.arp_spa));
- char tpa[17];
- ip_ntoa(ntohl(packet->arp_data.arp_eth_ipv4.arp_tpa));
- if (eth->ipv4addr && packet->arp_data.arp_eth_ipv4.arp_tpa == eth->ipv4addr) {
+ uint32_t tpa = 0;
+ memcpy(&tpa, &packet->arp_data.arp_eth_ipv4.arp_tpa, 4);
+
+ ip_ntoa(ntohl(tpa));
+ if (eth->ipv4addr && tpa == eth->ipv4addr) {
NetARP arp;
arp.hwAddressType = htons(1);
arp.hwProtocolType = htons(ETHERNET_TYPE_IPV4);
@@ -138,8 +139,16 @@ void ARPHandlePacket(void* data, AuVFSNode* nic) {
arp.operation = htons(2);
memcpy(arp.arp_data.arp_eth_ipv4.arp_sha, eth->mac, 6);
memcpy(arp.arp_data.arp_eth_ipv4.arp_tha, packet->arp_data.arp_eth_ipv4.arp_sha, 6);
- arp.arp_data.arp_eth_ipv4.arp_spa = eth->ipv4addr;
- arp.arp_data.arp_eth_ipv4.arp_tpa = packet->arp_data.arp_eth_ipv4.arp_spa;
+
+ //arp.arp_data.arp_eth_ipv4.arp_spa = eth->ipv4addr;
+ memcpy(&arp.arp_data.arp_eth_ipv4.arp_spa, ð->ipv4addr, 4);
+ //arp.arp_data.arp_eth_ipv4.arp_tpa = packet->arp_data.arp_eth_ipv4.arp_spa;
+ memcpy(&arp.arp_data.arp_eth_ipv4.arp_tpa, &packet->arp_data.arp_eth_ipv4.arp_spa, 4);
+
+ uint32_t tpa, spa = 0;
+ memcpy(&tpa, &arp.arp_data.arp_eth_ipv4.arp_tpa, 4);
+ memcpy(&spa, &arp.arp_data.arp_eth_ipv4.arp_spa, 4);
+
AuEthernetSend(nic, &arp, sizeof(NetARP), ETHERNET_TYPE_ARP, packet->arp_data.arp_eth_ipv4.arp_sha);
}
}
diff --git a/KernelAA64/Net/aunet.c b/KernelAA64/Net/aunet.c
index 49bce5de4..82d61e963 100644
--- a/KernelAA64/Net/aunet.c
+++ b/KernelAA64/Net/aunet.c
@@ -42,6 +42,7 @@
#include
#include
#include
+#include
static hashmap_t* netadapters;
diff --git a/KernelAA64/Net/ethernet.c b/KernelAA64/Net/ethernet.c
index 3ce0cebd8..8c69bc87d 100644
--- a/KernelAA64/Net/ethernet.c
+++ b/KernelAA64/Net/ethernet.c
@@ -40,19 +40,17 @@
#include
#include
#include
+#include
+
-#ifdef ARCH_X64
#pragma pack(push,1)
-#endif
-typedef struct _ethernet_ {
+ALIGNED(2) typedef struct _ethernet_ {
uint8_t dest[6];
uint8_t src[6];
uint16_t typeLen;
uint8_t payload[];
}Ethernet;
-#ifdef ARCH_X64
#pragma pack(pop)
-#endif
AU_EXTERN AU_EXPORT void AuEthernetHandle(void* data, int size, AuVFSNode* nic) {
@@ -60,8 +58,8 @@ AU_EXTERN AU_EXPORT void AuEthernetHandle(void* data, int size, AuVFSNode* nic)
AuNetworkDevice* ndev = (AuNetworkDevice*)nic->device;
if (!ndev)
return;
-
list_t* raw_sockets = AuRawSocketGetList();
+ UARTDebugOut("Adding to raw_sockets \r\n");
for (int i = 0; i < raw_sockets->pointer; i++) {
AuSocket* sock = (AuSocket*)list_get_at(raw_sockets, i);
AuSocketAdd(sock, frame, size);
@@ -116,13 +114,13 @@ void AuEthernetSend(AuVFSNode* nic, void* data, size_t len, uint16_t type, uint8
Ethernet* pacl = (Ethernet*)kmalloc(totalSz);
memset(pacl, 0, totalSz);
memcpy(&pacl->payload, data, len);
- memcpy(pacl->dest, dest, 6);
+ memcpy(&pacl->dest, dest, 6);
uint8_t* src_mac = ndev->mac;
- memcpy(pacl->src, src_mac, 6);
+ memcpy(&pacl->src, src_mac, 6);
pacl->typeLen = htons(type);
-
- if (nic->write) {
+ UARTDebugOut("PaclTypelen : %d \r\n", pacl->typeLen);
+ if (nic->write)
nic->write(nic, nic, (uint64_t*)pacl, totalSz);
- }
+
kfree(pacl);
}
\ No newline at end of file
diff --git a/KernelAA64/Net/ipv4.c b/KernelAA64/Net/ipv4.c
index e8841627c..84856cbe0 100644
--- a/KernelAA64/Net/ipv4.c
+++ b/KernelAA64/Net/ipv4.c
@@ -43,6 +43,7 @@
#include
#include
#include
+#include
uint16_t IPv4CalculateChecksum(IPv4Header* p) {
uint32_t sum = 0;
@@ -73,16 +74,22 @@ void IPv4HandlePacket(void* data, AuVFSNode* nic) {
char dest[16];
char src[16];
IPv4Header* pack = (IPv4Header*)data;
- ip_ntoa(ntohl(pack->destAddress));
- ip_ntoa(ntohl(pack->srcAddress));
- switch (pack->protocol) {
+ uint32_t destIP;
+ memcpy(&destIP, &pack->destAddress, 4);
+ uint32_t srcIP;
+ memcpy(&srcIP, &pack->srcAddress, 4);
+ ip_ntoa(ntohl(destIP));
+ ip_ntoa(ntohl(srcIP));
+ uint8_t protocol;
+ memcpy(&protocol, &pack->protocol, 1);
+ switch (protocol) {
case 1: {
UARTDebugOut("[ipv4]: received ICMP message \r\n");
- //AuICMPHandle(pack, nic);
+ AuICMPHandle(pack, nic);
break;
}
case IPV4_PROTOCOL_UDP: {
- UARTDebugOut("[ipv4]: received UDP packet \r\n");
+ UDPHandlePacket(pack);
break;
}
case IPV4_PROTOCOL_TCP: {
@@ -146,7 +153,7 @@ void IPV4SendPacket(IPv4Header* packet, AuVFSNode* nic) {
cache = AuARPGet(ip_dest);
if (!cache) {
AuARPRequestMAC(nic, ip_dest);
- UARTDebugOut("[aurora]:Requesting MAC \r\n");
+ UARTDebugOut("[aurora]:Requesting MAC #1 \r\n");
/* Not implemented yet */
AuSleepThread(AuGetCurrentThread(), 100);
@@ -159,12 +166,12 @@ void IPV4SendPacket(IPv4Header* packet, AuVFSNode* nic) {
cache = AuARPGet(ip_dest);
if (!cache) {
AuARPRequestMAC(nic, ip_dest);
- UARTDebugOut("[aurora]: Requesting MAC \r\n");
+ UARTDebugOut("[aurora]: Requesting MAC #2\r\n");
/* Not implemented yet */
- AuSleepThread(AuGetCurrentThread(), 10000);
+ AuSleepThread(AuGetCurrentThread(), 100);
AuForceScheduler();
-
+ UARTDebugOut("Rechecking ARP \r\n");
cache = AuARPGet(ip_dest);
}
}
diff --git a/KernelAA64/Net/socket.c b/KernelAA64/Net/socket.c
index 3df3493ed..02a419481 100644
--- a/KernelAA64/Net/socket.c
+++ b/KernelAA64/Net/socket.c
@@ -41,6 +41,7 @@
#include
#include
#include
+#include
#include
list_t* raw_socket_list;
@@ -62,7 +63,13 @@ void AuSocketAdd(AuSocket* sock, void* data, size_t sz) {
char* data_ = (char*)kmalloc(sizeof(size_t) + sz);
memset(data_, 0, sz + sizeof(size_t));
*(size_t*)data_ = sz;
- memcpy(data_ + sizeof(size_t), data, sz);
+ UARTDebugOut("Adding data %x , sz : %d\r\n", data, sz);
+ //memcpy(data_ + sizeof(size_t), (char*)data, sz);
+ char* dest = data_ + sizeof(size_t);
+ const char* src = (const char*)data;
+ for (size_t i = 0; i < sz; i++) {
+ dest[i] = src[i];
+ }
UARTDebugOut("]aurora]: socket sock stack -> %x \r\n", sock->rxstack);
AuStackPush(sock->rxstack, data_);
}
@@ -85,10 +92,16 @@ void* AuSocketGet(AuSocket* sock) {
* @param flags -- flags to be cared about
*/
int AuRawSocketReceive(AuSocket* sock, msghdr* msg, int flags) {
- if (!sock->binedDev)
+ if (!sock->binedDev) {
+ UARTDebugOut("No binded device \r\n");
return -1;
- if (msg->msg_iovlen == 0) return 0;
+ }
+ if (msg->msg_iovlen == 0) {
+ UARTDebugOut("MSG_IOVLen : 0 \r\n");
+ return 0;
+ }
char* data = (char*)AuSocketGet(sock);
+ UARTDebugOut("Getting data : %x \r\n", data);
if (!data) return -1;
size_t pack_sz = *(size_t*)data;
if (msg->msg_iov[0].iov_len < pack_sz) return -1;
diff --git a/KernelAA64/Net/tcp.c b/KernelAA64/Net/tcp.c
new file mode 100644
index 000000000..f43c5925a
--- /dev/null
+++ b/KernelAA64/Net/tcp.c
@@ -0,0 +1,387 @@
+/**
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2024, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+list_t* tcpSocketList;
+
+typedef struct _tcpcheckheader_ {
+ uint32_t source;
+ uint32_t destination;
+ uint8_t zeros;
+ uint8_t protocol;
+ uint16_t tcpLen;
+ uint8_t tcpHeader[];
+}TCPCheckHeader;
+
+/** Implementation needed **/
+
+
+/*
+ * CalculateTCPChecksum -- calculate tcp checksum
+ * @param p -- Pointer to TCP Checksum header
+ * @param h -- Pointer to TCP header
+ * @param d -- Payload
+ * @param payloadsz -- size of the payload
+ */
+uint16_t CalculateTCPChecksum(TCPCheckHeader* p, TCPHeader* h, void* d, size_t payloadsz) {
+ uint32_t sum = 0;
+ uint16_t* s = (uint16_t*)p;
+
+ for (int i = 0; i < 6; ++i) {
+ sum += ntohs(s[i]);
+ if (sum > 0xFFFF)
+ sum = (sum >> 16) + (sum & 0xFFFF);
+ }
+
+ s = (uint16_t*)h;
+ for (int i = 0; i < 10; ++i) {
+ sum += ntohs(s[i]);
+ if (sum > 0xFFFF)
+ sum = (sum >> 16) + (sum & 0xFFFF);
+ }
+
+ uint16_t dwords = payloadsz / 2;
+ s = (uint16_t*)d;
+ for (unsigned int i = 0; i < dwords; ++i) {
+ sum += ntohs(s[i]);
+ if (sum > 0xFFFF)
+ sum = (sum >> 16) + (sum & 0xFFFF);
+ }
+
+ if (dwords * 2 != payloadsz) {
+ uint8_t* t = (uint8_t*)d;
+ uint8_t tmp[2];
+ tmp[0] = t[dwords * sizeof(uint16_t)];
+ tmp[1] = 0;
+
+ uint16_t* f = (uint16_t*)tmp;
+
+ sum += ntohs(f[0]);
+ if (sum > 0xFFFF)
+ sum = (sum >> 16) + (sum & 0xFFFF);
+ }
+
+ return ~(sum & 0xFFFF) & 0xFFFF;
+}
+/*
+ * AuTCPReceive -- TCP protocol receive interface
+ * @param sock -- Pointer to socket
+ * @param msghdr -- Message header containing every information
+ * @param flags -- extra flags
+ */
+int AuTCPReceive(AuSocket* sock, msghdr* msg, int flags) {
+ return 0;
+}
+
+/*
+* AuTCPSend -- TCP protocol send interface
+* @param sock -- Pointer to socket
+* @param msghdr -- Message header containing every information
+* @param flags -- extra flags
+*/
+int AuTCPSend(AuSocket* sock, msghdr* msg, int flags) {
+ return 0;
+}
+
+/*
+* AuTCPClose -- TCP protocol close call
+* @param sock -- Pointer to socket
+*/
+void AuTCPClose(AuSocket* sock) {
+ return;
+}
+
+static int _tcp_port_ = 49152;
+/*
+ * AuTCPObtainPort -- obtains a new port for
+ * a session, port number 0 - 1024 are reserved
+ * for services and protocols like HTTP(port 80)
+ * FTP(port 21), SSH(port 22)..etc
+ * Rage from 1024 to 49151 are assigned by Internet
+ * Assigned Numbers Authority for specific services
+ * upon application by a requesting entity.
+ * Dynamic/Private ports ranges from 49152 - 65535
+ * this ports are not assigned and can be used
+ * dynamically by applications and services
+ * @param sock -- Pointer to socket session
+ */
+void AuTCPObtainPort(AuSocket* sock) {
+ int port = _tcp_port_++;
+ sock->sessionPort = port;
+ list_add(tcpSocketList, sock);
+}
+
+/*
+ * AuTCPAcknowledge -- send ack packets
+ * @param nic -- Pointer to NIC device
+ * @param sock -- Pointer to session socket
+ * @param ippack -- Pointer to IPv4 packet
+ * @param payloadLen -- length of the payload
+*/
+int AuTCPAcknowledge(AuVFSNode* nic, AuSocket* sock, IPv4Header* ippack, size_t payloadLen) {
+ AuNetworkDevice* nicdev = (AuNetworkDevice*)nic->device;
+ if (!nicdev)
+ return -1;
+
+
+ /* need to implement three way ack to handle
+ * packet loss or errors
+ */
+ TCPHeader* tcp = (TCPHeader*)&ippack->payload;
+ int windowsz = TCP_DEFAULT_WIN_SZ;
+
+ unsigned seq_num = sock->packID + 1;
+ unsigned ack_num = (tcp->sequenceNum + payloadLen);
+ size_t totalLen = sizeof(IPv4Header) + sizeof(TCPHeader);
+ IPv4Header* ipv4 = (IPv4Header*)kmalloc(totalLen);
+ ipv4->totalLength = htons(totalLen);
+ ipv4->destAddress = ippack->srcAddress;
+ ipv4->srcAddress = nicdev->ipv4addr;
+ ipv4->timeToLive = 64;
+ ipv4->protocol = IPV4_PROTOCOL_TCP;
+ sock->ipv4Iden++;
+ ipv4->identification = htons(sock->ipv4Iden);
+ ipv4->flagsFragOffset = htons(0x0);
+ ipv4->versionHeaderLen = 0x45;
+ ipv4->typeOfService = 0;
+ ipv4->headerChecksum = htons(IPv4CalculateChecksum(ipv4));
+
+ /* handle fin packets */
+ int flags = TCP_FLAGS_ACK;
+
+ TCPHeader* tcppack = (TCPHeader*)&ipv4->payload;
+ tcppack->srcPort = htons(sock->sessionPort);
+ tcppack->destPort = tcp->srcPort;
+ tcppack->sequenceNum = htonl(seq_num);
+ tcppack->ackNum = htonl(ack_num);
+ tcppack->dataOffsetFlags = htons(flags | 0x5000);
+ tcppack->window = htons(windowsz);
+ tcppack->checksum = 0;
+ tcppack->urgentPointer = 0;
+
+ TCPCheckHeader checkhdr;
+ checkhdr.source = ipv4->srcAddress;
+ checkhdr.destination = ipv4->destAddress;
+ checkhdr.zeros = 0;
+ checkhdr.protocol = IPV4_PROTOCOL_TCP;
+ checkhdr.tcpLen = htons(sizeof(TCPHeader));
+
+ tcppack->checksum = htons(CalculateTCPChecksum(&checkhdr, tcppack, NULL, 0));
+ IPV4SendPacket(ipv4, nic);
+ UARTDebugOut("TCP-ACK Sent !! successfully \r\n");
+ kfree(ipv4);
+ return 0;
+}
+/*
+* AuTCPConnect -- TCP protocol connect interface
+* @param sock -- Pointer to socket
+* @param addr -- socket address information
+* @param addrlen -- address length
+*/
+int AuTCPConnect(AuSocket* sock, sockaddr* addr, socklen_t addrlen) {
+ sockaddr_in* sockdata = (sockaddr_in*)addr;
+ UARTDebugOut("TCP connect call called \r\n");
+ AuTCPObtainPort(sock);
+ int sourcePort = sock->sessionPort;
+ sock->sockState = SOCK_STATE_WAITING_FOR_CONNECTION;
+ sock->ipv4Iden = rand();
+ AuVFSNode* nic = AuNetworkRoute(sockdata->sin_addr.s_addr);
+ if (!nic) {
+ UARTDebugOut("[Aurora-net]: TCP failed to connect, no NIC\r\n");
+ return 1;
+ }
+
+ AuNetworkDevice* ndev = (AuNetworkDevice*)nic->device;
+ if (!ndev) {
+ UARTDebugOut("[Aurora-net]: TCP No Netword device data \r\n");
+ return 1;
+ }
+
+ size_t totalLen = sizeof(IPv4Header) + sizeof(TCPHeader);
+
+ /* IPV4 Header */
+ IPv4Header* ipv4 = (IPv4Header*)kmalloc(totalLen);
+ ipv4->totalLength = htons(totalLen);
+ ipv4->destAddress = sockdata->sin_addr.s_addr;
+ ipv4->srcAddress = ndev->ipv4addr;
+ ipv4->timeToLive = 64;
+ ipv4->protocol = IPV4_PROTOCOL_TCP;
+ ipv4->identification = htons(sock->ipv4Iden);
+ ipv4->flagsFragOffset = htons(0x0);
+ ipv4->versionHeaderLen = 0x45;
+ ipv4->typeOfService = 0;
+ ipv4->headerChecksum = htons(IPv4CalculateChecksum(ipv4));
+
+ TCPHeader* tcp = (TCPHeader*)&ipv4->payload;
+ tcp->srcPort = htons(sock->sessionPort);
+ tcp->destPort = sockdata->sin_port;
+ tcp->sequenceNum = 0;
+ tcp->ackNum = 0;
+ tcp->dataOffsetFlags = htons((1 << 1) | 0x5000);
+ tcp->window = htons(TCP_DEFAULT_WIN_SZ);
+ tcp->checksum = 0;
+ tcp->urgentPointer = 0;
+ sock->packID = tcp->sequenceNum;
+
+ TCPHeader* tcpch = (TCPHeader*)ipv4->payload;
+ UARTDebugOut("TCP Check SRC -> %d \r\n", tcpch->srcPort);
+
+ TCPCheckHeader checkhdr;
+ checkhdr.source = ipv4->srcAddress;
+ checkhdr.destination = ipv4->destAddress;
+ checkhdr.zeros = 0;
+ checkhdr.protocol = IPV4_PROTOCOL_TCP;
+ checkhdr.tcpLen = htons(sizeof(TCPHeader));
+
+ tcp->checksum = htons(CalculateTCPChecksum(&checkhdr, tcp, NULL, 0));
+
+ IPV4SendPacket(ipv4, nic);
+
+ uint64_t s, ss = 0;
+ uint64_t ns, nss = 0;
+ aa64_calculate_ticks(1, 0, &s, &ss);
+ int attempts = 0;
+ while (!sock->rxstack->itemCount) {
+ AuSleepThread(AuGetCurrentThread(), 20);
+ AuScheduleNext();
+
+ aa64_calculate_ticks(0, 0, &ns, &nss);
+ //connection refused
+ if (sock->sockState == SOCK_STATE_CONNECTION_RST) {
+ UARTDebugOut("Sock state reset \r\n");
+ kfree(ipv4);
+ return -1;
+ }
+ if ((ns > s || (ns == s && nss > ss))) {
+ if (attempts == 3) {
+ UARTDebugOut("Attempts == 3 \r\n");
+ kfree(ipv4);
+ return -1; //timeout
+ }
+ UARTDebugOut("[aurora]: TCP retrying connection \r\n");
+ IPV4SendPacket(ipv4, nic);
+ aa64_calculate_ticks(1, 0, &s, &ss);
+ attempts++;
+ }
+ }
+ kfree(ipv4);
+ UARTDebugOut("[aurora]: TCP connection succeeded \r\n");
+ return 0;
+}
+
+
+int AuTCPBind(AuSocket* sock, sockaddr* addr, socklen_t addrlen) {
+ return 0;
+}
+
+
+uint64_t AuTCPRead(AuVFSNode* node, AuVFSNode* file, uint64_t* buffer, uint32_t len) {
+ return 0;
+}
+
+uint64_t AuTCPWrite(AuVFSNode* node, AuVFSNode* file, uint64_t* buffer, uint32_t len) {
+ return 0;
+}
+
+int AuTCPFileClose(AuVFSNode* fsys, AuVFSNode* file) {
+ AuSocket* sock = (AuSocket*)file->device;
+ if (sock) {
+ if (sock->rxstack) {
+ while (sock->rxstack->itemCount) {
+ void* data = AuStackPop(sock->rxstack);
+ kfree(data);
+ }
+ kfree(sock->rxstack);
+ }
+ kfree(sock);
+ }
+ kfree(file);
+ UARTDebugOut("TCP/IP Socket Closed \r\n");
+ return 0;
+}
+/*
+ * CreateTCPSocket -- creates a new TCP Socket
+ */
+int CreateTCPSocket() {
+ int fd = -1;
+ AA64Thread* thread = AuGetCurrentThread();
+ if (!thread)
+ return -1;
+ AuProcess* proc = AuProcessFindThread(thread);
+ if (!proc)
+ proc = AuProcessFindSubThread(thread);
+ if (!proc)
+ return -1;
+ AuSocket* sock = (AuSocket*)kmalloc(sizeof(AuSocket));
+ memset(sock, 0, sizeof(AuSocket));
+ sock->send = AuTCPSend;
+ sock->receive = AuTCPReceive;
+ sock->connect = AuTCPConnect;
+ sock->bind = AuTCPBind;
+ sock->close = AuTCPClose;
+ sock->rxstack = AuStackCreate();
+ fd = AuProcessGetFileDesc(proc);
+ AuVFSNode* node = (AuVFSNode*)kmalloc(sizeof(AuVFSNode));
+ memset(node, 0, sizeof(AuVFSNode));
+ node->flags |= FS_FLAG_SOCKET;
+ node->device = sock;
+ node->close = AuTCPFileClose;
+ node->iocontrol = SocketIOControl;
+ proc->fds[fd] = node;
+ UARTDebugOut("TCP Socket created \r\n");
+ return fd;
+}
+
+/*
+ * TCPGetSocketList -- return the current socket
+ * list of TCP
+ */
+list_t* TCPGetSocketList() {
+ return tcpSocketList;
+}
+
+/*
+ * TCPProtocolInstall -- initialize the TCP protocol
+ */
+void TCPProtocolInstall() {
+ tcpSocketList = initialize_list();
+}
\ No newline at end of file
diff --git a/KernelAA64/Net/udp.c b/KernelAA64/Net/udp.c
index 756fc798e..8a93a487e 100644
--- a/KernelAA64/Net/udp.c
+++ b/KernelAA64/Net/udp.c
@@ -48,6 +48,43 @@ int UDPGetPort(AuSocket* sock) {
list_add(udp_socket_list, sock);
return out;
}
+
+
+/**
+ * @brief AuUDPHandlePacket -- handle incoming packet
+ * @param packet -- pointer to ipv4 packet
+ */
+void UDPHandlePacket(char* packet) {
+ IPv4Header* ipv4 = (IPv4Header*)packet;
+ UDPHeader* udp = (UDPHeader*)&ipv4->payload;
+ uint16_t dest_port;
+ memcpy(&dest_port, &udp->destPort, 2);
+ uint16_t src_port;
+ memcpy(&src_port, &udp->srcPort, 2);
+
+ uint16_t totalLen = 0;
+ memcpy(&totalLen, &ipv4->totalLength, 2);
+
+#ifdef DEBUG_SERIAL
+ UARTDebugOut("UDP Packet received with dest_port : %d , src_port : %d \r\n", ntohs(dest_port), src_port);
+ UARTDebugOut("Data bytes (%d bytes): \r\n", ntohs(totalLen));
+ for (int i = 0; i < 15; i++) {
+ UARTDebugOut("%c", udp->payload[i]);
+ }
+#endif
+
+ /** add it to its destination socket **/
+ for (int i = 0; i < udp_socket_list->pointer; i++) {
+ AuSocket* sock = (AuSocket*)list_get_at(udp_socket_list, i);
+ if (sock->sessionPort == ntohs(dest_port)) {
+ AuSocketAdd(sock, packet, ntohs(totalLen));
+#ifdef DEBUG_SERIAL
+ UARTDebugOut("UDP Packet added \r\n");
+#endif
+ break;
+ }
+ }
+}
/**
* @brief AuUDPReceive -- UDP protocol receive interface
* @param sock -- Pointer to socket
diff --git a/KernelAA64/Serv/fileserv.c b/KernelAA64/Serv/fileserv.c
index 85fe80098..3759c0e8a 100644
--- a/KernelAA64/Serv/fileserv.c
+++ b/KernelAA64/Serv/fileserv.c
@@ -30,6 +30,7 @@
**/
#include
+#include
#include
#include
#include
@@ -42,6 +43,7 @@
#include
#include
#include
+#include
extern uint64_t read_sp();
extern uint64_t read_sp_el1();
@@ -50,7 +52,7 @@ extern uint64_t read_sp_el1();
* @param file -- file path
* @param mode -- mode of the file
*/
-int OpenFile(char* filename, int mode) {
+int OpenFile(char* filename, int mode) {
AA64Thread* current_thr = AuGetCurrentThread();
if (!current_thr)
return -1;
@@ -102,6 +104,29 @@ int OpenFile(char* filename, int mode) {
if (file->open)
file->open(file,NULL);
current_proc->fds[fd] = file;
+CapRights rights = CAP_SEEK;
+
+if (mode & FILE_OPEN_READ_ONLY)
+ rights |= CAP_READ | CAP_WRITE;
+
+if (mode & (FILE_OPEN_WRITE | FILE_OPEN_CREAT))
+ rights |= CAP_WRITE;
+
+/* Preserve current default behaviour */
+if (mode == 0)
+ rights |= CAP_READ;
+
+if (rights & CAP_READ)
+ BPrintK(BORDOISILA_WARN, "Creating rights has read %s, %d, fname: %s\r\n", current_proc->name, fd, filename);
+
+BordoisilaCapCreate(
+ current_proc,
+ fd,
+ file,
+ CAP_OBJ_FILE,
+ rights);
+
+
//_setdebug = 1;
return fd;
}
@@ -178,6 +203,9 @@ size_t ReadFile(int fd, void* buffer, size_t length) {
if (!file) {
return 0;
}
+ if (!BordoisilaCapCheckRights(current_proc, fd, CAP_READ)) {
+ return 0;
+ }
size_t ret_bytes = 0;
/* every general file will contain its
@@ -229,10 +257,13 @@ size_t WriteFile(int fd, void* buffer, size_t length) {
if (!current_proc)
return 0;
}
+
AuVFSNode* file = current_proc->fds[fd];
uint8_t* aligned_buffer = (uint8_t*)buffer;
if (!file)
return 0;
+ if (!BordoisilaCapCheckRights(current_proc, fd, CAP_WRITE))
+ return 0;
size_t write_bytes = 0;
size_t ret_bytes;
/* every general file will contain its
@@ -286,15 +317,18 @@ int CloseFile(int fd) {
AuVFSNode* file = current_proc->fds[fd];
if (file->flags & FS_FLAG_FILE_SYSTEM) {
current_proc->fds[fd] = 0;
+ BordoisilaCapDestroy(current_proc, fd);
return -1;
}
if (file->flags & FS_FLAG_CACHED) {
current_proc->fds[fd] = 0;
+ BordoisilaCapDestroy(current_proc, fd);
return 0;
}
if (file->flags & FS_FLAG_GENERAL) {
current_proc->fds[fd] = 0;
+ BordoisilaCapDestroy(current_proc, fd);
/** NEED to fix, freeing the file causes crash **/
kfree(file);
return 0;
@@ -303,6 +337,7 @@ int CloseFile(int fd) {
if (file->flags & FS_FLAG_DIRECTORY) {
current_proc->fds[fd] = 0;
+ BordoisilaCapDestroy(current_proc, fd);
kfree(file);
return 0;
}
@@ -311,6 +346,7 @@ int CloseFile(int fd) {
if (file->close)
file->close(file, file);
current_proc->fds[fd] = 0;
+ BordoisilaCapDestroy(current_proc, fd);
return 0;
}
diff --git a/KernelAA64/Serv/thrserv.c b/KernelAA64/Serv/thrserv.c
index f4635d9dd..4cc7d662f 100644
--- a/KernelAA64/Serv/thrserv.c
+++ b/KernelAA64/Serv/thrserv.c
@@ -39,6 +39,9 @@
#include
#include
#include
+#include
+#include
+#include
/**
* @brief GetThreadID -- returns current id
@@ -100,10 +103,12 @@ int ProcessWaitForTermination(int pid) {
//NOT IMPLEMENTED
AA64Thread* current_thr = AuGetCurrentThread();
AuProcess* proc = AuProcessFindThread(current_thr);
- AuProcessWaitForTermination(proc, pid);
- AA64Registers* regs = AA64GetCurrentRegCtx();
- AuScheduleThread(regs);
- return 0;
+ int ret = AuProcessWaitForTermination(proc, pid);
+ if (ret == 1) {
+ AA64Registers* regs = AA64GetCurrentRegCtx();
+ AuScheduleThread(regs);
+ }
+ return ret;
}
/**
@@ -258,9 +263,29 @@ int SetFileToProcess(int fileno, int dest_fdidx, int proc_id) {
* fileno to destination processes file
* entry
*/
+
+
+
+
destproc->fds[dest_fdidx] = file;
file->fileCopyCount += 1;
- }
+
+ /* inherit the capability if inheritance is allowed */
+ AuCapability* src = BordoisilaCapLookup(proc, fileno);
+ if (src && !(src->flags & CAP_FLAG_NO_INHERIT)) {
+ BPrintK(BORDOISILA_INFO, "Capability copied from proc : %s, fileno-> %d \r\n", proc->name, fileno);
+ BordoisilaCapCreate(
+ destproc,
+ dest_fdidx,
+ file,
+ src->object_type,
+ src->rights);
+ }
+
+
+ }
+ return 0;
+
}
/**
@@ -300,4 +325,72 @@ size_t GetEnvironmenBlock() {
}
return proc->_envp_block_;
+}
+
+void SignalReturn(int signum) {
+ AA64Thread* thr = AuGetCurrentThread();
+ AA64Registers* regs = (AA64Registers*)thr->sp;
+ memcpy(regs, &thr->signal.regs, sizeof(AA64Registers));
+ thr->elr_el1 = thr->signal.elr_el1;
+ //thr->state = thr->signal.last_thread_state;
+ thr->x30 = regs->x30;
+}
+
+/**
+ * @brief SendSignal -- send a signal to destination
+ * thread
+ * @param pid -- process id
+ * @param signum -- signal number
+ */
+int SendSignal(int pid, int signum) {
+ UARTDebugOut("Send signal called \r\n");
+ AuProcess* proc = AuProcessFindPID(pid);
+ if (!proc)
+ return 1;
+ UARTDebugOut("Sending Signal to proc : %s \r\n", proc->name);
+ AA64Thread* mainthr = proc->main_thread;
+ if (!mainthr)
+ return 1;
+ return AuAllocSignal(mainthr, signum);
+}
+
+/*
+ * SetSignal -- register a signal handler
+ * @param signo -- signal number
+ * @param handler -- handler to register
+ */
+int SetSignal(int signo, AuSignalHandler handler) {
+ AA64Thread* thr = AuGetCurrentThread();
+ if (!thr)
+ return 0;
+ thr->sigs[signo] = (uint64_t*)handler;
+}
+
+/**
+ * @brief Alarm -- schedules a timer for next one-shot
+ * @param seconds -- amount of second to consider
+ */
+int Alarm(uint64_t seconds) {
+ AA64Thread* thr = AuGetCurrentThread();
+ if (!thr)
+ return 0;
+ return AuTimerCalculateAlarm(thr, seconds);
+}
+
+int SetITimer(int which, const itimerval_t* new_value, itimerval_t* old_value) {
+ AA64Thread* thr = AuGetCurrentThread();
+ if (!thr)
+ return 0;
+ UARTDebugOut("ITIMERVAL : itval.tv_sec : %d \r\n", new_value->it_value.tv_sec);
+ UARTDebugOut("ITIMERVAL : itval.tv_usec: %d \r\n", new_value->it_value.tv_usec);
+ UARTDebugOut("ITIMERVAL : interval.tv_sec : %d \r\n", new_value->it_interval.tv_sec);
+ UARTDebugOut("ITIMERVAL : interval.tv_usec: %d \r\n", new_value->it_interval.tv_usec);
+ return AuTimerSetITimer(thr, which, new_value, old_value);
+}
+
+int GetITimer(int which, const itimerval_t* curr_value) {
+ AA64Thread* thr = AuGetCurrentThread();
+ if (!thr)
+ return 0;
+ return AuTimerGetITimer(thr, which, curr_value);
}
\ No newline at end of file
diff --git a/KernelAA64/Sound/sndcore.c b/KernelAA64/Sound/sndcore.c
index de8197d50..17da6d830 100644
--- a/KernelAA64/Sound/sndcore.c
+++ b/KernelAA64/Sound/sndcore.c
@@ -32,6 +32,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -39,6 +40,7 @@
#include
#include
#include
+#include
#define AURORA_MAX_SOUND_CARDS 256
diff --git a/KernelAA64/aucon.c b/KernelAA64/aucon.c
index dacc231cf..ddafb4e02 100644
--- a/KernelAA64/aucon.c
+++ b/KernelAA64/aucon.c
@@ -30,7 +30,11 @@
**/
#include
-
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
#include
#include <_null.h>
#include "font.h"
@@ -43,6 +47,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -290,6 +295,16 @@ void AuPutPixel(size_t x, size_t y, uint32_t col) {
* @param c -- character to print
*/
void AuPutC(char c) {
+ if (early_) {
+ if (is_uart_initialized())
+ uartPutc(c);
+ else if (_print_func) {
+ char buf[2] = {c, 0};
+ _print_func(buf);
+ }
+ return;
+ }
+
if (console_x > v_res / 9) {
console_x = 0;
console_y++;
@@ -311,22 +326,35 @@ void AuPutC(char c) {
console_x++;
uint32_t* lfb = aucon->buffer;
- if (console_y + 1 > h_res / 16)
+ if (console_y + 1 > v_res / 16)
{
- for (int i = 16; i < h_res * v_res; i++)
- lfb[i] = lfb[i + v_res * 16];
+ for (int i = 0; i < (v_res - 16) * h_res; i++)
+ lfb[i] = lfb[i + h_res * 16];
+ for (int i = (v_res - 16) * h_res; i < v_res * h_res; i++)
+ lfb[i] = CONSOLE_BACKGROUND;
+ for (int i = 0; i < h_res * (v_res - 16); i++)
+ lfb[i] = lfb[i + h_res * 16];
+
+ memset(lfb + h_res * (v_res - 16), 0, h_res * 16 * sizeof(uint32_t));
console_y--;
}
}
-
/**
* @brief Prints string to console output
* @param str -- string to print
*/
void AuPutS(char* str) {
+ if (early_) {
+ if (is_uart_initialized())
+ uartPuts(str);
+ else if (_print_func)
+ _print_func(str);
+ return;
+ }
+
uint32_t* lfb = aucon->buffer;
while (*str) {
@@ -373,25 +401,99 @@ void AuPutS(char* str) {
/* Scroll */
if (console_y + 1 > v_res / 16)
{
- for (int i = 16; i < v_res * h_res; i++)
+ for (int i = 0; i < (v_res - 16) * h_res; i++)
+ lfb[i] = lfb[i + h_res * 16];
+ for (int i = (v_res - 16) * h_res; i < v_res * h_res; i++)
+ lfb[i] = CONSOLE_BACKGROUND;
+ for (int i = 0; i < h_res * (v_res - 16); i++)
lfb[i] = lfb[i + h_res * 16];
+
+ memset(lfb + h_res * (v_res - 16), 0, h_res * 16 * sizeof(uint32_t));
console_y--;
}
}
/**
- * @brief AuTextOut -- standard text printing function
- * for entire kernel
- * @param text -- text to output
+ * @brief Prints string to console output
+ * @param str -- string to print
+ * @param col -- foreground color
*/
-void AuTextOut(const char* format, ...) {
+void AuPutS_Color(char* str, uint32_t color) {
if (early_) {
if (is_uart_initialized())
- UARTDebugOut(format);
- else
- _print_func(format);
+ uartPuts(str);
+ else if (_print_func)
+ _print_func(str);
return;
}
+
+ uint32_t* lfb = aucon->buffer;
+ while (*str) {
+
+ if (*str > 0xFF) {
+ //unicode
+ }
+ else if (*str == '\n') {
+ ++console_y;
+ console_x = 0;
+ }
+ else if (*str == '\r') {
+ }
+ else if (*str == '\b') {
+ if (console_x > 0)
+ --console_x;
+ }
+ else {
+
+ const bx_fontcharbitmap_t entry = bx_vgafont[*str];
+ for (size_t y = 0; y < 16; ++y) {
+
+ for (size_t x = 0; x < 8; ++x) {
+
+ if (entry.data[y] & (1 << x)) {
+ AuPutPixel(x + console_x * 9, y + console_y * 16, color);
+ }
+ else {
+ AuPutPixel(x + console_x * 9, y + console_y * 16, CONSOLE_BACKGROUND);
+ }
+ }
+ AuPutPixel(8 + console_x * 9, y + console_y * 16, CONSOLE_BACKGROUND);
+ }
+ ++console_x;
+ if (console_x > h_res / 9) {
+ console_x = 0;
+ ++console_y;
+ }
+ }
+
+ ++str;
+ }
+
+
+ /* Scroll */
+ if (console_y + 1 > v_res / 16)
+ {
+ for (int i = 0; i < (v_res - 16) * h_res; i++)
+ lfb[i] = lfb[i + h_res * 16];
+ for (int i = (v_res - 16) * h_res; i < v_res * h_res; i++)
+ lfb[i] = CONSOLE_BACKGROUND;
+ for (int i = 0; i < h_res * (v_res - 16); i++)
+ lfb[i] = lfb[i + h_res * 16];
+
+ memset(lfb + h_res * (v_res - 16), 0, h_res * 16 * sizeof(uint32_t));
+ console_y--;
+ }
+}
+
+#ifdef _MSC_VER
+extern void store_x0_x7(uint64_t* buffer);
+#endif
+/**
+ * @brief AuTextOut -- standard text printing function
+ * for entire kernel
+ * @param text -- text to output
+ */
+void AuTextOut(const char* format, ...) {
if (bypass_autextout)
return;
diff --git a/KernelAA64/audrv.c b/KernelAA64/audrv.c
index db4b58b9b..59a653bad 100644
--- a/KernelAA64/audrv.c
+++ b/KernelAA64/audrv.c
@@ -34,6 +34,11 @@
#include
#include
#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
#include
#include
#include
@@ -299,7 +304,7 @@ void AuDriverLoad(char* filename, AuDriver* driver) {
size_t file_offset = 0;
while (file->eof != 1) {
uint64_t block = ((uint64_t)scratchBuffer + file_offset);
- size_t bytes_read = AuVFSNodeReadBlock(fsys, file, block);
+ size_t bytes_read = AuVFSNodeReadBlock(fsys, file, (uint64_t*)block);
if (bytes_read == 0) break;
file_offset += bytes_read;
}
diff --git a/KernelAA64/circbuf.c b/KernelAA64/circbuf.c
index b4fdf2f48..0c21ddd54 100644
--- a/KernelAA64/circbuf.c
+++ b/KernelAA64/circbuf.c
@@ -31,6 +31,11 @@
#include
#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
/**
* @brief AuAdvancePointer -- advances the pointer
diff --git a/KernelAA64/dtb.c b/KernelAA64/dtb.c
index ae6e19ca0..d9753bbef 100644
--- a/KernelAA64/dtb.c
+++ b/KernelAA64/dtb.c
@@ -252,6 +252,23 @@ uint64_t AuDeviceTreeGetRegSize(uint32_t* node, uint32_t addressCell, uint32_t s
return 0;
}
+uint32_t* AuDeviceTreeGetPropCells(uint32_t* node, const char* property, uint32_t* out_num_cells) {
+ uint32_t* prop = AuDeviceTreeFindProperty(node, property);
+ if (!prop) {
+ *out_num_cells = 0; return NULL;
+ }
+ uint32_t len_bytes = AuDTBSwap32(prop[0]);
+ *out_num_cells = len_bytes / 4;
+ return &prop[2];
+}
+
+uint32_t AuDeviceTreeGetU32Property(uint32_t* node, const char* property, uint32_t default_val) {
+ if (!node) return default_val;
+ uint32_t* prop = AuDeviceTreeFindProperty(node, property);
+ if (!prop) return default_val;
+ return AuDTBSwap32(prop[2]);
+}
+
/**
* @brief AuDeviceTreeInitialize -- initialize the device tree
* @param fdt_address -- device tree address passed by
@@ -294,4 +311,76 @@ void AuDeviceTreeMapMMIO() {
void* mmio = (void*)P2V((uint64_t)dtbAddress); //AuMapMMIO((uint64_t)dtbAddress, pageCount);
dtbAddress = mmio;
AuTextOut("[aurora]: Device tree mmio %x mapped with page count : %d \r\n",mmio, pageCount);
+}
+
+
+uint32_t* dump_recursive_(uint32_t* node, int depth);
+
+void AuDeviceTreeDumpAll() {
+ fdt_header_t* fdt = (fdt_header_t*)dtbAddress;
+ uint32_t* node = (uint32_t*)((uint64_t)dtbAddress + AuDTBSwap32(fdt->off_dt_struct));
+ dump_recursive_(node, 0);
+}
+
+uint32_t* dump_recursive_(uint32_t* node, int depth){
+ while (AuDTBSwap32(*node) == 4) node++;
+ if (AuDTBSwap32(*node) != 1) return node;
+ node++;
+
+ char* name = (char*)node;
+ for (int i = 0; i < depth; i++) AuTextOut(" ");
+ AuTextOut("[aurora]: node: \%s \r\n", name);
+
+ while ((*node & 0xFF000000) && (*node & 0xFF0000) && (*node & 0xFF00) && (*node & 0xFF)) node++;
+ node++;
+
+ while (1) {
+ while (AuDTBSwap32(*node) == 4)node++;
+ uint32_t tag = AuDTBSwap32(*node);
+ if (tag == 2) return node + 1;
+ if (tag == 9) return node;
+ if (tag == 3) {
+ uint32_t len = AuDTBSwap32(node[1]);
+ node += 3;
+ node += (len + 3) / 4;
+ }
+ else if (tag == 1) {
+ node = dump_recursive_(node, depth + 1);
+ }
+ else {
+ AuTextOut("[aurora]: UNKNOWN TAG %x at node %x - DESYNC \r\n", tag, (void*)node);
+ return node;
+ }
+ }
+}
+
+void AuDeviceTreeDumpAllProps(const char* node_name) {
+ uint32_t* node = AuDeviceTreeGetNode(node_name);
+ if (!node) {
+ AuTextOut("[aurora]: AuDeviceTreeDumpAllProps: no node found : %s \r\n", node_name);
+ return;
+ }
+
+ fdt_header_t* fdt = (fdt_header_t*)dtbAddress;
+ char* strings = (char*)((uint64_t)dtbAddress + AuDTBSwap32(fdt->off_dt_strings));
+
+ while ((*node & 0xFF000000) && (*node & 0xFF0000) && (*node & 0xFF00) && (*node & 0xFF)) node++;
+ node++;
+
+ AuTextOut("[aurora]: properties of \%s: \r\n", node_name);
+ while (1) {
+ while (AuDTBSwap32(*node) == 4) node++;
+ uint32_t tag = AuDTBSwap32(*node);
+ if (tag == 2 || tag == 9)break;
+ if (tag == 3) {
+ uint32_t len = AuDTBSwap32(node[1]);
+ uint32_t nameoff = AuDTBSwap32(node[2]);
+ AuTextOut("[aurora]: \%s\" (len=%d)\r\n", strings + nameoff, len);
+ node += 3;
+ node += (len + 3) / 4;
+ }
+ else {
+ break;
+ }
+ }
}
\ No newline at end of file
diff --git a/KernelAA64/hashmap.c b/KernelAA64/hashmap.c
index 5f31d165d..ba54df12c 100644
--- a/KernelAA64/hashmap.c
+++ b/KernelAA64/hashmap.c
@@ -136,14 +136,12 @@ void* AuHashmapSet(hashmap_t* map, const void* key, void* value) {
void* AuHashmapGet(hashmap_t* map, const void* key) {
unsigned int hash = map->hash_func(key) % map->size;
- UARTDebugOut("Hashget hash : %d \r\n", hash);
hashmap_entry_t* x = map->entries[hash];
if (!x) {
return NULL;
}
else {
do {
- UARTDebugOut("Hasmap hash key : %x \r\n", x->key);
if (map->hash_comp(x->key, key))
return x->value;
x = x->next;
diff --git a/KernelAA64/init.c b/KernelAA64/init.c
index 375a4ddd7..cb847e239 100644
--- a/KernelAA64/init.c
+++ b/KernelAA64/init.c
@@ -69,6 +69,8 @@
#include
#include
#include
+// #include
+#include
extern int _fltused = 1;
static bool _littleboot_used;
@@ -109,7 +111,6 @@ int i_ = 1;
extern void sub_rsp();
void AuEntryTest(uint64_t test) {
- //aa64_utest();
int c = 10;
//enable_irqs();
AuTextOut("[aurora]: test2 \r\n");
@@ -197,6 +198,7 @@ void _AuMain(KERNEL_BOOT_INFO* info) {
#endif
AuConsoleInitialize(info, true);
+ B_KLogInit();
AuDeviceTreeInitialize(info);
AA64CpuInitialize();
mask_irqs();
@@ -210,10 +212,11 @@ void _AuMain(KERNEL_BOOT_INFO* info) {
AA64CPUPostInitialize(info);
AuTextOut("Initializing VFS \r\n");
AuVFSInitialise();
- AuTextOut("[aurora]: VFS initialized \r\n");
AuInitrdInitialize(info);
AuConsolePostInitialise(info);
//AuConsoleBypassAuTextOut();
+
+
AuroraTimerInitialize();
/* initialize the tty service */
@@ -250,6 +253,7 @@ void _AuMain(KERNEL_BOOT_INFO* info) {
/* required virtio-mouse and keyboard */
//Here goes board pre driver initialize
AuDrvMngrInitialize(info);
+ UARTDebugOut("[aurora]: driver initialized \r\n");
FontManagerInitialise();
@@ -276,22 +280,21 @@ void _AuMain(KERNEL_BOOT_INFO* info) {
#endif
UARTDebugOut("[aurora]: starting xeneva (ARM64) please wait...\r\n");
-
/* clear out the lower half memory */
AuVmmngrBootFree();
+ UARTDebugOut("this");
AuMmngrFileCacheEnable();
UARTDebugOut("[aurora]: boot freed up \r\n");
AuSchedulerInitialize();
-
AuProcess* proc = AuCreateProcessSlot(0, "exec");
int num_args = 1;
- char* about = (char*)kmalloc(strlen("-about"));
+ char* about = (char*)kmalloc(strlen("-about") + 1);
strcpy(about, "-about");
char** argvs = (char**)kmalloc(num_args * sizeof(char*));
- memset(argvs, 0, num_args);
+ memset(argvs, 0, num_args * sizeof(char*));
argvs[0] = about;
/** make init process, as root of all */
@@ -302,7 +305,6 @@ void _AuMain(KERNEL_BOOT_INFO* info) {
#ifdef __KERNEL_PROFILER_ON__
PROFILE_END("_AuMain");
#endif
-
AuSchedulerStart();
while (1) {
//UARTDebugOut("Printing \n");
diff --git a/KernelAA64/loader.c b/KernelAA64/loader.c
index 8b4ac6356..676c75d8e 100644
--- a/KernelAA64/loader.c
+++ b/KernelAA64/loader.c
@@ -44,6 +44,7 @@
#include
#include <_null.h>
#include
+#include
#define LOADER_SCRATCH_VIRT 0xFFFFC00000700000
@@ -83,40 +84,61 @@ void testFunc(uint64_t x0, uint64_t x1) {
void AuProcessEntUser(uint64_t rcx) {
mask_irqs();
AA64Thread* t = AuGetCurrentThread();
+ t->start_time_us = AuGetCurrentUS();
AuUserEntry* uentry = t->uentry;
uentry->rsp -= 32;
PUSHALIGN(uentry->rsp, 16);
t->first_run = 1;
- /* do all arguments passing stuff, arguments
- * are passed as strings to stack
+
+ /*
+ * ARM64 ABI: argc and argv must be placed on the user stack so that
+ * crt0arm64.s can pop them via: ldp x0, x1, [sp], #16
+ *
+ * Step 1: Push each argument string onto the user stack (grow downward).
+ * Record the resulting user-space SP as argv[i] in the
+ * user-mapped argvaddr page.
+ * Step 2: Push argc and argv_ptr (argvaddr) onto the user stack.
+ * Step 3: Free kernel-side copies AFTER we have finished reading them.
*/
- char** argvs = (char**)uentry->argvaddr;
- for (int i = 0; i < uentry->num_args; i++) {
+ /* Step 1 — push strings and record user-space pointers */
+ char** argvs = (char**)uentry->argvkernel; /* kernel-accessible VA of argv[] page */
+ for (int i = uentry->num_args - 1; i >= 0; i--) {
char* str = uentry->argvs[i];
- for (int j = strlen(str); j >= 0; j--) {
+ int slen = strlen(str);
+ /* push null terminator first, then chars in reverse so string
+ * reads forward at lower address after push */
+ PUSH(uentry->rsp, char, '\0');
+ for (int j = slen - 1; j >= 0; j--) {
PUSH(uentry->rsp, char, str[j]);
}
+ /* record the user-space address of this string */
argvs[i] = (char*)uentry->rsp;
}
- /* I think this code should be placed in _KeProcessExit */
+ /* Step 2 — align, then push argv_ptr and argc */
+ PUSHALIGN(uentry->rsp, 16);
+ PUSH(uentry->rsp, size_t, (size_t)uentry->argvaddr); /* x1 = argv */
+ PUSH(uentry->rsp, size_t, (size_t)uentry->num_args); /* x0 = argc */
+ PUSHALIGN(uentry->rsp, 16);
+
+ /* Step 3 — free kernel-side argv copies (no longer needed) */
if (uentry->argvs) {
for (int i = 0; i < uentry->num_args; i++) {
- //uint64_t addr = (uint64_t)uentry->argvs[i];
kfree(uentry->argvs[i]);
}
- void* address = (void*)uentry->argvs;
- kfree(address);
+ kfree(uentry->argvs);
}
- PUSHALIGN(uentry->rsp, 16);
uentry->argvs = 0;
- PUSH(uentry->rsp, size_t, (size_t)uentry->argvaddr);
- PUSH(uentry->rsp, size_t, (size_t)uentry->num_args);
- PUSHALIGN(uentry->rsp, 16);
+
+ UARTDebugOut("[loader]: entering user: sp=%x entry=%x argc=%d argv=%x\r\n",
+ uentry->rsp, uentry->entrypoint, uentry->num_args, uentry->argvaddr);
+
+ uint64_t* check_sp = (uint64_t*)uentry->rsp;
+ UARTDebugOut("[loader]: stack check [0]: %x, [1]: %x\r\n", check_sp[0], check_sp[1]);
+
aa64_enter_user(uentry->rsp, uentry->entrypoint);
- while (1) {
- }
+ while (1) {}
}
/**
@@ -134,37 +156,42 @@ void AuLoaderMapExecFromCache(AuProcess* proc, AuMMFileBack *fb,PIMAGE_NT_HEADER
UARTDebugOut("Name : %s \r\n", fb->file->filename);
for (size_t i = 0; i < nt->FileHeader.NumberOfSections; ++i) {
size_t load_addr = _image_base_ + secthdr[i].VirtualAddress;
- void* sect_addr = (void*)load_addr;
- size_t sectsz = secthdr[i].VirtualSize;
- int req_pages = sectsz / 4096 +
- ((sectsz % 4096) ? 1 : 0);
- uint64_t* block = 0;
- int physFrameIndex = 0;
- size_t rawSize = secthdr[i].SizeOfRawData;
size_t virtSize = secthdr[i].VirtualSize;
+ size_t rawSize = secthdr[i].SizeOfRawData;
size_t fileOffset = secthdr[i].PointerToRawData;
- int page_index = fileOffset / PAGE_SIZE;
- AuMMPageCache* cache = AuMmngrFileCacheGetByIndex(fb, page_index);
- if (secthdr[i].Characteristics & IMAGE_SCN_MEM_WRITE) {
- for (int j = 0; j < req_pages; j++) {
- uint64_t alloc = (load_addr + j * 0x1000);
- uint64_t phys = P2V((size_t)AuPmmngrAlloc());
- AuMapPageEx(proc->cr3, V2P(phys), alloc, PTE_USER_EXECUTABLE | PTE_AP_RW_USER | PTE_NORMAL_MEM);
- if (!block)
- block = (uint64_t*)phys;
- memcpy(phys, (void*)P2V(cache->physicalPage), PAGE_SIZE);
- physFrameIndex++;
- cache = cache->next;
+
+ /* Ensure all pages for this section's virtual address range are mapped */
+ size_t end_addr = load_addr + virtSize;
+ for (size_t v_page = (load_addr & ~0xFFFULL); v_page < end_addr; v_page += PAGE_SIZE) {
+ void* phys = AuGetPhysicalAddressEx(proc->cr3, v_page);
+ if (!phys) {
+ phys = AuPmmngrAlloc();
+ memset((void*)P2V((size_t)phys), 0, PAGE_SIZE);
+ AuMapPageEx(proc->cr3, (uint64_t)phys, v_page, PTE_USER_EXECUTABLE | PTE_AP_RW_USER | PTE_NORMAL_MEM);
}
}
- else {
- for (int j = 0; j < req_pages; j++) {
- uint64_t alloc = (load_addr + j * 0x1000);
- uint64_t phys = cache->physicalPage; //P2V((size_t)AuPmmngrAlloc());
- AuMapPageEx(proc->cr3, phys, alloc, PTE_USER_EXECUTABLE | PTE_AP_RW_USER | PTE_NORMAL_MEM);
- physFrameIndex++;
- cache = cache->next;
+
+ /* Copy data from the scratch buffer to the mapped pages, handling boundaries */
+ size_t bytes_to_copy = rawSize;
+ size_t current_vaddr = load_addr;
+ size_t current_file_offset = fileOffset;
+ while (bytes_to_copy > 0) {
+ size_t page_offset = current_vaddr & 0xFFF;
+ size_t bytes_in_this_page = PAGE_SIZE - page_offset;
+ if (bytes_in_this_page > bytes_to_copy) {
+ bytes_in_this_page = bytes_to_copy;
+ }
+
+ void* phys = AuGetPhysicalAddressEx(proc->cr3, current_vaddr);
+ if (phys) {
+ void* dest = (void*)(P2V((size_t)phys) + page_offset);
+ void* src = (void*)((uint64_t)_ldr_scratchBuffer + current_file_offset);
+ memcpy(dest, src, bytes_in_this_page);
}
+
+ current_vaddr += bytes_in_this_page;
+ current_file_offset += bytes_in_this_page;
+ bytes_to_copy -= bytes_in_this_page;
}
}
}
@@ -230,7 +257,7 @@ int AuLoadExecToProcess(AuProcess* proc, char* filename, int argc, char** argv)
size_t file_offset = 0;
while (file->eof != 1) {
uint64_t block = ((uint64_t)_ldr_scratchBuffer + file_offset);
- size_t bytes_read = AuVFSNodeReadBlock(fsys, file, block);
+ size_t bytes_read = AuVFSNodeReadBlock(fsys, file, (uint64_t*)block);
if (bytes_read == 0) break;
file_offset += bytes_read;
}
@@ -248,14 +275,14 @@ int AuLoadExecToProcess(AuProcess* proc, char* filename, int argc, char** argv)
size_t copy_sz = PAGE_SIZE;
if (i == total_pages - 1 && (file_offset % PAGE_SIZE) != 0)
copy_sz = file_offset % PAGE_SIZE;
- memcpy(P2V(physcache), (void*)((uint64_t)_ldr_scratchBuffer + i * PAGE_SIZE), copy_sz);
+ memcpy((void*)P2V(physcache), (void*)((uint64_t)_ldr_scratchBuffer + i * PAGE_SIZE), copy_sz);
}
fb->readComplete = true;
} else {
AuMMPageCache* pcache = fb->pageCache;
size_t file_offset = 0;
while (pcache != NULL) {
- memcpy((void*)((uint64_t)_ldr_scratchBuffer + file_offset), P2V(pcache->physicalPage), PAGE_SIZE);
+ memcpy((void*)((uint64_t)_ldr_scratchBuffer + file_offset), (void*)P2V(pcache->physicalPage), PAGE_SIZE);
file_offset += PAGE_SIZE;
pcache = pcache->next;
}
@@ -267,7 +294,7 @@ int AuLoadExecToProcess(AuProcess* proc, char* filename, int argc, char** argv)
PIMAGE_NT_HEADERS nt = RAW_OFFSET(PIMAGE_NT_HEADERS,dos, dos->e_lfanew);
PSECTION_HEADER secthdr = RAW_OFFSET(PSECTION_HEADER,&nt->OptionalHeader, nt->FileHeader.SizeOfOptionaHeader);
- uint64_t _image_base_ = 0x60000000000;// nt->OptionalHeader.ImageBase;
+ uint64_t _image_base_ = 0x600000000;// nt->OptionalHeader.ImageBase;
entry ent = (entry)(nt->OptionalHeader.AddressOfEntryPoint + _image_base_);//nt->OptionalHeader.ImageBase);
//AuTextOut("Image base address : %x \n", dos->e_magic);
uint64_t* cr3 = proc->cr3;
@@ -344,23 +371,28 @@ int AuLoadExecToProcess(AuProcess* proc, char* filename, int argc, char** argv)
uentry->stackBase = proc->_main_stack_;
int num_args = argc;
uint64_t argvaddr = 0;
+ uint64_t argvkernel = 0;
if (num_args) {
/* Allocate a memory for passing arguments */
uint64_t* args = (uint64_t*)P2V((size_t)AuPmmngrAlloc());
memset(args, 0, PAGE_SIZE);
- if (!AuMapPageEx(proc->cr3, (size_t)V2P((uint64_t)args), 0x40000000000,PTE_AP_RW_USER | PTE_NORMAL_MEM)) {
+ if (!AuMapPageEx(proc->cr3, (size_t)V2P((uint64_t)args), 0x40000000000, PTE_AP_RW_USER | PTE_NORMAL_MEM)) {
UARTDebugOut("Arguments address already mapped \n");
argvaddr = 0;
+ argvkernel = 0;
}
else {
- argvaddr = 0x40000000000;
+ argvaddr = 0x40000000000; /* user-space VA for crt0 */
+ argvkernel = (uint64_t)args; /* kernel-space VA for AuProcessEntUser to write */
}
}
uentry->argvaddr = argvaddr;
+ uentry->argvkernel = argvkernel;
uentry->num_args = num_args;
uentry->argvs = argv;
thr->uentry = uentry;
proc->main_thread = thr;
+ thr->procSlot = proc;
file->current = file->first_block;
file->eof = 0;
#ifdef __KERNEL_PROFILER_ON__
diff --git a/KernelAA64/pcie.c b/KernelAA64/pcie.c
index 344a3a9ac..c8cd6b7e1 100644
--- a/KernelAA64/pcie.c
+++ b/KernelAA64/pcie.c
@@ -55,7 +55,7 @@ static int _pcie_check_and_map_dtb() {
return 1;
}
AuTextOut("[aurora]: pcie found \r\n");
-#ifdef __TARGET_BOARD_QEMU_VIRT__
+#ifdef __TARGET_BOARD_QEMU_VIRT__
/* else need to parse the DTB for */
uint32_t addressCell = AuDeviceTreeGetAddressCells(pcie);
uint32_t sizeCell = AuDeviceTreeGetSizeCells(pcie);
@@ -65,9 +65,11 @@ static int _pcie_check_and_map_dtb() {
AuTextOut("[aurora]: ecam address : %x, size value : %x \n", ecamAddr, sizeValue);
/** in qemu, ecam address is 256 mb so 0x10000 number of pages */
- _ecamAddress = AuMapMMIO(ecamAddr, 0x10000);
-#endif
+ if (ecamAddr != 0)
+ _ecamAddress = (uint64_t)AuMapMMIO(ecamAddr, 0x10000);
+
_pcieInitialized = 1;
+#endif
return 0;
}
@@ -127,7 +129,6 @@ void AA64PCIeInitialize() {
AuTextOut("[aurora]: Ki koriba aru !! Eku dekhun device discovery mechanism support nokore !! Baad diya \r\n");
AuTextOut("[aurora]: Ponta Bhaat khuwa ge \r\n");
_pcieInitialized = 0;
- for (;;);
return;
}
@@ -250,15 +251,15 @@ uint32_t AuPCIERead(uint64_t device, int reg, int bus, int dev, int func) {
break;
}
if (size == 1) {
- result = *RAW_OFFSET(volatile uint8_t*, device, reg);
+ result = *RAW_OFFSET(volatile uint8_t*, device, ®);
return result;
}
else if (size == 2) {
- result = *RAW_OFFSET(volatile uint16_t*, device, reg);
+ result = *RAW_OFFSET(volatile uint16_t*, device, ®);
return result;
}
else if (size == 4) {
- result = *RAW_OFFSET(volatile uint32_t*,device, reg);
+ result = *RAW_OFFSET(volatile uint32_t*,device, ®);
return result;
}
diff --git a/KernelAA64/pe.c b/KernelAA64/pe.c
index f3d7283c7..a7e2786ee 100644
--- a/KernelAA64/pe.c
+++ b/KernelAA64/pe.c
@@ -34,6 +34,11 @@
#include
#include
#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
#include
#define IMAGE_DOS_SIGNATURE 0x5A4D
@@ -364,4 +369,5 @@ bool AuCoffResolveAddress(uint8_t* imageBase, uint64_t paddr) {
else
UARTDebugOut("[aurora]: pe symbol , offset : %x \r\n", rva);
+ return 1;
}
\ No newline at end of file
diff --git a/KernelAA64/power.c b/KernelAA64/power.c
index a513ef1fa..3ed00952e 100644
--- a/KernelAA64/power.c
+++ b/KernelAA64/power.c
@@ -83,6 +83,9 @@ int AuPowerDown() {
tlb_flush_vmalle1is();
AuAA64BoardPowerDown();
+
+ //false here
+ return 1;
}
/**
diff --git a/KernelAA64/process.c b/KernelAA64/process.c
index 962e5e62e..b87ac5499 100644
--- a/KernelAA64/process.c
+++ b/KernelAA64/process.c
@@ -29,20 +29,30 @@
*
**/
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
#include
#include
#include
#include
#include
+#include
#include
#include
#include <_null.h>
#include
+#include
#include
#include
#include
#include
#include
+#include
+#include
+#include
static int pid = 1;
@@ -245,6 +255,8 @@ AuProcess * AuCreateProcessSlot(AuProcess * parent, char* name) {
proc->proc_heapmem_len = 0;
proc->_kstack_index_ = 1;
proc->_main_stack_ = main_thr_stack;
+ proc->prev_sample_time_us = AuGetCurrentUS();
+ proc->prev_sample_runtime_us = 0;
uint64_t* envpBlock = (uint64_t*)P2V((size_t)AuPmmngrAlloc());
memset(envpBlock, 0, PAGE_SIZE);
@@ -308,9 +320,7 @@ int AuCreateUserthread(AuProcess* proc, void(*entry) (), char* name)
uint64_t kstack = stack;
stack = ((uint64_t)kstack & ~(uint64_t)0xF);
stack -= 64;
- UARTDebugOut("User stack created %x \r\n", stack);
AA64Thread* thr = AuCreateSubKthread(AuProcessEntUser,stack,proc->cr3, name);
- UARTDebugOut("[aurora]: user thread created \r\n");
thr->threadType = THREAD_LEVEL_USER;
thr->first_run = 0;
thr->procSlot = proc;
@@ -320,9 +330,7 @@ int AuCreateUserthread(AuProcess* proc, void(*entry) (), char* name)
uentry->entrypoint = (uint64_t)entry;
uentry->argvs = 0;
uentry->num_args = 0;
- UARTDebugOut("[aurora]: creating user stack for user thread cr3 : %x %x\r\n",proc->cr3, V2P((uint64_t)thr->pml));
uentry->rsp = (uint64_t)CreateSubUserStack(proc, proc->cr3);
- UARTDebugOut("[aurora]:User stack created : %x main_stack : %x \r\n", uentry->rsp, proc->_main_stack_);
uentry->stackBase = uentry->rsp;
thr->uentry = uentry;
int thread_indx = proc->num_thread;
@@ -407,6 +415,7 @@ void AuProcessExit(AuProcess* proc, bool schedulable) {
}
/** free up all allocated files by this process **/
+ BordoisilaCapCleanupProcess(proc);
for (int i = 0; i < FILE_DESC_PER_PROCESS; i++) {
AuVFSNode* file = proc->fds[i];
if (file) {
@@ -487,7 +496,7 @@ AuProcess* AuGetKillableProcess() {
* @param pid -- pid of the process, if -1 then any child
* process
*/
-void AuProcessWaitForTermination(AuProcess* proc, int pid) {
+int AuProcessWaitForTermination(AuProcess* proc, int pid) {
if (pid == -1) {
do {
AuProcess* killable = AuGetKillableProcess();
@@ -499,19 +508,105 @@ void AuProcessWaitForTermination(AuProcess* proc, int pid) {
if (!killable) {
- AuSleepThread(proc->main_thread, 10);
proc->state = PROCESS_STATE_SUSPENDED;
- return;
+ //AuScheduleNext();
+ return -1;
}
} while (1);
}
else {
AuProcess* proc = AuProcessFindByPID(0, pid);
if (!proc)
- return;
+ return -1;
AA64Thread* thr = AuGetCurrentThread();
AuBlockThread(thr);
list_add(proc->waitlist, thr);
- return;
+ return 1;
+ }
+ return 0;
+}
+
+/**
+ * @brief AuProcGetNumProcessCount -- returns the total number
+ * of process created
+ */
+int AuProcGetNumProcessCount() {
+ int count = 0;
+ for (AuProcess* first = proc_first; first != NULL; first = first->next)
+ count++;
+ return count;
+}
+
+static int AuProcGetOpenFileCount(AuProcess* proc) {
+ int count = 0;
+ for (int i = 0; i < FILE_DESC_PER_PROCESS; i++) {
+ if (!proc->fds[i])
+ continue;
+
+ count += 1;
}
+ return count;
+}
+
+static uint64_t AuProcessGetLiveRuntime(AuProcess* proc, uint64_t now_us) {
+ uint64_t runtime = proc->total_runtime_us;
+ if (proc->main_thread->state == THREAD_STATE_RUNNING)
+ runtime += (now_us - proc->main_thread->start_time_us);
+ for (int i = 0; i < proc->num_thread; i++) {
+ AA64Thread* thr = proc->threads[i];
+ if (!thr)
+ continue;
+ if (thr->state == THREAD_STATE_RUNNING)
+ runtime += (now_us - thr->start_time_us);
+
+ }
+ return runtime;
+}
+
+
+static uint32_t AuProcessUpdateCPUPercent(AuProcess* proc, uint64_t now) {
+ uint64_t live_runtime = AuProcessGetLiveRuntime(proc, now);
+
+ uint64_t runtime_delta = live_runtime - proc->prev_sample_runtime_us;
+ uint64_t time_delta = now - proc->prev_sample_time_us;
+
+ if (time_delta == 0)
+ proc->cpu_usage = 0;
+ else
+ proc->cpu_usage = (uint32_t)((runtime_delta * 1000) / time_delta);// * num_cores );
+
+ proc->prev_sample_runtime_us = live_runtime;
+ proc->prev_sample_time_us = now;
+ return proc->cpu_usage;
+}
+/**
+ * @brief AuProcessFetch -- fetch current process table
+ * status
+ * @param list -- Pointer to AuProcessList
+ * @param num_proc_count -- number of process count
+ */
+int AuProcessFetch(AuProcessList* list, int num_proc_count) {
+
+ AuProcess* first = proc_first;
+ uint64_t now = AuGetCurrentUS();
+
+ for (int i = 0; i < num_proc_count; i++) {
+ if (!first)
+ break;
+ size_t namelen = strlen(first->name);
+ if (namelen >= sizeof(list[i].name))
+ namelen = sizeof(list[i].name) - 1;
+ memcpy(list[i].name, first->name, namelen);
+ list[i].name[namelen] = '\0';
+ list[i].num_file_opened = AuProcGetOpenFileCount(first);
+ list[i].num_threads = first->num_thread;
+ list[i].proc_id = first->proc_id;
+ list[i].total_runtime_us = first->total_runtime_us;
+ list[i].window_runtime_us = first->window_runtime_us;
+ first->cpu_usage = AuProcessUpdateCPUPercent(first, now);
+ list[i].cpu_usage = first->cpu_usage;
+ first = first->next;
+ }
+
+ return 0;
}
\ No newline at end of file
diff --git a/KernelAA64/signal.c b/KernelAA64/signal.c
new file mode 100644
index 000000000..cd123b89d
--- /dev/null
+++ b/KernelAA64/signal.c
@@ -0,0 +1,126 @@
+/**
+* BSD 2-Clause License
+*
+* Copyright (c) 2022-2026, Manas Kamal Choudhury
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**/
+
+#include
+#include
+#include
+#include
+#include
+#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
+
+
+extern void aa64_signal_return();
+/**
+ * @brief AuAllocSignal -- allocate a signal for destination
+ * thread
+ * @param thr -- destination thread
+ * @param signum -- signal number
+ */
+int AuAllocSignal(AA64Thread* thr, int signum) {
+ if (!thr)
+ return 1;
+
+ if (signum <= 0)
+ return 1;
+
+ if (signum > SIGTTOU)
+ return 1;
+
+ /* check if all tokens are sold out !!*/
+
+ /** let's go with standard posix signal **/
+ thr->sig_pending |= (1UL << signum);
+
+ AuThreadMakeReady(thr);
+ return 0;
+}
+
+static inline int ctzl(uint64_t x) {
+ if (x == 0) return 64;
+ int n = 0;
+ while (!(x & 1UL)) {
+ x >>= 1;
+ n++;
+ }
+ return n;
+}
+/**
+ * @brief AuSignalDispatch -- dispatch a signal
+ * @param thr -- pointer to thread
+ */
+int AuSignalDispatch(AA64Thread* thr) {
+ //lock here
+ int result = 0;
+ uint64_t deliverable = thr->sig_pending;
+ if (deliverable) {
+ int signo = ctzl(deliverable);
+ thr->sig_pending &= ~(1UL << signo);
+ result = signo;
+ }
+ //unlock here
+ //UARTDebugOut("SignalDispatch sig number : %d \r\n", result);
+ return result;
+}
+
+/**
+ * @brief AuSignalDeliver -- deliver the current thread's
+ * signal
+ * @param current_thread -- pointer to thread
+ */
+bool AuSignalDeliver(AA64Thread* current_thread) {
+ int signo;
+ while ((signo = AuSignalDispatch(current_thread)) != 0) {
+ if (signo > SIGHUP || signo < SIGTTOU) {
+ AA64Registers* regs_ = (AA64Registers*)current_thread->sp;
+ memcpy(¤t_thread->signal.regs, regs_, sizeof(AA64Registers));
+ current_thread->signal.elr_el1 = current_thread->elr_el1;
+ current_thread->elr_el1 = (uint64_t)current_thread->sigs[signo];
+ regs_->x30 = current_thread->signal.sigret_address;
+ return true;
+ }
+ }
+ return false;
+}
+
+/**
+ * @brief AuSignalInitializeTrampoline -- installs
+ * return trampoline code to threads sig return address
+ * @param t -- pointer to thread struct
+ */
+void AuSignalInitializeTrampoline(AA64Thread* t) {
+ uint64_t* phys = (uint64_t*)P2V((uint64_t)AuPmmngrAlloc());
+ memcpy(phys, &aa64_signal_return, PAGE_SIZE);
+ AuMapPageEx((uint64_t*)t->pml, V2P((uint64_t)phys), 0xD0000000, PTE_USER_EXECUTABLE | PTE_NORMAL_MEM | PTE_AP_RW_USER);
+ t->signal.sigret_address = 0xD0000000;
+}
diff --git a/KernelAA64/stack.c b/KernelAA64/stack.c
index 78687f2c7..486cbe4f6 100644
--- a/KernelAA64/stack.c
+++ b/KernelAA64/stack.c
@@ -33,6 +33,7 @@
#include
#include
#include <_null.h>
+#include
/**
* @brief AuStackCreate -- create a new stack
@@ -51,8 +52,14 @@ AuStack* AuStackCreate() {
void AuStackPush(AuStack* stack, void* data) {
AuStackItem* newItem = (AuStackItem*)kmalloc(sizeof(AuStackItem));
newItem->data = data;
- newItem->link = stack->top;
- stack->top = newItem;
+ newItem->link = NULL;
+
+ if (stack->bottom)
+ stack->bottom->link = newItem;
+ else
+ stack->top = newItem;
+
+ stack->bottom = newItem;
stack->itemCount += 1;
}
@@ -64,12 +71,15 @@ void* AuStackPop(AuStack* stack) {
void* data = NULL;
if (!stack->top)
return NULL;
+ UARTDebugOut("Stack Pop here \r\n");
AuStackItem* si;
si = stack->top;
- stack->top = stack->top->link;
+ stack->top = si->link;
+ if (!stack->top)
+ stack->bottom = NULL;
si->link = NULL;
+ stack->itemCount--;
data = si->data;
kfree(si);
- stack->itemCount--;
return data;
}
\ No newline at end of file
diff --git a/KernelAA64/string.c b/KernelAA64/string.c
index 649e44875..4bb82866a 100644
--- a/KernelAA64/string.c
+++ b/KernelAA64/string.c
@@ -5,6 +5,7 @@
#include <_null.h>
#include
#include
+#include
#define MAX_STRING_LENGTH 4095
@@ -12,7 +13,8 @@ typedef size_t WT;
#define WS (sizeof(WT))
-void memset(void* targ, int val, uint32_t len) {
+
+void memset(void* targ, int val, uint32_t len) {
/*uint8_t* t = (uint8_t*)targ;
while (len--)
*t++ = (unsigned char*)val;*/
@@ -45,6 +47,7 @@ void memset(void* targ, int val, uint32_t len) {
*t++ = byte_val;
}
+
int memcmp(const void* first, const void* second, size_t length) {
size_t count;
for (count = 0; count < length; count++)
@@ -66,10 +69,11 @@ int memcmp(const void* first, const void* second, size_t length) {
}
-void memcpy(void* __restrict dest, void* __restrict src, size_t len) {
+void* memcpy(void* __restrict dest, void* __restrict src, size_t len) {
//_fastcpy(dest, src, count);
- //uint8_t* t = (uint8_t*)dest;
- //uint8_t* s = (uint8_t*)src;
+
+ //volatile uint8_t* t = (volatile uint8_t*)dest;
+ //const volatile uint8_t* s = (const volatile uint8_t*)src;
//if (len > 0) {
// // check to see if target is in the range of src and if so, do a memmove() instead
// if ((t > s) && (t < (s + len))) {
@@ -83,10 +87,10 @@ void memcpy(void* __restrict dest, void* __restrict src, size_t len) {
// *t++ = *s++;
// }
//}
- uint8_t* t = (uint8_t*)dest;
- const uint8_t* s = (const uint8_t*)src;
+ volatile uint8_t* t = (volatile uint8_t*)dest;
+ const volatile uint8_t* s = (const volatile uint8_t*)src;
- if (len == 0 || dest == src) return;
+ if (len == 0 || dest == src) return NULL;
if ((t > s) && (t < (s + len))) {
t += len;
@@ -99,8 +103,8 @@ void memcpy(void* __restrict dest, void* __restrict src, size_t len) {
if (len >= 8) {
uint32_t blocks = len / 8;
- uint64_t* t64 = (uint64_t*)t;
- const uint64_t* s64 = (const uint64_t*)s;
+ volatile uint64_t* t64 = (volatile uint64_t*)t;
+ const volatile uint64_t* s64 = (const volatile uint64_t*)s;
while (blocks--)
*(--t64) = *(--s64);
@@ -122,8 +126,8 @@ void memcpy(void* __restrict dest, void* __restrict src, size_t len) {
if (len >= 8) {
uint32_t blocks = len / 8;
- uint64_t* t64 = (uint64_t*)t;
- const uint64_t* s64 = (const uint64_t*)s;
+ volatile uint64_t* t64 = (volatile uint64_t*)t;
+ const volatile uint64_t* s64 = (const volatile uint64_t*)s;
while (blocks--)
*t64++ = *s64++;
@@ -165,6 +169,17 @@ char* strcpy(char* __restrict s1, const char* __restrict s2)
return s1_p;
}
+char* strrchr(const char* str, int c) {
+ const char* last = NULL;
+
+ do {
+ if (*str == (char)c) {
+ last = str;
+ }
+ } while (*str++ != '\0');
+ return (char*)last;
+}
+
size_t strlen(const char* s) {
const char* a = s;
@@ -254,6 +269,7 @@ char* strcat(char* destString, const char* sourceString)
return (destString);
}
+
char* strncat(char* destString, const char* sourceString, size_t maxLength)
{
unsigned count1, count2;
diff --git a/KernelAA64/timer.c b/KernelAA64/timer.c
index 70238c667..f8e9feeca 100644
--- a/KernelAA64/timer.c
+++ b/KernelAA64/timer.c
@@ -34,10 +34,18 @@
#include
#include
#include
+#include <_null.h>
+#include
+#if defined(__GNUC__) || defined(__clang__)
+#ifndef __cplusplus
+#include
+#endif
+#endif
static AuKernelTimer _timers[AURORA_MAX_TIMER];
static uint64_t _system_current_us;
static uint64_t _system_current_ms;
+static void AuWalltimeUpdate();
static inline uint64_t _get_current_us() {
uint64_t cnt = get_cntpct_el0();
@@ -49,6 +57,16 @@ static inline uint64_t _get_current_ms() {
return _get_current_us() / 1000;
}
+typedef struct _clock_state_ {
+ uint64_t cycle_last;
+ uint64_t mult;
+ uint32_t shift;
+ int64_t wall_sec;
+ int64_t wall_nsec;
+}AuClockState;
+
+static AuClockState wallClock;
+
/**
* @brief AuroraTimerInitialize -- initialize aurora
* timer
@@ -58,6 +76,8 @@ void AuroraTimerInitialize() {
memset(&_timers[i], 0, sizeof(AuKernelTimer));
_system_current_us = 0;
_system_current_ms = 0;
+ wallClock.shift = 32;
+ wallClock.mult = ((uint64_t)1000000000ULL << wallClock.shift) / (AA64CPUGetFreqencyHz() * 10000);
}
/**
@@ -143,6 +163,9 @@ void AuroraTimerTick() {
_system_current_us = now;
_system_current_ms = _get_current_ms();
+ //update the wall time
+ AuWalltimeUpdate();
+
for (int i = 0; i < AURORA_MAX_TIMER; i++) {
if (!_timers[i].active) continue;
if (now < _timers[i].expireUS) continue;
@@ -168,3 +191,203 @@ uint64_t AuGetCurrentUS() {
return _system_current_us;
}
+void __kernel_timer_alarm_callback(void* param) {
+ AA64Thread* thr = (AA64Thread*)param;
+ AuAllocSignal(thr, SIGALRM);
+}
+
+/**
+ * @brief AuTimerCalculateAlarm -- schedule a timer to one-shot mode
+ * respective to given seconds
+ * @param thr -- pointer to thread which requires one-shot timer
+ * @param seconds -- amount of second to wait
+ */
+int AuTimerCalculateAlarm(AA64Thread* thr, uint64_t seconds) {
+ uint64_t now = _get_current_us();
+ int remaining_sec = 0;
+
+ int existing_idx = -1;
+ for (int i = 0; i < AURORA_MAX_TIMER; i++) {
+ if (_timers[i].active && _timers[i].owner == thr &&
+ _timers[i].handler == __kernel_timer_alarm_callback) {
+ existing_idx = i;
+ break;
+ }
+ }
+
+ if(existing_idx != -1) {
+ if (_timers[existing_idx].expireUS > now) {
+ uint64_t remaining_us = _timers[existing_idx].expireUS - now;
+ remaining_sec = (remaining_us + 999999) / 1000000;
+ }
+ _timers[existing_idx].active = 0;
+ _timers[existing_idx].owner = NULL;
+ }
+
+ if (seconds == 0)
+ return remaining_sec;
+
+ int free_idx = -1;
+ for (int i = 0; i < AURORA_MAX_TIMER; i++) {
+ if (!_timers[i].active) {
+ free_idx = i;
+ break;
+ }
+ }
+
+ if (free_idx == -1)
+ return remaining_sec;
+
+ _timers[free_idx].expireUS = now + (seconds * 1000000ULL);
+ _timers[free_idx].intervalUS = 0;
+ _timers[free_idx].handler = __kernel_timer_alarm_callback;
+ _timers[free_idx].param = (void*)thr;
+ _timers[free_idx].owner = thr;
+ _timers[free_idx].active = 1;
+
+ return remaining_sec;
+}
+
+
+static inline uint64_t _timeval_to_us(const timeval_t* tv) {
+ return (uint64_t)tv->tv_sec * 1000000ULL;
+}
+
+static inline uint64_t _us_to_timeval(uint64_t us, timeval_t* tv) {
+ tv->tv_sec = us / 1000000ULL;
+ tv->tv_usec = us % 1000000ULL;
+ return 0;
+}
+
+#define ITIMER_REAL 0
+#define ITIMER_VIRTUAL 1
+#define ITIMER_PROF 2
+
+/**
+ *@brief AuTimerSetITimer -- posix standard implementation of
+ * setting periodic timer
+ */
+int AuTimerSetITimer(AA64Thread* thr, int which, const itimerval_t* newval, itimerval_t* oldval) {
+ if (which != ITIMER_REAL)
+ return -1;
+
+ uint64_t now = _get_current_us();
+
+ int idx = -1;
+ for (int i = 0; i < AURORA_MAX_TIMER; i++) {
+ if (_timers[i].active && _timers[i].owner == thr &&
+ _timers[i].handler == __kernel_timer_alarm_callback) {
+ idx = i;
+ break;
+ }
+ }
+
+ if (oldval) {
+ if (idx != -1 && _timers[idx].expireUS > now) {
+ _us_to_timeval(_timers[idx].expireUS - now, &oldval->it_value);
+ }
+ else {
+ oldval->it_value.tv_sec = 0;
+ oldval->it_value.tv_usec = 0;
+ }
+ _us_to_timeval(_timers[idx != -1 ? idx : 0].intervalUS, &oldval->it_interval);
+ if (idx == -1) {
+ oldval->it_interval.tv_sec = 0;
+ oldval->it_interval.tv_usec = 0;
+ }
+ }
+
+ uint64_t new_value_us = newval ? _timeval_to_us(&newval->it_value) : 0;
+ uint64_t new_interval_us = newval ? _timeval_to_us(&newval->it_interval) : 0;
+
+ if (new_value_us == 0) {
+ if (idx != -1) {
+ _timers[idx].active = 0;
+ _timers[idx].owner = NULL;
+ }
+ return 0;
+ }
+
+ if (idx == -1) {
+ for (int i = 0; i < AURORA_MAX_TIMER; i++) {
+ if (!_timers[i].active) {
+ idx = i;
+ break;
+ }
+ }
+ if (idx == -1)
+ return -1;
+ }
+ UARTDebugOut("Seting kernel timer : %d \r\n", idx);
+ _timers[idx].expireUS = now + new_value_us;
+ _timers[idx].intervalUS = new_interval_us;
+ _timers[idx].handler = __kernel_timer_alarm_callback;
+ _timers[idx].param = (void*)thr;
+ _timers[idx].owner = thr;
+ _timers[idx].active = 1;
+
+ return 0;
+}
+
+int AuTimerGetITimer(AA64Thread* thr, int which, itimerval_t* curr_value) {
+ if(which != ITIMER_REAL) return -1;
+ if (!curr_value) return -1;
+ uint64_t now = _get_current_us();
+
+ for (int i = 0; i < AURORA_MAX_TIMER; i++) {
+ if (_timers[i].active && _timers[i].owner == thr &&
+ _timers[i].handler == __kernel_timer_alarm_callback) {
+ uint64_t remaining = (_timers[i].expireUS > now) ? (_timers[i].expireUS - now) : 0;
+ _us_to_timeval(remaining, &curr_value->it_value);
+ _us_to_timeval(_timers[i].intervalUS, &curr_value->it_interval);
+ return 0;
+ }
+ }
+
+ curr_value->it_value.tv_sec = curr_value->it_value.tv_usec = 0;
+ curr_value->it_interval.tv_sec = curr_value->it_interval.tv_usec = 0;
+ return 0;
+}
+
+void AuSetWalltime(int64_t sec, int64_t nsec) {
+ //lock
+ /** need credential verifications too, for security **/
+ wallClock.cycle_last = get_cntpct_el0();
+ wallClock.wall_sec = sec;
+ wallClock.wall_nsec = nsec;
+}
+
+
+void AuGetWalltime(int64_t* out_sec, int64_t* out_ns) {
+ /** need credential verifications too, for security **/
+
+ uint64_t now = get_cntpct_el0();
+ uint64_t delta_cycles = now - wallClock.cycle_last;
+ uint64_t delta_ns = (delta_cycles * wallClock.mult) >> wallClock.shift;
+
+ int64_t sec = wallClock.wall_sec;
+ int64_t nsec = wallClock.wall_nsec + (int64_t)delta_ns;
+
+ sec += nsec / 1000000000LL;
+ nsec %= 1000000000LL;
+
+ *out_sec = sec;
+ *out_ns = nsec;
+}
+
+static void AuWalltimeUpdate() {
+ //lock
+ uint64_t now = get_cntpct_el0();
+ uint64_t delta_cycles = now - wallClock.cycle_last;
+ uint64_t delta_ns = (delta_cycles * wallClock.mult) >> wallClock.shift;
+
+ wallClock.wall_nsec += (int64_t)delta_ns;
+ if (wallClock.wall_nsec >= 10000000000LL) {
+ wallClock.wall_sec += wallClock.wall_nsec / 1000000000LL;
+ wallClock.wall_nsec %= 1000000000LL;
+ }
+
+ wallClock.cycle_last = now;
+ //lock release
+}
+
diff --git a/Libs/Chitralekha/Chitralekha.vcxproj b/Libs/Chitralekha/Chitralekha.vcxproj
index eea66101d..8ac1a2eb4 100644
--- a/Libs/Chitralekha/Chitralekha.vcxproj
+++ b/Libs/Chitralekha/Chitralekha.vcxproj
@@ -1,4 +1,4 @@
-
+
@@ -65,10 +65,10 @@
MultiByte
- Application
+ DynamicLibraryfalse
- v120
- true
+ v142
+ falseMultiByte
@@ -104,6 +104,10 @@
falsechlkha
+
+ chlkha
+ false
+ Level3
@@ -153,13 +157,13 @@
/ALIGN:512 %(AdditionalOptions)
-