main.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* Copyright (C) 2021 Rain */
  2. /* This file is part of Cunix. */
  3. /*
  4. Cunix 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. Cunix 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 Cunix. If not, see <https://www.gnu.org/licenses/>.
  18. */
  19. #include <kernel/init.h>
  20. #include <kernel/types.h>
  21. #include <kernel/errno.h>
  22. #include <kernel/panic.h>
  23. #include <kernel/mm.h>
  24. #include <modules/tty.h>
  25. void init(void) {
  26. tty_init();
  27. mem_init();
  28. printf("Cunix kernel %d is starting...\n", 1879);
  29. void *a, *b;
  30. a = palloc();
  31. b = palloc();
  32. printf("alloc one page: 0x%p\n", &a);
  33. printf("alloc another page: 0x%p\n", &b);
  34. pfree(a);
  35. a = palloc();
  36. printf("free first page and alloc one page: 0x%p\n", &a);
  37. for (;;);
  38. }