View Single Post
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#3
Originally Posted by AapoRantalainen View Post
I made testing with own hildon-desktop and I found it ultimately handy to kill system's hildon-desktop and then start non-installed version on hildon-desktop.
i.e.

as root
Code:
killall hildon-desktop ; /etc/osso-af-init/launch-wrapper.sh stop hildon-desktop /usr/bin/hildon-desktop
killall hildon-desktop ; /etc/osso-af-init/launch-wrapper.sh stop hildon-desktop /usr/bin/hildon-desktop
killall hildon-desktop ; /etc/osso-af-init/launch-wrapper.sh stop hildon-desktop /usr/bin/hildon-desktop
killall hildon-desktop ; /etc/osso-af-init/launch-wrapper.sh stop hildon-desktop /usr/bin/hildon-desktop
killall hildon-desktop ; /etc/osso-af-init/launch-wrapper.sh stop hildon-desktop /usr/bin/hildon-desktop
#And then start own version
(as user)
Code:
maemo-invoker ~/hildon-desktop.launch
I realized that if phone has --set-rd-flags=no-lifeguard-reset this will work. But if it is not in RD-mode, phone will reboot when hildon-desktop dies.

My questions
* How system decides that hildon-desktop is a critical application?
*How I can see which applications are critical?
*How I can change list of critical applications?

Consider my questions as I would make own operating system based on Maemo5.
How system decides that hildon-desktop is a critical application?


An application is 'critical' when it is required for the n900 to run. Imagine hildon-desktop was crashing due to some weird bug with a widget or somthing and It keeps crashing. Either you have a mostly broken semi-working device or you just turn it off and back on again to sort the issue. Did you ever see that UK comedy 'The IT crowd'? It is a comedy show about the IT support staff in a big company. Their running joke is 'have you turned it off and back on again?' The n900 automatically turns itself off and back on again when something goes massively wrong.

Hildon-desktop crashing/killed 5 times in a row? HOLY SHíT, SYSTEM IN MELTDOWN!! RESTART NOW!!

No camera program?? HOW?? RESTART NOW!!!!!11!


There are 2 items used to detect when the shít has hit the fan and trigger a reboot.

1. The watchdog timer (WD). This is a hardware clock that counts down to 0 (possibly up, however this is just an example). There is software that stops it by resetting it back to a value (like 255 or something). If the software crashes, it will stop resetting the counter, the counter will count down to 0 and the CPU will trigger a reboot. The counter takes around 15 seconds to count down (hence BME, BQ27XXX module crash after short time after BME start stop thing.).

2. DSME. something STATE MANAGMENT ENTITY. This is the program responsible for 'tickling' (resetting) the WD timer. When DSME stops tickling, the CPU stops lolling and a reboot is triggered.

So a process is 'critical' when it is started with DSME. When a process that is started with DSME fails a particular number of times or won't start or crashes (all these rules are defineable) DSME will force a reboot. If DSME fails or stops tickling, the WD will force a reboot.


How I can see which applications are critical?

Unfortunatly DSME does not have a 'list' function. However, if you read ALL the scripts in:

Code:
/etc/init.d/
/etc/event.d/
/etc/X11/xsession-post.d
/etc/X11/xsession.d
You will find various programs being started by DSME including hildon desktop and camera-ui etc.

Start by looking in the xsession folders.


How I can change list of critical applications?

By editing the way DSME launches the critical processes in the various start up scripts found in the various locations above.

***BIG FAT WARNING!!***


This is 'going deep', as deep as the maemo 5 Mariana trench. These hackjob bootup scripts are what holds this whole rust bucket together. Make a backup and be ready to re-flash before you bugger up the whole thing.

Consider my questions as I would make own operating system based on Maemo5.

lolwut?
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.

Last edited by vi_; 2012-04-04 at 09:51.
 

The Following 7 Users Say Thank You to vi_ For This Useful Post: