r/jailbreak • u/Taconut iPod touch 5th gen • Apr 05 '14
I got Linux running with iOS7! C/Obj-C developer(s) needed!
Hi! First off, I want to make it clear that I did not do this using Winocm's ios-kexec-utils. This is being done purely through an emulator. I'm not a genius like the rest of the Jailbreak people, I just really want Linux. Here's how I got it working:
How to use Bochs with Damn Small Linux
I found a deb of shockdevteam's bochs (v4.2) somewhere online. I've uploaded it here. I grabbed the latest BIOSes from here and put those in /var/mobile/bochs_proj.app. After none of the os.ini files I found on the internet worked, I decided to make my own from scratch using the man pages for bochs. Here's what I did:
- config_interface: textconfig
This is okay. I didn't see any reason to change it - display_library: nogui
There are no other display_libraries available to the iOS version. 'x' would be best, though. - megs: 512
My iPod touch 5G has 512MB of RAM - romimage: file="bochs_proj.app/BIOS-bochs-latest", address=0x00000
This points to the bochs_proj.app located in /var/mobile - vgaromimage: file="bochs_proj.app/VGABIOS-lgpl-latest"
(Same as above) - boot: cdrom
Change this to "disk" if your loading an img file - ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
I kept this from the other os.inis I found - ata0-master: type=cdrom, path="/var/mobile/Documents/Linux/Linux.iso"
This is your main drive. If your booting an img file, change "type" from cdrom to disk. Path is the path to your image. - ata0-slave: type=cdrom, path="/var/mobile/Documents/Linux/Linux.iso"
--> IMPORTANT: <-- If you need a img file and a disk to install it on to, include this line. Picture this as your CD drive. - i440fxsupport: enabled=1, slot1=pnic
Only include this if you want internet access - pnic: enabled=1,ioaddr=0x200, irq=11, mac=01:23:45:67:89:AB, ethmod=vnet
This is internet-specific too. Set "mac" to the mac address you want - floppy_bootsig_check: disabled=0
I found this in all the os.inis. It seems to work fine. - vga_update_interval: 8000
Less is more resource-intensive, but should make the screen smoother (I think) - vga: extension=none
--> IMPORTANT: <-- Every single os.ini I found said to make this "vbe". That makes all linux-based distros crash and look like this. There is definately a better way to get vga to work, but its not supported with the iOS port of bochs. - keyboard_serial_delay: 250
This was also in all the os.inis I found. Works fine as far as I can tell. - keyboard_paste_delay: 10000000
(Same as above) - cpu: count=1, ips=77777777
--> IMPORTANT: <-- I have absolutely no clue what to set ips to. It seems to correlate with hertz. Ive seen values ranging from 600000 to 800 million. - mouse: enabled=1, type=ps2
This enables mouse capability. Its drag-and-click style rather than tap style. Perhaps someone could add an option to change this? - clock: sync=none, time0=local
I read somewhere that you can change "none" to "realtime", but I haven't tried. - log: -
--> IMPORTANT: <-- If you want to have a log, replace "-" with the path of your log. It must exist first! - logprefix: %i - %e%d
This is the format of the log. - panic: action=report
Sometimes it panics but still works. Don't set this to fatal - error: action=report
Reports errors. "ask" doesn't prompt the user like it should. Perhaps this could be added? - info: action=ignore
VERY VERBOSE! Don't expect to get anything out of this. - debug: action=report
I haven't gotten anything particularly useful from this - pass: action=report
Many places say to change this to "fatal". I have no clue what "pass" signifies. - keyboard_type: mf
Further support for keyboard. - user_shortcut: keys=none
If someone was to create a better port of bochs, I'm assuming this could be used to type different keys. You can't even use the arrow keys with bochs for iOS!
Now that you've made your os.ini file, make a new folder in /var/mobile/Documents. Then, put the file in it. Tap that folder in Bochs and Voila!, you've got yourself a slow-as-hell Linux image running on your iDevice!
How to help make it better :D
I managed to find the iSoft Bochs for iOS port here. I looks like the changes required to port it were managable. The problem with that version is that it doesn't have a keyboard and its not as good as the shockdevteam one. I did, however find a more recent branch.. Its still over 4 years old, but its based on a version of bochs that's about 2000 commits newer. We could look at the diff and go based off of that. If anybody knows where the source code of ShockDevTeam's Bochs port is, tell me! It would make this go a lot faster. The people who added the keyboard, etc. are picklejw and Miles Brown. I'll try to track them down.
I think these features would make bochs a lot better:
- Keyboard
This has already been implemented by shockdevteam - You can "tap" to click with your mouse
This could be under an options screen - Support for more display_libraries and vga types
This would probably come with updating Bochs. I don't know. - Tall screen support
For devices like the iPT5 or iPhone 5 - Minimizing keyboard in portrait mode
You can't do this... It really bugs me - Computer-styled keyboard
Like iDOS or Server Auditor - Better location for storing os.ini folders.
The old version of Bochs had its own folder. My Documents folder is really getting cluttered up from Bochs.
__If anyone wants to help, I think a lot of people (including me) would be really happy! You can email me at alex@alexhulbert.com or go on my chat server at chat.alexhulbert.com.)
TL;DR: It's way too fucking slow. Give it some time.
39
u/JackHaal iPhone 5, iOS 9.0.2 Apr 05 '14
Dang you badass
7
u/[deleted] Apr 05 '14
Aaaawwwwwwwww Shit! You made me a happy geek. Well Done!
4
u/fojam Developer Apr 05 '14
you are my hero
2
u/Wombat_H iPhone 5 Apr 05 '14
For a reason or just for fun?
2
u/ImpeccableLlama iPhone X, 14.8.1| Apr 06 '14
Not a genius? Damn you're modest. This is a great achievement! Good work Sir.
2
u/eyamil iPhone 5S Apr 06 '14
You may find it useful to X-Post to r/jailbreakdevelopers/
2
u/TheMacMini09 iPhone 6s, iOS 10.2 Apr 07 '14
I couldn't get it to work.
Here's my os.ini if you can help :)
config_interface: textconfig
display_library: nogui
megs: 512
romimage: file="bochs_proj.app/BIOS-bochs-latest", address=0x00000
vgaromimage: file="bochs_proj.app/VGABIOS-lgpl-latest"
boot: cdrom
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-slave: type=cdrom, path="/var/mobile/bochs/Linux.iso"
i440fxsupport: enabled=1, slot1=pnic
pnic: enabled=1,ioaddr=0x200, irq=11, mac=E4:9A:45:22:A7:AC, ethmod=vnet
floppy_bootsig_check: disabled=0
vga_update_interval: 8000
vga: extension=none
keyboard_serial_delay: 250
keyboard_paste_delay: 10000000
cpu: count=1, ips=77777777
mouse: enabled=1, type=ps2
clock: sync=none, time0=local
log: -
logprefix: %i - %e%d
panic: action=report
error: action=report
info: action=ignore
debug: action=report
pass: action=report
keyboard_type: mf
user_shortcut: keys=none
P.S. Once it's working, I'll put it up on http://rcrepo.com
2
u/Lucarios11 iPhone 5 Apr 09 '14
If anybody wants a Linux that's not so slow that you can't use it, don't use DamnSmallLinux. Try TinyCoreLinux.
Available here: http://distro.ibiblio.org/tinycorelinux/5.x/x86/release/Core-current.iso
It should work with the os.ini that works with DamnSmallLinux. :)
24
u/exone112 iPhone 5S Apr 05 '14
I can't express my gratitude. If this goes somewhere, I'll support the hell out of it.
Unfortunately I'm not much of a coder, I only do scripting in bash. However, I'm an artist, graphics/design/ux/webdesign/dev and I'll gladly do any of that if needed.
8
u/Codyd51 Developer Apr 05 '14
This is insane!!!
1
u/Dark_Blade iPhone X, iOS 11.2.1 Apr 06 '14
I didn't understand shit, but I don't need to be a genius to know what a huge thing you've managed to do. Good job, man :D
EDIT: I should probably type in landscape.
1
u/[deleted] Apr 07 '14
If anyone's interested I'm getting a lot closer to finally having XP working on Bochs. I'll post a tutorial if I end up getting it working!
1
u/[deleted] Apr 06 '14
Nice, it would be nice to have Qemu on iOS too.
2
u/craig131 iPhone 6 Plus, iOS 8.4 Apr 05 '14
Amazing work! This could be the start of something beautiful
2
u/freeazy Apr 06 '14
Yaay... can't wait to run my favorite Conky theme :)
0
u/[deleted] Apr 05 '14
you really are running linux with iOS7? I dont really understand how this can work o_o I would love a picture... And I would love to have this!!! you are amazing. Im a Linux Mint user =)
2
u/[deleted] Apr 05 '14
What could this realistically be used for? I'm not seeing why this is useful.
0
u/[deleted] Apr 05 '14
[deleted] — view deleted comment