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
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Customizing Rockbox - Need Help Please
« previous next »
  • Print
Pages: [1] 2

Author Topic: Customizing Rockbox - Need Help Please  (Read 4832 times)

Offline rangi_chip

  • Member
  • *
  • Posts: 38
Customizing Rockbox - Need Help Please
« on: October 29, 2008, 06:20:00 PM »
Okay, some may take offense to what I am wanting to achieve here. But any help would be much appreciated as I am fairly new to Rockbox.

This is what I am wanting from Rockbox:

I want my Apple OS to be the default firmware when booting, with Rockbox being the alternative. This is fairly easily achieved no?

Then... and this maybe the offensive part...
When Rockbox boots, I would like to see if it could do this...
Boots (with a blank black screen)
Runs a script (which renames some folders on the root directory of my iPod)
Reboots

Is this possible?
I know it isn't what Rockbox is intended to do, but this would be Very useful for me!

I would need help for that entire process. The blank booting (which shouldn't be too hard), the writing and calling of the script on startup (which I wouldn't have a clue how to do), and then rebooting once the script has finished it's business.

I have a 80GB 5.5G iPod if this means anything.


Cheers.
« Last Edit: October 30, 2008, 03:32:30 PM by rangi_chip »
Logged
5.5G 80GB iPod

Offline gevaerts

  • Administrator
  • Member
  • *
  • Posts: 1053
Re: Customizing Rockbox - Need Help Please
« Reply #1 on: October 29, 2008, 06:23:25 PM »
I think that maybe you don't want a full customized rockbox, but just a customized rockbox bootloader.
Do you need this "script" to be changeable, or can it just be a C function that's compiled in?
Logged

Offline rangi_chip

  • Member
  • *
  • Posts: 38
Re: Customizing Rockbox - Need Help Please
« Reply #2 on: October 29, 2008, 06:30:35 PM »
Yes! Just a customized bootloader would be great...

Basically I have two folders that I want to be renamed every time Rockbox bootloader is run.

Example:
I have these two folders
"iPod_Control"
"Music2"

When the bootloader is run, I would like it to swap them
"iPod_Control" becomes "Music1"
"Music2" becomes "iPod_Control"

And then vice-versa the next time the Rockbox bootloader is run
"iPod_Control" becomes "Music2"
"Music1" becomes "iPod_Control"

Is this possible?


Thanks for the reply!
« Last Edit: October 29, 2008, 07:09:56 PM by rangi_chip »
Logged
5.5G 80GB iPod

Offline gevaerts

  • Administrator
  • Member
  • *
  • Posts: 1053
Re: Customizing Rockbox - Need Help Please
« Reply #3 on: October 29, 2008, 06:42:14 PM »
That should be possible, yes. You can change main() in bootloader/ipod.c to do that instead of loading firmware. I think the correct place to start your changes would be at the "printf("Partition 1: 0x%02x %ld MB"," line.

The filesystem is mounted there, so you can use all rockbox file manipulation functions. There may be some documentation about those on the wiki. If not, have a look at firmware/export/fat.h, or look in apps/ for examples.

Logged

Offline rangi_chip

  • Member
  • *
  • Posts: 38
Re: Customizing Rockbox - Need Help Please
« Reply #4 on: October 29, 2008, 07:07:06 PM »
Would it be easier doing what was described above with changing two folder names... or would it be easier using the Rockbox bootloader to boot two Apple OS's?

Like one default one, and one alternative one?
« Last Edit: October 30, 2008, 06:18:20 PM by rangi_chip »
Logged
5.5G 80GB iPod

Offline nls

  • Developer
  • Member
  • *
  • Posts: 460
Re: Customizing Rockbox - Need Help Please
« Reply #5 on: October 30, 2008, 10:29:11 AM »
I don't even know if you can have two different apple firmwares on the same ipod, but changing two dirnames and inverting the firmware boot selection should be pretty easy.
Logged

Offline rangi_chip

  • Member
  • *
  • Posts: 38
Re: Customizing Rockbox - Need Help Please
« Reply #6 on: October 30, 2008, 02:33:35 PM »
Quote from: nls on October 30, 2008, 10:29:11 AM
I don't even know if you can have two different apple firmwares on the same ipod, but changing two dirnames and inverting the firmware boot selection should be pretty easy.

You can definitely have two different Apple firmwares on the one iPod.
I had it so I had one firmware in the RAM that read its music from one directory ("iPod_Contro1") and I had another firmware on the harddrive that read it's music from another directory ("iPod_Contro2").

I used Loader2 to run these and it worked. I just hated the ugly boot menu at the start.
I wanted a discreet boot of the alternative firmware, hence this thread  :)

