Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Installation / Removal
| |-+  Manual Installation
| | |-+  Apple - Installation/Removal
| | | |-+  modifying ipod bootloader and intalling fw to an other position
« previous next »
  • Print
Pages: [1] 2

Author Topic: modifying ipod bootloader and intalling fw to an other position  (Read 7657 times)

Offline KoSa333

  • Member
  • *
  • Posts: 8
modifying ipod bootloader and intalling fw to an other position
« on: December 17, 2009, 07:11:20 PM »
Hi, the HDD of my iPod (5.5 video /80GB/) is physically damaged, but only the first few GBs (i scanned it with hdd surface testers). I made a fat32 partition (from right after the damaged part till the end of the hdd) and it is working as a file storage but of course I want to make the ipod work on it. The only way is to do it manually, make the hidden partition of the os/rockbox bootloader, and after it make the fat32 partition so I have to modify the original bootloader of my iPod (or at least the offset where it tries to load the os). I gave up on the original apple firmware because of the iTunes, but It doesn't matter because rockbox rocks! :D

Well, I need an expert who can help me doing it because I don't wanna throw my ipod away.
Currently, the original firmware is on the ipod, and it's only luck that it runs but usually it freezes.

Maybe I could make copy my song onto it if I modify the fat table so the songs would be copied to the right place.
The bad sectors are between lsa 0 and lsa 30.000.000 while the ipod's last lsa is around 160.000.000

I hope you understand the problem, if not, just ask, It is important to me..
« Last Edit: December 20, 2009, 06:09:04 PM by KoSa333 »
Logged

Offline KoSa333

  • Member
  • *
  • Posts: 8
