Skip to content

Draft: Apple Silicon runtime and guest memory foundation - #37

Closed
AttilaTheFun wants to merge 1 commit into
OpenCommunityEdition:mainfrom
AttilaTheFun:macos/arm64-runtime-memory
Closed

AttilaTheFun wants to merge 1 commit into
OpenCommunityEdition:mainfrom
AttilaTheFun:macos/arm64-runtime-memory

Conversation

@AttilaTheFun

Copy link
Copy Markdown

Halo's existing ARM guest uses 32-bit addresses, while an Apple Silicon host needs a plan for preserving those addresses within its 64-bit process. This draft adds an independently runnable native arm64 memory foundation: a non-overwriting, 4 GiB-aligned Mach reservation, checked Xbox-address translation, and host-page-aligned read/write protection.

The probe uses the existing Android ABI window/image constants and leaves adjacent pages inaccessible. It rejects NULL/overflowing ranges, misaligned protection requests and executable permissions. Build and run with python3 tools/macos_memory_probe.py; no game data or third-party downloads are required.

Validation

Tested on Apple Silicon macOS 27.0.1 with Apple clang 21.0.0:

  • Built as a Mach-O arm64 executable with strict warnings as errors.
  • Probe passed with 16 KiB host pages: independent reservations, Xbox-offset read/write and round trips, address bounds, protection transitions/isolation, teardown and recreation.
  • Clang static analysis and git diff --check passed.

Draft scope and related work

This does not execute the Halo guest or implement a playable macOS port. The README records outstanding guest execution/rebasing, ABI bridges, loading, 4 KiB guest-block bookkeeping on 16 KiB host pages, platform services and graphics work. Existing platform build paths are untouched.

This branch is based on main, without the browser changes from #12. Related Apple Silicon efforts #16, #20 and #22 already explore fuller ports; this draft provides a small memory-contract experiment for review alongside that work, without claiming to supersede it. Maintainer feedback on alignment with those efforts is welcome before expanding the runtime.

Implementation and documentation were AI-assisted; the validation above was executed locally on the contributor's Apple Silicon machine.

@MrMilenko MrMilenko added enhancement New feature or request priority: low Nice to have / when time allows labels Oct 5, 2026
@cybersecurity

Copy link
Copy Markdown
Collaborator

macOS support cannot be officially added due to the github runners for them costing 10x as much as Linux runners (I also don't own any apple products so I cannot do testing). Long term, I will likely link one of the MacOS / IOS forks in the main repo for people to find.

FractumSeraph pushed a commit to FractumSeraph/OpenCE that referenced this pull request Oct 21, 2026
…hog OpenCommunityEdition#35-OpenCommunityEdition#37 and OpenCommunityEdition#40)

What Warthog's original Xbox line changed outside its port, so that
warthog-xbox adds only port/xbox on top of the game:

- The original Xbox's own target in the game code (HALO_XBOX_CONSOLE): the
  game as the Xbox ran it where the native builds changed it (a frame a
  tick, the Xbox's pools and screen), the XDK's memory, network and sound
  calls, and the game's calls into port/xbox (the memory log, the
  watchdog, the game list, direct join, co-op names, the platform claim).
- The console's limits and capacity (halo_port_limits.h,
  halo_port_capacity.h, halo_port_features.h: HALO_CONSOLE_PLAYERS, the
  HALO_CONSOLE_NO_* switches, and configure.py --console-limits for a
  desktop test build), and the game settings record folded between the
  PCs' slots and a console's (network_game_layout.c, docs/cross-play.md).
- The platform layer built for a console: the settings in D:\config.toml
  (port_config.c), Delta Peer as a client, text chat, and internet play's
  datagrams sent from the tunnel's thread.
- The shared console layer (port/console) and the XDK declarations the
  console's build needs.
- The audio probe (port/linux/game/audio_probe.c,
  tools/audio_probe_compare.py): a scripted recording of the mix, in every
  build, off unless debug.audio_probe or debug.audio_capture_seconds is set.
- Fixes for every build: a camera that is not numbers is built with the
  game's defaults; the bans file's buffer and the script compiler's
  refusal stack are on the heap; the loading screen loads without its
  textures when there is no memory for them; a refused join returns to
  the menus; the dynamic vertices' overflow line says which group; the
  spinners' extra items are a table (kills to win is unchanged).

Main's own changes stay where the Xbox line had older copies: the native
64-bit Android build's texture cache and draw limits, and Delta's code
under the GPL with the rest.
Adam-AtlasSoftware pushed a commit to Adam-AtlasSoftware/MendicantCE that referenced this pull request Nov 12, 2026
VR merge gaps: structure culling for both eyes, z-sprite depth, light ranking and the Frame's lists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: low Nice to have / when time allows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants