C programming in IOS

Discussion in 'iOS Programming' started by unix.war, Jul 2, 2014.

  1. unix.war macrumors newbie

    Joined:
    Jul 2, 2014
    #1
    Hello all

    1 - Can we run C programs in IOS?
    2 - How we can use System Calls in IOS? is like OSX?
    3 - Can we write a KEXT for IOS? How we can programming in kernel?
    4 - Can we have a none-GUI program in IOS like Daemons?

    Regards
     
  2. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #2
    These answers assume you are not using a jailbroken device.

    1. Yes.
    2. Same as with OS X. Most (if not all) of the standard Unix system calls are available.
    3. You can't. Kernel programming is not an option on iOS devices.
    4. No.
     
  3. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #3
    1. ANSI C is a legal subset of Objective C, so any C code should work. However, for App store apps, you will need an iOS Objective C UI stub to start your C code and get any user IO.
    2. iOS includes support for many posix and mach calls, but some are illegal or disabled inside the stock OS sandbox. System calls that need to start another process are blocked.
    3. No KEXTs are legal or possible inside the app store or stock OS sandbox. Same with kernel mods on stock iOS devices.
    4. A non-GUI program can run (for instance a web server), but only inside an app in the foreground with some sort of iOS UI present, and perhaps given some limited time in the background for certain modes at the whim of the OS.

    Of course, if you somehow figure out how to root and install your own OS on a device, anything is possible. But Apple tries to prevent that with OS updates.
     

Share This Page