Re: modifying ipod bootloader and intalling fw to an other position
« Reply #1 on: December 20, 2009, 06:15:29 PM »
Anyone? I hoped rockbox developers could help me :(

Then tell me how I can reach the flash memory of the iPod and modify that with PC.
I know nothing about the working of iPods it would be easier if you shared your knowledge.

Is there any other forum where I may get help?
Thanks.
Logged

Offline froggyman

  • Member
  • *
  • Posts: 214
Re: modifying ipod bootloader and intalling fw to an other position
« Reply #2 on: December 20, 2009, 08:28:18 PM »
Quote from: KoSa333 on December 20, 2009, 06:15:29 PM
Is there any other forum where I may get help?
Thanks.

This is pretty much the only active *english* rockbox forum.


Quote from: KoSa333 on December 20, 2009, 06:15:29 PM
Anyone? I hoped rockbox developers could help me :(

Then tell me how I can reach the flash memory of the iPod and modify that with PC.
I know nothing about the working of iPods it would be easier if you shared your knowledge.
Thanks.

The devs that did most of the work on the iPods may not have checked the forums recently.
There might be some information on the wiki about the flash memory (although i think its ROM, so you would need specialized tools to change it, ie you cant edit it from your PC)

Keep it mind i am just ASSuming that last part there... feel free to correct me if I am wrong.
Logged
iPod Video 5.5G 30GB - Now Dead :(
Sansa Fuzev2 4GB

"To prevent this day from getting worse, I'll just read ERROR as GOOD THING"

Offline torne

  • Developer
  • Member
  • *
  • Posts: 994
  • arf arf
Re: modifying ipod bootloader and intalling fw to an other position
« Reply #3 on: December 20, 2009, 09:38:13 PM »
If you need to modify the in-flash boot loader code, this will be difficult and risky. We do not currently have any support for writing to the boot flash on the iPods, but I expect it's a fairly standard NOR part that can be written via CFI. You would need to write or find this code. You would also need to disassemble quite a bit of the flash to work out what to change, I expect. And if you get it wrong your iPod will be bricked.

Get a new disk. Working around a large number of bad sectors in a critical location is not worth the effort. You can get a much bigger one while you are at it :)
Logged
some kind of ARM guy. ipodvideo/gigabeat-s/h120/clipv2. to save time let's assume i know everything.

Offline KoSa333

  • Member
  • *
  • Posts: 8
Re: modifying ipod bootloader and intalling fw to an other position
« Reply #4 on: December 21, 2009, 08:44:41 AM »
Thanks for the replies. I could disassemble the code and modify it correctly that wouldn't be a problem.. There is an other way to get it work: where I would put the rockbox bootloader, I put a little "call code" that calls the bootloader from an other place. What do you think?
I haven't seen the code of the bootloader. How does it work? It also calls an offset or read the partition table and choose the second partition where the o/s files are stored?

I don't want to spend money on it, because I have an other mp4 player which works well, and i listen music on it while the ipod is down, and if i can't get it work I would only throw away, the only reason i would use it is because of its HDD. (if i could save the half of the 80GB HDD would be fairly enough against the 2GB mp4 player :)) That's why it doesn't really matters if it is risky.

The flash memory think I got from the rockbox manual:
Quote
The Ipod bootloader. The Ipod bootloader is the program that tells your player how
     to load and start the original firmware. It is also responsible for any emergency,
     recovery, or disk modes on your player. This bootloader is stored in special flash
     memory in your Ipod and comes factory-installed. It is not necessary to modify
     this in order to install Rockbox.
That's the reason why I thought I could modify it at least.

I hardly can code out of o/s I don't have any experience in it, and really know what sohuld I do, either make a program that loads the code on the HDD into the memory and runs it or a simple JMP would be enough that's why I need technical help.

Thanks.
Logged

Offline torne

  • Developer
  • Member
  • *
  • Posts: 994
  • arf arf
Re: modifying ipod bootloader and intalling fw to an other position
« Reply #5 on: December 21, 2009, 11:11:39 AM »
Have you actually tried moving the partitions around? I don't know offhand how the flash bootloader locates the firmware partition; do you even know for sure that it's fixed?

The Rockbox bootloader uses the exact same code to access the disk as Rockbox itself (since both run using the same drivers/firmware code, only the application on top is different) - it just looks in the partition table and uses the first FAT partition.

I don't think you really understand what you are suggesting here, and if you were really able to do this you wouldn't have to ask these questions...
Logged
some kind of ARM guy. ipodvideo/gigabeat-s/h120/clipv2. to save time let's assume i know everything.

Offline KoSa333

  • Member
  • *
  • Posts: 8
Re: modifying ipod bootloader and intalling fw to an other position
« Reply #6 on: December 21, 2009, 02:03:58 PM »
"I don't think you really understand what you are suggesting here, and if you were really able to do this you wouldn't have to ask these questions..."

I have never said I'm able to do it without understanding how it works, that's why I'm asking questions here..

I tried moving the partitions but then I got error message that's why I think it's probably fixed, I'm not sure.

"it just looks in the partition table and uses the first FAT partition."

The first partition is a hidden one, where the firmware can be found. The bootloader of the iPod loads it, and it runs the files on the second partition what you can see from your o/s.
Since you are a developer I guess, you should know what it does and how it works, that's why I'm asking for information and help here.

If I want to install the rockbox manually first I have to download the firmware and the necessary files and then the ipodpatcher does the job. What does it do in fact?
If I understand that, I can do it manually or even make a selfmade ipodpatcher for my ipod..
« Last Edit: December 21, 2009, 02:06:01 PM by KoSa333 »
Logged

Offline torne

  • Developer
  • Member
  • *
  • Posts: 994
  • arf arf
Re: modifying ipod bootloader and intalling fw to an other position
« Reply #7 on: December 21, 2009, 04:39:27 PM »
http://www.rockbox.org/wiki/IpodPatcher describes what ipodpatcher does :)

It sounds like you are confusing the flash bootloader (which we do not touch) with the Rockbox bootloader. ipodpatcher appends the rockbox bootloader to the end of the Apple firmware in the hidden partition, and changes the entry point address so that our bootloader will run first. On poweron, the flash bootloader loads the entire Apple firmware file into ram from the hidden partition, including the rockbox bootloader, and then jumps to the changed entry point, thus running our bootloader. We then look at the partition table on the disk to find the normal, unhidden FAT partition, mount it, and load .rockbox/rockbox.ipod from that partition. Installing Rockbox does not in any way remove the need for the flash bootloader to work, and for the flash bootloader to be able to find the hidden firmware partition - we depend on the flash bootloader to load *our* bootloader.

What did you do to move the partitions? It's possible it's *not* a fixed position, but whatever you did it didn't like...
Logged
some kind of ARM guy. ipodvideo/gigabeat-s/h120/clipv2. to save time let's assume i know everything.

Offline KoSa333

  • Member
  • *
  • Posts: 8
Re: modifying ipod bootloader and intalling fw to an other position
« Reply #8 on: December 21, 2009, 06:16:00 PM »
Thanks it was quite useful to me. I am not confusing the iPod's bootloader with the Rockbox bootloader, you probably misunderstood me. When I said I tried to move the partitions, I moved the hidden partition too because was in the damaged part, the other partition is movable.

Now I rewrite the whole MBR with hex editor, made the partitions, restored the original firmware to the hidder partition i made, I formatted the second partition to fat32 and repaired the mbr so the iPod can detect t, and works fine. There is only one step left to make the ipod work with the rockbox.

I will only put the rockbox bootload onto the hidden partition, and make it work that way (less size, less chance of bad sector :)) Any other things go onto the fat32 partition.
There is only one problem: now the ipodpatcher can't detect the iPod (i will look into the source later or you can also tell me what to do now if you have an idea)
I will either get the ipodpatcher be able to detect it or do it manually but I'm sleepy now  ;D
Thanks for your help!
Logged

