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.

ASM > GBA OS

#162159 - moonlightcheese - Wed Aug 27, 2008 2:09 am

i've got a school project on the horizon that i'm going to use as an opportunity to get down and dirty with the gba. this will be my first time building an operating system and what i'd like to do is flash the eeprom or rom or whatever on my GBA-SP.

specifically what i'm trying to accomplish is to back up the eeprom on the gba, just for the sake of experience and safety, and flash it with a boot loader that will load part (or all) of the os kernel that i'm writing and from there, load the rest of the system software like the shell and other things from a flash cartridge and basically use the flash cartridge as a block device which will essentially allow me to run a small version of minix (or my version of minix, stripped down for this umpc device) on the gba.

i'll need to buy a flash cart but i understand that retailer information is forbidden so i guess i can't ask for where and what exactly to buy?

anyway, what i need to know is more specifics about the hardware, such as how much memory i have to play with, a schematic of the gba-sp if possible, the model of the rom on the board, how to flash it (if there's an easy way), any specifics that are particular to the gba that may interfere with normal arm7 architecture and things of that nature. any gba specific hardware information would be great.

what i already know is the type of architecture i'll need to be coding for (ARM7TDMI). and i've found most of the architecture specific resources i think i'll need. i'm already underway with setting up a gcc cross-compiler and i'm hard at work poring over my two OS text books and the minix code. other than that, i have a lot to learn. i'd like to turn this into a long-term project and offer the capability of connecting devices like ps/2 keyboards and such to the gba if possible and turning this into a useful umpc device with a basic shell and maybe a gui of some kind.

any insight and help would be awesome!

#162161 - tepples - Wed Aug 27, 2008 2:22 am

moonlightcheese wrote:
this will be my first time building an operating system and what i'd like to do is flash the eeprom or rom or whatever on my GBA-SP.

There is no writable memory to speak of inside a GBA SP. You'll need to write your OS kernel to a SLOT-2 flash card and use that.

Quote:
load the rest of the system software like the shell and other things from a flash cartridge and basically use the flash cartridge as a block device

Most file systems use blocks of 512 to 4,096 bytes. But NOR flash cards appear to have 131,072 byte blocks. You'll probably want to use what's called a "SLOT-2 SD adapter" so that you can use a "typical" file system.

Quote:
i'll need to buy a flash cart but i understand that retailer information is forbidden so i guess i can't ask for where and what exactly to buy?

The "what" is fine to discuss.

Quote:
i'd like to turn this into a long-term project and offer the capability of connecting devices like ps/2 keyboards and such to the gba if possible and turning this into a useful umpc device with a basic shell and maybe a gui of some kind.

Did somebody say openpandora.org?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#162164 - moonlightcheese - Wed Aug 27, 2008 2:52 am

wow... didn't know about open pandora. but i kinda had my heart set on coding for the gba since it'd be relatively cheap since i already own the hardware and at most would have to purchase a flashable eeprom to replace the one on board. i'm totally willing and more than capable of doing the soldering. would that be possible?

edit: or would it even be necessary? then again... at that point it would only be useful for this school project as i doubt anyone else would be comfortable soldering their gba....

#162168 - Dwedit - Wed Aug 27, 2008 5:17 am

The onboard ROM is inside the processor. You can't get around that fact that when you turn it on, you will see a Game Boy logo, and it will check a cartridge for a valid Nintendo logo before it boots.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#162177 - moonlightcheese - Wed Aug 27, 2008 12:48 pm

ok, that's enough information to at least get a better idea of the work involved. i checked out some of the beginner information and it looks like i won't have the option of building a memory mapped io table and i'll have to make sure the prof is cool with that. also, trying to fit minix+bash and other functionality into 256KBytes of memory may be impossible. looks like minix requires 8MB of ram at the very least. it may be necessary for me to use pandora (if it's available for purchase now?) or something like it... but i'm not giving up yet! man it would be so cool to switch on the gba and see a login screen and be able to hook up a keyboard or rs232 conn or something :D

#162193 - Dwedit - Wed Aug 27, 2008 8:57 pm

Someone once ported a really old version of Unix to the GBA. There have also been small operating systems ported over which provide some Posix functionality.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#162195 - Miked0801 - Wed Aug 27, 2008 9:55 pm

Lol. Good luck with the RS232 code. That isn't anywhere in the realm of easy on a GBA. Not to be a downer, but a more suitable development platform may be in order here.

#162204 - Dwedit - Thu Aug 28, 2008 1:08 am

Doesn't the GBA link port naturally have a UART COMMS mode? Just get a MBV2 cable from somewhere and you can do GBA communication with a standard serial port.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#162207 - dantheman - Thu Aug 28, 2008 2:43 am

moonlightcheese wrote:
but i'm not giving up yet! man it would be so cool to switch on the gba and see a login screen and be able to hook up a keyboard or rs232 conn or something :D


Closest thing I've seen - http://www.brolinembedded.se/projects/keyboard/

Dwedit wrote:
Someone once ported a really old version of Unix to the GBA. There have also been small operating systems ported over which provide some Posix functionality.


Link to the Unix port (which crashes after a few "ls" commands due to lack of memory) - http://wwwhsse.fh-hagenberg.at/Studierende/hse02006/uclgba/

#162292 - moonlightcheese - Sat Aug 30, 2008 1:08 am

wow, that's actually more information than i was expecting :D
thanks.

#162300 - pepsiman - Sat Aug 30, 2008 6:37 pm

dantheman wrote:
Link to the Unix port (which crashes after a few "ls" commands due to lack of memory) - http://wwwhsse.fh-hagenberg.at/Studierende/hse02006/uclgba/

That's the Linux port, the Unix port is here:
http://www.kernelthread.com/publications/gbaunix/

Linux Is Not UniX

#162512 - dantheman - Thu Sep 04, 2008 6:53 am

My bad, didn't realize both had been ported so I went with what Dwedit said. Of course now that you linked the page I remember that I read it a while ago but never really experimented with it.