Configuring my stylus active digitizer pen with .idc file - Miscellaneous Android Development

Device: Surface Pro 3
ROM: Bliss 713
Android x86 Nougat 7.1.3
I have created the following file named Vendor_1b96_Model_1b05_Version_0100.idc
Code:
##########################
#surface pro 3 n-trig pen#
##########################
# touch.deviceType = touchScreen | touchPad | pointer | default
touch.deviceType = pointer
# orientationAware
# touch.orientationAware = 0 or 1
touch.orientationAware = 1
# gestureMode
# Definition: touch.gestureMode = pointer | spots | default
touch.gestureMode = spots
#Extras
device.internal = 1
touch.size.calibration = geometric
I have placed it into the folder /system/usr/idc .
But the file is completely ignored.
I found this file naming info online somewhere.
Code:
#################
#filenaming info#
#################
#name the file Vendor_XXXX_Model_YYYY_Version_ZZZZ.idc
#Replace XXXX , YYYY and ZZZZ with the information from $cat /proc/bus/input/devices
#cat /proc/bus/input/devices
And here is my information.
Code:
#I: Bus=0018 Vendor=1b96 Product=1b05 Version=0100
#N: Name="NTRG0001:01 1B96:1B05 Pen"
#P: Phys=i2c-NTRG0001:01
#S: Sysfs=/devices/pci0000:00/INT33C3:00/i2c-1/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input28
#U: Uniq=
#H: Handlers=event12 mouse1
#B: PROP=0
#B: EV=1b
#B: KEY=c03 1 0 0 0 0
#B: ABS=1000003
#B: MSC=10
Can anyone push me in the right direction?
Thanks.

EUREEKA!!!
I've done it. Perfect surface pro 3 N-Trig pen support.
Just add the following two files to your /system/usr/idc folder and reboot
https://mega.nz/#!LYFBXQrY
https://mega.nz/#!eJkRWbJA
The problem was the name scheme for the idc files. If you look at the information inside my files and see how I ended up naming the files you will figure it out. Basically you do not need to actually write the word Vendor_ and Model_ you just write the vendor and model . Hope this helps somebody.

Decryption Key
Hey, I tired clicking those links, but it requires a decryption key. Could you possibly make it open or post the key here? Thanks!

https://mega.nz/#!eJkRWbJA!lbMSDuVRHFhWgtR00ScWZfguyN365fbx-0sRyG2xM9w
https://mega.nz/#!LYFBXQrY!w3fRnZri_nQqLS5w3p82oa8MnoGB43xdHlVunbE6Wio

Related

floating point arithmetic? - hack job workaround now included

is there a way to do floating point arithmetic in terminal?...or would bc binary need to be included since busybox does not have it? as of now you get a syntax error if using fp numbers in expression..or 0 when using division and result is a floating point.
Code:
# echo $(( 1 + 1 ))
echo $(( 1 + 1 ))
2
# echo $(( 1.0 + 1.0 ))
echo $(( 1.0 + 1.0 ))
arith: syntax error: " 1.0 + 1.0 "
# echo $(( 1 / 2 ))
echo $(( 1 / 2 ))
0
sh/bash has no native support for floating point math, so your solution must involve a binary executable. You can either use bc, or you can write a very simple C program and compile it for this platform....
i.e.,
Code:
//math.c
#include <stdlib.h>
#include <stdio.h>
int main (int argc, char ** argv){
float a = atof(argv[1]);
char op = argv[2][0];
float b = atof(argv[3]);
if (op == '+') printf("%f\n",a+b);
else if (op == '-') printf("%f\n",a-b);
else if (op == 'x') printf("%f\n",a*b);
else if (op == '/') printf("%f\n",a/b);
return 0;
}
$ ./math 1.5 + 2
3.500000
$ ./math 1.5 x 2
3.000000
$ ./math 1.5 - 2
-0.500000
$ ./math 1.5 / 2
0.750000
Oh and FYI, don't forget you can use variables in there, i.e.
$ A=1.5
$ B=2
$ OP=/
$./math $A $OP $B
0.750000
Is this the appropriate forum?
jdstankosky said:
Is this the appropriate forum?
Click to expand...
Click to collapse
Sorry, are you a moderator? :/
And yes, since this is a development matter, I'd say it falls within the DEVELOMPENT section..
lbcoder said:
sh/bash has no native support for floating point math, so your solution must involve a binary executable. You can either use bc, or you can write a very simple C program and compile it for this platform....
i.e.,
Code:
//math.c
#include <stdlib.h>
#include <stdio.h>
int main (int argc, char ** argv){
float a = atof(argv[1]);
char op = argv[2][0];
float b = atof(argv[3]);
if (op == '+') printf("%f\n",a+b);
else if (op == '-') printf("%f\n",a-b);
else if (op == 'x') printf("%f\n",a*b);
else if (op == '/') printf("%f\n",a/b);
return 0;
}
$ ./math 1.5 + 2
3.500000
$ ./math 1.5 x 2
3.000000
$ ./math 1.5 - 2
-0.500000
$ ./math 1.5 / 2
0.750000
Oh and FYI, don't forget you can use variables in there, i.e.
$ A=1.5
$ B=2
$ OP=/
$./math $A $OP $B
0.750000
Click to expand...
Click to collapse
thanks for the info. very helpful.
script workaround
i have constructed a workaround for doing fp math for determining partition sizes.
it's not pretty, but it gets the job done.
basically, it goes like this:
1. check to see if the number passed to the function is an integer
2. if not, i search the string for a "."
3. if the search turns up a "." (and units in GB) i break the number into two whole numbers (the integer portion..before the decimal, and the fraction portion after the decimal).
4. do the appropriate math on the integer section.
5. do the appropriate math on the fraction section, then divide by 10^#of digits after the decimal place.
6. add the two numbers together and voila! a hack job, floating point calculation.
Code:
ValidateSizeArg() {
# check for zero-length arg to protect expr length
[ -z "$1" ] && ShowError "zero-length argument passed to size-validator"
SIZEMB=
ARGLEN=`expr length $1`
SIZELEN=$(($ARGLEN-1))
SIZEARG=`expr substr $1 1 $SIZELEN`
SIZEUNIT=`expr substr $1 $ARGLEN 1`
# check if SIZEARG is an integer
if [ $SIZEARG -eq $SIZEARG 2> /dev/null ] ; then
# look for G
[ "$SIZEUNIT" == "G" ] && SIZEMB=$(($SIZEARG * 1024))
# look for M
[ "$SIZEUNIT" == "M" ] && SIZEMB=$SIZEARG
# no units on arg
[ -z "$SIZEMB" ] && SIZEMB=$1
# check if SIZEARG is a floating point number, GB only
elif [ `expr index "$SIZEARG" .` != 0 ] && [ "$SIZEUNIT" == "G" ] ; then
INT=`echo "$SIZEARG" | cut -d"." -f1`
FRAC=`echo "$SIZEARG" | cut -d"." -f2`
SIGDIGITS=`expr length $FRAC`
[ -z "$INT" ] && INT=0
INTMB=$(($INT * 1024))
FRACMB=$((($FRAC * 1024) / (10**$SIGDIGITS)))
SIZEMB=$(($INTMB + $FRACMB))
# it's not a valid size
else
ShowError "$1 is not a valid size"
fi
# return valid argument in MB
FUNC_RET=$SIZEMB
}
I was a basic/qbasic/gwbasic programmer in my younger days (like 12-14 yrs old)...
I feel ashamed that I have no idea of what this stuff is anymore. Thank God for guys like you.

