Skip to content
This repository was archived by the owner on Apr 6, 2020. It is now read-only.

Interrupt refactor #31

Merged
merged 28 commits into from
Jun 2, 2016
Merged

Interrupt refactor #31

merged 28 commits into from
Jun 2, 2016

Conversation

steveklabnik
Copy link
Member

This is a big refactoring of the way interrupts are handled. I took some inspiration from @phil-opp, @emk, Redox, (specifically, @ticki) and an inb/outb combo from @thepowersgang. All different bits of their OSes' code and several OSDev/OSDevr tutorials. Whew!

These commits should probably be cleaned up, and this isn't even quite in a final state; I should be using a lazy_static rather than making things Copy, and I would like to move a lot of these home-grown structures to the x86 crate instead. But before I do, I wanted to have written it all myself. Ha!

Thoughts, all?

And also simplify a bit. This will get worse before it gets better.
It wasn't being used, at all.
Remove the macros to define interrupt handlers. While the macros are much more concise,
they're also more confusing. Let's just remove this for now.
well, through rust, anyway
This removes a bunch of junk, and also fixes some things:

updating an entry in the ISR now uses the number passed to it

We check to make sure we've actually installed the keyboard handler properly

A better interface overall.
The selector and flags are hard coded, but that's okay for now.
We aren't using these for anything right now, so just don't worry about
them. It will make editing these files a bit easier.
We don't need it to be static.
extern crate vga;

extern {
fn isr0();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But... naked functions 😆

@ticki
Copy link

ticki commented Jun 1, 2016

Awesome work! It seems that you don't use naked functions? Why not?

@steveklabnik
Copy link
Member Author

@ticki @eddyb I should. this code originally landed since before naked functions had existed, but now that they do, i should make use of them.

@WilsonGiese
Copy link
Contributor

I've been following along with your development and it's looking great to me! Excited for the upcoming work on the kernel 👍

@steveklabnik
Copy link
Member Author

Merging this for now, because it's still an improvement. I'll open issues for the other stuff.

@steveklabnik steveklabnik merged commit 5803fc2 into master Jun 2, 2016
@steveklabnik steveklabnik deleted the interrupt_refactor branch June 7, 2016 00:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants