You've already got a lot of great advice here, but I'll add this: How you leave a job depends on the company culture, your relationship with your manager, your manager's personality, etc. I've given notice 4-5 weeks ahead of leaving a job and had it go swimmingly, and I've given 3 weeks' notice in order to help finish up a big project for my team that was due in 3 weeks, and been summarily dismissed that day.
(And that job where it went swimmingly? I was burned out and planning to just take 6 months off from working. I had people ask me what I was going to do next, and I smiled and said, "Absolutely nothing." And they looked at me with envy and said, "That sounds wonderful!" I worried that they'd judge me, but instead, it felt pretty great.)
It sounds like there's precedent to expect no punitive action for your giving long notice, given what you've said about coworkers doing so.
My advice is to wait until the day when if giving notice means they fire you, you'll be fine financially. If that day is today, and you believe you'll have a positive reception, then sure, tell your boss now, if you're ready.
The boss I have now? I would tell him pretty much immediately as soon as I set my FIRE date; I have every confidence he would take the news well and treat me fairly.
It speaks well for your character that you want to give as much notice as possible, partly to help your boss and your company, and partly for your own sense of ethics. It's really hard balancing an ethical impulse against self-preservation sometimes.
So -- you need to find the balance between doing what protects you financially, but *also* protects your sense of integrity and ethics, so you can feel good about how you conducted yourself. At the same time, temper that with the realization that everyone really is expendable, and the world will keep spinning without you in that job.
Good luck.