LSX-blog

Feed Rss

【原创 】刷固件Layer1到手机FLASH(硬刷)

12.26.2013, Linux, osmocomBB, 破解, by .
开头:

注意:本文章并不是做GSM 嗅探必须的,平时我们刷机叫软刷是刷到内存里面的,断电就消失了,这个是硬刷,刷到flash里面的,断电不消失,开机就运行的。
本文章经过作者实测可行,这只是单个应用程序,官方还有多个应用程序菜单

这篇教程解释了怎样把应用程序刷到C118手机里面。你一定要仔细的阅读每一个细节,否则你的手机可能会变砖。即使你遵循本教程,您可能也会变砖,如果你遇到电缆问题,弱电池或软件故障,目前firmare还不支持电池充电功能。

总共需要三部分:
  1. 原bootloader,第一次刷我就把这个清空了,直接成砖了
  2. osmocom loader,这个是osmocom的loader
  3. 应用程序,这个可以是rssi,layer1 如果没有bootloader,手机就成砖了
内存布局:
  • 0x000000-0x00ffff: Flash page 0
  • 0x010000-0x01ffff: Flash page 1
  • … more Flash pages …
  • 0x800000-0x83ffff: Ram

osmocom flash 布局:
  • 0x000000-0x001fff: Compal loader
  • 0x002000-0x00ffff: OSMOCOM loader
  • 0x010000-……..: OSMOCOM application and storage

注意:C118 bootloader和OSMOCOM loader将位于同一flash页面!

准备工作

解锁 Osmocom loader 的flash write:
1
2
$ cd src/target/firmware/
$ edit Makefile
开启下面的编译选项:
1
2
CFLAGS += -DCONFIG_FLASH_WRITE
CFLAGS += -DCONFIG_FLASH_WRITE_LOADER
更改loader
1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/target/firmware/apps/loader/main.c b/src/target/firmware/apps/loader/main.c
index 2ff6f9c..e488c98 100644
--- a/src/target/firmware/apps/loader/main.c
+++ b/src/target/firmware/apps/loader/main.c
@@ -438,6 +438,9 @@ static void key_handler(enum key_codes code, enum key_states state)
 		puts("Resetting due to keypress.\n");
 		device_reset();
 		break;
+	case KEY_MENU:
+		device_jump((void *)0x10000);
+		break;
 	default:
 		break;
 	}
编译
1
make

安装

引导手机到downloading 到RAM
1
2
$ cd src
$ host/osmocon/osmocon -p /dev/ttyUSB0 -m c123xor target/firmware/board/compal_e88/loader.compalram.bin

你将看到类似以下输出:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Received PROMPT1 from phone, responding with CMD
read_file(target/firmware/board/compal_e88/loader.compalram.bin): file_size=18436, hdr_len=4, dnload_len=18443
Received PROMPT2 from phone, starting download
handle_write(): 4096 bytes (4096/18443)
handle_write(): 4096 bytes (8192/18443)
handle_write(): 4096 bytes (12288/18443)
handle_write(): 4096 bytes (16384/18443)
handle_write(): 2059 bytes (18443/18443)
handle_write(): finished
Received DOWNLOAD ACK from phone, your code is running now!
Received DOWNLOAD ACK from phone, your code is running now!
 
OSMOCOM Loader (revision osmocon_v0.0.0-1322-g43c588b-modified)
======================================================================
Running on compal_e88 in environment compalram
Found flash of 2097152 bytes at 0x0 with 2 regions

现在打开另一个终端

装载loader

备份loader

1
2
$ cd src
$ host/osmocon/osmoload memdump 0x000000 0x2000 compal_loader.bin
测试flash:

首先我们将loader装载到错误的位置,如果失败,我们仍然还有原来的loader, 这样不会把手机搞成砖.

1
2
3
4
$ host/osmocon/osmoload funlock 0x010000 0x10000
$ host/osmocon/osmoload ferase 0x010000 0x10000
$ host/osmocon/osmoload fprogram 0 0x010000 compal_loader.bin
$ host/osmocon/osmoload fprogram 0 0x012000 target/firmware/board/compal_e88/loader.e88loader.bin

如果上面没有出现错误之类的,下面我们就开始动真格的了

