how does this command(at+cfun=1,1) works?
Hi Everyone, When this command (at+cfun=1,1) is executed on phone, it does a reboot. I want to know which and how this command calls the kernel level functions. I googled this, but seems like all the data explains only about AT command and not as to how this reboot process is done. Coz what I know is that reboot process needs a syncing of filesystem, so this command must be calling some kernel functions to do that. Please if anyone can give more detail on this. Thank you Ritesh
Le lundi 17 décembre 2012 à 12:41 +0530, Ritesh Harjani a écrit :
Hi Everyone,
When this command (at+cfun=1,1) is executed on phone, it does a reboot. I want to know which and how this command calls the kernel level functions. I googled this, but seems like all the data explains only about AT command and not as to how this reboot process is done.
The kernel alone is not responsible of interpreting Hayes commands (AT). According to ETSI TS 100 916 V7.4.0 (1999-11) Technical Specification Digital cellular telecommunications system (Phase 2+); AT command set for GSM Mobile Equipment (ME) (GSM 07.07 version 7.4.0 Release 1998), Section 8.2 Set phone functionality +CFUN (found through by http://wiki.openmoko.org/wiki/Hardware:AT_Commands ), this command (AT+CFUN=1,1) is one of the command a "baseband" must implement. And this command is asking for a reboot. So what you describe seems more likely to be a hardware problem. Regards. -- Yann Droneaud OPTEYA
Hi Yann, On Mon, Dec 17, 2012 at 3:12 PM, Yann Droneaud <ydroneaud@opteya.com> wrote:
Le lundi 17 décembre 2012 à 12:41 +0530, Ritesh Harjani a écrit :
Hi Everyone,
When this command (at+cfun=1,1) is executed on phone, it does a reboot. I want to know which and how this command calls the kernel level functions. I googled this, but seems like all the data explains only about AT command and not as to how this reboot process is done.
The kernel alone is not responsible of interpreting Hayes commands (AT).
According to ETSI TS 100 916 V7.4.0 (1999-11) Technical Specification Digital cellular telecommunications system (Phase 2+); AT command set for GSM Mobile Equipment (ME) (GSM 07.07 version 7.4.0 Release 1998), Section 8.2 Set phone functionality +CFUN (found through by http://wiki.openmoko.org/wiki/Hardware:AT_Commands ), this command (AT+CFUN=1,1) is one of the command a "baseband" must implement.
And this command is asking for a reboot. So what you describe seems more likely to be a hardware problem.
On Android phones(some of them) there are essentially two processors. The *Application Processor (AP)* where your Android operating system (AOS) and user interface (UI) lives, and the *Baseband/Cellular Processor (BP/CP)* where all the GSM and other high-tech communication magic happens, including the modem we wish to communicate with. Here, AP and BP communicates via UART (serial line), USB, SPI or through shared RAM and/or a combination of these. Therefore there will always be some path directly accessible from the outside that we should be able to use to communicate directly with the BP. So, what I am asking for is not any hardware problem. What I have figured out that, this command (at+cun=1,1) calls for sysrq reset which does a emergency restart. But, I wanted to know the exact path that it follows before calling Sysrq key. Thank you Ritesh
Regards.
-- Yann Droneaud OPTEYA
Hi, Le lundi 17 décembre 2012 à 15:32 +0530, Ritesh Harjani a écrit :
So, what I am asking for is not any hardware problem. What I have figured out that, this command (at+cun=1,1) calls for sysrq reset which does a emergency restart.
That's the problem in the first place. This function shouldn't be linked to the emergency restart except in case of emergency (watchdog).
But, I wanted to know the exact path that it follows before calling Sysrq key.
IMHO you're looking in the wrong way to fix your problem. Instead of doing something like 'echo b > /proc/sysrq-trigger' [1] [2] why not call "reboot" . If "reboot" or "shutdown -R now" are not available, you could probably use the following sequence: echo 'e' > /proc/sysrq-trigger sleep 1 echo 'i' > /proc/sysrq-trigger sleep 1 echo 's' > /proc/sysrq-trigger sleep 1 echo 'u' > /proc/sysrq-trigger sleep 1 echo 'b' > /proc/sysrq-trigger This is going to do what 'init' is doing when a "reboot" is issued: send SIGTERM to each processes, send SIGKILL to remaining processes, flush the filesystems, try to remount them read-only, and then proceed to reboot. [1] http://en.wikipedia.org/wiki/Magic_SysRq_key [2] http://kernel.org/doc/Documentation/sysrq.txt PS: you're looking for sysrq_handle_reboot() in drivers/tty/sysrq.c which call emergency_restart(). Regards. -- Yann Droneaud OPTEYA
On Mon, Dec 17, 2012 at 2:02 AM, Ritesh Harjani <ritesh.harjani@gmail.com>wrote:
Hi Yann,
On Mon, Dec 17, 2012 at 3:12 PM, Yann Droneaud <ydroneaud@opteya.com>wrote:
Le lundi 17 décembre 2012 à 12:41 +0530, Ritesh Harjani a écrit :
Hi Everyone,
When this command (at+cfun=1,1) is executed on phone, it does a reboot. I want to know which and how this command calls the kernel level functions. I googled this, but seems like all the data explains only about AT command and not as to how this reboot process is done.
The kernel alone is not responsible of interpreting Hayes commands (AT).
According to ETSI TS 100 916 V7.4.0 (1999-11) Technical Specification Digital cellular telecommunications system (Phase 2+); AT command set for GSM Mobile Equipment (ME) (GSM 07.07 version 7.4.0 Release 1998), Section 8.2 Set phone functionality +CFUN (found through by http://wiki.openmoko.org/wiki/Hardware:AT_Commands ), this command (AT+CFUN=1,1) is one of the command a "baseband" must implement.
And this command is asking for a reboot. So what you describe seems more likely to be a hardware problem.
On Android phones(some of them) there are essentially two processors. The *Application Processor (AP)* where your Android operating system (AOS) and user interface (UI) lives, and the *Baseband/Cellular Processor (BP/CP)* where all the GSM and other high-tech communication magic happens, including the modem we wish to communicate with. Here, AP and BP communicates via UART (serial line), USB, SPI or through shared RAM and/or a combination of these. Therefore there will always be some path directly accessible from the outside that we should be able to use to communicate directly with the BP.
So, what I am asking for is not any hardware problem. What I have figured out that, this command (at+cun=1,1) calls for sysrq reset which does a emergency restart. But, I wanted to know the exact path that it follows before calling Sysrq key.
Did you try 'strace'?
On Mon, Dec 17, 2012 at 7:11 AM, Ritesh Harjani <ritesh.harjani@gmail.com>wrote:
Hi Everyone,
When this command (at+cfun=1,1) is executed on phone, it does a reboot. I want to know which and how this command calls the kernel level functions. I googled this, but seems like all the data explains only about AT command and not as to how this reboot process is done.
Coz what I know is that reboot process needs a syncing of filesystem, so this command must be calling some kernel functions to do that. Please if anyone can give more detail on this.
Thank you Ritesh
This question probably belongs to the relevant phone's mailing list. For the most part if you send a reboot command from the command line most desktop Linux will do whatever is required to carry out the reboot process including sync with filesystems. at+cfun might be just calling the reboot command internally. Please have a look at the source code for "at".
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- Thank you Warm Regards Anuz
participants (4)
-
Anand Arumugam -
Anuz Pratap Singh Tomar -
Ritesh Harjani -
Yann Droneaud