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

Remove unsafe from Vga's constructor. #66

Merged
merged 3 commits into from Sep 27, 2016
Merged

Conversation

steveklabnik
Copy link
Member

Turns out, we don't need to worry about this! We can accept a mutable
slice instead, and panic if it's the wrong length.

This now means that the VGA driver is 100% safe, and the only mention of
unsafety in the kernel at all is the creation of the slice to video
memory.

Since I was changing the signature of Vga::new, I also cleaned up some
of the const fn stuff that used to matter when we had a static Vga, but
now do not. 🤘

@steveklabnik
Copy link
Member Author

r? @ashleygwilliams

Turns out, we don't need to worry about this! We can accept a mutable
slice instead, and panic if it's the wrong length.

This now means that the VGA driver is 100% safe, and the only mention of
unsafety in the kernel at all is the creation of the slice to video
memory.

Since I was changing the signature of Vga::new, I also cleaned up some
of the const fn stuff that used to matter when we had a static Vga, but
now do not. 🤘
steveklabnik added a commit to intermezzOS/vga that referenced this pull request Sep 27, 2016
No more need for the print stuff, and all the other simplifications from
intermezzOS/kernel#66
@steveklabnik
Copy link
Member Author

I want to ship this so that I can reorganize the repo, so I'm merging. If anyone has beef with any of this, please file issues!

@steveklabnik steveklabnik merged commit 3a7386e into master Sep 27, 2016
@steveklabnik steveklabnik deleted the remove_unsafety branch September 27, 2016 03: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.

None yet

1 participant