免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 859 | 回复: 0
打印 上一主题 下一主题

项目一 iMX21整体方案(4): Suspend [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-05-02 13:05 |只看该作者 |倒序浏览

                               

  Normal
  0
  
   
  
  

Suspend2 on
Imx21

Suspend2 is
an add-on feature I implemented on iMX21 platform. This work is based on
suspend2 on i386 on (please refer to suspend2.com). I port onto iMX21 platform
and add all the suspend/resume feature in all the devices driver.

Except for
the basic function of suspend/resuming, the suspend makes use of a dynamic
tool-bar to show the procedure of suspend/resuming. The GUI picture will be
appended later…

The process
of "booting->suspend->resuming->suspend " works like:

start
booting-> applications run, and user application runs (booting) ->
user application exits, save data into swap partition (suspend) -> copy data
back, user application runs (resuming)->user application exits, save data
into swap partition (suspend)

FAQ of
suspend.

-Where is suspend image saved.
Suspend image is saved on swap partition. In this implement
of iMX21 platform, there is one swap partition on mmc/sd card created. Its
device name is /dev/mmc/part2.

-what happens during the sleeping process (e.g. what things
are saved and to which file/s)
When we exit user application, we will check whether it
meets the condition of boot and reboot. If it does, system goto shutdown or
reboot; otherwise, system will go to suspend.

In the suspending process, we enter kernel mode and save the
data in the memory space into /dev/mmc/part2. (please refer to
/home/s2script/hibernate)
- what's the flow of execution during resumption mode (e.g., what are the
scripts called)
When we
resume from suspend, we wil check whether suspend image is stored in partition2
(/dev/mmc/part2). If there is an image matched with our kernel, the system will
recove from the image, and the data in swap partition will be copied back into
memory space. (Kernel mode)

After that,
the system will go to user space. we return to the
"/home/s2script/hibernate". please find "echo 1 >
/proc/software_suspend/do_suspend". Then /home/s2script/hibernate calls up
our user application routing restart section
- what files are needed to support this feature
The important files that is used by suspend mode:
kernel with
suspend supported;
user
application routing to call /home/s2script/hibernate;
swap
partitions on SD card
- any other information you can give us.
If there is any features you would like to test whether it
can work after resuming, you need test whether this feature can work after our
system works a long time.
Because our
resuming process actually works like our machine does not shut down.

For
a feature that is called up at the beginning"start" and
"restart" section, the first one is the feature is called up with
minor applications; while the second case is the feature is called up after
main applications in system.

  Normal
  0
  
   
  
  

Two callgraphs ofsuspend task

  Normal
  0
  
   
  
  



Any question about suspend:

  Normal
  0
  
   
  
  

Contact me
|
               
               
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/7273/showart_1916169.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP