gma500: sort out the file operations