atapio_test.asm 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. ;; This file is part of asmc, a bootstrapping OS with minimal seed
  2. ;; Copyright (C) 2018 Giovanni Mascellani <gio@debian.org>
  3. ;; https://gitlab.com/giomasce/asmc
  4. ;; This program 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) any later version.
  8. ;; This program is distributed in the hope that it will be useful,
  9. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. ;; GNU General Public License for more details.
  12. ;; You should have received a copy of the GNU General Public License
  13. ;; along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. atapio_test:
  15. ;; Allocate the read buffer
  16. push 512
  17. call platform_allocate
  18. add esp, 4
  19. mov ecx, atapio_buf
  20. mov [ecx], eax
  21. ;; Call IDENTIFY
  22. call atapio_identify
  23. ;; Read a sector
  24. push 0
  25. call atapio_read_sector
  26. add esp, 4
  27. ret