The Following 55 Users Say Thank You to pali For This Useful Post: | ||
ahmadamaj, AlMehdi, arora.rohan, b-man, Bad_Habit, Bundyo, bzbnd, Captwheeto, chrget, clasificado, Daneel, demolition, divan, don_falcone, drucula, ejasmudar, Estel, flailingmonkey, freemangordon, fw190, gazza_d, gregoranderson, Hurrian, ivgalvez, ivyking, Joseph9560, jpala16, jvollmann, lardman, lma, Megaltariak, Mentalist Traceur, mikhail_ramalho, MINKIN2, MohammadAG, mosiomm, mr_jrt, nicolai, NIN101, onion, OVK, pelago, peterleinchen, petur, prankster, Rob1n, SSLMM, thegman, theonelaw, Tigerite, Transcend, tuxsavvy, vetsin, wumpwoast, zoner |
|
2011-07-17
, 19:35
|
Posts: 63 |
Thanked: 27 times |
Joined on Jul 2011
@ Venezuela
|
#2
|
|
2011-07-23
, 22:26
|
Posts: 2,154 |
Thanked: 8,464 times |
Joined on May 2010
|
#3
|
The Following 4 Users Say Thank You to pali For This Useful Post: | ||
|
2011-07-23
, 22:31
|
Posts: 1,680 |
Thanked: 3,685 times |
Joined on Jan 2011
|
#4
|
The Following User Says Thank You to vi_ For This Useful Post: | ||
|
2011-07-23
, 22:39
|
Posts: 2,154 |
Thanked: 8,464 times |
Joined on May 2010
|
#5
|
|
2011-07-23
, 23:05
|
Banned |
Posts: 778 |
Thanked: 337 times |
Joined on Jun 2010
|
#6
|
|
2011-08-04
, 14:03
|
Posts: 2,225 |
Thanked: 3,822 times |
Joined on Jun 2010
@ Florida
|
#7
|
|
2011-08-05
, 01:46
|
|
Posts: 5,028 |
Thanked: 8,613 times |
Joined on Mar 2011
|
#8
|
The Following 3 Users Say Thank You to Estel For This Useful Post: | ||
|
2011-08-05
, 06:53
|
Posts: 96 |
Thanked: 105 times |
Joined on Aug 2006
@ Finland
|
#9
|
|
2011-08-05
, 07:36
|
Posts: 2,154 |
Thanked: 8,464 times |
Joined on May 2010
|
#10
|
The Following 3 Users Say Thank You to pali For This Useful Post: | ||
Tags |
free maemo!, getbootstate, open source |
|
Year later developers/users could find source code of program getbootstate on gitorious which is now part of harmattan DSME:
https://meego.gitorious.org/meego-mi...getbootstate.c
I asked if this code is compatible with fremantle. Answer from bugtracker:
"Maemo5 and Harmattan getbootstate are quite similar but with one major difference: in maemo5, getbootstate accesses the battery information. In Harmattan, battery checks are moved to the boot loader (NOLO)."
I used strace and gdb to see what exactly fremantle getbootstate doing. bootreason and bootmode read from files /proc/bootreason and /proc/component_version (instead /proc/cmdline - so it is fully incompatible).
Next, a lot of syscalls is about access to partition /dev/mtd1. When I spend time on it I find out that getbootstate using libcal.so for checking if R&D mode state - nothing more from cal.
Last part was somethink about battery (major difference as written in bugtracker). This was only one syscall iocl 0x6000 (with magic param) for device /dev/twl4030-adc. But it was handled by (open source) kernel module twl4030-madc. With source code from:
http://mxr.maemo.org/fremantle/sourc...030-madc.h#117
http://mxr.maemo.org/fremantle/sourc...030-madc.c#394
I was able to decode magic ioctl param. Fremantle getbootstate set channel to 4 and average to 1 and check result.
If result (of ioctl) is 32..85 it say SERVICE battery and LOCAL bootstate. If result is 87..176 it say TEST battery and TEST state. If result is 280..568 it say normal battery and continue checking state. And last if it not set R&D mode (yes, only here it is used) set state to SHUTDOWN and write error.
With all this info I was able to patch harmattan getbootstate for compatibility with fremantle on Nokia N900. I'm attaching source code of patched getbootstate. I tested it only in qemu and here it worked. USE IT AT YOUR OWN RISK.
If Nokia does not release source code of core programs, we can rewrite it...
Note: For checking if R&D mode is set, my patched version use cal.h and libcal.so library for acces to /dev/mtd1 partiotion. This library is closed source (but stable). I do know now about any open source method how to check if R&D mode is set... Maybe somebody know it..
EDIT:
Source code is now in my bzr repository on launchpad: https://code.launchpad.net/~pali/+ju...o_getbootstate
Last edited by pali; 2011-08-11 at 19:24.