Commit graph

245 commits

Author SHA1 Message Date
Ronald Caesar
e2459f5392
temp commit
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-19 00:35:50 -04:00
Ronald Caesar
2e2b5df20c
Merge branch 'ramenrrami-arm64' into arm64 2025-10-17 21:32:33 -04:00
ramenrrami
aff8491a19
jit: inline ARM32 instruction logging and remove redundant traces 2025-10-17 21:28:07 -04:00
ramenrrami
15938b667b
jit: add detailed logging for ARM32 instruction registration 2025-10-17 21:23:34 -04:00
Ronald Caesar
9341e8d4ee
Merge remote-tracking branch 'Xphalnos/arm64' into arm64
Made freeing memory from our arena allocator safer. Replaced free() with munmap().
2025-10-17 17:13:47 -04:00
Ronald Caesar
194b15b556
host: add assertions
Munmap can fail if the length argument is 0, and the address being freed
is not a multiple of the host's page size.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-17 16:28:02 -04:00
Xphalnos
51e7adcbee Replace free() by munmap()
Signed-off-by: Xphalnos <yiga.steam@gmail.com>
2025-10-16 08:16:32 +02:00
Ronald Caesar
7aac83b2f2
jit: Add more foundational code
Strengthens the decoder's foundation but does not yet implement the core
instruction lookup table logic or the public arm32_decode API. These
will be addressed in future patches.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-12 21:51:24 -04:00
OwnedByWuigi
09da076aaf
Update to macOS 15-intel ahead of macOS 13's depreciation
Signed-off-by: OwnedByWuigi <120682622+OwnedByWuigi@users.noreply.github.com>
2025-10-10 12:40:37 +01:00
Ronald Caesar
b96c58c71a
Merge branch 'Xphalnos-arm64' into arm64
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-08 16:39:17 -04:00
Xphalnos
8c40261fee Revert SDL3 Submodule Update 2025-10-08 13:45:49 +02:00
GloriousTacoo
078af2f528
Merge branch 'arm64' into arm64 2025-10-07 16:25:11 -04:00
Ronald Caesar
0d4e5fd765
Merge branch 'Xphalnos-VirtualAlloc' into arm64
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-07 16:21:37 -04:00
Xphalnos
328292ce55 Minor Changes
Signed-off-by: Xphalnos <yiga.steam@gmail.com>
2025-10-07 07:47:31 +02:00
Xphalnos
8434b4a368 Windows: Use VirtualAlloc
Signed-off-by: Xphalnos <yiga.steam@gmail.com>
2025-10-07 07:42:10 +02:00
Ronald Caesar
ccedf3b251
jit: Instruction decoder temp
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-04 22:17:36 -04:00
Ronald Caesar
ee9fbf5253
Update Readme
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-04 19:51:38 -04:00
Ronald Caesar
9d7b05d6ae
rename kvm references to pvm
The term KVM is missleading because we are not using linux kernel
virtualization. PVM stands for "Pound Virtual Machine" which is more
accurate.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-30 18:13:48 -04:00
Ronald Caesar
70a1abc62f
docs: Remove mmio design doc
The mmio will not be touchwd for a couple months while we focus on
executing arm instructions. Once we get to that point this design doc
will be rewritten.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-29 23:30:37 -04:00
Ronald Caesar
8eb0398803
docs: Update Readme
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-29 22:09:51 -04:00
Ronald Caesar
ae041bff84
docs: Clarify contributing rules
I failed to mentiones that the memory allocation and OOP rules are
temporary.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-29 22:05:18 -04:00
Ronald Caesar
69abf0efc8
Add PR template
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-28 13:39:41 -04:00
Ronald Caesar
6bdfd6fcea
Big Commit
The changes affects multiple places in the repo and this one of the rare
instances where I cant be bothered writing a comprehensive commit. Look
at the diff for changes.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-27 09:16:49 -04:00
Ronald Caesar
4dd8506346 Update 3rd_Party/SDL3 to a96677bdf6b4acb84af4ec294e5f60a4e8cbbe03: Since the build system is being refactered, all submodules will be updated to their latest release 2025-09-21 23:10:05 -04:00
Ronald Caesar
d0f9fd8686 Update 3rd_Party/imgui to bf75bfec48fc00f532af8926130b70c0e26eb099: Since the build system is being refactered, all submodules will be updated to their latest release 2025-09-21 22:50:55 -04:00
Ronald Caesar
4d363ea3b2 Remove fmt library
This library wasnt used anywhere in the source code.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-21 18:37:06 -04:00
Ronald Caesar
8713dd751a docs: Add githib vuln scanning design doc
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-21 18:36:28 -04:00
Ronald Caesar
3058e9992f docs: Add License complience design docs
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-21 18:23:39 -04:00
Ronald Caesar
1138d8c9d3 docs: Add 3rd Party libs design doc.
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-21 18:22:44 -04:00
Ronald Caesar
5850a13f18 Move design docs to one folder
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-21 15:11:36 -04:00
Ronald Caesar
fddd5b6694 kvm: Add MMIO design doc
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-21 14:39:57 -04:00
Ronald Caesar
0af6018a3f frontend: Disable GUI
The GUI will not be necessary for the foreseeable future. Focus will be
on implementing the virtual machine. And this commit speeds up the compile time
as well.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-21 13:03:52 -04:00
Ronald Caesar
5b0aaf5fc4 Merge branch 'arm64'
Ronald Caesar (7):
      common: Implement logging framework
      common: add assert framework dedign doc
      common: Implement assertion framework
      Add Pound log and assert macros in every system, and fixed all linux compiler warnings
      common: Remove unused files
      build: remove commented code
      Remove outdated contributing suggestions
