.elf to cdi ?

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
mouZ
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 16
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Sun Apr 03, 2011 10:48 am
Has thanked: 0
Been thanked: 0

.elf to cdi ?

Post by mouZ »

Hi, i have compiled an .elf (thanks to DC Dev ISO R4).
Now how can i boot this .elf with SDcard ?
How can i convert my .elf to .cdi ?
Thanks.
User avatar
Basil
Insane DCEmu
Insane DCEmu
Posts: 200
Joined: Wed Apr 09, 2008 9:04 am
Has thanked: 13 times
Been thanked: 0
Contact:

Re: .elf to cdi ?

Post by Basil »

You have to convert elf to bin first then create iso for loading from sd card .
mouZ
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 16
Joined: Sun Apr 03, 2011 10:48 am
Has thanked: 0
Been thanked: 0

Re: .elf to cdi ?

Post by mouZ »

Thanks for your answer but my questions are :
- how convert .elf to .bin ?
- how launch .bin with my SDcard ? (with DreamShell ?)

Thanks.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5666
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: .elf to cdi ?

Post by BlueCrab »

mouZ wrote:- how convert .elf to .bin ?
For an unscrambled binary (which you cannot burn to a cd without scrambling first), do this (assuming your toolchain is sane):

Code: Select all

sh-elf-objcopy -R .stack -O binary file.elf file.bin
You can scramble the binary (only for making a bootable CD) using Marcus' scrambling tool, for which the source code can be found at http://mc.pp.se/dc/files/scramble.c .
mouZ
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 16
Joined: Sun Apr 03, 2011 10:48 am
Has thanked: 0
Been thanked: 0

Re: .elf to cdi ?

Post by mouZ »

User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5666
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: .elf to cdi ?

Post by BlueCrab »

If you're compiling code yourself, there's little to no reason to be using elf2bin. Especially since its probably just a renamed version of sh-elf-objcopy anyway.
mouZ
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 16
Joined: Sun Apr 03, 2011 10:48 am
Has thanked: 0
Been thanked: 0

Re: .elf to cdi ?

Post by mouZ »

Oh :) yes. Thanks again.

DreamShell can't load the .bin.
How can i load the .bin without codercable ?
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5666
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: .elf to cdi ?

Post by BlueCrab »

I've never used DreamShell, so I have no idea.
User avatar
PH3NOM
DC Developer
DC Developer
Posts: 576
Joined: Fri Jun 18, 2010 9:29 pm
Has thanked: 0
Been thanked: 5 times

Re: .elf to cdi ?

Post by PH3NOM »

mouZ wrote:Hi, i have compiled an .elf (thanks to DC Dev ISO R4).
How can i convert my .elf to .cdi ?
Thanks.
I have made a script to build a .cdi image from a compiled elf! Assuming you use windows, this should work for you.
http://www.megaupload.com/?d=72M4Y7A3

Just name the elf 1st_read.elf and place it in the /data folder then run CDi4DC.bat
( you can also set the elf name to something else, just look at CDi4DC.bat )

Hope that helps!
Last edited by PH3NOM on Tue Apr 05, 2011 12:43 pm, edited 1 time in total.
mouZ
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 16
Joined: Sun Apr 03, 2011 10:48 am
Has thanked: 0
Been thanked: 0

Re: .elf to cdi ?

Post by mouZ »

Thanks PH3NOM but your MU link is break. :/


I can't load .bin without codercable ?
User avatar
PH3NOM
DC Developer
DC Developer
Posts: 576
Joined: Fri Jun 18, 2010 9:29 pm
Has thanked: 0
Been thanked: 5 times

Re: .elf to cdi ?

Post by PH3NOM »

Link fixed, sorry it was a typo:-)

4 ways to test code on DC:
1-CD-Rom
2-Coders Cable
3-BBA
4-SD card

2-4 still require a boot disc of some sort

I only use method 1, and I have given you all the help I can with that.
Maybe some others here feel like sharing how to use methods 2-4, but there should be more than enough info available searching the net...
mouZ
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 16
Joined: Sun Apr 03, 2011 10:48 am
Has thanked: 0
Been thanked: 0

Re: .elf to cdi ?

Post by mouZ »

Thanks for your Data2CDI.
Post Reply