1
2
3
4
$ host/osmocon/osmoload funlock 0x000000 0x10000
$ host/osmocon/osmoload ferase 0x000000 0x10000
$ host/osmocon/osmoload fprogram 0 0x000000 compal_loader.bin
$ host/osmocon/osmoload fprogram 0 0x002000 target/firmware/board/compal_e88/loader.e88loader.bin

装载应用程序

注意:在你把应用程序刷到手机里面你是要看一下你刷的应用程序的大小的,有多少你就清空多大的flash空间,我这里清空了64KB

1
2
3
$ host/osmocon/osmoload funlock 0x010000 0x20000
$ host/osmocon/osmoload ferase 0x010000 0x20000
$ host/osmocon/osmoload fprogram 0 0x010000 target/firmware/board/compal_e88/layer1.e88flash.bin

测试

  1. 关闭手机
  2. 断开串口线
  3. 打开手机,你会看见一个空白的蓝色屏幕,这时你可不要以为手机成砖了,我第一次以后我手机又牺牲了,吓死人了.
  4. 按 Menu 按钮,开始应用程序,这时就出现了.关于Menu按钮,其实就是左右上面键中间的那个圆的.

如何使用:

让手机处于关于状态,连接后各个模块及线路,确保能误别出来,模块CP2102,如图所示:

image

1
2
cd src
host/osmocon/osmocon -p /dev/ttyUSB0

然后开机,出现蓝色空白屏幕,接着按菜单键,就是那个圆点,出现如下图所示表示成功image

关于后面的步骤,就是其它的文章操作,一样了,就不多讲了.

