←back to thread

169 points pabs3 | 6 comments | | HN request time: 0.931s | source | bottom
Show context
sanskarix ◴[] No.45756787[source]
This kind of thing is how you actually learn what's under the hood. Everyone's building with React Native and Flutter, which is fine until something breaks. Then you're stuck Googling black magic. Starting from assembly teaches you the real cost of abstraction.
replies(8): >>45757063 #>>45757628 #>>45758058 #>>45758840 #>>45758893 #>>45759007 #>>45760502 #>>45761692 #
internetter ◴[] No.45757063[source]
Is this really low level though? Because its hooking UIKit which is very high level relative to ASM. I'd be really curious to see an app draw on iOS without UIKit. I don't know if thats possible.
replies(4): >>45757231 #>>45757464 #>>45757623 #>>45758326 #
shreddit ◴[] No.45757464[source]
Of course it is. You just have to reimplement UIKit in ASM, no big deal…
replies(1): >>45757829 #
pjmlp ◴[] No.45757829[source]
And even that won't do it, because within the constraints of iOS, eventually that framebuffer with software rendering has to be displayed on the screen via an OS API, which is UI Kit.
replies(1): >>45758436 #
1. fingerlocks ◴[] No.45758436[source]
It should be possible.

If you enable the JIT entitlement for personal development, then bundle a mach-o into an entitled app. Or compile it directly on the app and mprotect-x to execute it. Is there something else you can’t do that I’m not considering? I might give this a try.

replies(1): >>45758615 #
2. pjmlp ◴[] No.45758615[source]
The point is what is possible within the constrains of public APIs.
replies(2): >>45758714 #>>45759556 #
3. fingerlocks ◴[] No.45758714[source]
Everything I described is in a public header right inside your iOS SDK folder
replies(1): >>45759186 #
4. pjmlp ◴[] No.45759186{3}[source]
I doubt you can render an UI in pure Assembly and show it on the screen without going through UI Kit in a non-rooted device, given that even the device drivers extension points is quite limited.

Which was the whole discussion point that started the thread, how to make a iOS app with zero references to UI Kit.

This isn't an 8 and 16 bit home computers, or games console, with an address for the framebuffer.

5. Someone ◴[] No.45759556[source]
Is syscall a public API on iOS? In the end, you have to call that to get anything on the screen?

Looking at unistd.h, it seems marked as

  __OS_AVAILABILITY_MSG(ios,deprecated=10.0,"syscall(2) is unsupported; "
    "please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost().")
and syscall numbers seem wrapped by

  #ifdef __APPLE_API_PRIVATE
in *<sys/syscall.h>
replies(1): >>45760251 #
6. pjmlp ◴[] No.45760251{3}[source]
Not at all, it is a Linux thing to keep applications doing syscalls, like back in MS-DOS interrupt days.

All other modern OSes give zero guarantees about syscalls.

Indeed, you have to call UI Kit, that is the public API for userspace applications.

Even if via OpenGL ES or Metal, you need a drawing context and a Window to render it.