Welcome! Log In Create A New Profile

Advanced

How to load a dol into memory and launch it

Posted by filfat 
How to load a dol into memory and launch it
August 03, 2013 03:34PM
Hi, I'm working on a launcher for wiicraft with version selection etc. And I wonder if its possible to launch a dol within a dol. Also free the memory that the launcher used. Thanks :)
Re: How to load a dol into memory and launch it
August 04, 2013 01:27PM
I have looked inot all "homebrew loaders" on the wiki(http://wiibrew.org/wiki/List_of_homebrew_loaders) but without help i cant understand them. all i want is a smal simple script to load a dol(sd:/wiicraft/wiicraft.dol). Thanks =)
Re: How to load a dol into memory and launch it
August 04, 2013 10:06PM
Just quit tell the user to re-launch the application and then quit the current program. Why go through the trouble and addition code?
Re: How to load a dol into memory and launch it
August 04, 2013 10:40PM
The pj I'm working on is a launcher that will launch wiicraft from SD:/wiicraft/wiicraft.dol so yeah... Restarting the app is not an option :(
Re: How to load a dol into memory and launch it
August 31, 2013 03:28PM
[fix94.no-ip.org] - very simple DOL loader, if you can't figure out how to adapt that to your purposes, you have a problem ;)

EDIT: Credits to FIX94 for this forwarder



Edited 1 time(s). Last edit at 09/03/2013 05:33PM by SifJar.
Re: How to load a dol into memory and launch it
August 31, 2013 04:02PM
Thanks =)
Re: How to load a dol into memory and launch it
August 31, 2013 04:31PM
i guess i am an idiot this morning XD
> "make" 
main.cpp
background_image.c
devicemounter.c
pngu.c
video.c
background.png
app_booter.bin
linking ... WiiCraft_Launcher.elf
main.o: In function `main':
main.cpp:(.text.startup.main+0x54): undefined reference to `GetImageData()'
main.cpp:(.text.startup.main+0x5c): undefined reference to `fadein(unsigned char*)'
main.cpp:(.text.startup.main+0xcc): undefined reference to `fadeout(unsigned char*)'
main.cpp:(.text.startup.main+0xe0): undefined reference to `StopGX()'
main.cpp:(.text.startup.main+0x138): undefined reference to `fadeout(unsigned char*)'
main.cpp:(.text.startup.main+0x14c): undefined reference to `StopGX()'
main.cpp:(.text.startup.main+0x194): undefined reference to `fadeout(unsigned char*)'
main.cpp:(.text.startup.main+0x1a0): undefined reference to `StopGX()'
main.cpp:(.text.startup.main+0x2b0): undefined reference to `__exception_closeall()'
main.cpp:(.text.startup.main+0x310): undefined reference to `__exception_closeall()'
collect2: ld returned 1 exit status
make[1]: *** [/c/Users/Filiph/Desktop/WiiCraft/WiiCraft_Launcher/WiiCraft_Launcher.elf] Error 1
"make": *** [build] Error 2

> Process Exit Code: 2
> Time Taken: 00:04

becuse the example comiles well but not my code...

EDIT: My 100:th post =)
EDIT 2: The code dosent work in C++ Thats why i got these errors XD



Edited 2 time(s). Last edit at 08/31/2013 04:45PM by filfat.
Re: How to load a dol into memory and launch it
September 02, 2013 09:21AM
Quote
filfat
EDIT 2: The code dosent work in C++ Thats why i got these errors XD

You know that this is a linker error, and the code did compile, right?
Re: How to load a dol into memory and launch it
September 02, 2013 10:34AM
Yes it does. But only in C and not C++. WAIT! That means that I have created my first C program XD
Re: How to load a dol into memory and launch it
September 02, 2013 12:33PM
C is a subset of C++, you should have no problem linking C code to C++, so I guess the problem is in your makefile.
Re: How to load a dol into memory and launch it
September 02, 2013 12:50PM
WiinterSomthing has talked this and its a bug in GCC or Devkitppc. So nope i havent done anything wrong XD
Re: How to load a dol into memory and launch it
September 02, 2013 05:02PM
I'm not sure what you are talking about exactly. I have linked third party C code with my C++ framework several times without any issues. Do you care to elaborate on that gcc/devkitppc bug?
Re: How to load a dol into memory and launch it
September 02, 2013 05:39PM
No. I got it working in C++ and that is fine to me XD
A Q: can I in someway set the Arc's? Using this metod.
Re: How to load a dol into memory and launch it
September 03, 2013 03:24PM
Quote
filfat
Q: can I in someway set the Arc's? Using this metod.

As I am not a psychic, I have no clue what you are talking about (as usual ;) )
Re: How to load a dol into memory and launch it
September 03, 2013 03:37PM
I want to boot the dol with Arguments if it possible XD
Re: How to load a dol into memory and launch it
September 03, 2013 05:33PM
Here's the version with argument support: [fix94.no-ip.org]

Note that both versions are written by FIX94, should have credited him in my previous post as well.
Re: How to load a dol into memory and launch it
September 03, 2013 08:42PM
I will add him to the credits for the launcher :)
Re: How to load a dol into memory and launch it
January 10, 2015 02:05PM
Quote
filfat
WiinterSomthing has talked this and its a bug in GCC or Devkitppc. So nope i havent done anything wrong XD

Sorry for bringing up this old thread but I don't think the linking problem is due to a bug with the compiler as I got a similar error when trying to link a library I wrote in C to a C++ project until I added extern "C" and placed my external function prototypes within it.

Basically, you are supposed to declare your external C functions like this:
#ifdef __cplusplus
extern "C" {
#endif

extern void __exception_setreload(int t);
extern void __exception_closeall();
extern const u8 app_booter_bin[];
extern const u32 app_booter_bin_size;

#ifdef __cplusplus
}
#endif
So that the C++ compiler will treat them as C functions which is what the object file you are trying to link to (app_booter.bin.o) contains.
Sorry, only registered users may post in this forum.

Click here to login