News for hackers. Stuff that matters.
Re:Android phone will run Debian Linux soon (like some Pixel... by fluoridation on Tuesday March 11, 2025 @04:05PM (#43336481)
What do you imagine happens when you call fopen()? At some point there's a transition from user mode into kernel mode. What can the system do to prevent normal "app" code from making the transition but not "low level" code, when it's all user mode stuff running in the same process?
Re:Android phone will run Debian Linux soon (like some Pixel... by gjsman-1000 on Tuesday March 11, 2025 @04:09PM (#43336511)
I asked Claude, turns out I’m (probably, not celebrating) right:

Yes, Android's fopen() function is indeed an abstraction over the Linux fopen() system call. Android's implementation is part of the Bionic C library, which is Android's custom implementation of the standard C library (libc).

When you call fopen() in Android:

1. You're directly using Bionic's implementation of this standard C library function 2. Bionic ultimately relies on the underlying Linux kernel for actual file operations 3. The function provides the same basic functionality as the standard C library fopen() on other Linux systems

The Bionic library was specifically designed for Android to be more lightweight and optimized for mobile devices compared to the traditional glibc used in most Linux distributions. It maintains the same interface as standard C library functions like fopen() while providing platform-specific optimizations for Android's environment.

Re:Android phone will run Debian Linux soon (like some Pixel... by Jyaif on Tuesday March 11, 2025 @05:03PM (#43336971)
> Android's fopen() function is indeed an abstraction over the Linux fopen() system call

Yikes, `fopen` is not a system call...

Re:Android phone will run Debian Linux soon (like some Pixel... by AdelaideSimone on Wednesday March 12, 2025 @01:42PM (#43345753)
What exactly is it you're "right" about? How do you think any libc wrapper or direct syscall works? Syscalls are filtered for security reasons on many platforms, including Android. I mean, a syscall is literally an API itself to get a kernel's internals to do something for you.

What you're suggesting is, as someone else said, non-sensical. Phrased without invincible ignorance, it's equivalent to saying, "Android prevents you from creating a new OS kernel to supplant its own control over hardware access," which is true of basically any OS. How helpful or secure would it be if you could make 0 guarantees about how your hardware is used?

You can do direct hardware access through drivers that are integrated/interfaced with the kernel somehow, but this still is not an entirely arbitrary access, and is still going through the kernel in a way.