compiling problems, at a loss and been googling for days.

this is the error i come accross when trying to compile from source.
i'm running ubunut 8.0.4 LTS Hardy Heron
these are the steps i use when settign it up:
http://source.android.com/download (for downloading and compiling the source)
'make' is ran once for the purposes of gettign ready to edit with eclipse
i git cloned housh's vendor tree from http://github.com/koush
SDK is installed in ~/android-sdk
sourcecode is in ~/android-source/android-2.1_r1
the files from koush's vendor tree are in ~/android-source/android-2.1_r1/vendor/motorola/sholes-open
proprietary files are from a 2.0.1 rom and located in ~/android-source/android-2.1_r1/proprietary
Code:
. build/envsetup.sh
lunch sholes-eng
make
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.1
TARGET_PRODUCT=sholes
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=ERD79
============================================
build/core/copy_headers.mk:15: warning: overriding commands for target `out/target/product/sholes-open/obj/include/libpv/getactualaacconfig.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for target `out/target/product/sholes-open/obj/include/libpv/getactualaacconfig.h'
/bin/bash: line 0: cd: sdk/layoutopt/app/src/resources: No such file or directory
No private recovery resources for TARGET_DEVICE sholes-open
Install: out/host/linux-x86/bin/vm-tests
Install: out/target/product/sholes-open/system/app/Mms.apk
target Executable: app_process (out/target/product/sholes-open/obj/EXECUTABLES/app_process_intermediates/LINKED/app_process)
/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld: warning: libril_rds.so, needed by out/target/product/sholes-open/obj/lib/libmoto_gps.so, not found (try using -rpath or -rpath-link)
/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld: warning: libnmea.so, needed by out/target/product/sholes-open/obj/lib/libmoto_gps.so, not found (try using -rpath or -rpath-link)
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `RdsSetupRemoteConnection'
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `RdsUtilCreateMsg'
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `nmea_parse_sentence'
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `RdsUtilSendMsg'
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `nmea_parse_error_string'
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `RdsReadServerRsp'
collect2: ld returned 1 exit status
make: *** [out/target/product/sholes-open/obj/EXECUTABLES/app_process_intermediates/LINKED/app_process] Error 1
i tried using -rpath-link as you can see these were my results.
Code:
*****@lap:~/android-source/android-2.1_r1$ make -rpath-link=/home/tourach23/android-source/proprietary
make: invalid option -- a
Usage: make [options] [target] ...
Options:
-b, -m Ignored for compatibility.
-B, --always-make Unconditionally make all targets.
-C DIRECTORY, --directory=DIRECTORY
Change to DIRECTORY before doing anything.
-d Print lots of debugging information.
--debug[=FLAGS] Print various types of debugging information.
-e, --environment-overrides
Environment variables override makefiles.
-f FILE, --file=FILE, --makefile=FILE
Read FILE as a makefile.
-h, --help Print this message and exit.
-i, --ignore-errors Ignore errors from commands.
-I DIRECTORY, --include-dir=DIRECTORY
Search DIRECTORY for included makefiles.
-j [N], --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
-k, --keep-going Keep going when some targets can't be made.
-l [N], --load-average[=N], --max-load[=N]
Don't start multiple jobs unless load is below N.
-L, --check-symlink-times Use the latest mtime between symlinks and target.
-n, --just-print, --dry-run, --recon
Don't actually run any commands; just print them.
-o FILE, --old-file=FILE, --assume-old=FILE
Consider FILE to be very old and don't remake it.
-p, --print-data-base Print make's internal database.
-q, --question Run no commands; exit status says if up to date.
-r, --no-builtin-rules Disable the built-in implicit rules.
-R, --no-builtin-variables Disable the built-in variable settings.
-s, --silent, --quiet Don't echo commands.
-S, --no-keep-going, --stop
Turns off -k.
-t, --touch Touch targets instead of remaking them.
-v, --version Print the version number of make and exit.
-w, --print-directory Print the current directory.
--no-print-directory Turn off -w, even if it was turned on implicitly.
-W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
Consider FILE to be infinitely new.
--warn-undefined-variables Warn when an undefined variable is referenced.
This program built for i486-pc-linux-gnu
Report bugs to <[email protected]>
# Make data base, printed on Mon Mar 1 17:14:13 2010
# Variables
# environment
DESKTOP_SESSION = default
# environment
ANDROID_EABI_TOOLCHAIN = /home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
# environment
GTK_RC_FILES = /etc/gtk/gtkrc:/home/tourach23/.gtkrc-1.2-gnome2
# environment
DESKTOP_STARTUP_ID =
# environment
XAUTHORITY = /home/tourach23/.Xauthority
# environment
GDMSESSION = default
# environment
SHELL = /bin/bash
# environment
GDM_LANG = en_US.UTF-8
# environment
_ = /usr/bin/make
# environment
BUILD_ENV_SEQUENCE_NUMBER = 9
# environment
HISTCONTROL = ignoreboth
# environment
USERNAME = tourach23
# environment
ANDROID_BUILD_PATHS = :/home/tourach23/android-source/android-2.1_r1/out/host/linux-x86/bin:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:/home/tourach23/android-source/android-2.1_r1/development/emulator/qtools:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
# environment
XDG_DATA_DIRS = /usr/local/share/:/usr/share/:/usr/share/gdm/
# environment
TARGET_SIMULATOR = false
# environment
DBUS_SESSION_BUS_ADDRESS = unix:abstract=/tmp/dbus-3sPGG4tkYw,guid=7738ab73bff2808fff67e4da4b8a9d2c
# environment
GNOME_KEYRING_SOCKET = /tmp/keyring-x3cTQA/socket
# environment
LESSOPEN = | /usr/bin/lesspipe %s
# environment
TARGET_BUILD_TYPE = release
# environment
PATH = /home/tourach23/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/tourach23/android-source/android-2.1_r1/out/host/linux-x86/bin:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:/home/tourach23/android-source/android-2.1_r1/development/emulator/qtools:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
# environment
ANDROID_QTOOLS = /home/tourach23/android-source/android-2.1_r1/development/emulator/qtools
# environment
GPG_AGENT_INFO = /tmp/seahorse-ssh3T0/S.gpg-agent:5563:1
# environment
SESSION_MANAGER = local/lap:/tmp/.ICE-unix/5448
# environment
WINDOWID = 56623197
# environment
GDM_XSERVER_LOCATION = local
# default
.FEATURES := target-specific order-only second-expansion else-if archives jobserver check-symlink
# environment
LS_COLORS = no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:
# environment
SSH_AUTH_SOCK = /tmp/keyring-x3cTQA/ssh
# environment
DISPLAY = :0.0
# environment
OPROFILE_EVENTS_DIR = /home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/oprofile
# environment
PWD = /home/tourach23/android-source/android-2.1_r1
# environment
HOME = /home/tourach23
# environment
ANDROID_PRODUCT_OUT = /home/tourach23/android-source/android-2.1_r1/out/target/product/sholes-open
# environment
XDG_SESSION_COOKIE = c6a232a9259e01cec5dca10f4b8a3c01-1267375402.490755-69030679
# environment
LOGNAME = tourach23
# environment
TARGET_PRODUCT = sholes
# environment
LESSCLOSE = /usr/bin/lesspipe %s %s
# environment
GNOME_DESKTOP_SESSION_ID = Default
# environment
COLORTERM = gnome-terminal
# environment
SHLVL = 1
# environment
DISABLE_DEXPREOPT = true
# environment
USER = tourach23
# environment
GNOME_KEYRING_PID = 5447
# environment
ANDROID_TOOLCHAIN = /home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
# environment
OLDPWD = /home/tourach23/android-source
# default
.VARIABLES :=
# environment
PROMPT_COMMAND = echo -ne "\033]0;[sholes-eng] [email protected]: /home/tourach23/android-source/android-2.1_r1\007"
# environment
OUT = /home/tourach23/android-source/android-2.1_r1/out/target/product/sholes-open
# environment
ANDROID_BUILD_TOP = /home/tourach23/android-source/android-2.1_r1
# environment
TARGET_BUILD_VARIANT = eng
# environment
WINDOWPATH = 7
# environment
LANG = en_US.UTF-8
# environment
TERM = xterm
# variable set hash-table stats:
# Load=53/1024=5%, Rehash=0, Collisions=2/60=3%
# Pattern-specific Variable Values
# No pattern-specific variable values.
# Directories
# No files, no impossibilities in 0 directories.
# Implicit Rules
# No implicit rules.
# Files
# files hash-table stats:
# Load=0/1024=0%, Rehash=0, Collisions=0/0=0%
# VPATH Search Paths
# No `vpath' search paths.
# No general (`VPATH' variable) search path.
# # of strings in strcache: 0
# # of strcache buffers: 0
# strcache size: total = 0 / max = 0 / min = 4096 / avg = 0
# strcache free: total = 0 / max = 0 / min = 4096 / avg = 0
# Finished Make data base on Mon Mar 1 17:14:13 2010
as the post says i ahve been googling this for days trying to figure something out. any help even if it's a point in the right direction would be greatly appreciated.
You are posting in the HTC passion group, but the procedure should be the same as far as building using koush's vendor packages.
I myself am trying to find instructions on building AOSP with vendor overlay just as you describe. I am looking for the equivalent of "building for dream" on source.android.com, for the nexus one. The same instructions would probably mostly apply to the motorola sholes you are asking for.
help!
yeah i debated between the G1 forum and the N1 forum since there isn't a sholes forum.
i've got everything setup as far as i know, but i am obviously missing something. i can compile individual system apk's like Launcher2.apk but if i go for a full system build it crashes out.
sniffle said:
yeah i debated between the G1 forum and the N1 forum since there isn't a sholes forum.
i've got everything setup as far as i know, but i am obviously missing something. i can compile individual system apk's like Launcher2.apk but if i go for a full system build it crashes out.
Click to expand...
Click to collapse
Did you remember to extract the proprietary files by using the extract-files.sh in koush's vendor dir?
I ran the extraction file in both the sholes-open directory as well as the root directory of the source files since I wasn't sure if the files needed to be placed in the source directory or the vendor directory.
Proprietary firles are locate in the following locations
Android-2.1_r1>proprietary
And
Android-2.1_r1>vendor>motorola>sholes-open>proprietary
sniffle said:
this is the error i come accross when trying to compile from source.
Code:
. build/envsetup.sh
lunch sholes-eng
make
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.1
TARGET_PRODUCT=sholes
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=ERD79
============================================
build/core/copy_headers.mk:15: warning: overriding commands for target `out/target/product/sholes-open/obj/include/libpv/getactualaacconfig.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for target `out/target/product/sholes-open/obj/include/libpv/getactualaacconfig.h'
/bin/bash: line 0: cd: sdk/layoutopt/app/src/resources: No such file or directory
Click to expand...
Click to collapse
Hi there, I've been looking for a while, ... and twice !
This error comes from your java version. You should use jdk-1.5.0.19
That you can find there
Code:
https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/[email protected]_Developer
Cheers,
Shaiton
drop by cyanogenmod IRC for live help, someone or the other will be able to help, according to me it might be some lib error. try repo sync again and make clean. then try building again

