System call

ewillwin·2022년 9월 20일
0

Operating System

목록 보기
1/3

Make system calls in xv6 kernel

  • getnice
  • setnice
  • ps
  1. Add your syscall to usys.S
  2. Add syscall number to syscall.h
  3. Add extern and syscall element in syscall.c
  4. Add a sys_function to sysproc.c
  5. Add a function that performs a real action to proc.c
  6. Add a definition to defs.h and user.h

proc.h file에서 proc 구조체에 변수 추가 (priority)

xv6 system call에선, system call function에 argument를 넘겨 주기 위해 sysproc.c file에 함수를 추가해줘야함

![](https://velog.velcdn.com/images/jw3418/post/9484a461-5c74-4320-82df-8bbe9b6c97a7/image.png

mytest.c file 작성 후 system call 정상적으로 작동되는 지 확인

profile
Software Engineer @ LG Electronics

2개의 댓글

comment-user-thumbnail
2022년 10월 10일

UNUSED 출력해서 감점됨 ㅜ
default nice value 설정도 allocproc()에서 해야함

답글 달기
comment-user-thumbnail
2023년 3월 28일

혹시 과제 소스판매하시나요 ㅠㅠ

답글 달기