gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Lick's rebootlib [Now 1.1r, relicensed]

#122536 - Lick - Tue Mar 20, 2007 1:37 am

Lick's rebootlib 1.1
Small programming library in released as source that allows you to reboot to the homebrew devices' bootmenus.

Supported devices
  • MPCF/MPSD
  • M3CF/M3SD
  • SCCF/SCSD/SCLT/SCDS1 (untested)
  • EFA2
  • EZ4
  • G6 (thx to Puyo)
  • DS Link
  • R4/M3 Simply (untested) (thx to Yasu)
If you plan to add support for other devices, please share the modified source.

Changes from 1.1 to 1.1r
Re-licensed under MIT/GPLv2 http://lickr.org/files/rebootlib/rebootlib_1.1r.zip

Changes from 1.0 to 1.1
- No more GPL, but instead a custom license. See Readme.
- reboot_file(): let's you boot an NDS file. Uses chishm's loader. (Don't forget to put the included "loadnds.bin" inside your projects ARM9 data-folder!! And also patch your application with DLDI!!)
- New devices: SCDS1, R4, M3 Simply. All three untested. Please test!

How to use
1. Include all the rebootlib files to your projects includes and sources.
2. Copy "loadnds.bin" to your projects ARM9 data.
3. Refer to the example project for code implementation.

Download library and example project
rebootlib_1.1r.zip - to use the example project: press L to reboot and R to boot a file called "runme.nds"

-Lick
_________________
http://licklick.wordpress.com


Last edited by Lick on Thu Sep 06, 2007 10:43 pm; edited 6 times in total

#122550 - felix123 - Tue Mar 20, 2007 6:30 am

Nice. The new can_reboot() function should make stuff easier.

On another topic, does the auto-reboot-patch function of R4 also work for homebrew?
_________________
Nintendo DS homebrew on Wikipedia

#122554 - HyperHacker - Tue Mar 20, 2007 6:57 am

Awesome. Just some questions since I'm not actively working on any DS projects right now:
-Will you be using the GBAMP hack's built-in NDS launcher, or a generic one? In my experience the generic ones are unreliable, while the built-in one works every time.
-Will it do DLDI patching, at least to the NDS files it's launching?
-Is it patch-based, or does it aim to support all devices at once?

I'll be sure to make good use of this. :-) IMO, all NDS apps should include some method to reset to the card's menu unless they absolutely can't (e.g. if they have no room left for such a thing).
_________________
I'm a PSP hacker now, but I still <3 DS.

#122585 - Lick - Tue Mar 20, 2007 3:22 pm

- I am going to write a new .nds booter, I'm not sure how the older booters differed from each other. When I find out I will use the most appropriate solution.
- I think I might make it so that the launched .nds will automatically have the launching nds' DLDI section. Copy DLDI section no jutsu!
- rebootlib only requires DevKitARM r20 and libfat for device recognizability. So the only patching required is the DLDI patching that you are used to already.

felix123: I don't know, I don't have an R4. Probably not, as other brands have ROM resetting as well, and those don't work on homebrew either.
_________________
http://licklick.wordpress.com

#122593 - Diddl - Tue Mar 20, 2007 4:23 pm

good work lick!

I will do additional code for all of my slot 1 cards, hope you help me if nessecary?


I would like to see a new concept aside from DLDI and reboot lib. I wish we had a driver concept for hardware. like DLDI for patching outside by a windows soft but with support for ANYTHING.
I mean a hardware driver for any slot1 or slot2 device which give an API to all supported hardware features. you can query for available features and call it to use:

  • block device (io-driver for libfat)
  • reboot function (including all nessecary subfunctions)
  • rumble
  • sav game support (read, write, type)
  • hardware reset
  • motion support.
  • RAM support/extension (for slot 2)
  • NAND/NOR support if any (for slot 2)
  • USB support (Fireline, DS-X, DSerial, ...)
  • UART support (DSerial ...)
  • : :

#122597 - tepples - Tue Mar 20, 2007 5:11 pm

Lick wrote:
- I am going to write a new .nds booter, I'm not sure how the older booters differed from each other. When I find out I will use the most appropriate solution.
- I think I might make it so that the launched .nds will automatically have the launching nds' DLDI section. Copy DLDI section no jutsu!

But will there be a way for a program that uses rebootlib to receive argv[0] (path to program) and argv[1] (path to selected file) from another program that uses rebootlib?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#122599 - Diddl - Tue Mar 20, 2007 5:15 pm

tepples wrote:
Lick wrote:
- I am going to write a new .nds booter

But will there be a way for a program that uses rebootlib to receive argv[0] (path to program) and argv[1] (path to selected file) from another program that uses rebootlib?


rebootlib is for returning to NDS menu (same like after turn on power), don't it?

argv[] would be for an bootlib or exec_nds() or such like an operating system.

#122604 - Diddl - Tue Mar 20, 2007 5:27 pm

@Lick

please how do you come to such code like
Code:
void reboot_prepare_ez() {
//-----------------------------
  *(vu16*)0x9FE0000 = 0xD200;
  *(vu16*)0x8000000 = 0x1500;
  *(vu16*)0x8020000 = 0xD200;
  *(vu16*)0x8040000 = 0x1500;
  *(vu16*)0x9880000 = (1<<15);
  *(vu16*)0x9FC0000 = 0x1500;
  *(vu32*)0x27FFFF8 = 0x80000C0;
}


????? you write anything to some memory addresses ?????

I have no idea how to make such things for any of my unsupported slot 1 cards!!!

#122605 - tepples - Tue Mar 20, 2007 5:29 pm

Those unlock sequences come from dumping and then disassembling and emulating the flash card's firmware.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#122609 - Lick - Tue Mar 20, 2007 5:39 pm

I looked at the FAT drivers, searching for something like a "mode change" and I experiment with those values. Slot-1 is going to be a lot harder to support. The Slot-1 device has to send a binary to you, and some manufacturers did not code this procedure. DS Link did, that's why we can reboot.

tepples: Good idea, but where to put those args?
_________________
http://licklick.wordpress.com

#122643 - Gunnex - Tue Mar 20, 2007 11:06 pm

Now what we need is M3DSS/R4 support. I know it's a big challenge, but there is a way. It involves re-loading the firmware or something...

#122677 - HyperHacker - Wed Mar 21, 2007 5:07 am

tepples wrote:
Lick wrote:
- I am going to write a new .nds booter, I'm not sure how the older booters differed from each other. When I find out I will use the most appropriate solution.
- I think I might make it so that the launched .nds will automatically have the launching nds' DLDI section. Copy DLDI section no jutsu!

But will there be a way for a program that uses rebootlib to receive argv[0] (path to program) and argv[1] (path to selected file) from another program that uses rebootlib?
I hope so, because that would own. I could do some nice things if I could pass arguments to a program, especially if it could re-load mine when done.

argv is a pointer, so we could put the actual arguments anywhere the binary won't overwrite them. Function parameters are in registers 0 through 3 and then the stack after that, AFAIK. So it should just be a matter of calling the loaded app's main() with r0=argc and r1=argv.

Hm, I wonder if it's possible to keep the FAT variables set, so that the loaded app doesn't have to re-initialize again (fatInitDefault() just returns instantly)? It seems kind of silly that a program uses libFAT to load another program which then initializes libFAT all over again itself, especially when this can take several seconds in some cases.
_________________
I'm a PSP hacker now, but I still <3 DS.

#123290 - tondopie - Tue Mar 27, 2007 1:30 am

im so glad you made this. to bad it doesn't support either GBAMP or MMD.... which is wat I have...'

EDIT: Oh nvm.... it says MPCF which means GBAMP lol im dumb


Last edited by tondopie on Tue Mar 27, 2007 1:34 am; edited 1 time in total

#123291 - tepples - Tue Mar 27, 2007 1:34 am

MMD would require an exec() function to reload bootme.nds using libfat. But in fact, the top post claims that GBAMP CF is supported (see "MPCF/MPSD").
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#123294 - tondopie - Tue Mar 27, 2007 1:36 am

tepples wrote:
MMD would require an exec() function to reload bootme.nds using libfat. But in fact, the top post claims that GBAMP CF is supported (see "MPCF/MPSD").



if only someone could crack it or make an alternative loader..... oh well i dont use my MMD for developing anyway

#123799 - HyperHacker - Sat Mar 31, 2007 6:19 am

Quote:
Searching for: REG_EXEMEMCNT
include\reboot.c(71): REG_EXEMEMCNT = 0;
include\reboot.c(96): REG_EXEMEMCNT = 0xFFFF;
include\reboot.c(104): REG_EXEMEMCNT = 0;
include\reboot.c(131): REG_EXEMEMCNT = 0xFFFF;
Found 4 occurrence(s) in 1 file(s)

Apparently there is no such register. >_<
_________________
I'm a PSP hacker now, but I still <3 DS.

#123812 - Lick - Sat Mar 31, 2007 10:44 am

REG_EXEMEMCNT is a new register in DKA r20, and also only available on ARM9. Are you not using either of those?

I love you HyperHacker!
_________________
http://licklick.wordpress.com

#123895 - HyperHacker - Sun Apr 01, 2007 8:30 am

Lick wrote:
REG_EXEMEMCNT is a new register in DKA r20, and also only available on ARM9. Are you not using either of those?

Probably not, as it seems every time I update DKP/DKA/libNDS/etc not everything actually gets updated. I am using ARM9 of course. How do I check the version?

Quote:
I love you HyperHacker!
What? o_O
_________________
I'm a PSP hacker now, but I still <3 DS.

#123897 - chishm - Sun Apr 01, 2007 9:04 am

REG_EXEMEMCNT is a spelling mistake. It should have been REG_EXMEMCNT, so expect some things to break when it's corrected.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#123902 - HyperHacker - Sun Apr 01, 2007 9:35 am

I thought the general procedure in such cases was to keep the old version with a "depreceated" attribute, as with vramRestorMainBanks()?
_________________
I'm a PSP hacker now, but I still <3 DS.

#123905 - chishm - Sun Apr 01, 2007 9:53 am

For register names, they tend to be moved to registers_alt.h
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#128952 - Lick - Thu May 17, 2007 12:41 am

Through looking at Cory's project I have concluded that Supercard DS One cards come with a bootable "msforsc.nds" file that seems to be the menu itself. Can anyone confirm this?

I'll put up a new release if it's true. ETA would be more than a few days though.

edit- I will probably add R4/M3Simply support as well, depending on how difficult it is to port Chishm's decrypter to NDS. Haven't checked the source, yet.
_________________
http://licklick.wordpress.com

#128975 - felix123 - Thu May 17, 2007 8:22 am

I think Rudolth figured out how to softreset R4.
_________________
Nintendo DS homebrew on Wikipedia

#129032 - tondopie - Fri May 18, 2007 3:46 am

Great new for all you PAlib people... I partially got this to work with the newest PAlib... the ARM7 side works... the ARM9 side is having a few problems... it has trouble with

Code:
can_reboot


and

Code:
reboot()


I included the reboot.h in the PAlib headers... and made its own function... BTW... shouldn't the 'BOOL' be just 'bool' or am I just being clueless like I usually am...?
_________________
Development Blog: http://teendev.org
Homebrew Podcast: http://homebrewcast.net
Web Design: http://xtendesign.net

#129037 - Lick - Fri May 18, 2007 8:38 am

Your ARM9 side is probably C++, that's why it's complaining about C-functions.

Try wrapping the include of reboot.h like this:
Code:
#ifdef __cplusplus
extern "C" {
#endif

#include "reboot.h"

#ifdef __cplusplus
}
#endif


Now the compiler will know that reboot.h-functions are all C functions.

There is no 'bool' in C, so I defined my own 'BOOL'.
_________________
http://licklick.wordpress.com

#129053 - Lick - Fri May 18, 2007 3:54 pm

Lick's rebootlib 1.1
Small programming library in released as source that allows you to reboot to the homebrew devices' bootmenus.

Supported devices
  • MPCF/MPSD
  • M3CF/M3SD
  • SCCF/SCSD/SCLT/SCDS1 (untested)
  • EFA2
  • EZ4
  • G6 (thx to Puyo)
  • DS Link
  • R4/M3 Simply (untested) (thx to Yasu)
If you plan to add support for other devices, please share the modified source.

Changes from 1.0 to 1.1
- No more GPL, but instead a custom license. See Readme.
- reboot_file(): let's you boot an NDS file. Uses chishm's loader. (Don't forget to put the included "loadnds.bin" inside your projects ARM9 data-folder!! And also patch your application with DLDI!!)
- New devices: SCDS1, R4, M3 Simply. All three untested. Please test!

How to use
1. Include all the rebootlib files to your projects includes and sources.
2. Copy "loadnds.bin" to your projects ARM9 data.
3. Refer to the example project for code implementation.

Download library and example project
rebootlib_1.1.zip - to use the example project: press L to reboot and R to boot a file called "runme.nds"

-Lick
_________________
http://licklick.wordpress.com


Last edited by Lick on Fri May 18, 2007 4:13 pm; edited 2 times in total

#129054 - Lick - Fri May 18, 2007 4:01 pm

As you can see I released rebootlib 1.1. However the newly added devices have not yet been tested. So I ask everyone with an SCDS1, R4 or M3 Simply to help testing.

Please:
1) Download the above file.
2) Patch "reboot.nds" (or ds.gba) with your device's DLDI.
3) Rename a random NDS file to "runme.nds" and put it on your root.
4) Run "reboot.nds" (or ds.gba) and press L to reboot to the bootmenu.
5) Run "reboot.nds" (or ds.gba) and press R to run "runme.nds".