2025-09-21 12:38:35 -04:00
Ronald Caesar
994cf52ae7 Remove outdated contributing suggestions
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-21 12:31:43 -04:00
Ronald Caesar
f94022057a build: remove commented code
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-21 12:29:02 -04:00
Ronald Caesar
3f8ce127ea common: Remove unused files
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-21 12:24:48 -04:00
Ronald Caesar
61f1340dee Add Pound log and assert macros in every system, and fixed all linux
compiler warnings

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-21 12:18:46 -04:00
Ronald Caesar
df86db1aa4 common: Implement assertion framework
This commit introduces the core assertion subsystem as defined in
`DESIGN_DOC_ASSERT_FRAMEWORK.md`.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-21 09:42:05 -04:00
Ronald Caesar
ba82ab5e9b common: add assert framework dedign doc
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-20 20:52:46 -04:00
Ronald Caesar
5b0e750c01 common: Implement logging framework
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-20 20:42:12 -04:00
Ronald Caesar
e8ce7a4921
Merge branch 'arm64'
Ronald Caesar (4):
      arm64/mem: Refactor guest memory access and made it endian aware
      build: Refactor CMake build system
      common: Add design doc for log framework.
      common: Implement logging framework
2025-09-20 07:50:18 -04:00
Ronald Caesar
d0857d83f0 common: Implement logging framework
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-20 04:59:09 -04:00
Ronald Caesar
2e45679675 common: Add design doc for log framework.
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-14 20:36:03 -04:00
Ronald Caesar
a3ed44003b build: Refactor CMake build system
This new architecture decomposes the project into several distict static
libraries: common, host, kvm, and frontend.

By using static libraries, changes within one module will only require
that library to be re-linked, rather than recompiling and re-linking the
entire executable.

The third party library ImGui is now built as a static library target.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-14 18:40:30 -04:00
Ronald Caesar
8b483849f4 arm64/mem: Refactor guest memory access and made it endian aware
Refactors the core guest memory access subsystem (guest.h) to be safer
and portable accross host systems with different endianness. The
previous implementation used direct pointer casting, which is not endian
safe.

1. All read and write functions have been converted from unsafe pointer
   casts to memcpy(). This resolves alignment warning -Wcast-align.

2. The access functions no longer rely on asserts for error checking.
   They now perform explicit boundary and alignment checking and returns
   a guest_mem_access_result_t status code.

3. A new header (endian.h) provides cross platform byte swapping macros.
   The memory access functions use these macros to ensure that the guest
   always sees memory in the correct endian format, regardless of the
   host's native byte order. The host endianness is now automatically
   detected via CMake.

3. Asserts are now explicitly enabled in release builds to catch
   critical errors.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-13 23:14:26 -04:00
Ronald Caesar
768355712d
Merge branch 'arm64'
This is a major architectural overhaul of the KVM core.

The monolithic core directory has been restructured into a more logical
component based structure under src/:

    * src/common: Truly genercic platform agnostic utilities.
    * src/host: The host abstraction layer for the OS soecific code.
    * src/frontend: User-interface and session management.
    * src/kvm: The core CPU and virtual machine emulation logic.
    * src/targets: Machine specific hardware definitions.

The core of the logical changes is a new framework for initializing and
running virtual machines.

    * Machine Probing: A new machine factory (kvm_probe) and operations
      table (kvm_ops_t) has been introduced. The core now interacts with
      the emulated machine through this abstraction interface.
    * Data Oriented MMIO disaptcher: This uses a data oriented structure
      of arrays design and a binary search lookup to provide efficient
      (O(log N)) dispatch for guest physical addresses.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-11 16:44:25 -04:00
OwnedByWuigi
f4b68e9467
Update README.md 2025-09-01 11:04:44 +01:00
Ronald Caesar
c6706dd8a0 kvm: Add framework for machine types and MMIO dispatch
The core of the machine-type support is the new operations table,
kvm_ops_t. This acts as a standard C-style virtual table decoupling the
generic KVM core logic from target specific hardware emualtion. The
kvm_t VM instance now points to an ops table, which defines the
"personality" of the guest. A kvm_probe() factory function has been
added to initialize a kvm_t instance with the correct ops table for a
given machine type (eg, Switch 1).

The ops table's .mmio_read and .mmio_write function pointers are the
link between the armv8 CPU core and this new MMIO dispatcher. When a
physical memory access is determined to be MMIO, the VM will call the
appropriate function pointer, which in turn will use the MMIO dispatcher
to find and execute the correct device handler.

The initial implementation for the Switch 1 target
(targets/switch1/hardware/probe.cpp) is a stub. The bootstrapping
logic will be added in subsequent patches.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-08-24 21:45:32 -04:00
Ronald Caesar
dea94dc259 Fix unknown type definition
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-08-23 17:41:32 -04:00
Ronald Caesar
05c4f7025f Major project restructuring
Remove unecessary files and made the tree much more cleaner.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-08-23 17:23:33 -04:00