《操作系统》的实验代码。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
562 B

10 years ago
  1. #include <defs.h>
  2. #include <syscall.h>
  3. #include <stdio.h>
  4. #include <ulib.h>
  5. void
  6. exit(int error_code) {
  7. sys_exit(error_code);
  8. cprintf("BUG: exit failed.\n");
  9. while (1);
  10. }
  11. int
  12. fork(void) {
  13. return sys_fork();
  14. }
  15. int
  16. wait(void) {
  17. return sys_wait(0, NULL);
  18. }
  19. int
  20. waitpid(int pid, int *store) {
  21. return sys_wait(pid, store);
  22. }
  23. void
  24. yield(void) {
  25. sys_yield();
  26. }
  27. int
  28. kill(int pid) {
  29. return sys_kill(pid);
  30. }
  31. int
  32. getpid(void) {
  33. return sys_getpid();
  34. }
  35. //print_pgdir - print the PDT&PT
  36. void
  37. print_pgdir(void) {
  38. sys_pgdir();
  39. }