driver.rs 340 B

12345678910111213141516171819202122
  1. pub mod ahci;
  2. pub mod e1000e;
  3. pub mod serial;
  4. // TODO!!!: Put it somewhere else.
  5. pub struct Port8 {
  6. no: u16,
  7. }
  8. impl Port8 {
  9. pub const fn new(no: u16) -> Self {
  10. Self { no }
  11. }
  12. pub fn read(&self) -> u8 {
  13. arch::inb(self.no)
  14. }
  15. pub fn write(&self, data: u8) {
  16. arch::outb(self.no, data)
  17. }
  18. }