Home | Forums | What's new | Resources | |
Need for a program loader ? |
vreuzon - Jan 13, 2003 |
< Prev | 1 | 2 | 3 | 4 | 5 | Next> |
TakaIsSilly | Jan 19, 2003 | |||
Can't you say where it crashes? PC adress, anything? maybe it's in a loop? Even asm could be handy right now ^^; |
antime | Jan 20, 2003 | |||||||
I don't think you'll have too much problems with programs using SGL, I'm more concerned with programs that doesn't use Sega's libraries (eg. Charles MacDonald's test software). The things that concern me most are any interrupts and slave CPU processing started by the libs, as these would still be running when executing the loaded program. Of course, if you're only planning on loading your own SGL programs there should be less to worry about.
Sure, but that would be too easy, wouldn't it? The segadev... mailing list is a good place to ask (Fabien Autrel, the author of Satourne subscribes to the list too). |
printf | Jan 20, 2003 | ||||
It took me some time to find something wrong with what you have done so far. But then I thought about your overall setup, and now I got another solution that hopefully won't cause more coasters. First of all, you aren't using the IP.bin example code that is supposed to be somewhere in the SGL and documents package, right? From what I read you use a normal IP.bin from some game or maybe a demo CD/homebrew game. That would explain a few things, because if you don't write your own startup code, you are likely to have missed something. You see, to correctly load and execute a program that has been compiled to work at 00200000 (low ram), you need to put 00200000 at the mentioned offset and jump to the correct address after the code in IP.bin has ended. If you don't do so, your Saturn will always jump to the same address (say 06004000) and try to execute your program there, which will fail. To solve this problem, simply change both occurences of 06004000 in your IP.bin, and try again. |
slinga | Jan 20, 2003 | |||
Hmmm...I changed both occurances of 0600 4000 to 0020 0000 in the ip.bin. I then changed the slstart value in makefile to SLSTART 0x00200000. Still no luck. It crashes at the sega logo, before any text is displayed, so I doubt there's anything wrong in my program code. I'm totally out of ideas. I've been reading through the docs, maybe there's something we're missing.... |
antime | Jan 21, 2003 | |||
What printf was referring to is the application initial program, ie. the code that is running while the Saturn is loading the first file into memory. If you're using a custom AIP it might not jump to the address you've specified but might have 0x6004000 hard-coded into it instead. |
slinga | Jan 21, 2003 | |||
That sounds possible....seeing how the code only executes when I have it at 0600 4000. Next question: How do I create my own ip.bin? I've been using (and modifying) an already created one. I think it was from the first sms emulator. |
printf | Jan 24, 2003 | |||
You can use the package coming with the SGL files, use a very small IP.bin from a game (see my other post) or ask me to dig one up for you. |
slinga | Jan 27, 2003 | |||
*bump* Any ideas? |
antime | Jan 27, 2003 | |||
Put the IP you've been using somewhere public and I'll take a look at it. |
slinga | Feb 11, 2003 | ||||
I figured out why it wasn't executing at any value other then 0600 4000, it was commented out in the MAKEFILE. Man do I feel dumb. Another thing I learned was, don't copy anything to 0600 0000 - 0600 4000, bad things will happen. Here's my progess:
I verified the memory in Satourne and the bootloader is in fact being loaded to 0020 0000 (thanks to printf for the ip.bin). Bonus.bin is being loaded to 0600 4000 as it should. When I run the iso in Satourne, all the text shows up as it should, including the last line: "Bin Final Test Whatever...". The only thing missing now is the fact that it's not executing the next program. Not sure why....I hope I don't need some special function. |
slinga | Feb 11, 2003 | ||||
A look through the includes directory brought up this file, PROCESS.H
Of course I have no idea idea how to use these files, something about neither a null terminated array....any tips...I'm guessing with need something like spawnl.... |
vreuzon | Feb 12, 2003 | |||
I can't see what is wrong with your code. Did you try it with satourne ? Then you should see if death tank really starts its execution by looking at the pc. (The problem might come from the loaded prog itself; you could try with a simple two lines asm prog for more clarity) About process.h. I don't think your spawn functions can help. The "path" and "argv" parameters don't have anything to do will the saturn, since they deal with command line. (you won't need the slSynch loop at the end when it works) |
slinga | Feb 12, 2003 | |||
Hmmm it appears to crash in Satourne if I take that last slSynch() out. I should probably test on a real saturn, I'll give u results by the weekend. |
TakaIsSilly | Feb 13, 2003 | |||
-- That means the readbuf() call was ignored... strange. Could you do a mixed c/assembly dump and check what's called on that instruction? Using something like this... 11) Generating mixed C/assembly listings To generate a nice assembly listing with interspersed C source, try: gcc -O2 -m2 -g -S foo.c as -ahld foo.s > junk.tmp "junk.tmp" will now contain a nicely formatted mixed C/assembly listing. |
slinga | Feb 14, 2003 | ||||
I get an error message:
|
ExCyber | Feb 14, 2003 | |||
You're passing as arguments to gcc instead of running as, and I don't remember whether or not it matters for this purpose but -s and -S almost certainly mean different things to gcc. |
slinga | Feb 18, 2003 | ||||
Ok I'm definitely on the verge of getting this now....what does this error mean:
I'm use FLD_ExecGame("DUKEIP.BIN", "DEATH", 1); and I'm including fld_load.h. Any ideas? And I'm positive this is the function I need. I read a doc on Antime's website, entitled "Saturn DEMO-DEMO File Loader", and I'm pretty sure this function is a shortcut for it. |
< Prev | 1 | 2 | 3 | 4 | 5 | Next> |