[ROM] I9001XXKPU_XXKPH_OXAKP1 Oryginal Open

I9001XXKPU XXKPH OXAKP1
Flash + Odin :
hotfile.com/dl/140028931/367f5c4/i9001XXKPU_XXKPH_OXAKP1.rar.html
Regards!
Wish there was any change log available for stock rom updates...
Sent from my GT-I9001 using XDA App
Make them yourself, like I did:
1. Unzip/rar the file (just ignore the error)
2. Unpack system with Diskinternal Linux Reader
3. Compare the two with whatever file/dir compare tool you like (I use copyto for binary folder compare and ultracompare for file compare)
Good luck!
Regards,
Nika.
Sorry, first link have damaged MD5 checksums inside.
new one tested :
hotfile.com/dl/140028931/367f5c4/i9001XXKPU_XXKPH_OXAKP1.rar.html
I also edited first.
Lol, and I was trying to figure out why unpacking the smd did not work... thanks!
For whomever wants to know, you can extract an smd using this script (Linux or Cygwin):
Code:
#!/bin/bash
base=0
length=1
while (( length > 0 ))
do
# calculate Length
let "skip = base + 18"
length=`hexdump -e '"%d"' -s ${skip} -n 2 ${1}`
let "length = length * 65536"
let "skip = base + 16"
length2=`hexdump -e '"%d"' -s ${skip} -n 2 ${1}`
let "length += length2"
let "length = length / 512" # Number of 512-Byte blocks
# calculate offset
let "skip = base + 22"
offset=`hexdump -e '"%d"' -s ${skip} -n 2 ${1}`
let "offset = offset * 65536"
let "skip = base + 20"
offset2=`hexdump -e '"%d"' -s ${skip} -n 2 ${1}`
let "offset += offset2"
let "offset = offset / 512" # Number of 512-Byte blocks
# save header in case of first loop
if (( base == 0 ))
then
dd if=${1} bs=512 of=header count=${offset}
fi
# extract filename
let "skip = base + 32"
filename=`dd if=${1} skip=${skip} count=16 bs=1 2>/dev/null`
# and finally: extract image
if (( length > 0 ))
then
echo "Length: ${length}"
echo "Offset: ${offset}"
echo "Filename: ${filename}"
dd if=${1} bs=512 of=${filename} skip=${offset} count=${length} 2>/dev/null
fi
# next header
let "base += 64"
done

