All Projects → ish-app → Ish

ish-app / Ish

Licence: other
Linux shell for iOS

Programming Languages

c
50402 projects - #5 most used programming language
objective c
16641 projects - #2 most used programming language
assembly
5116 projects
swift
15916 projects
Meson
512 projects
shell
77523 projects

Projects that are alternatives of or similar to Ish

Lemuroid
All in 1 emulator on Android!
Stars: ✭ 194 (-98.23%)
Mutual labels:  hacktoberfest, emulator
Duckstation
Fast PlayStation 1 emulator for x86-64/AArch32/AArch64
Stars: ✭ 2,888 (-73.72%)
Mutual labels:  hacktoberfest, emulator
Cxbx Reloaded
Xbox (Original) Emulator
Stars: ✭ 1,746 (-84.11%)
Mutual labels:  hacktoberfest, emulator
Miasm
Reverse engineering framework in Python
Stars: ✭ 2,649 (-75.9%)
Mutual labels:  hacktoberfest, emulator
Xemu
Original Xbox Emulator for Windows, macOS, and Linux (Active Development)
Stars: ✭ 362 (-96.71%)
Mutual labels:  hacktoberfest, emulator
Awesome Emulators Simulators
A curated list of software emulators and simulators of PCs, home computers, mainframes, consoles, robots and much more...
Stars: ✭ 94 (-99.14%)
Mutual labels:  hacktoberfest, emulator
Sameboy
Game Boy and Game Boy Color emulator written in C
Stars: ✭ 732 (-93.34%)
Mutual labels:  hacktoberfest, emulator
Azerothcore Wotlk
Complete Open Source and Modular solution for MMO
Stars: ✭ 1,330 (-87.9%)
Mutual labels:  hacktoberfest, emulator
Awesome Courses
😏 📄 An awesome list of educational websites, YouTube playlists, channels and books about programming
Stars: ✭ 99 (-99.1%)
Mutual labels:  hacktoberfest
Libreelec.tv
Just enough OS for KODI
Stars: ✭ 1,358 (-87.64%)
Mutual labels:  hacktoberfest
Magiccap
MagicCap is an image/GIF capture suite for Mac and Linux.
Stars: ✭ 99 (-99.1%)
Mutual labels:  hacktoberfest
Pokebase
Python 3 wrapper for Pokéapi v2
Stars: ✭ 99 (-99.1%)
Mutual labels:  hacktoberfest
Desktop
Mattermost Desktop application for Windows, Mac and Linux
Stars: ✭ 1,358 (-87.64%)
Mutual labels:  hacktoberfest
Spin
Spinnaker CLI
Stars: ✭ 99 (-99.1%)
Mutual labels:  hacktoberfest
Zookeeper
Apache ZooKeeper
Stars: ✭ 10,061 (-8.46%)
Mutual labels:  hacktoberfest
Emage
🧙‍♂️ From developers to developers: a cross-platform tool for losslessly image compression.
Stars: ✭ 99 (-99.1%)
Mutual labels:  hacktoberfest
Yii2 Openapi
REST API application generator for Yii2, openapi 3.0 YAML -> Yii2
Stars: ✭ 99 (-99.1%)
Mutual labels:  hacktoberfest
Vue Material
Material design for Vue.js
Stars: ✭ 9,528 (-13.31%)
Mutual labels:  hacktoberfest
Openrct2
An open source re-implementation of RollerCoaster Tycoon 2 🎢
Stars: ✭ 10,115 (-7.97%)
Mutual labels:  hacktoberfest
Statiq.web
Statiq Web is a flexible static site generator written in .NET.
Stars: ✭ 1,358 (-87.64%)
Mutual labels:  hacktoberfest

iSH

Build Status goto counter fuck counter

A project to get a Linux shell running on iOS, using usermode x86 emulation and syscall translation.

For the current status of the project, check the issues tab, and the commit logs.

Hacking

This project has a git submodule, make sure to clone with --recurse-submodules or run git submodule update --init after cloning.

You'll need these things to build the project:

  • Python 3
    • Meson (pip3 install meson)
  • Ninja
  • Clang and LLD (on mac, brew install llvm, on linux, sudo apt install clang lld or sudo pacman -S clang lld or whatever)
  • sqlite3 (this is so common it may already be installed on linux and is definitely already installed on mac. if not, do something like sudo apt install libsqlite3-dev)
  • libarchive (brew install libarchive, sudo port install libarchive, sudo apt install libarchive-dev) TODO: bundle this dependency

Build for iOS

Open the project in Xcode, open iSH.xcconfig, and change ROOT_BUNDLE_IDENTIFIER to something unique. You'll also need to update the development team ID in the project (not target!) build settings. Then click Run. There are scripts that should do everything else automatically. If you run into any problems, open an issue and I'll try to help.

Build command line tool for testing

To set up your environment, cd to the project and run meson build to create a build directory in build. Then cd to the build directory and run ninja.

To set up a self-contained Alpine linux filesystem, download the Alpine minirootfs tarball for i386 from the Alpine website and run ./tools/fakefsify, with the minirootfs tarball as the first argument and the name of the output directory as the second argument. Then you can run things inside the Alpine filesystem with ./ish -f alpine /bin/login -f root, assuming the output directory is called alpine. If tools/fakefsify doesn't exist for you in your build directory, that might be because it couldn't find libarchive on your system (see above for ways to install it.)

You can replace ish with tools/ptraceomatic to run the program in a real process and single step and compare the registers at each step. I use it for debugging. Requires 64-bit Linux 4.11 or later.

Logging

iSH has several logging channels which can be enabled at build time. By default, all of them are disabled. To enable them:

  • In Xcode: Set the ISH_LOG setting in iSH.xcconfig to a space-separated list of log channels.
  • With Meson (command line tool for testing): Run meson configure -Dlog="<space-separated list of log channels>".

Available channels:

  • strace: The most useful channel, logs the parameters and return value of almost every system call.
  • instr: Logs every instruction executed by the emulator. This slows things down a lot.
  • verbose: Debug logs that don't fit into another category.
  • Grep for DEFAULT_CHANNEL to see if more log channels have been added since this list was updated.

A note on the JIT

Possibly the most interesting thing I wrote as part of iSH is the JIT. It's not actually a JIT since it doesn't target machine code. Instead it generates an array of pointers to functions called gadgets, and each gadget ends with a tailcall to the next function; like the threaded code technique used by some Forth interpreters. The result is a speedup of roughly 3-5x compared to pure emulation.

Unfortunately, I made the decision to write nearly all of the gadgets in assembly language. This was probably a good decision with regards to performance (though I'll never know for sure), but a horrible decision with regards to readability, maintainability, and my sanity. The amount of bullshit I've had to put up with from the compiler/assembler/linker is insane. It's like there's a demon in there that makes sure my code is sufficiently deformed, and if not, makes up stupid reasons why it shouldn't compile. In order to stay sane while writing this code, I've had to ignore best practices in code structure and naming. You'll find macros and variables with such descriptive names as ss and s and a. Assembler macros nested beyond belief. And to top it off, there are almost no comments.

So a warning: Long-term exposure to this code may cause loss of sanity, nightmares about GAS macros and linker errors, or any number of other debilitating side effects. This code is known to the State of California to cause cancer, birth defects, and reproductive harm.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].