Offline torne

  • Developer
  • Member
  • *
  • Posts: 994
  • arf arf
Re: modifying ipod bootloader and intalling fw to an other position
« Reply #9 on: December 21, 2009, 06:47:49 PM »
It's not really something you can do manually; you need to rearrange the contents of the Apple firmware partition to make room for a larger OSOS image, append the Rockbox bootloader to the OSOS image, and change the image header to match. ipodpatcher might well be looking in a fixed location for the partition, I don't recall how it accesses the disk; in which case it probably could be fixed to find it "properly"... if you look at the code and manage to get this working please post a patch :)
Logged
some kind of ARM guy. ipodvideo/gigabeat-s/h120/clipv2. to save time let's assume i know everything.

Offline KoSa333

  • Member
  • *
  • Posts: 8
Re: modifying ipod bootloader and intalling fw to an other position
« Reply #10 on: December 22, 2009, 09:00:24 AM »
Well, I downloaded the source code in Linux, recompiled it and it found my iPod.. Strange..
Then i followed the instructions on the wiki page you had sent me before.
I made a backup of the apple firmware, copied it into the .rockbox directory, put the rockbox bootloader onto the hidden partition with the ipodpatcher, and it works fine, however I don't have an option to load the original or any other firmware.
Later I will customize it, thank you I'm happy it is working again :)
« Last Edit: December 22, 2009, 12:36:27 PM by KoSa333 »
Logged

Offline torne

  • Developer
  • Member
  • *
  • Posts: 994
  • arf arf
Re: modifying ipod bootloader and intalling fw to an other position
« Reply #11 on: December 22, 2009, 02:04:12 PM »
The code may well have changed since the last released version.

You didn't follow the default installation instructions, it sounds like; you don't have to dump the apple OF and provide it as a file... the bootloader is normally appended to the OF, not replacing it. Either way flicking the hold switch on should boot the OF so if that doesn't work you have done something wrong - there's no reason for this not to work, especially if you have used the normal install method (the apple flashrom code has already loaded the OSOS image into ram, so the state of the disk is irrelevant, it should always be able to run it)
Logged
some kind of ARM guy. ipodvideo/gigabeat-s/h120/clipv2. to save time let's assume i know everything.

Offline KoSa333

  • Member
  • *
  • Posts: 8
Re: modifying ipod bootloader and intalling fw to an other position
« Reply #12 on: December 22, 2009, 03:17:32 PM »
http://www.rockbox.org/wiki/IpodPatcher#3_OSOS_contains_only_the_Rockbox

