segment.inc 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. ; Copyright (C) 2021 Rain
  2. ; This file is part of Cunix.
  3. ; Cunix is free software: you can redistribute it and/or modify
  4. ; it under the terms of the GNU General Public Licene and published by
  5. ; the Free Software Foundation, either version 3 of the License, or
  6. ; (at your option) any later version.
  7. ; Cunix is distributed in the hope that it will be useful,
  8. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. ; GNU General Public License for more details.
  11. ; You should have recceived a copy of the GNU General Public License
  12. ; along with Cunix. If not, see <https://www.gnu.org/licenses/>.
  13. ; 32 bit segment descriptor:
  14. ; BASE | G | 32/16 | 64 | LIMIT | PRESENT | PERMISSION | SYSSEG | TYPE | BASE | LIMIT
  15. ; 63 | 55 | 54 | 53 | 51 | 47 | 46 | 44 | 43 | 39 | 15
  16. ; type-bit 0: accessed
  17. ; type-bit 1: readable / writable
  18. ; type-bit 2: conforming / expansion-direction
  19. ; type-bit 3: 1 / 0
  20. ; permision: DPL 0-2
  21. ; G:
  22. ; if G = 1:
  23. ; limit = limit * 4KB
  24. ; else:
  25. ; limit = limit * 1B