---
title: PostMarketOS for iPad Air 2 (iPad-5,3)
---

## Existing Work:

https://github.com/SoMainline/linux-apple-resources/blob/master/HOWTO.md
[PongoOS](https://github.com/checkra1n/PongoOS/tree/master):Seems to be a minimal boot environment for checkra1n boards
https://github.com/konradybcio/linux-apple: Kernel fork for iOS devices?

## PongoOS build errors

```c
src/kernel/mm.c:378:14: error: variable 'vm_index_start' set but not used [-Werror,-Wunused-but-set-variable]
  378 |     uint32_t vm_index_start = 0;
      |              ^
src/kernel/mm.c:938:10: error: variable 'is_tt1' set but not used [-Werror,-Wunused-but-set-variable]
  938 |     bool is_tt1 = false;
      |          ^
2 errors generated.
src/kernel/task.c:294:5: error: call to undeclared function 'va_start'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  294 |     va_start(va, reason);
      |     ^
src/kernel/task.c:296:5: error: call to undeclared function 'va_end'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  296 |     va_end(va);
      |     ^
src/kernel/task.c:300:5: error: call to undeclared function 'va_start'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  300 |     va_start(va, reason);
      |     ^
src/kernel/task.c:302:5: error: call to undeclared function 'va_end'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  302 |     va_end(va);
      |     ^
4 errors generated.
src/drivers/sep/sep.c:913:6: error: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C23, conflicting with a subsequent definition [-Werror,-Wdeprecated-non-prototype]
  913 | void sep_help();
      |      ^
src/drivers/sep/sep.c:1145:6: note: conflicting prototype is here
 1145 | void sep_help(const char* cmd, char* args) {
      |      ^
1 error generated.
make: *** [Makefile:99: build/Pongo] Error 1
```

Code fixes:

```diff
diff --git i/src/drivers/sep/sep.c w/src/drivers/sep/sep.c
index 10d0a98..cc074b6 100644
--- i/src/drivers/sep/sep.c
+++ w/src/drivers/sep/sep.c
@@ -910,7 +910,8 @@ struct sep_command {
     void (*cb)(const char* cmd, char* args);
 };

-void sep_help();
+void sep_help(const char* cmd, char* args);
 #define SEP_COMMAND(_name, _desc, _cb) {.name = _name, .desc = _desc, .cb = _cb}
 void sep_pwned_peek(const char* cmd, char* args) {
     if(!sep_is_pwned) {
diff --git i/src/kernel/mm.c w/src/kernel/mm.c
index 595ae64..108b885 100644
--- i/src/kernel/mm.c
+++ w/src/kernel/mm.c
@@ -375,13 +375,13 @@ err_t vm_allocate(struct vm_space* vmspace, uint64_t* addr, uint64_t size, vm_fl
     uint32_t vm_scan_base = 0;
     uint64_t vm_scan_size = (VM_SPACE_SIZE / PAGE_SIZE);
     uint32_t found_pages = 0;
-    uint32_t vm_index_start = 0;

     if (flags & VM_FLAGS_FIXED) {
         uint64_t vm_offset = *addr - vmspace->vm_space_base;
         if (vm_offset > vmspace->vm_space_end) vm_scan_size = 0;
         else {
-            vm_index_start = vm_offset / PAGE_SIZE;
             vm_scan_size = ((size + PAGE_MASK) & ~PAGE_MASK) / PAGE_SIZE;
         }
     } else {
@@ -935,20 +935,21 @@ void ttbpage_free_walk(uint64_t base, bool is_tt1) {
 }
 bool tte_walk_get(struct vm_space* vmspace, uint64_t va, uint64_t** tte_out) {
     uint64_t bits = 64ULL;
-    bool is_tt1 = false;
     uint64_t* ttb = NULL;
     if (va & 0x7000000000000000) {
         bits -= t1sz;
         va -= (0xffffffffffffffff - ((1ULL << (65 - t1sz)) - 1));
         va &= (1ULL << bits) - 1;
-        is_tt1 = true;
         ttb = phystokv(vmspace->ttbr1);
     } else {
         bits -= t0sz;
         va &= (1ULL << bits) - 1;
-        is_tt1 = false;
         ttb = phystokv(vmspace->ttbr0);
     }
     uint32_t levels = ((bits - (tt_bits + 3ULL)) / tt_bits);
     union tte tte;
     while (levels) {
diff --git i/src/kernel/task.c w/src/kernel/task.c
index 0e6fa22..b957e16 100644
--- i/src/kernel/task.c
+++ w/src/kernel/task.c
@@ -26,6 +26,7 @@
  */
 #include <errno.h>
 #include <stdlib.h>
+#include <stdarg.h>
 #include <pongo.h>

 extern void task_load(struct task* to_task);
```

## PongoOS linker errors:

```
ld: could not process llvm bitcode object file, because /usr/bin/../lib/llvm/libLTO.so could not be loaded file '/tmp/dtree-76a2ef.o' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

~~`ln -s ../llvm-18/lib/libLTO.so libLTO.so`~~
nevermind we don't need to build PongoOS

~~turns out shit's broken af on iOS 15 so project ends here~~
from Siguza:

- [https://github.com/asdfugil/PongoOS](https://github.com/asdfugil/PongoOS "https://github.com/asdfugil/PongoOS") <- Build that
- [https://checkra.in/1337](https://checkra.in/1337 "https://checkra.in/1337") <- Use this special ver of checkrain
- [https://github.com/HoolockLinux/m1n1](https://github.com/HoolockLinux/m1n1 "https://github.com/HoolockLinux/m1n1") <- Chainload thath
