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: Select all
#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;
}
Thanks in advance!
sparrow[/quote]