intermezzOS / kernel

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

Remove unsafe from Vga's constructor. #66

Closed steveklabnik closed 7 years ago

steveklabnik commented 7 years ago

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. :metal:

steveklabnik commented 7 years ago

r? @ashleygwilliams

steveklabnik commented 7 years ago

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!