【原创 】刷固件Layer1到手机FLASH(硬刷) 有 454 条回应

  1. Saved as a favorite, I love your blog!

    回复
  2. Excellent goods from you, man. I have understand your stuff previous to and you’re just too fantastic. I actually like what you have acquired here, certainly like what you are stating and the way in which you say it. You make it enjoyable and you still take care of to keep it smart. I cant wait to read far more from you. This is actually a great website.| а

    回复
  3. Wow, this paragraph is pleasant, my sister is
    analyzing such things, thus I am going to convey her.

    回复
  4. This article gives clear idea in support of the new people of blogging, that really how to do blogging and site-building.| а

    回复
  5. When I originally commented I appear to have clicked the -Notify me when new comments are added- checkbox and from now on whenever a comment is added I get four emails with the exact same comment. Perhaps there is an easy method you can remove me from that service? Thank you!

    回复
  6. Good information. Lucky me I discovered your site by chance (stumbleupon). I have saved it for later!

    回复
  7. You ought to be a part of a contest for one of the best sites online. I’m going to recommend this web site!| а

    回复
  8. You have made some decent points there. I checked on the internet for more info about the issue and found most people will go along with your views on this web site.| а

    回复
  9. I’m more than happy to discover this web site. I want to to thank you for ones time due to this fantastic read!! I definitely savored every bit of it and I have you bookmarked to check out new stuff in your site.

    回复
  10. I couldn’t refrain from commenting. Very well written!

    回复
  11. I visited multiple web pages but the audio quality for audio songs existing at this web site is genuinely superb.| а

    回复
  12. I read this article fully on the topic of the comparison of latest and previous technologies, it’s awesome article.| а

    回复
  13. I needed to thank you for this great read!! I definitely loved every little bit of it. I have got you saved as a favorite to look at new things you post…

    回复
  14. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates. I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.| а

    回复
  15. This information is worth everyone’s attention. When can I
    find out more? adreamoftrains web hosting sites

    回复
  16. Hello there, just became aware of your blog through Google, and found that it is really informative. I’m gonna watch out for brussels. I’ll appreciate if you continue this in future. Numerous people will be benefited from your writing. Cheers!| а

    回复
  17. Keep on writing, great job!

    回复
  18. After looking into a few of the articles on your blog, I truly like your way of blogging. I bookmarked it to my bookmark site list and will be checking back soon. Please visit my website too and tell me your opinion.

    回复
  19. hey there and thank you for your info – I have certainly picked up
    anything new from right here. I did however expertise
    several technical points using this website, since I experienced to reload the web site lots of times previous to I could get it to load correctly.
    I had been wondering if your web host is OK? Not that I’m complaining, but slow loading instances times will sometimes affect your placement in google and
    could damage your high quality score if ads and marketing with Adwords.
    Well I am adding this RSS to my e-mail and could look out for
    a lot more of your respective intriguing content. Ensure that you update this again soon.

    回复
  20. Hello, this weekend is good in favor of me, since this time i am reading this impressive educational post here at my home.

    回复
  21. Your way of explaining everything in this paragraph is really fastidious, every one can simply understand it, Thanks a lot.

    回复
  22. Greetings! Very useful advice in this particular post! It’s the little changes that will make the most significant changes. Many thanks for sharing!

    回复
  23. This website was… how do you say it? Relevant!! Finally I’ve found something which helped me. Kudos!

    回复
  24. You’ve made some good points there. I checked on the net for more information about the issue and found most people will go along with your views on this site.

    回复
  25. Howdy! This article couldn’t be written any better! Looking at this article reminds me of my previous roommate! He always kept talking about this. I’ll forward this post to him. Pretty sure he will have a very good read. Thank you for sharing!

    回复
  26. I just want to mention I am just very new to blogging and site-building and definitely loved you’re web page. Most likely I’m likely to bookmark your site . You definitely come with terrific stories. Kudos for revealing your webpage.

    回复
  27. There’s certainly a great deal to find out about this issue. I love all the points you made.

    回复
  28. You have made some good points there. I checked on the net to learn more about the issue and found most individuals will go along with your views on this web site.

    回复
  29. This is a topic which is near to my heart… Cheers! Where are your contact details though?

    回复
  30. When I initially commented I seem to have clicked on the -Notify me when new comments are added- checkbox and now whenever a comment is added I recieve four emails with the same comment. There has to be an easy method you can remove me from that service? Cheers!

    回复
  31. Very quickly this web site will be famous among all blogging users, due to it’s good articles or reviews

    回复
  32. Hi, i read your blog occasionally and i own a similar one and
    i was just wondering if you get a lot of spam responses?
    If so how do you protect against it, any plugin or anything
    you can suggest? I get so much lately it’s driving
    me crazy so any assistance is very much appreciated.

    回复
  33. I am extremely impressed with your writing skills and also with the layout on your weblog.
    Is this a paid theme or did you modify it yourself?
    Anyway keep up the nice quality writing, it’s rare to see a nice blog like this
    one nowadays.

    回复
  34. Hey there! I simply want to give you a huge thumbs up for your excellent info you have got right here on this post. I’ll be coming back to your website for more soon.

    回复
  35. I need to to thank you for this fantastic read!! I absolutely enjoyed every little bit of it. I have got you saved as a favorite to check out new stuff you post…

    回复
  36. I have read so many articles or reviews concerning the blogger lovers but this paragraph is
    genuinely a nice piece of writing, keep it up.

    回复
  37. This blog was… how do I say it? Relevant!! Finally I’ve found something which helped me. Thanks!

    回复
  38. This is a good tip particularly to those new to the blogosphere. Short but very accurate info… Thank you for sharing this one. A must read article!

    回复
  39. You made some really good points there. I looked on the internet for more information about the issue and found most people will go along with your views on this web site.

    回复
  40. Hello outstanding website! Does running a blog
    like this take a massive amount work? I have absolutely
    no knowledge of programming but I was hoping to start my own blog in the near future.

    Anyhow, if you have any ideas or tips for new blog
    owners please share. I know this is off subject but I simply
    needed to ask. Thanks!

    回复
  41. That is a very good tip especially to those fresh to the blogosphere. Brief but very accurate info… Thanks for sharing this one. A must read article!

    回复
  42. Nice post. I learn something new and challenging on blogs I stumbleupon everyday. It’s always interesting to read content from other writers and use something from their web sites.

    回复
  43. Excellent web site you’ve got here.. It’s difficult to find good quality writing like yours these days. I seriously appreciate people like you! Take care!!

    回复
  44. Good post. I learn something totally new and challenging on websites I stumbleupon on a daily basis. It will always be interesting to read articles from other authors and use something from their web sites.

    回复
  45. Having read this I thought it was very informative. I appreciate you spending some time and effort to put this short article together. I once again find myself spending a lot of time both reading and commenting. But so what, it was still worth it!

    回复
  46. bookmarked!!, I really like your site!

    回复

发表评论

电子邮件地址不会被公开。 必填项已用*标注