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(硬刷) 有 99 条回应

  1. It is perfect time to make some plans for the future and it is time to be happy.
    I have read this post and if I could I wish to suggest you
    some interesting things or suggestions. Maybe you could write
    next articles referring to this article. I want to read even more things about it!

    回复
  2. I’ve been browsing on-line greater than 3 hours lately,
    yet I never discovered any fascinating article like yours.
    It’s lovely price enough for me. In my view, if all web owners and bloggers made just right content material as you probably
    did, the internet shall be much more useful than ever
    before.

    回复
  3. I will right away snatch your rss feed as I can not to find your e-mail subscription link or e-newsletter service.
    Do you have any? Please let me realize in order
    that I could subscribe. Thanks.

    回复
  4. If you wish for to take a good deal from this post then you have to apply
    such methods to your won blog.

    回复
  5. Greetings from Florida! I’m bored to death at work so I decided
    to browse your website on my iphone during lunch break.
    I love the info you present here and can’t wait to take a look
    when I get home. I’m shocked at how fast your
    blog loaded on my cell phone .. I’m not even using WIFI, just 3G ..
    Anyways, very good site!

    回复
  6. I’ve been surfing online more than 3 hours lately, but I
    never discovered any fascinating article like yours. It’s lovely price
    enough for me. In my view, if all web owners and bloggers made good content
    as you probably did, the web shall be much more helpful than ever before.

    回复
  7. These days of austerity and relative panic about getting debt, many people balk about the idea of making use of a credit card in order to make purchase of merchandise or maybe pay for a trip, preferring, instead just to rely on the tried plus trusted procedure for making settlement – raw cash. However, if you possess cash on hand to make the purchase fully, then, paradoxically, that’s the best time to be able to use the credit cards for several good reasons.

    回复
  8. Wow! Finally I got a website from where I can truly get useful information regarding my study and knowledge.| а

    回复
  9. Howdy! I know this is somewhat off topic but I was
    wondering if you knew where I could locate a captcha plugin for my comment form?
    I’m using the same blog platform as yours and I’m having trouble finding one?
    Thanks a lot!

    回复
  10. I am actually delighted to read this blog posts which includes tons of helpful facts,
    thanks for providing these information.

    回复
  11. I’ve been browsing online more than 2 hours today, yet I never found any interesting article like yours.
    It is pretty worth enough for me. In my view, if all site owners and bloggers made good
    content as you did, the web will be a lot more useful than ever before.

    回复
  12. Everyone loves it when people get together and share opinions.
    Great site, stick with it!

    回复
  13. Everyone loves it when folks get together and share thoughts.
    Great blog, keep it up!

    回复
  14. Excellent post! We will be linking to this
    great article on our site. Keep up the good writing.

    回复
  15. Hi there, I enjoy reading all of your post. I wanted to write a
    little comment to support you.

    回复
  16. Your style is really unique compared to other people I have read stuff from.
    Thank you for posting when you’ve got the opportunity, Guess I will just
    bookmark this page.

    回复
  17. Fantastic beat ! I would like to apprentice even as you amend your web site, how can i subscribe for a blog
    website? The account aided me a acceptable deal. I were a little bit acquainted
    of this your broadcast offered vivid clear
    idea

    回复
  18. Hello there! This blog post could not be written much better!

    Going through this post reminds me of my previous roommate!
    He always kept talking about this. I’ll forward this information to him.
    Fairly certain he’ll have a good read. I appreciate you
    for sharing!

    回复
  19. It is the best time to make some plans for the future and it is time to be happy.
    I’ve read this post and if I could I desire to suggest you
    few interesting things or tips. Maybe you could write next articles referring to this article.
    I wish to read even more things about it!

    回复
  20. Ahaa, its nice discussion concerning this piece of
    writing at this place at this blog, I have read all that, so
    now me also commenting here.

    回复
  21. I am sure this article has touched all the internet
    people, its really really pleasant article on building up new web site.

    回复
  22. I visited several blogs however the audio feature for audio songs present
    at this site is in fact fabulous.

    回复
  23. I absolutely love your site.. Very nice colors & theme.
    Did you make this website yourself? Please reply back as I’m hoping to create my own blog and would like to learn where you got this from or what the theme is named.

    Cheers!

    回复
  24. Hey! Someone in my Facebook group shared this website with us so I came to
    check it out. I’m definitely loving the information. I’m bookmarking and will be tweeting this to my followers!
    Outstanding blog and brilliant design and style.

    回复
  25. Definitely imagine that which you said. Your
    favorite reason seemed to be at the internet the
    easiest thing to be mindful of. I say to you, I definitely
    get annoyed whilst people consider concerns that they just don’t recognize about.
    You managed to hit the nail upon the top and also defined out the whole thing with no need side-effects , other people can take a signal.

    Will probably be again to get more. Thanks

    回复
  26. Thanks for this wonderful article. Also a thing is that nearly all digital cameras can come equipped with the zoom lens that allows more or less of that scene being included by ‘zooming’ in and out. These kinds of changes in focus length are generally reflected inside the viewfinder and on significant display screen right on the back of the particular camera.

    回复
  27. I visited several blogs but the audio feature for audio songs present at this website is truly
    fabulous.

    回复
  28. Terrific work! This is the kind of info that are supposed to be shared across the web. Disgrace on Google for no longer positioning this publish upper! Come on over and consult with my web site . Thank you =)

    回复
  29. I have been surfing online more than 4 hours today, yet
    I never found any interesting article like yours. It’s pretty worth
    enough for me. In my opinion, if all website owners and bloggers made good content as you did, the net will be
    much more useful than ever before.

    回复
  30. I have been surfing online more than three hours today, yet I never
    found any interesting article like yours. It’s pretty worth enough for me.
    In my view, if all webmasters and bloggers made
    good content as you did, the net will be much more useful than ever before.

    回复
  31. Quality articles is the crucial to be a focus for the viewers to go to see the website,
    that’s what this site is providing.

    回复
  32. Wonderful article! That is the type of information that are meant to be shared across the net.
    Disgrace on the search engines for not positioning this
    post higher! Come on over and visit my site . Thanks =)

    回复
  33. There’s definately a lot to know about this issue. I really
    like all of the points you’ve made.

    回复
  34. It’s awesome to visit this site and reading the views of all colleagues on the topic of this paragraph, while I
    am also zealous of getting experience.

    回复
  35. Good day! I could have sworn I’ve been to this website before but after reading
    through some of the post I realized it’s new to me.

    Anyhow, I’m definitely glad I found it and
    I’ll be bookmarking and checking back often!

    回复
  36. I every time spent my half an hour to read this blog’s articles everyday along with a
    mug of coffee.

    回复
  37. It’s really a nice and useful piece of information. I am satisfied that you just shared this helpful info with us.
    Please stay us informed like this. Thank you for sharing.

    回复
  38. I think this is among the most important information for me.

    And i’m glad reading your article. But should remark on few general things, The web site style
    is perfect, the articles is really excellent : D. Good job, cheers

    回复
  39. What a data of un-ambiguity and preserveness of precious
    knowledge regarding unexpected emotions.

    回复
  40. Great blog here! Also your web site loads up very fast!

    What host are you using? Can I get your affiliate link to your host?
    I wish my web site loaded up as fast as yours lol

    回复

发表评论

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