Skip to content
Adan edited this page Jun 27, 2020 · 13 revisions

Welcome to the open2x-bootloader wiki!

Features

  • Can load kernels from SD and NAND
  • Slightly faster to boot than the GPH u-boot
  • Configurable autoboot from NAND or SD
  • Can load bare metal o2x binaries
  • Can receive bare metal binaries via serial XMODEM
  • Serial command line interface
  • Supports all MMC and SD([XH]C)? cards I can obtain (formatted as FAT12/16/32, NOT exFAT)
  • Can load patched u-boot from SD (download these here)

How to install

WARNING! If this goes wrong, it can brick your GP2X. You can generally unbrick them using JTAG (see below), but it can be difficult and frustrating. You install this bootloader at your own risk.

To install the bootloader, copy it to the root of your SD card, and hold Start+Select while booting the GPH u-boot. The same binary works on F100 and F200 units.

If you wish to flash another bootloader, you'll need to do this through the GPH u-boot for now. Grab one of the patched binaries, and launch it from open2x-bootloader, while holding Start+Select.

How to use

Filer

It's pretty obvious how to use the filer - up/down to highlight files (left/right to skip a page at a time), B to run a file, X to navigate back one level.

You can run o2x and kernel img files directly from SD, you can also flash a kernel to NAND by highlighting it and pressing Y.

interpreters.ini

If you create an interpreters.ini file in the root of your SD card, the filer can also execute other file types. It works a little like the shebang in a UNIX file.

The file can have up to 128 interpreters registered, one per line. A line is of the format: ext=/path/to/interpreter.o2x

For example if you had for argument's sake a Python interpreter installed at /python/run.o2x, you might register an interpreter for .py files like this:


py=sd:/python/run.o2x

Which would allow you to select .py files directly from the filer. The path to the file you are trying to launch is passed to the interpreter in argv[1].

Command line

If you connect your UART to a serial terminal emulator like putty or minicom (when using minicom I also have to set 'Add Carridge Ret', U and 'Add linefeed', A) set up with the same 115200 8N1 settings as are needed for the stock u-boot and Linux, you'll be presented with the following on boot:


**********************************
Open2x Bootloader v1.0
**********************************
Auto boot NAND: off
Auto boot SD: off
**********************************
#

Type 'help' and hit return to see the available commands:


# help                                                                    
ls [path]              - Lists directory contents                         
run [path]             - Runs a file
md[whb] [addr]         - Displays the value of a memory address as a 32, 16 or 8 bit value
mw[whb] [addr] [value] - Writes a value to a memory address
xm                     - Receives an runs an o2x via xmodem                     
kernel                 - Boots kernel from NAND                                 
flash [path]           - Flash a kernel file to NAND                            
help                   - Displays this message

If you want to launch an o2x file (up to 1MB in size) via XMODEM, type xm, hit return and then start sending the file (Ctrl-A S in minicom). The executable will be launched as soon as it has been received. This isn't very quick, but it works fine for small executables. You're better off using JTAG if you can for development but this is unreliable on my units.

Settings

There are a few settings which can be configured. These are stored in the final block of the bootloader region of NAND (0x7FE00). They can be reset at any time to default by booting while holding both L and R while powering on the GP2X and holding until your end up at the bootloader menu.

Autoboot

There are a couple of autoboot settings which can be bypassed by holding the R button while powering on the GP2X until you end up at the bootloader menu.

  • Autoboot from NAND will cause the GP2X to automatically run Linux when it is turned on.
  • Autoboot from SD will try to find an autoboot.o2x file in the root of the SD card and run it, if not found you'll be dropped to the menu.

See it running!

Photo of open2x-bootloader running on F100s and F200

Tested hardware

NOTE! This will NOT work on a Wiz, Caanoo, or 'F300' (which is the same hardware as these machines), only on the original MMSP2-powered GP2X.

GP2X

  • First edition MK1 F100
  • MK2 F100
  • F200(b)

Cards

  • QUMOX 2GB SD (SD 2.x)
  • ScanDisk Ultra 16GB SDHC
  • ScanDisk Ultra 64GB SDXC
  • Canon 16M MMC
  • Canon 32M SD (SD 1.x)
  • Integral 512M SD (SD 2.x)

If it all goes horribly wrong

I haven't personally had any failures while installing this on any of my test machines, however you may be less lucky and it can brick your GP2X. You install this bootloader at your own risk.

If it does go wrong, a lot of units seem to have unreliable JTAG, but you can normally get it to work eventually. You could then use run.sh to load the bootloader into memory, and attempt to flash again.

You'll need a JTAG adapter and breakout board to do this, I have board designs for one on my website.