driver.rs 357 B

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