intermezzOS / kernel

A hobby operating system, in Rust
http://intermezzos.github.io/
Apache License 2.0
1.39k stars 90 forks source link

Use naked fn and define all interrupts in Rust #49

Closed steveklabnik closed 8 years ago

steveklabnik commented 8 years ago

Sooooo more "Steve is doing coding on a plane."

In #33, both @ticki and @eddyb suggested moving to naked fns for the interrupt handlers. Given that Rust was so nice to implement this feature just for OSdev, why not?

So I started hacking away. I realized that if I had the trampoline in Rust, I really didn't want to copy it over and over. But each function would need to be able to call into the right one... so a macro. So I started working on a macro-based solution... and then I thought, hmmm, this code seems familiar... and turns out, @Ericson2314 introduced me to this technique a few weeks ago. I guess it percolated in my brain until now. It's not the exact same code, but the same basic strategy: use a macro to generate an IDTEntry, and go from there.

:confetti_ball:

nxnfufunezn commented 8 years ago

I have been waiting for this... Awesome..

phil-opp commented 8 years ago

Wow, this is impressive!

I really like the approach of combining naked functions with macros. Maybe you should fly more often ;)

nxnfufunezn commented 8 years ago

@phil-opp yup @steveklabnik should fly more often... :laughing:

waiting for next steve_was_on_a_plane PR..

steveklabnik commented 8 years ago

maybe you should fly on a plane more often

hahahah