[KERNEL] [DEV] MTK6573 kernel improvement effort

There are a number of chinese dual sim phones using the chipset MTK6573
Unfortunately the manufacturer has chosen to be very secretive about the kernel and
1) Has not published the source code
2) Has not included the kernel .config file in the compilation
3) Has not compiled ext2, ext3 or ext4 support in the kernel
In an effort to overcome some of those limitations I have gathered the exact same version of the android kernel used in current roms (2.6.35.7) and tried to come up with a configuraration that produces modules (.ko) that can be loaded and used from MTK6573 based devices.
Instructions for compiling the kernel:
Pre-requirements:
a) check with uname -a in your device that the kernel version is 2.6.35.7
b) Download this file with the kernel source and the arm toolchain:
http://www.ziddu.com/download/18628468/androidkernelANDtoolchain.rar.html
1) Unpack the .rar file and extract the toolchain to your home folder
2) Extract the kernel sources somewhere you like
3) Open a bash terminal and cd into the folder containing the kernel source
4 ) make -j8 ARCH=arm menuconfig
That should open a menu and you will be able to modify options, the chosen system is a qualcom MSM as this is the closest thing I could find to the MTK6573
5) Compile with:
make -j8 ARCH=arm CROSS_COMPILE=~/code/distro/kernel/arm-2011.03/bin/arm-none-eabi-
6) to test the ext2.ko module
adb push fs/ext2/ext2.ko /data/local/
adb shell
insmod /data/local/ext2/ko
7) Try to mount an ext2 partition
We are really trying to overcome this situation and all the help is appreciated.
So far all the ext2.ko modules built can be loaded without any error, but as soon as the mount command is issued the phone immediately reboots. I can't even log anything. Any ideas?
EDIT:
Code:
lsmod
pvrsrvkm 151229 29 mtklfb, Live 0xbf000000
mtklfb 11329 0 - Live 0xbf033000
mtk_drvb 8436 0 - Live 0xbf03c000 (P)
lca_core 2706 0 - Live 0xbf044000 (P)
mtk_stp_core 211207 5 mt6620_fm_drv,mtk_stp_bt,mtk_stp_gps,mtk_stp_wmt,mtk_stp_u
art, Live 0xbf04a000 (P)
mtk_stp_uart 20598 1 - Live 0xbf087000 (P)
mtk_hif_sdio 10961 2 wlan,mtk_stp_wmt, Live 0xbf092000
mtk_stp_wmt 88860 6 wlan,mtk_fm_priv,mt6620_fm_drv,mtk_stp_bt,mtk_stp_gps, Live
0xbf09b000 (P)
mtk_stp_gps 37165 0 - Live 0xbf0ba000
mtk_stp_bt 39581 1 - Live 0xbf0c9000
mt6620_fm_drv 99803 1 mtk_fm_priv, Live 0xbf0d8000
mtk_fm_priv 7205 0 - Live 0xbf0f9000 (P)
wlan 255235 2 - Live 0xbf100000 (P)
ext2 44907 0 [permanent], Live 0xbf154000
ccci 195306 18 sec,ccmni, Live 0xbf167000 (P)
ccmni 16270 0 - Live 0xbf1a4000 (P)
mt6573_m4u 62946 0 - Live 0xbf1ae000 (P)
mt6573_mfv_kernel_driver 341502 0 - Live 0xbf1c5000 (P)
sec 52226 0 - Live 0xbf21f000 (P)
xlog 89315 24 - Live 0xbf233000 (P)
As you can see, ext2 module is loaded and cat /proc/filesystems confirms:
Code:
cat /proc/filesystems
nodev sysfs
nodev rootfs
nodev bdev
nodev proc
nodev tmpfs
nodev sockfs
nodev pipefs
nodev anon_inodefs
nodev devpts
nodev ramfs
vfat
msdos
yaffs
yaffs2
nodev mqueue
nodev mtd_inodefs
ext2
/sd-ext is created and the mount command that I'm issuing is:
Code:
busybox mount -r -w -t ext2 /dev/block/mmcblk0p2 /sd-ext
I think the memory allocation is using something non-standard, perhaps the kernel for the mtk6516 is similar enough...
http://groups.google.com/group/mt6516-linux/browse_thread/thread/2b6896ce22570932
I tried this, but unsuccessful.
/data/local # insmod ext3.ko
insmod: can't insert 'ext3.ko': invalid module format
/data/local # insmod ext2.ko
insmod: can't insert 'ext2.ko': invalid module format
/data/local # insmod ext4.ko
insmod: can't insert 'ext4.ko': invalid module format
You could provide the modules compiled for us?
The kernel also does not support swap.
Thank you.
kindly post the output of (after trying insmod ext2.ko )
dmesg
and
uname -a
riystetyt said:
I tried this, but unsuccessful.
/data/local # insmod ext3.ko
insmod: can't insert 'ext3.ko': invalid module format
/data/local # insmod ext2.ko
insmod: can't insert 'ext2.ko': invalid module format
/data/local # insmod ext4.ko
insmod: can't insert 'ext4.ko': invalid module format
You could provide the modules compiled for us?
The kernel also does not support swap.
Thank you.
Click to expand...
Click to collapse
Hello, thanks for your quick answer!
Errors for ext2.ko in dmesg:
[30005.453739] ext2: Unknown symbol kmalloc_caches (err 0)
[30005.454575] [17976:insmod] sig 17 to [11249:sh]
uname -a:
/data/local # uname -a
Linux localhost 2.6.35.7 #1 PREEMPT Mon Jan 9 16:05:35 CST 2012 armv6l GNU/Linux
Thanks for your help!
Is this the ext2.ko module you are trying to load?
ls -l /system/lib/modules/ext2.ko
-rw-r--r-- root root 756026 2012-05-02 18:20 ext2.ko
Hello, I get the ext2.ko in your post on eten-users. Works like a charm! I had only about 8MB free and now with your module and Link2sd has 120MB. Thanks!
Glad it helps you.
In truth I don´t know what mediatek were thinking when they released an android kernel with so little nand storage space and no ext2 support.
Hex Freq Value MTK CPU
Code:
0x68t
0xdft
0x41t
0xd8t
0xeat
0xf8t
0x91t
0x7t
0x19t
0x27t
0x64t
0xf1t
0x93t
0xedt
0x21t
0x59t
0x6ft
0x1t
0x83t
0x39t
Could you please post the ext2.ko that works with the 2.6.35.7? The one that riystetyt points.
You can download it from one of my G11i Pro or HD7 ROMs (check my signature).
Great, checking now.
Did you try compiling zram for the mtk6573?
---------- Post added at 04:12 PM ---------- Previous post was at 03:24 PM ----------
By the way, how did you solve the "invalid module format" issue?
Thanks for your replies
build <drivers> error 2
Where i miss?
@casacristo
Any updates on the compressed swap? I can help testing
My phone has the 2.6.35.7 kernel mt6573
I tried to download the .rar from eten-users but the dropbox link is broken.
Thanks...
casacristo?
bump
Why don't you ask him via PM instead of doing bumps? Probably he's busy to look at this thread...
maybe its help?
http://www.pudn.com/downloads391/doc/comm/detail1673271.html
Thanks for the suggestion but tried sending a private sms to casacristo with no luck.
Sadly I also found that if the kernel does not support swap, swap can't be loaded as a module, so we can't compile a swap module.
The page provided has the datasheet which as far as I know has the technical specs of the mt6573 processor, not the kernel, but I hope there is something there that can be used to compile a custom kernel.
---------- Post added at 10:06 AM ---------- Previous post was at 10:01 AM ----------
Hey just found this: what does it mean? the guy who posted this has the source?
================================================================================================
drivers debug
-------------------------------------------------------------------------------------------------------------
board_init
-------------------------------------------------------------------------------------------------------------
/mediatek/platform/mt6573/kernel/core/mt6573_devs.c
所有的驱动名对应的设备名都可以在这里找到!
-------------------------------------------------------------------------------------------------------------
lcd
-------------------------------------------------------------------------------------------------------------
/mediatek/custom/common/uboot/lcm
/mediatek/custom/common/kernel/lcm
CUSTOM_UBOOT_LCM = ili9481_dpi
***********************************************************
LCM_WIDTH = 320
LCM_HEIGHT = 480
CUSTOM_UBOOT_LCM = ili9481_dpi
CUSTOM_KERNEL_LCM = ili9481_dpi
***********************************************************
-------------------------------------------------------------------------------------------------------------
camera
-------------------------------------------------------------------------------------------------------------
kernel
/mediatek/custom/common/kernel/imgsensor/src
kd_imgsensor.h
kd_sensorlist.h
hal
/mediatek/custom/common/hal/imgsensor/
sensorlist.cpp
MTKCameraHardware.cpp
***********************************************************
CUSTOM_HAL_CAMERA = camera
CUSTOM_HAL_IMGSENSOR = gc2015_yuv
CUSTOM_KERNEL_IMGSENSOR = gc2015_yuv
CUSTOM_HAL_MAIN_IMGSENSOR = gc2015_yuv
CUSTOM_KERNEL_MAIN_IMGSENSOR = gc2015_yuv
***********************************************************
-------------------------------------------------------------------------------------------------------------
TouchPanel
-------------------------------------------------------------------------------------------------------------
/mediatek/custom/common/kernel/touchpanel/src/mtk_tpd.c
tpd_driver_add(&tpd_device_driver);
platform_driver_unregister(&tpd_driver);
***********************************************************
CUSTOM_KERNEL_TOUCHPANEL = COMM
# default settings: generic
# candidate settings: generic;eeti_pcap7200
# select the panel used by certain project.
***********************************************************
-------------------------------------------------------------------------------------------------------------
flash
-------------------------------------------------------------------------------------------------------------
CUSTOM_MEMORY_HDR = mediatek/custom/$(PROJECT)/preloader/inc/custom_MemoryDevice.h
CUSTOM_NAND_HDR = mediatek/custom/$(PROJECT)/common/nand_device_list.h
MEMORY_DEVICE_XLS = mediatek/build/tools/emigen/$(MTK_PLATFORM)/MemoryDeviceList_$(MTK_PLATFORM).xls
-------------------------------------------------------------------------------------------------------------
GPIO_config
-------------------------------------------------------------------------------------------------------------
./mediatek/build/makemtk.mk +294
drvgen:
ifneq ($(PROJECT),generic)
$(hide) echo $(SHOWTIME) [email protected]
$(hide) echo -e \\t\\t\\t\\b\\b\\b\\bLOG: $(S_LOG)[email protected]
$(hide) mediatek/source/dct/DrvGen mediatek/custom/$(PROJECT)/kernel/dct/dct/codegen.dws $(DEAL_STDOUT_DRVGEN) && \
$(SHOWRSLT) $$? $(LOG)[email protected] || \
$(SHOWRSLT) $$? $(LOG)[email protected]
endif
*********************************************
mediatek/source/dct/DrvGen
mediatek/custom/$(PROJECT)/kernel/dct/dct/codegen.dws
*********************************************
-------------------------------------------------------------------------------------------------------------
G-sensor
-------------------------------------------------------------------------------------------------------------
int hwmsen_gsensor_add(struct sensor_init_info* obj)
/mediatek/custom/common/kernel/accelerometer/auto/
/mediatek/config/mtk/ProjectConfig.mk:188:MTK_SENSOR_SUPPORT = yes
# Android sensor device
MTK_SENSOR_SUPPORT = yes
CUSTOM_KERNEL_MAGNETOMETER =
#akm8962
#akm8975
#auto for detcet by lilingyun
CUSTOM_KERNEL_ACCELEROMETER = auto
CUSTOM_KERNEL_ALSPS = tmd2771
CUSTOM_KERNEL_BAROMETER =
CUSTOM_KERNEL_GYROSCOPE =
#l3g4200d
#if defined(MTK_AUTO_DETECT_ACCELEROMETER)
/mediatek/source/kernel/drivers/hwmon/hwmsen/Hwmsen_dev.c
********************************************
#auto for detcet by lilingyun
CUSTOM_KERNEL_ACCELEROMETER = auto
*******************************************
-------------------------------------------------------------------------------------------------------------
compass
-------------------------------------------------------------------------------------------------------------
mediatek/custom/common/kernel/magnetometer/akm8962/akm8962.c
mediatek/custom/tm100/kernel/magnetometer/akm8962/cust_mag.c
*********************************************
CUSTOM_KERNEL_MAGNETOMETER =
#akm8962
#akm8975
********************************************
-------------------------------------------------------------------------------------------------------------
ALS/PS 光感 接近传感器
-------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_ALSPS = tmd2771
*********************************************
mediatek/custom/common/kernel/alsps/tmd2771/tmd2771.c
mediatek/custom/common/kernel/alsps/tmd2771/tmd2771.h
mediatek/custom/tm100/kernel/alsps/tmd2771/cust_alsps.c
-------------------------------------------------------------------------------------------------------------
GYRO-sensor motion sensor 陀螺仪
-------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_GYROSCOPE =
#l3g4200d
*********************************************
mediatek/custom/common/kernel/gyroscope/l3g4200d/l3g4200d.c
mediatek/custom/tm100/kernel/gyroscope/l3g4200d/cust_gyro.c
-------------------------------------------------------------------------------------------------------------
BAROMETER-sensor 气压计
-------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_BAROMETER =
#ms5607
*********************************************
mediatek/custom/tm100/kernel/barometer/ms5607/cust_baro.c
mediatek/custom/common/kernel/barometer/ms5607/ms5607.c
------------------------------------------------------------------------------------------------------------
flashlight
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_HAL_FLASHLIGHT = dummy_flashlight
CUSTOM_KERNEL_FLASHLIGHT = dummy_flashlight
*********************************************
mediatek/custom/common/kernel/flashlight/dummy_flashlight/dummy_flashlight.c
mediatek/custom/common/kernel/flashlight/src/kd_flashlightlist.c
------------------------------------------------------------------------------------------------------------
jogball
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_JOGBALL =
*********************************************
mediatek/custom/common/kernel/jogball/
------------------------------------------------------------------------------------------------------------
leds
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_LEDS = mt65xx
*********************************************
mediatek/custom/common/kernel/leds
------------------------------------------------------------------------------------------------------------
matv
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_HAL_MATV =
CUSTOM_KERNEL_MATV =
HAVE_MATV_FEATURE = no
*********************************************
mediatek/custom/common/kernel/matv/mt5193/matv.c
------------------------------------------------------------------------------------------------------------
sound
------------------------------------------------------------------------------------------------------------
*********************************************
MTK_SOUNDRECORDER_APP = yes
CUSTOM_KERNEL_SOUND = speaker
*********************************************
mediatek/custom/common/kernel/sound/inc/yusu_android_speaker.h
mediatek/custom/tm100/kernel/sound/speaker/yusu_android_speaker.c
------------------------------------------------------------------------------------------------------------
USB
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_USB = mt6573
*********************************************
mediatek/custom/common/kernel/usb/src/Makefile
mediatek/custom/mt6573/kernel/usb/src/mtk_usb_custom.c
mediatek/custom/mt6573/kernel/usb/src/mtk_usb_custom.h
mediatek/custom/mt6573/uboot/inc/cust_sdc.h
mediatek/platform/mt6573/kernel/drivers/usb-gadget/
mediatek/platform/mt6573/kernel/drivers/power/
------------------------------------------------------------------------------------------------------------
BT
------------------------------------------------------------------------------------------------------------
*********************************************
MTK_WLAN_CHIP = MT6620
# candidate settings: MT6620
MTK_BT_CHIP = MTK_MT6620
# candidate settings: MTK_MT6611/MTK_MT6612/MTK_MT6616/MTK_MT6620
MTK_WLAN_SUPPORT = yes
MTK_BT_SUPPORT = yes
MTK_WLAN_SUPPORT = yes
MTK_WLANBT_SINGLEANT = no
MTK_BT_30_HS_SUPPORT = yes
####config BT feature###########
# please do not modify these options
MTK_BT_21_SUPPORT = yes
MTK_BT_30_SUPPORT = yes
MTK_BT_40_SUPPORT = yes
MTK_BT_FM_OVER_BT_VIA_CONTROLLER = yes
MTK_BT_PROFILE_OPP = yes
MTK_BT_PROFILE_SIMAP = yes
MTK_BT_PROFILE_PRXM = yes
MTK_BT_PROFILE_PRXR = yes
MTK_BT_PROFILE_HIDH = yes
MTK_BT_PROFILE_FTP = yes
MTK_BT_PROFILE_PBAP = yes
MTK_BT_PROFILE_MANAGER = yes
MTK_BT_PROFILE_BPP = yes
MTK_BT_PROFILE_BIP = yes
MTK_BT_PROFILE_DUN = yes
MTK_BT_PROFILE_PAN = yes
MTK_BT_PROFILE_HFP = yes
MTK_BT_PROFILE_A2DP = yes
MTK_BT_PROFILE_AVRCP = yes
MTK_BT_PROFILE_AVRCP14 = yes
MTK_BT_PROFILE_TIMEC = no
MTK_BT_PROFILE_TIMES = no
MTK_BT_PROFILE_MAPS = no
MTK_BT_PROFILE_MAPC = no
MTK_BT_PROFILE_SPP = yes
####config BT feature end ####
*********************************************
mediatek/custom/common/kernel/btwlanem/btwlanem/btwlanem.c
------------------------------------------------------------------------------------------------------------
EEPROM
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_HAL_EEPROM = dummy_eeprom
CUSTOM_KERNEL_EEPROM = dummy_eeprom
*********************************************
mediatek/custom/common/kernel/eeprom/dummy_eeprom/dummy_eeprom.c
------------------------------------------------------------------------------------------------------------
FM
------------------------------------------------------------------------------------------------------------
*********************************************
MTK_FM_CHIP = MT6620_FM
MTK_FM_SUPPORT = yes
MTK_FM_TX_SUPPORT = yes
MTK_FM_AUDIO = FM_ANALOG_INPUT
#FM_DIGITAL_INPUT
*********************************************
mediatek/custom/common/kernel/fm/mt6620/dummy.c
------------------------------------------------------------------------------------------------------------
voice coil motor driver
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_HAL_LENS = dummy_lens dummy_lens
CUSTOM_KERNEL_LENS = dummy_lens dummy_lens
CUSTOM_HAL_MAIN_LENS = dummy_lens
CUSTOM_HAL_MAIN_BACKUP_LENS =
CUSTOM_HAL_SUB_LENS = dummy_lens
CUSTOM_HAL_SUB_BACKUP_LENS =
CUSTOM_KERNEL_MAIN_LENS = dummy_lens
CUSTOM_KERNEL_MAIN_BACKUP_LENS =
CUSTOM_KERNEL_SUB_LENS = dummy_lens
CUSTOM_KERNEL_SUB_BACKUP_LENS =
*********************************************
mediatek/custom/common/kernel/lens/dummy_lens/dummy_lens.c
------------------------------------------------------------------------------------------------------------
OFN
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_OFN = ofn1090
*********************************************
mediatek/custom/common/kernel/ofn/inc
mediatek/custom/tm100/kernel/ofn/ofn1090/cust_ofn.c
------------------------------------------------------------------------------------------------------------
wifi
-----------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_WIFI =
MTK_SCREEN_OFF_WIFI_OFF = no
MTK_WIFI_P2P_SUPPORT = yes
MTK_WIFI_HOTSPOT_SUPPORT = yes
*********************************************
mediatek/custom/common/kernel/wifi/mt592x/dummy.c
------------------------------------------------------------------------------------------------------------
HEADSET
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_HEADSET = accdet
MTK_HEADSET_ICON_SUPPORT = yes
*********************************************
mediatek/custom/tm100/kernel/headset/accdet/accdet_custom.h
------------------------------------------------------------------------------------------------------------
board 配置与分区信息
------------------------------------------------------------------------------------------------------------
*********************************************
*********************************************
mediatek/custom/tm100/kernel/core/src/board.c
mediatek/custom/tm100/kernel/core/src/partition.c
------------------------------------------------------------------------------------------------------------
PM
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_BATTERY = battery
*********************************************
mediatek/custom/tm100/kernel/battery/battery/cust_battery.h
mediatek/custom/tm100/kernel/battery/battery/custom_fuel_gauge.h
mediatek/platform/mt6573/kernel/drivers/power/mt6573_battery.c
------------------------------------------------------------------------------------------------------------
RTC
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_RTC = rtc
# default settings: rtc
# candidate settings: rtc
# For RTC
*********************************************
mediatek/custom/tm100/kernel/rtc/rtc/rtc-mt6573.h
mediatek/platform/mt6573/kernel/drivers/rtc/mtk_rtc.c

I need your knowledge about idc files!

Hi everyone!
I want to run my Waltop Graphic Tablet(VendorID=172f ProductID=0032 Version=0110) on my Android Tablet. It is not directly supported, so I generated a file with the name Vendor_172f_Model_0037_Version_0110.idc with the content:
Code:
# touch.deviceType = touchScreen | touchPad | pointer | default
touch.deviceType = pointer
# orientationAware
# touch.orientationAware = 0 or 1
touch.orientationAware = 1
# gestureMode
# Definition: touch.gestureMode = pointer | spots | default
touch.gestureMode = pointer
# Definition: device.internal = 0 | 1
device.internal = 0
This file I copied to /system/usr/idc
Sadly nothing happened. I found this stuff in an old thread here, where it worked. So if anyone knows about this kind of stuff you might want to tell me: Did I something wrong? And if not how do I check if android even uses the idc file when I plug in my Graphic Tablet

Categories

Resources