How about enacting a law that you either need to keep your hardware running via software updates, or you need to open-source all the software for others to keep doing so the moment you cease support. Would prevent a lot of waste.
The original producers of the software could be unhelpful even if they comply though. That's another story.
In any case, presumably in this proposed scenario secondary service industries would pop up to do this for them/offer ongoing alternatives. Much like computer maintenance and repair.