forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

I quit trying to format the HDD... Will this code work???

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
sparrow



Joined: 13 Apr 2006
Posts: 24

PostPosted: Tue Apr 18, 2006 4:03 am    Post subject: I quit trying to format the HDD... Will this code work??? Reply with quote

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
View user's profile Send private message Visit poster's website
sparrow



Joined: 13 Apr 2006
Posts: 24

PostPosted: Tue Apr 18, 2006 10:06 am    Post subject: Reply with quote

This is not needed anymore, cos I could format the HDD by using libhdd!! :D
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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