Quote
Instructions

   1. Back up the Apple firmware! Run ipodpatcher -rf apple_os.ipod and save the file apple_os.ipod somewhere safe. You can restore this later with ipodpatcher -wf apple_os.ipod if something goes wrong.
   2. Unzip your Rockbox build to .rockbox on the ipod as usual.
   3. Place a copy of apple_os.ipod in the .rockbox directory (this enables dual booting).
   4. Install the Rockbox bootloader to the OSOS image with ipodpatcher -wf bootloader-youripodmodel.ipod
   5. Reboot the ipod. Dual booting should function as before, but Rockbox should load faster.

I followed this one step by step. Anyway, I want to replace the OF because the size of the executable code at the bad part of the HDD will be smaller, that's why I chose this method, so it should contain only a bootloader.. However I want to enable dualbooting so I can load any other firmwares later on.

I forgot to say when the ipodpatcher couldn't detect my iPod I was on win32 platform then I changed back to Linux and rebuilt the source and tried there.

Quote
(the apple flashrom code has already loaded the OSOS image into ram, so the state of the disk is irrelevant, it should always be able to run it)
Now I know how it was able to restore itself even after partition format. It was annoying :)
Logged

Offline torne

  • Developer
  • Member
  • *
  • Posts: 994
  • arf arf
Re: modifying ipod bootloader and intalling fw to an other position
« Reply #13 on: December 22, 2009, 07:19:11 PM »
That's not the standard installation method, but dual booting should work fine; if turning the hold switch on immediately after poweron doesn't start the original firmware then you have done something wrong. Try powering on by pressing and holding MENU, also (this should also trigger booting the OF).

Also, er, what do you mean the size of the code on the bad part of the disk will be smaller? Wasn't the entire point of this to move the data entirely out of the bad part? I don't understand what you've done, in that case..

And I think you misunderstood me; the flash bootloader loads OSOS into ram on poweron, whether OSOS contains the OF, or Rockbox, or the Rockbox bootloader, or a combination of them. If you erase the disk there, it won't be able to load anything and the OF will not boot; if the OF still boots after you erase the partition then you can't be erasing it right :)
Logged
some kind of ARM guy. ipodvideo/gigabeat-s/h120/clipv2. to save time let's assume i know everything.

Offline KoSa333

  • Member
  • *
  • Posts: 8
Re: modifying ipod bootloader and intalling fw to an other position
« Reply #14 on: December 22, 2009, 08:05:03 PM »
Quote
That's not the standard installation method, but dual booting should work fine; if turning the hold switch on immediately after poweron doesn't start the original firmware then you have done something wrong. Try powering on by pressing and holding MENU, also (this should also trigger booting the OF).
I've just done what you said and it loaded the OF. This is how it should work? Shouldn't be there a menu where I can choose the firmware I want to load? (I saw it on videos on youtube..)

Quote
Also, er, what do you mean the size of the code on the bad part of the disk will be smaller? Wasn't the entire point of this to move the data entirely out of the bad part? I don't understand what you've done, in that case..
Well, the bad sectors appear right from the beginning of the disk, where the hidden partition is (and it is fixed, if i wanted to move it i would have to modify the ipod bootloader) and it ends around the first quarter of the fat partition, so I had to move it because I couldn't copy files onto it properly, or even if the ipod read it, it froze or restarted. Now the fat32 is on a healthy part of the HDD so it works without a problem.
The bootloader is only a few sectors big so it fits between bad sectors :D (it is better than i try to fit megabytes there, isn't it?)

Quote
And I think you misunderstood me; the flash bootloader loads OSOS into ram on poweron, whether OSOS contains the OF, or Rockbox, or the Rockbox bootloader, or a combination of them. If you erase the disk there, it won't be able to load anything and the OF will not boot; if the OF still boots after you erase the partition then you can't be erasing it right :)
Then the reason why it could restore itself is because I used quick format which only deletes the files (in the fat table signs the files as deleted but it doesn't touch the files themselves) while normal format writes 00's everywhere. I'm not sure about it but it is my only idea.
Logged

  • Print
Pages: [1] 2
« previous next »
+  Rockbox Technical Forums
|-+  Installation / Removal
| |-+  Manual Installation
| | |-+  Apple - Installation/Removal
| | | |-+  modifying ipod bootloader and intalling fw to an other position
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.077 seconds with 14 queries.