Help Needed With Hh Programming


Dex

Still Fresh
Joined
Feb 2, 2006
Messages
39
HI, i need help with HH programming, i want to write a very basic OS that boot looks for a file on the SD card by a certain name, if it find it it runs it, if not it loads a menu, with built in media player etc.

I have already done the above for the x86, now i want to port it to the gp2x, but it means learning both the ARM ASM and the gp2x layout. i have written some test programs to run under gp2x linux, these were code in fasmarm much better and easier to use than gcc (for assembly i mean ), these work fine, but it when i come to HH Dev that i can not get anything to work, i have been testing my work with tramp_SD from here: http://deadcoderssociety.org/www/dev/GP2X/dl.html
made by rob brown, it should load a test.bin file to 0x00008000 , but so far i get a blank screen, i have tryed blinking battry LED, setting LCD on, serial port dump, but nothing works.

Does anyone have a basic 920t boot setup (as in list of mini setup, to get writing to screen working, ) or any code example that works with the above HH program ( No linux running).
As i need some way of debuging my code.
Thanks advance.
Dex
 
Sounds like you need Robster's GP2X SDK (contains stuff for writing to the screen, sd cards, setting up the system, etc) and Art's uboot (can boot a file direct from sd therefore bypassing the loading of linux).
 
Squidge posted on Sep 7 2006 at 08:43 PM said:
Sounds like you need Robster's GP2X SDK (contains stuff for writing to the screen, sd cards, setting up the system, etc) and Art's uboot (can boot a file direct from sd therefore bypassing the loading of linux).


im using the ART's u-boot and lib's i can boot to the SD card but whatever demo i try or code i get the same blank screen!!! its like the screen has been switched off ive tryed blinking the battery LED and filling the screen with a colour if coded by me or other's its astho for instance when i use 0xc0000000 + offset they dont read or write to those addresses as tho im missing something in setting memory up!! if the memory wasnt set up properly but just as a clean boot from SD card would i still be abel to read and write to these addresses?
 
Last edited by a moderator:
Dex posted on Sep 7 2006 at 05:37 PM said:
Squidge posted on Sep 7 2006 at 08:43 PM said:
Sounds like you need Robster's GP2X SDK (contains stuff for writing to the screen, sd cards, setting up the system, etc) and Art's uboot (can boot a file direct from sd therefore bypassing the loading of linux).


im using the ART's u-boot and lib's i can boot to the SD card but whatever demo i try or code i get the same blank screen!!! its like the screen has been switched off ive tryed blinking the battery LED and filling the screen with a colour if coded by me or other's its astho for instance when i use 0xc0000000 + offset they dont read or write to those addresses as tho im missing something in setting memory up!! if the memory wasnt set up properly but just as a clean boot from SD card would i still be abel to read and write to these addresses?

http://www.gigasize.com/get.php/43308/arm-20060802a.zip

This is an arm gcc compiler for win32, that was built for HH, it also includes a number of working hh examples that boot from the SD using the ART103 boot loader. As simple as the 920blinker that blinks the battery led, on up to using the display and/or uart, and on to using both the 920 and 940 cores.

I generally use the uart for printf debugging, I highly recommend getting a cable. I am using a modified samsung cable per the wiki page.

Are you using the efsl sd card library? I am interested in trying it out on this platform...
 
Last edited by a moderator:
Dex posted on Sep 7 2006 at 05:37 PM said:
Squidge posted on Sep 7 2006 at 08:43 PM said:
Sounds like you need Robster's GP2X SDK (contains stuff for writing to the screen, sd cards, setting up the system, etc) and Art's uboot (can boot a file direct from sd therefore bypassing the loading of linux).


im using the ART's u-boot and lib's i can boot to the SD card but whatever demo i try or code i get the same blank screen!!! its like the screen has been switched off ive tryed blinking the battery LED and filling the screen with a colour if coded by me or other's its astho for instance when i use 0xc0000000 + offset they dont read or write to those addresses as tho im missing something in setting memory up!! if the memory wasnt set up properly but just as a clean boot from SD card would i still be abel to read and write to these addresses?


Sorry...to answer your question, for the most part the bootloader has already setup a number of peripherals, you can take either the sdk2x or rylehs library and figure out how to page flip the video and go from there. I do have some working examples, if they are not in the file from the previous link, I can get you something. The video really is that easy, just write the data somewhere, write the registers to point the memory at it.

I dont think the cache is on by default, so the machine is PAINFULLY slow, around 3 mips. Turning on the cache will make it more than 30 times faster. Yes, my examples demonstrate how to do this for both the 920 and 940.

I made my own makeimage program, called doimage. Makes it easy to get from a .bin to .img that the bootloader will load. I have had more success extracting the .bin from the .elf using my rip utility, although recently I had one instance (very rare) where objdump did a better job. go with what you know here.

Nice to see someone else interested in HH, I think a number of people tried and then gave up because it wasnt giving the performance gains they were hoping for, linux was good enough.
 
Last edited by a moderator:
Hi dwelch, thanks for your help, that zip you posted will be a big help, but its seems from my test that the battry led does not work on some gp2x as i have two, 1 about 6 months old and the other about 2weeks old, and both the battry led has not worked ?.
I have just got a bob, so that should help, i am going to write a program to link the gp2x to my own OS (Dex4u) through bob, this will help with debugging etc, if i get it work your are welcome to use it.
My main problem is i want to write my own simpler bootloader, instead of using open-u-boot etc.
This will be hard, but if we can get it working it will give us better control for HH Dev and we will have a better understanding
of the setup etc.
Speed is not important at the moment, we can optimise it for speed latter, the most important thing is direct hardware access.
I worked on xbox code, and that basically a low powed PC but its fast because of direct hardware access and no protection etc and the basic OS is only 150k, see here for full spec : http://www.extremetech.com/article2/0,1697,1670116,00.asp

As for graphic code to screen, i have written code for that, that no problem, but it does not work in a reset environment, (by this i mean not one set up by the bootloader, but as one setup by using "tramp_sd" ).

All my programing is done in ASM, and with Fasm or FasmArm, with this you can do bin files for Gp2x as easy as
c:\FasmArm test.asm test.bin
Its nice to know theres other people interested in HH programming for the gp2x.
Regards Dex.
 
Back
Top