minimal amd loader mostly stolen from wycats.