ata.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* Copyright (C) 2021 Rain */
  2. /* This file is part of XNIX. */
  3. /*
  4. XNIX is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) and later version.
  8. */
  9. /*
  10. XNIX is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. */
  15. /*
  16. You should have received a copy of the GNU General Public License
  17. along with XNIX. If not, see <https://www.gnu.org/licenses/>.
  18. */
  19. #include <kernel/init.h>
  20. #include <kernel/errno.h>
  21. #include <kernel/types.h>
  22. #define ATACMD_ID 0xec
  23. #define ATACMD_RD 0x20
  24. #define ATACMD_RD48 0x24
  25. #define ATACMD_WR 0x30
  26. #define ATACMD_WR48 0x34
  27. #define ATASTAT_READY 0x40
  28. #define ATASTAT_REQ 0x08
  29. #define ATASTAT_ERR 0x01
  30. #define ATASTAT_BUSY 0x80
  31. #define ATACTL_INTDIS 0x02
  32. #define ATACTL_RESET 0x04
  33. #define ATAERR_OTHER 0x01
  34. #define ATAERR_TRACK0 0x02
  35. #define ATAERR_ABORT 0x04
  36. #define ATAERR_NOTFOUND 0x10
  37. #define ATAERR_DATAERR 0x40
  38. #define ATAERR_BADSECT 0x80