mm.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* kernel/mm.c
  2. *
  3. * Copyright (C) 2021, 2022 intirain.
  4. *
  5. * This file is part of evx.
  6. *
  7. * evx is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * evx is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with evx. If not, see <https://www.gnu.org/licenses/>
  19. */
  20. #include <kernel/init.h>
  21. #include <kernel/module.h>
  22. #include <kernel/mm.h>
  23. #include <arch/archinfo.h>
  24. #include <sys/types.h>
  25. int early_mempool_init(void);
  26. int pages_init(void);
  27. struct page *first_usable_ram;
  28. struct page *kmem_pages;
  29. int nr_ram_pages = 0, usable_ram_pages = 0;
  30. int mm_init(void) {
  31. early_mempool_init();
  32. pages_init();
  33. return 0;
  34. }
  35. kernel_init(mm_init);