Please report if step 4 or 5 fail. Also report if your screen doesn't go from gray->green because it should.

Thankssssss,
- Lick
_________________
http://licklick.wordpress.com

#129076 - Diddl - Fri May 18, 2007 6:29 pm

Tested with a DS simply
- green screen
- neither L nor R does anything

#129084 - moncul - Fri May 18, 2007 6:51 pm

Diddl wrote:
Tested with a DS simply
- green screen
- neither L nor R does anything


same results with r4

#129089 - Lick - Fri May 18, 2007 7:07 pm

It might be that it's still in the process of decrypting the _DS_MENU.DAT file... Or does it really completely freeze?
_________________
http://licklick.wordpress.com

#129100 - tondopie - Fri May 18, 2007 9:48 pm

this project its really goiing far... is the rebooting based on the FAT of the card? If so, I could supply you with some I/O data for the MMD... I don't know if all of it is correct... but It would be usefuul for people who still use a MMD...
_________________
Development Blog: http://teendev.org
Homebrew Podcast: http://homebrewcast.net
Web Design: http://xtendesign.net

#129107 - tondopie - Fri May 18, 2007 10:30 pm

sorry for the 2x post but my browser sucks and the edit buttons and such don't always work.


THis:

Code:
e:/devkitPro/PAlib/lib\libpa9.a(PA.o): In function `PA_Reboot':
e:/devkitPro/PAlib/lib/arm9/PA.c:260: undefined reference to `can_reboot'
e:/devkitPro/PAlib/lib/arm9/PA.c:261: undefined reference to `reboot'


is why PAlib sucks. Its not exactly very easy to add functions to it... I did what you said, it just doesn't want to work...
_________________
Development Blog: http://teendev.org
Homebrew Podcast: http://homebrewcast.net
Web Design: http://xtendesign.net

#129110 - Lick - Fri May 18, 2007 10:41 pm

Is reboot.c being compiled?
_________________
http://licklick.wordpress.com

#129111 - tondopie - Fri May 18, 2007 10:43 pm

when I do 'build' in the PAlib directory it always compiles fine... it just never works...


EDIT: do you think you could maybe find a way to use it in PAlib? This is my last app being made in PAlib and want some more advanced functions in it.
_________________
Development Blog: http://teendev.org
Homebrew Podcast: http://homebrewcast.net
Web Design: http://xtendesign.net

#129131 - Diddl - Sat May 19, 2007 1:01 pm

Lick wrote:
It might be that it's still in the process of decrypting _DS_MENU.DAT file... Or does it really completely freeze?


It freezes completly. After some minutes green screen, - same result.

#129145 - tepples - Sat May 19, 2007 5:17 pm

Lick wrote:
Changes from 1.0 to 1.1
- No more GPL, but instead a custom license. See Readme.

I quote the license below:
Quote:
Feel free to use and redistribute my library freely, as long as you
a) credit me for this library and
b) publish all your modifications to this library (if any are made) and
c) do not create any damaging software with this library.

This license appears not to be a free software license.

Requirement b) does not permit a user to make private modifications that aren't distributed to the public in any form. The old Plan 9 license and the Reciprocal Public License have this requirement as well, and it makes those licenses non-free. Did you mean the following?
Quote:
b) if you make modifications to this library and distribute them in executable form, you must also distribute them in source code form, and


Requirement c) appears troublesome, much like HESSLA. Your license does not define "damaging software". Is there a statutory definition that you rely on?

I recommend using the Classpath license or the Mozilla tri-license (MPL || GPL || LGPL).

Quote:
- New devices: SCDS1, R4, M3 Simply. All three untested. Please test!

I see an included demo app that runs "/runme.nds". Could you add a file chooser to your demo app?

EDIT:
After I get gray->green on my R4, how long must I wait before pressing L or R?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#129154 - Lick - Sat May 19, 2007 8:26 pm

The R4/M3 Simply routine doesn't work, but I wonder if you guys get a file named "_DS_MENU.NDS" in your root?

Licenses are annoying, I'll just leave it as it is.

Whenever your screen goes green, it's okay to press L (reset) or R (runme.nds).
_________________
http://licklick.wordpress.com

#129162 - Dood77 - Sun May 20, 2007 12:09 am

For the liscense issue, as it stands if someone created software that had a bug that screwed up something permanently, someone could call it "damaging software". It should be changed to something like prohibits the creation of malicious software.

And I'm not entirely sure on what you guys are discussing about the R4... Does reboot work with the stock .DAT files? Has anyone tested it while running DSO as the .DAT files?
_________________
If I use a term wrong or something then feel free to correct, I?m not much of a programmer.

Original DS Phat obtained on day of release + flashme v7
Supercard: miniSD, Kingston 1GB, Kingston 2GB
Ralink chipset PCI NIC

#129173 - tepples - Sun May 20, 2007 1:28 am

Lick wrote:
Licenses are annoying, I'll just leave it as it is.

Unfortunately, if you leave it as it is, with the 3-clause license that prohibits private modification and prohibits some vague notion of "damaging software", many developers of DS homebrew software will not be able to use your library. Did you create the library so that only you can use it in larger works?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#129298 - chrisc - Mon May 21, 2007 6:24 pm

I tested the reboot.nds with my supecard ds 1

I get 2 green screens

left shoulder button resets and right shoulder button hangs with 2 white screens

Well done with this lib, and please feel free to PM me should you wish anything specifically testing on a sc ds 1

[edit]
duh! discovered if you spell the rom name correctly the right shoulder button also works!

#132383 - spinal_cord - Tue Jun 26, 2007 11:39 am

tested with R4ds, get two green screens, L does nothing, R not tried.

I might be missing the point here, but would it not be simpler to had the lib just reset the DS, and let what ever card is in take you to its menu? the same as just switching the ds off and on again?
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#132393 - tepples - Tue Jun 26, 2007 12:49 pm

spinal_cord wrote:
but would it not be simpler to had the lib just reset the DS

If this were the case, then the settings applet in the official firmware would reset the DS instead of powering it off.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#132407 - spinal_cord - Tue Jun 26, 2007 1:43 pm

also, how would someone get this working in palib?
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#132427 - arctic_flame - Tue Jun 26, 2007 3:44 pm

PALib is just a library. Follow the example...

#132503 - spinal_cord - Wed Jun 27, 2007 10:09 am

arctic_flame wrote:
PALib is just a library. Follow the example...

done, thanyou, I wasn't thinking for a second.
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#132750 - HyperHacker - Fri Jun 29, 2007 3:06 am

.nds loading isn't working right for me on GBAMP. Even if I clear VRAM before calling reboot_file(), crap gets left in it, which breaks some programs. Also, when I try to use it to reload my own program, the ARM7 binary doesn't seem to get started.
_________________
I'm a PSP hacker now, but I still <3 DS.

#132802 - Lick - Fri Jun 29, 2007 3:58 pm

I had just added Chishm's boot stub. I'm not really sure what it does internally anymore. Maybe you can find a fix for it? I'm kinda busy atm.
_________________
http://licklick.wordpress.com

#132827 - tondopie - Fri Jun 29, 2007 9:51 pm

chishm's loader does have some arm7 related problems, and some people have told him about it so I am assuming he is working on it.
_________________
Development Blog: http://teendev.org
Homebrew Podcast: http://homebrewcast.net
Web Design: http://xtendesign.net

#132871 - spinal_cord - Sat Jun 30, 2007 8:51 pm

I've just updated both devkitpro, and palib, so I don't know which one is to blame, but...

Code:

preparedevices.o: In function `reboot_prepare_scds':
c:/devkitPro/_my_games/DiagnoSe/source/preparedevices.c:79: undefined reference to `prepare_load_bin'
preparedevices.o: In function `reboot_prepare_r4':
c:/devkitPro/_my_games/DiagnoSe/source/preparedevices.c:210: undefined reference to `prepare_load_bin'
collect2: ld returned 1 exit status


Can anyone help?
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#133089 - HyperHacker - Tue Jul 03, 2007 4:53 am

Any chance of being able to choose which slot to reboot to? E.g. boot from a slot-1 card, and have the program boot a slot-2 card or vice-versa.

BTW, I'm trying the loader with some different programs now and it's not having much luck.

  • Moonshell: FAT init fails (same Japanese error message as when /shell is not found)
  • DSOrganize: works
  • TxtWriter: Garbage on bottom screen, works but can't see the keyboard well enough to use
  • NES DS: Runs but doesn't respond to anything
  • SNEmulDS: Same as NES DS
  • TetattDS: Runs slow(?), game doesn't actually start (cursor is in top-left, timer doesn't count donw), no sound
  • Project JDS: Slow to start up, freezes at title screen
  • DS2Key: works
  • DSLinux: works
  • DSLiveweather: Hangs after 2 lines of output, bottom screen black
  • Bunjalloo: White screens
  • Loopy's(?) firmware dump: White screens (could only get this to work with DSO's Mighty Max loader)
  • REIN: works


So yeah, it has some problems, I'm guessing most of them are ARM7-related. Hopefully Chishm decides to look in here. :-p
_________________
I'm a PSP hacker now, but I still <3 DS.

#133106 - Lick - Tue Jul 03, 2007 11:41 am

It's hell easy to build that functionality. Just give reboot() [ARM9] a parameter, give prepare_device() [ARM9] a parameter and add an if-condition. Then you can specify which device you want to reset. You can get the devicetype from libfat and pass it to the new reboot().
I tried to keep the API as simple as possible so I left out stuff like this. Basically, it will reboot to the libfat-device.

I'm not sure why the bootstub fails, but one thing that's known is that dswifi doesn't boot twice. It might be something that needs to be reseted but no one knows what exactly.

Thanks for your extensive testing man.
_________________
http://licklick.wordpress.com

#133423 - tondopie - Fri Jul 06, 2007 3:19 am

spinal_cord wrote:
I've just updated both devkitpro, and palib, so I don't know which one is to blame, but...

Code:

preparedevices.o: In function `reboot_prepare_scds':
c:/devkitPro/_my_games/DiagnoSe/source/preparedevices.c:79: undefined reference to `prepare_load_bin'
preparedevices.o: In function `reboot_prepare_r4':
c:/devkitPro/_my_games/DiagnoSe/source/preparedevices.c:210: undefined reference to `prepare_load_bin'
collect2: ld returned 1 exit status


Can anyone help?



its the way PAlib handles binary files. You'll have to edit the makefile yourself.
_________________
Development Blog: http://teendev.org
Homebrew Podcast: http://homebrewcast.net
Web Design: http://xtendesign.net

#133451 - HyperHacker - Fri Jul 06, 2007 7:21 am

I did some more testing of the stubborn files between Rebootlib, GBAMP loader, DSOrganize (the loader in DSO actually called "DSOrganize"), and Mighty Max (one of the other loaders in DSO). Bunjalloo only booted with DSOrganize and the firmware dump only booted with Mighty Max. I'd like to get a look at these files and see just what it is the loaders don't like... Moonshell won't boot my program either, when it works fine as _BOOT_MP.NDS on the GBAMP and as a WMB download.

Lick wrote:
It's hell easy to build that functionality. Just give reboot() [ARM9] a parameter, give prepare_device() [ARM9] a parameter and add an if-condition. Then you can specify which device you want to reset. You can get the devicetype from libfat and pass it to the new reboot().
I tried to keep the API as simple as possible so I left out stuff like this. Basically, it will reboot to the libfat-device.
Maybe a dumb question but how do I get the device type? (I'm on my way to bed so I haven't actually looked. :-p)

Quote:
I'm not sure why the bootstub fails, but one thing that's known is that dswifi doesn't boot twice. It might be something that needs to be reseted but no one knows what exactly.
You mean after one program that uses DSWifi is loaded, a second one won't load? My program includes a "search for access points" function using it, but besides that it doesn't even touch wifi. It loads DSO just fine though even after using that.

Quote:
Thanks for your extensive testing man.
Thank you for your code!
_________________
I'm a PSP hacker now, but I still <3 DS.

#133489 - Lick - Fri Jul 06, 2007 1:40 pm

There's device-type checking code in the [arm9] "can_reboot()" function, if I remember correctly.

DSLiveWeather "hung" after two lines, which means it was trying to set up DSWifi, but failed and died a horribly death.
_________________
http://licklick.wordpress.com

#133556 - HyperHacker - Sat Jul 07, 2007 1:31 am

Interesting. I noticed Wifi_Deinit() doesn't stop the LED flashing, so maybe it's leaving other things in a funny state too.
_________________
I'm a PSP hacker now, but I still <3 DS.

#133577 - spinal_cord - Sat Jul 07, 2007 5:55 am

tondopie wrote:
spinal_cord wrote:
I've just updated both devkitpro, and palib, so I don't know which one is to blame, but...

Code:

preparedevices.o: In function `reboot_prepare_scds':
c:/devkitPro/_my_games/DiagnoSe/source/preparedevices.c:79: undefined reference to `prepare_load_bin'
preparedevices.o: In function `reboot_prepare_r4':
c:/devkitPro/_my_games/DiagnoSe/source/preparedevices.c:210: undefined reference to `prepare_load_bin'
collect2: ld returned 1 exit status


Can anyone help?



its the way PAlib handles binary files. You'll have to edit the makefile yourself.


Edit the makefile to what?
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#133859 - OSW - Mon Jul 09, 2007 10:16 am

Is rebooting to the DS's main firmware menu possible?

#133883 - chuckstudios - Mon Jul 09, 2007 3:16 pm

Not at this time.

#133895 - OSW - Mon Jul 09, 2007 4:28 pm

has anyone looked into it or is looking into it?

just out of interest.

#133952 - HyperHacker - Mon Jul 09, 2007 10:18 pm

It's something I plan to look at in the distant future. :-/
_________________
I'm a PSP hacker now, but I still <3 DS.

#133959 - dantheman - Mon Jul 09, 2007 10:32 pm

You could reboot to the device's menu and then run the firmware backup Olimar made at http://forum.gbadev.org/viewtopic.php?t=13459 though it probably won't be able to boot anything else after that point.

#133979 - spinal_cord - Tue Jul 10, 2007 12:10 am

It doesn't detect either slot-1 or 2 card inserted.
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#133986 - HyperHacker - Tue Jul 10, 2007 12:28 am

It detects slot-2 for me, and runs unsigned WMB code too. The warning screen is annoying though.
_________________
I'm a PSP hacker now, but I still <3 DS.

#134033 - OSW - Tue Jul 10, 2007 6:26 am

Interesting. thanks for the info.

I used cory1492's 7/9 bios + firmware dumper (DSBF_dump) to make my own dumps.
The firmware dump was 256kb and i have a new NDSL. I forget whether new NDSL have 512kb firmware or not, but if it is 512kb then my dump isn't proper.

I failed trying to boot it myself from my carts loader which is unsurprising given the information you guys have provided.

I'll try out Olimars firmware backup now.

#134039 - dantheman - Tue Jul 10, 2007 7:25 am

The firmware dump I got using DSLinux was 256 kb in size as well, if it matters. But yeah, that thread I linked to has some good info in it.

For me, when running Olimar's firmware file, I can't boot either slot-1 or slot-2, like spinal_cord. I'd only use it for changing firmware settings though, so it doesn't matter too much.

#134084 - Lick - Tue Jul 10, 2007 2:42 pm

OSW wrote:
has anyone looked into it or is looking into it?

just out of interest.


Yes, it can't be done.
_________________
http://licklick.wordpress.com

#134089 - OSW - Tue Jul 10, 2007 3:10 pm

I see. My testing of Olimar's firmware seems to yeild pretty much the same results as others.

It is still somewhat useful though.

#134157 - tondopie - Wed Jul 11, 2007 2:12 am

spinal_cord wrote:
tondopie wrote:
spinal_cord wrote:
I've just updated both devkitpro, and palib, so I don't know which one is to blame, but...

Code:

preparedevices.o: In function `reboot_prepare_scds':
c:/devkitPro/_my_games/DiagnoSe/source/preparedevices.c:79: undefined reference to `prepare_load_bin'
preparedevices.o: In function `reboot_prepare_r4':
c:/devkitPro/_my_games/DiagnoSe/source/preparedevices.c:210: undefined reference to `prepare_load_bin'
collect2: ld returned 1 exit status


Can anyone help?



its the way PAlib handles binary files. You'll have to edit the makefile yourself.


Edit the makefile to what?



oh, wait. I thought you were trying to use a .bin file. Nvm. Just comment it out. Thats what I did. Cuz I hate Slot-1s, I'm a traditionalist.
_________________
Development Blog: http://teendev.org
Homebrew Podcast: http://homebrewcast.net
Web Design: http://xtendesign.net

#138004 - melw - Sat Aug 18, 2007 10:36 am

Wasn't sure if this is a bug or feature, but I noticed the following: Using rebootlib after wifi initialization keeps the wifi alive (the led is blinking + re-initializing wifi is a lot faster). This happens at least with M3 Perfect Lite.

Should the user shutdown all the systems before using reboot()? I was assuming rebooting resets the device close to a same state as starting up the DS.

#138037 - Lick - Sat Aug 18, 2007 9:25 pm

Yes, the developer should do it himself. I had thought about resetting everything but because I had no time/I was too lazy/I wanted to keep the lib as clean as I could/All of the above I did not add these procedures. One could argue that rebootlib is therefore not complete (should be 0.x version) however, I encourge you to improve it and add to it, and it doesn't seem like the current state of the lib is causing any errors. Last but not least, it works.
_________________
http://licklick.wordpress.com

#138059 - OSW - Sun Aug 19, 2007 5:43 am

hmm. i just realised that using lovelite, rebooting to the ez4 menu works fine, but when i restart the DS the brightness changes to full.

#138070 - Lick - Sun Aug 19, 2007 11:14 am

Which version of LoveLite is it? How old/new is your DS Lite?
_________________
http://licklick.wordpress.com

#138074 - OSW - Sun Aug 19, 2007 1:28 pm

last december. so 9 months approx.

I think i'm using the latest version. If it's important i can check. however same thing happens when soft-resetting with DSLiveWeather (latest version).

#139277 - HyperHacker - Tue Sep 04, 2007 5:03 am

Add me to the list of people who can't use this because of the license (and the list of people who hate the GPL for being viral >8^( ). Unless someone happens to have some decent code to read from a DS card, including all the encryption and secure area BS (I.E. it needs to be able to read anywhere from a card that's put in after the app starts) that's not infected with GPL, then I can ditch that silly license entirely. >_>

(For that matter, I can't use your slot-2 RAM library in my app either, which it will probably need in the future.)
_________________
I'm a PSP hacker now, but I still <3 DS.

#139424 - Skizo - Thu Sep 06, 2007 1:33 am

hello. I've been messing around with this lib and was trying to make it work with the R4.

I've been looking around and trying to patch here and there the lib, and as far as I've seen (aside the fact it takes quite a while to copy/decrypt the _DS_MENU.DAT) it has also some problem with decryption (or so I think).

I've kept it in the SD just to check it out, and eventually tried to boot it from within the r4 itself. While the first menu perfectly opens, it freezes shortly after.

None to say, it just won't do anything after the softboot within the homebrew.

I would dearly like to help, but as I'm pretty new to the DS, I would like to know where I should give a look... I've mostly been trying it all until now, with no much luck.

I'll be awaiting for some news. Peace :]
_________________
Demons-Я-US

#139448 - Lick - Thu Sep 06, 2007 8:19 am

Yeah, the R4 procedure doesn't fully work. I don't have an R4 (or a DS for that matter) myself, so I'm not really motivated to fix the lib. Debugging and testing is much easier with hardware that you own.

The libraries "framework" is pretty easy to follow, so if you have the right procedure, it wouldn't be too hard to implement it and update it.
_________________
http://licklick.wordpress.com

#139458 - Skizo - Thu Sep 06, 2007 1:12 pm

Yep, the code itself is quite straight, and I think I roughly have an idea of how it should work. The problem is that if the decryption doesn't get done right, no matter the effort it just won't work.

Also should be noted that I started coding for DS like... huh... yesterday afternoon? :D

I'm getting through it quite fast, but for such a matter I would be in need of quite some "heads-up". I'd be pleased to fix it and make it public, but the fact is that as of now I have no idea where to start, including the _DS_MENU.DAT decryption. The way it should technically do it is rather simple: check if R4, open the system file, decrypt it (pretty slowly atm I should say), save to some temp file (fully achieved) and then load and run. And it wouldn't be a problem if it worked, mind me.

Any hints/suggestions toward this?
_________________
Demons-Я-US

#139505 - chuckstudios - Thu Sep 06, 2007 9:56 pm

Why don't you integrate the code that Rudolph wrote for soft reset? He made a modified reset.mse for Moonshell that accomplished soft reset without decryption, and it's open source.

#139509 - Lick - Thu Sep 06, 2007 10:27 pm

chuckstudios wrote:
Why don't I integrate the code that Rudolph wrote for soft reset? He made a modified reset.mse for Moonshell that accomplished soft reset without decryption, and it's open source.

;D
_________________
http://licklick.wordpress.com

#139510 - Skizo - Thu Sep 06, 2007 10:32 pm

Lick wrote:
chuckstudios wrote:
Why don't I integrate the code that Rudolph wrote for soft reset?

;D


lol...


chuckstudios wrote:
Why don't you integrate the code that Rudolph wrote for soft reset? He made a modified reset.mse for Moonshell that accomplished soft reset without decryption, and it's open source.


Well... probably beacause I didn't know it at all... I'm too new at this. I thought that reset.mse was also closed source...

I'll have a look at it anyway and try to modify this lib... just to get it sorted, you know ;)
_________________
Demons-Я-US

#139511 - Lick - Thu Sep 06, 2007 10:42 pm

Re-licensed under MIT/GPLv2 http://lickr.org/files/rebootlib/rebootlib_1.1r.zip
_________________
http://licklick.wordpress.com

#139516 - MechaBouncer - Thu Sep 06, 2007 11:33 pm

I'm currently trying to convince Team Cyclops to add support to the CycloDS Evolution to support the rebootlib. They have released a customized version of MoonShell with a custom reset.mse, but as far as I can tell it is closed source. Obviously, it would probably be cleaner to just add the source to the rebootlib, but would it also be possible to execute an external reset.mse file like the way Moonshell does it? According to the text accompanying the reset.mse file, it's mostly based on Lick's code from LoveLite:
reset.txt wrote:
MoonShell execute plug-in

This plug-in is exclusive return to firmware function.

Reference URL that becomes base of reset function.
Most of reset.mse is a copy of LoveLite.

Lick + ds homebrew
http://licklick.wordpress.com/tag/lovelite/

For other homebrew developers.
'reset.mse' can be used from your self-made application.

Please make the C/D bank of VRAM accessible from ARM9.
example.
VRAM_C_CR = VRAM_ENABLE | _VRAM_CD_MAIN_BG_0x6000000;
VRAM_D_CR = VRAM_ENABLE | _VRAM_CD_MAIN_BG_0x6020000;

Please write the following values in 1024 bytes from 0x0603FC00. (16bit access is necessary.)
0x0603FC00 0x01
0x0603FC01 0x01
0x0603FC02 0x01
0x0603FC03 0x01
0x0603FC04 '?'
0x0603FC05 '?'
0x0603FC06 '?'
0x0603FC07 '?'
0x0603FC08 0x00
0x0603FC09 0x00
0x0603FC0A 0x00
0x0603FC0B 0x00
0x0603FC0C 0x00,0x00,0x00...
Please input the adaptor name (four characters) from 0x0603FC04 to 0x0603FC07.
Please fill zero from 0x0603FC0C to 0x0603FFFF.

Please start 'reset.mse'. (Please begin with usual NDS multi boot in a similar way.)


So is this something that can be done within the rebootlib if the reset.mse file is put somewhere standard like the root of the card?
_________________
Cobalt/Black NDSL
CycloDS Evolution (firmware 1.55 BETA 3) and EZFlash 3-in-1
Kingston SD-C02G JAPAN 2GB MicroSD
MoonShell 1.71, DSOrganize 3.1129, QuakeDS Pre3, ScummVM DS 0.11.1, Pocket Physics 0.6, OpenTyrian DS 0.3

#139524 - chuckstudios - Fri Sep 07, 2007 1:02 am

Lick wrote:
chuckstudios wrote:
Why don't I integrate the code that Rudolph wrote for soft reset? He made a modified reset.mse for Moonshell that accomplished soft reset without decryption, and it's open source.

;D


I tried, and failed. But he was asking for suggestions, so I gave him one.

#139539 - melw - Fri Sep 07, 2007 10:13 am

Lick wrote:
Re-licensed under MIT/GPLv2 http://lickr.org/files/rebootlib/rebootlib_1.1r.zip

In practice what does this mean? Do we have to publish now the source code of a program that uses this Reboot library?

#139544 - sonny_jim - Fri Sep 07, 2007 10:56 am

No, I think it means that if you only have to supply the bits you modified in the original library to get it to work with your code.
(IANAL)

#139562 - Corsix - Fri Sep 07, 2007 2:48 pm

IANAL, but a MIT/GPLv2 license means that you can choose to use the library either under the terms of the GPL v2 (which forces full source code release, amongst other things), or the MIT license, which only requires you put something like this with any program which uses the library:
Quote:

Uses rebootlib copyright (c) <year> <copyright holders>

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

#139565 - sonny_jim - Fri Sep 07, 2007 3:14 pm

I was under the impression that it only forces full source release of the GPL software being used. If you use some GPL code you don't have to open source ALL of your code, just the parts that you might have changed in the GPL code.

Or am I completely wrong?

EDIT: Yes, I am completely wrong

#139580 - Corsix - Fri Sep 07, 2007 6:54 pm

GPL is often referred to as a virus-like license, in that if a small part of the the program is GPLed, then the whole program must become GPL. The LGPL is the less restrictive, its spirit being that end users must be able to replace the LGPL library with a new/different version of the library, so either the library must be loaded dynamically, or the program author must provide a way for the end user to recompile the program using the new library (eg, by providing full source).

#139727 - melw - Sun Sep 09, 2007 3:40 pm

Corsix wrote:
IANAL, but a MIT/GPLv2 license means that you can choose to use the library either under the terms of the GPL v2 (which forces full source code release, amongst other things), or the MIT license, which only requires you put something like this ...

Thanks for the explanation. Sounds like a good solution to have two licences to choose from.

Lick wrote:
I don't have an R4 (or a DS for that matter) myself, so I'm not really motivated to fix the lib.

No DS at all? What happened?

#139737 - wintermute - Sun Sep 09, 2007 6:11 pm

melw wrote:
Corsix wrote:
IANAL, but a MIT/GPLv2 license means that you can choose to use the library either under the terms of the GPL v2 (which forces full source code release, amongst other things), or the MIT license, which only requires you put something like this ...

Thanks for the explanation. Sounds like a good solution to have two licences to choose from.


Except for the minor detail that there's no information on how the statement is supposed to be interpreted. It could be anything given that the source appears to have no proper licensing.

The MIT license is compatible with the GPL license so this dual arrangement doesn't seem to actually serve any purpose. As the distribution stands now the licensing isn't clear enough to be acceptable for any 3rd party use.

Fixing it is a simple matter of spelling out the MIT license and stating that the license is compatible with GPL. Dual licensing only makes sense if there's a commercial aspect.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#139743 - Lick - Sun Sep 09, 2007 6:44 pm

Is there any way for me to transfer the ownership/copyright of these libraries to someone else who is interested in maintaining and properly licensing them?
_________________
http://licklick.wordpress.com

#139747 - tepples - Sun Sep 09, 2007 7:20 pm

wintermute wrote:
Except for the minor detail that there's no information on how the statement is supposed to be interpreted. It could be anything given that the source appears to have no proper licensing.

Lick's RAM Unlocking API was relicensed on the same day. Each source code file of the relicensed version of that package as I downloaded it states that it is licensed as described in the package's README, which states the following:
Lick wrote:
Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
and GPLv2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt) licenses.

The page at URL http://www.opensource.org/licenses/mit-license.php contains the text of the MIT License as approved by Open Source Initiative. Is there something I missed about this statement? Or was rebootlib handled differently from RAM API?

Quote:
The MIT license is compatible with the GPL license so this dual arrangement doesn't seem to actually serve any purpose.

As I understood the discussions around the Mozilla tri-license (MPL/GPL/LGPL), MoFo used both GPL and LGPL to make use under the GPL more convenient.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#139754 - wintermute - Sun Sep 09, 2007 9:39 pm

tepples wrote:

Lick's RAM Unlocking API was relicensed on the same day. Each source code file of the relicensed version of that package as I downloaded it states that it is licensed as described in the package's README, which states the following:
Lick wrote:
Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
and GPLv2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt) licenses.

The page at URL http://www.opensource.org/licenses/mit-license.php contains the text of the MIT License as approved by Open Source Initiative. Is there something I missed about this statement? Or was rebootlib handled differently from RAM API?


The full text of the license should be in the readme, linking to a webpage isn't generally considered to be a valid license statement.

Quote:

Quote:
The MIT license is compatible with the GPL license so this dual arrangement doesn't seem to actually serve any purpose.

As I understood the discussions around the Mozilla tri-license (MPL/GPL/LGPL), MoFo used both GPL and LGPL to make use under the GPL more convenient.


The mozilla public license is not compatible with GPL and thus needs explicit treatment.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#139758 - tepples - Sun Sep 09, 2007 10:08 pm

wintermute wrote:
The full text of the license should be in the readme

I agree that it SHOULD (that is, as a best practice), but MUST it?

Quote:
linking to a webpage isn't generally considered to be a valid license statement.

Creative Commons would disagree with such a statement. If I use the license wizard at creativecommons.org to choose a license for a work other than a computer program[1], allow modifications and commercial use, and choose jurisdiction where I live, I get a result page recommending the Creative Commons Attribution License (US version) as well as some HTML code to incorporate the license into a work by reference. Or is the ability to incorporate license text by reference specific to the license, where some licenses allow this and other licenses do not?

[1] Creative Commons recommends GNU licenses for computer programs, and it offers Commons Deeds for these licenses.

wintermute wrote:
The mozilla public license is not compatible with GPL and thus needs explicit treatment.

But that alone doesn't explain why Mozilla used MPL/GPL/LGPL rather than plain MPL/LGPL.

Lick: For the avoidance of doubt, it would be best practice to include GPL-2.0.txt and MIT-LICENSE.txt the next time you package your libraries.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#140404 - MEstk - Sun Sep 16, 2007 4:22 am

What about R4 compatibility ?

I get two green screens and it wont reboot or boot file :(

#143413 - norgg - Sun Oct 21, 2007 1:25 am

Lick wrote:
There is no 'bool' in C, so I defined my own 'BOOL'.


#include <stdbool.h>

#151117 - Dwedit - Tue Feb 19, 2008 11:16 am

The URL in the first post no longer works.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#151164 - Lick - Wed Feb 20, 2008 9:16 am

Yeah, my hosting expired. And I'm broke. I do have a back-up of all the files though. Need me to upload, just say the word.
_________________
http://licklick.wordpress.com

#151171 - tepples - Wed Feb 20, 2008 1:24 pm

Lick wrote:
Yeah, my hosting expired. And I'm broke. I do have a back-up of all the files though. Need me to upload, just say the word.

The word is "drunkencoders". You could consider asking them about hosting.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#151175 - tondopie - Wed Feb 20, 2008 3:26 pm

I can give you hosting, Lick.


PHP 5, MySQL, CGI, Mail, FTP, etc.
_________________
Development Blog: http://teendev.org
Homebrew Podcast: http://homebrewcast.net
Web Design: http://xtendesign.net

#155041 - Ludo6431 - Thu Apr 24, 2008 9:38 am

I can't download the rebootlib, the website is down.
May i have a link ? plz
Thanks

#155088 - tondopie - Thu Apr 24, 2008 9:48 pm

hIs hosting expired.... I have a link right here:

Look in this archive some where: http://ndsdev.opensourceds.info/index.php?dir=&file=teendev.dragonminded.com_files.tar I believe 1.1r is in there if not, tell me and I'll re-host it.
_________________
Development Blog: http://teendev.org
Homebrew Podcast: http://homebrewcast.net
Web Design: http://xtendesign.net

#155145 - Ludo6431 - Fri Apr 25, 2008 4:45 pm

Thanks but there's no the rebootlib 1.1r ;).

#155167 - tondopie - Fri Apr 25, 2008 10:33 pm

/me looks deep in the depths of his hard drive....


Ahh! Here we go: http://ndsdev.opensourceds.net/index.php?dir=&file=rebootlib_1.1r.zip

EDIT: Link Updated ^^
_________________
Development Blog: http://teendev.org
Homebrew Podcast: http://homebrewcast.net
Web Design: http://xtendesign.net


Last edited by tondopie on Wed May 14, 2008 11:34 pm; edited 1 time in total

#155172 - Ludo6431 - Fri Apr 25, 2008 11:35 pm

Thanks

edit : I think the reboot don't work on R4 but this should work... because there is the function to reboot on R4.