Thaw the potatoes before mixing (they mix and cook better).
Mix the hash browns, ¼ cup margarine, salt, pepper, onion, soup, sour cream, and cheese together.
Pour into a buttered 9 × 13-inch casserole dish.
Mix the remaining ¼ cup margarine with the crushed cornflakes and spread over the top.
Bake at 350 degrees for 45 minutes to 1 hour.