Oh shut up!Inopia posted on Oct 13 2005 at 07:31 PM said:Hmm, maybe you want three different transparent colors, one for each icon
Aren't there still bits left in the FLAGS byte? I recall so.Robster posted on Oct 23 2005 at 05:13 AM said:OK at so now I want to add some more... a flag that says "ARM940 code present". If this flag is set, then there will be addresses and sizes for code, data, and bss for the 940 as well. The "Address of start of code section" for the 940 will need to be on a 24-bit (16MB) boundary, because the 940 code must be based at zero in its banked memory space. If this is done, the most significant byte of the 940's "Address of start of code section" will also be the value to be placed in the 940BANK special function register.
The value of 940BANK in the GP2X can only be 0 - 3 because of the 64MB RAM limit... so instead of having "Address of start of code section" for the 940, it could just be 2 bits in the flags byte.
Only 16MB wasted... :blink:Anyone got any ideas about a "standard" way of partitioning the RAM space? I guess we could put the 940's code at 0x01000000 and then start the heap just above that, so there will "only" be up to 16MB wasted.
I would rather have 920t code to start 940t.. instead if crt0/loader.Another possibility is to make the 940 code base anything above 0x02000000, and a "Start_940_Running" SDK function could poke 0x02000000 with a jump to the real start of the 940's code. I'd like to put the 940's code at 60MB or something... that gives 4MB for it to play with which should be more than enough.
I was wondering about another flag in the header that says "Start the 940 running before jumping to the 920's entry point"... so the loader would start both cores. Doesn't really seem worthwhile to me, as starting the 940 is a trivial operation.
IMHO does not belong to a header.Finally, I was wondering about having a field in the header for speed settings... like, CPU 200MHz, RAM 100MHz, peripherals 50MHz etc. The loader could set the speeds before entering the application. Again, it's not a big job to set it up so I don't really think it's worthwhile.
Integrating arm-elf-objcopy ? heh.I'm doing an elf2g2x tool, and I'll also write up this format properly if we ever feel that it's complete
int CODE_IN_940 foo( int bar ) { ... }
char DATA_IN940 blaat[] = "mr.spiv takes over..";
Squidge posted on Oct 24 2005 at 07:26 AM said:Hmmmm, If the arm940 code is loaded and placed into memory by the loader, doesn't that mean that the memory will not actually be allocated? How are we going to make sure that a malloc sometime in the future is not going to return memory at some same address where the arm940 code has been located?
Are we going to have the same situation as linux - only allowing memory allocations within the first 32mb to ensure this? If this is the case, then I think I would prefer linker scripts per application.
Well now I don't quite get you.. ld & linkerscripts are able to compile codes belonging to separate address spaces into one binary. That's what I after. Just like GBA guys do it.. their normal code runs in cart rom address space and IWRAM tagged funtions run iwram address space. On start crt0 does the thing of placing the code where needed.Robster posted on Oct 24 2005 at 05:24 AM said:Erm, I don't quite understand what you're saying.
About the linker script and magic incantations in function declarations: well, these need to resolve to hard addresses at some stage. We've (perhaps unfortunately) already defined the start of the 920 executable as 0x00008000, and the 940 necessarily starts at 0x00000000, so if we leave the addresses as they are any 940 code + data that's bigger than 32k will cause a collision.
Have a look at devkitARM GBA linkerscripts.. :rolleyes:Personally, I prefer having a separate linker script for the 940, which bases the code at 0, then have separate link steps in the program makefile. This will result in 2 ELF files. I'm quite happy for my elf2g2x prog to take in 2 ELF files, and stick them into the same final object.
I disagree here.. keep the loader away from the 940As for dealing with repositioning the 940 code in crt0 or whatever, well the loader is currently loading the g2x file into RAM, repositioning the 920 code and data etc, so I think it makes sense for the loader to do the same for the 940 code. This also
It can be made easily a makfile option.. so when single core code -> no extra code for 940 handling.removes the need for every dual-core application to carry the code to do this. The size and position of 940 code, data and bss will be in the g2x file somewhere anyway (whether as entries in a header, constant data in the code or whatever) so it might as well just go in the header.
Check devkitARM GBA crt0s and linkerscripts.Could you give more detailed examples of what you're suggesting?