 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
sparrow
Joined: 13 Apr 2006 Posts: 24
|
Posted: Tue Apr 18, 2006 4:03 am Post subject: I quit trying to format the HDD... Will this code work??? |
|
|
Hi everybody!
I am kinda quitting trying to format the HDD by myself by using libhdd: http://forums.ps2dev.org/viewtopic.php?t=5457
Now I just got an (ugly) idea, which consists of embedding DMS HDD Format Tool inside my application. Now I don't know if the following code will execute DMS HDD Format Tool (I have to try it when I get home, but I would like to hear some opinions here before that :-):
| Code: |
#include <kernel.h>
#include <sifrpc.h>
#include <debug.h>
extern u8 *hddfrmt_elf; // This is HDD Format Tool 1.1, which is embedded into my APP!
extern int size_hddfrmt_elf;
typedef struct
{
u8 ident[16];
u16 type;
u16 machine;
u32 version;
u32 entry;
u32 phoff;
u32 shoff;
u32 flags;
u16 ehsize;
u16 phentsize;
u16 phnum;
u16 shentsize;
u16 shnum;
u16 shstrndx;
} elf_header_t;
int main(void)
{
elf_header_t *eh = (elf_header_t *) hddfrmt_elf;
SifExitRpc();
FlushCache(0);
ExecPS2((void *)eh->entry, 0, 0, NULL); // Executes HDD Format Tool 1.1
SleepThread();
return 0;
}
|
This is the corret way of executing an ELF which is in memory (embedded)? This code will execute the HDDFRMT.ELF file?
Thanks in advance!
sparrow[/quote] |
|
| Back to top |
|
 |
sparrow
Joined: 13 Apr 2006 Posts: 24
|
Posted: Tue Apr 18, 2006 10:06 am Post subject: |
|
|
| This is not needed anymore, cos I could format the HDD by using libhdd!! :D |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|