paging.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #ifndef INCLUDED_PAGING_H
  20. #define INCLUDED_PAING_H
  21. #define PAGE_PRESENT 0x0001
  22. #define PAGE_RDWR 0x0002
  23. #define PAGE_USER 0x0004
  24. #define PAGE_NWRBACK 0x0008
  25. #define PAGE_NOCACHE 0x0010
  26. #define PAGE_ACCESSED 0x0020
  27. #define PAGE_DIRTY 0x0040
  28. #define PAGE_PAT 0x0080
  29. #define PAGE_GLOBAL 0x0100
  30. /* 0x83 */
  31. #define PATT_KERNEL (PAGE_PRESENT | PAGE_RDWR | PAGE_PAT)
  32. /* 0x07 */
  33. #define PATT_USER (PAGE_PRESENT | PAGE_RDWR | PAGE_USER)
  34. #define PML4_ADDR 0x70000
  35. #define PDPT_ADDR 0x71000
  36. #define PTE_ADDR 0x72000
  37. #endif