EDIT
What about this edit of the bootloader...
Code: [Select]
pinfo = disk_partinfo(1);
    printf("Partition 1: 0x%02x %ld MB",
           pinfo->type, pinfo->size / 2048);

    if (button_was_held) {
        printf("Loading Alternative Firmware...");   
        rc=load_raw_firmware(loadbuffer, "/alternativeos.bin");
   
        if (rc == EOK) {
            return (void*)DRAM_START;
        } else if (rc == EFILE_NOT_FOUND) {
            printf("Failed to load Alternative Firmware");
            printf("Loading Original Firmware..."); 
            haveretailos = (memcmp((void*)(DRAM_START+0x20),"portalplayer",12)==0);
            if (haveretailos) {
                return (void*)DRAM_START;
            }
        } else if (rc < EFILE_NOT_FOUND) {
            printf("No firmware detected");
        }
       
    } else if (btn==BUTTON_MENU) {
        printf("Loading Rockbox...");
        rc=load_firmware(loadbuffer, BOOTFILE, MAX_LOADSIZE);
        if (rc < EOK) {
            printf("Error!");
            printf("Can't load rockbox.ipod:");
            printf(strerror(rc));
        } else {
            return (void*)DRAM_START;
        }
    } else {
        printf("Loading Original Firmware...");
            haveretailos = (memcmp((void*)(DRAM_START+0x20),"portalplayer",12)==0);
            if (haveretailos) {
                return (void*)DRAM_START;
            }
        } else if (rc < EFILE_NOT_FOUND) {
            printf("No firmware detected");
        }
    }

Boot Alternative OS if hold button is on while booting
Boot Rockbox if menu button is on while booting
Boot Original OS if neither hold button or menu button is on while booting

Am I way off with this?

This way i get my two Ipod music directories and Rockbox which I am discovering is very cool!
« Last Edit: October 30, 2008, 07:20:43 PM by rangi_chip »
Logged
5.5G 80GB iPod

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: Customizing Rockbox - Need Help Please
« Reply #7 on: October 30, 2008, 07:33:30 PM »
Well, first of all I really don't understand why you would want a reversed boot order. The reasons why it wouldn't make a real difference have been posted in these forums several times. I also don't get the point in renaming folders upon startup -- Rockbox can access any folder, so why rename them? And for the original firmware you would only break it finding its database (thus music).
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

Offline rangi_chip

  • Member
  • *
  • Posts: 38
Re: Customizing Rockbox - Need Help Please
« Reply #8 on: October 30, 2008, 08:07:04 PM »
Quote from: bluebrother on October 30, 2008, 07:33:30 PM
I also don't get the point in renaming folders upon startup -- Rockbox can access any folder, so why rename them?(thus music). And for the original firmware you would only break it finding its database (thus music).

There's two ways of achieving the same thing I want.

I want my iPod to have a dual boot with two seperate music directories.
This can be achieved like so...

One:
When the bootloader is run, swapping these two folders
"iPod_Control" becomes "Music1"
"Music2" becomes "iPod_Control"

And then vice-versa the next time the bootloader is run
"iPod_Control" becomes "Music2"
"Music1" becomes "iPod_Control"

This essentially is swapping the iPod_Control directory every time the bootloader is run. This means it swaps the database. This is one way of doing it.

Two:
I use the Rockbox bootloader to run two Apple firmwares.
One which is stored in the RAM and which looks at "iPod_Contro1" for it's database and the other which is stored on the harddrive and which looks at "iPod_Contro2" for it's database.

This method I'd prefer. Because then I can run Rockbox too, which I like.
« Last Edit: October 30, 2008, 09:41:19 PM by rangi_chip »
Logged
5.5G 80GB iPod

Offline gratt

  • Member
  • *
  • Posts: 34
Re: Customizing Rockbox - Need Help Please
« Reply #9 on: November 01, 2008, 12:10:08 PM »
You could also just write a plugin for rockbox
that renames your folders.
Boot rockbox and run the plugin anytime.
Then you get everything you want and rockbox.
GRaTT
Logged

Offline rangi_chip

  • Member
  • *
  • Posts: 38
Re: Customizing Rockbox - Need Help Please
« Reply #10 on: November 01, 2008, 08:57:52 PM »
Yup yup, I know that. But I prefer them on their separate boots... a lot nicer that way.

EDIT: This topic has been solved. I managed to due this myself using the very handy Wiki page - awesome!
I used cygwin to compile my own bootloader. Thanks for the help.
« Last Edit: November 05, 2008, 08:48:10 PM by rangi_chip »
Logged
5.5G 80GB iPod

Offline rangi_chip

  • Member
  • *
  • Posts: 38
Re: Customizing Rockbox - Need Help Please
« Reply #11 on: November 06, 2008, 04:00:45 PM »
Okay. So I've sorted this out, thanks for your guys help.

Is there any Wiki or information I can access on the RB bootloader? Like the different arguments that can be used and what not.
If someone could be so kind as to point me to that...

Thanks again.
Logged
5.5G 80GB iPod

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Customizing Rockbox - Need Help Please
« Reply #12 on: November 06, 2008, 04:05:27 PM »
The bootloader runs on your player, and launches automatically as soon as you turn on your player. It's not something you give arguments to.
Logged

Offline rangi_chip

  • Member
  • *
  • Posts: 38
Re: Customizing Rockbox - Need Help Please
« Reply #13 on: November 06, 2008, 05:19:11 PM »
Sorry. I could be a tad more clearer...

Within the ipod.c file, what coding can I use? Like is there anywhere I can look to see what I can adjust in here?

Like "rc=load_firmware" and "rc=load_raw_firmware" for example.
I have seen other 'arguments' used instead of those. I was just wondering if there is any info I can read on how to code this.
Logged
5.5G 80GB iPod

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Customizing Rockbox - Need Help Please
« Reply #14 on: November 06, 2008, 05:20:28 PM »
It's a C source file. You can change any part of it if you know C. Maybe you should be more specific still.
Logged

  • Print
Pages: [1] 2
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Customizing Rockbox - Need Help Please
 

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

Page created in 0.106 seconds with 14 queries.