Joel ArmstrongDocumentation5c562d515 years agoHistory
102 lines · 3.7 KB · Text
RawDownload
===Usage=== Just run /data/inferno/Android/arm/bin/emu-g. It'spossible to run Inferno (without graphics) in parallel with zygote(the Android java layer). Don't touch the radio if the Java layer'srunning; your phone will probably freeze. The phone device is mountedautomatically. If you want to change this, look in emu/port/main.c forwhere it mounts the device #f. ===Phone interface===Turn on the radio (you'll want to do this before anything else): echo on > /phone/ctl Turn off the radio: echo off > /phone/ctl Turn on the data connection (APN information is omitted if on CDMA): echo net on <gsm/cdma> <APN name> <APN user> <APN password> > /phone/ctlFor example, on AT&T this would be: echo net on gsm wap.cingular WAP@CINGULARGPRS.COM cingular1 > /phone/ctl Turn off the data connection: echo net off > /phone/ctl Route the audio to a different device: echo route <earpiece/speaker/headphone> > /phone/ctl Change the call volume: echo volume <0-5> > /phone/ctl Mute/unmute your microphone: echo <mute/unmute> > /phone/ctl Dial a number: echo dial <number> > /phone/phone Hang up a call: echo hangup > /phone/phone Pick up an incoming call: echo answer > /phone/phone Send an SMS: echo send <number> <quoted message> > /phone/sms Reading from /phone/sms gives you SMS messages as they come in. Reading from /phone/ctl returns "off" or "on" depending on whether thedriver thinks the radio is off or on. There's no way to query thepower state from RIL, though, so if you have the radio powered onbefore Inferno starts it will still return "off." /phone/signal gives you the raw signal strength value, 0-30 or 99 forfailure. It may be different for CDMA phones. Reading from /phone/status returns a radio status message. Thecontents can vary depending on whether you're on CDMA or GSM (seehardware/ril/include/telephony/ril.h for details on theRIL_REQUEST_REGISTRATION_STATE response). The most useful informationis the registration status message, which is always the first line inthe data. It tells you whether you're registered to the cell networkor not. Reading from /phone/phone will give you messages when the phone ringsand when the call state has changed. You should read from /phone/callswhen the call state changes. Reading from /phone/calls gives you a list of calls. The device dumpsall the information it gets, but the information that you probablycare about the most is the state of each call and the number of theother party. The state is a value 0-5:| Value | Meaning  ||-------+----------||     0 | Active   ||     1 | Holding  ||     2 | Dialing  ||     3 | Alerting ||     4 | Incoming ||     5 | Waiting  | ===Building===  Before you build for the Android, you need to compile the Infernotools for x86. Change mkconfig to include SYSHOST=Linux andOBJTYPE=386. Run makemk.sh, then run mk nuke. When you mk install,you'll run into errors--this is because of the changes to make Infernoplay nicely with bionic. Run mk install in the directory of each tooland library you need (lib9, libmath, utils/iyacc, limbo, and maybemore). After you have a full toolset, change SYSHOST back to Androidand OBJTYPE back to arm. Run mk nuke, mk install, then push yourinferno directory over to your phone using adb push or theparallel-push.sh script. Make sure to place your Inferno directory tomatch the ROOT variable in mkconfig (we suggest using /data/infernofor your ROOT). ===Porting=== For porting to a new Android phone, take a look at emu/port/main.c,emu/Android/framebuffer.c, and emu/Android/screen.c. Most of the workshould be finding out which device is the touchscreen input andhandling that correctly. If you want buttonserver to work correctly,create a config file in /data/inferno/etc.