Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Project 2-1] Passing the argument and creating a thread(mywnajsldkf) #16

Open
2 of 3 tasks
mywnajsldkf opened this issue Jun 2, 2023 · 2 comments · Fixed by #29
Open
2 of 3 tasks

[Project 2-1] Passing the argument and creating a thread(mywnajsldkf) #16

mywnajsldkf opened this issue Jun 2, 2023 · 2 comments · Fixed by #29

Comments

@mywnajsldkf
Copy link
Contributor

mywnajsldkf commented Jun 2, 2023

Passing the argument and creating a thread

✍️ 과제 미션

  • parse the arguments and push them to the user stack

📖 개념

💻� 구현

  • file_name을 메서드와 인자를 tokenizing한다.
  • 파싱한 것을 사용자 스택에 토큰으로 저장한다.

⭐️ 생각 및 보완할 점

  • 코드 리팩토링(함수 분리)
@mywnajsldkf
Copy link
Contributor Author

mywnajsldkf commented Jun 6, 2023

Screenshot 2023-06-05 at 3 00 53 PM

@heekyoung2000

mywnajsldkf added a commit to mywnajsldkf/pintos that referenced this issue Jun 7, 2023
- const 타입인 file_name을 tokenizing 하기 위해 복제
mywnajsldkf added a commit to mywnajsldkf/pintos that referenced this issue Jun 7, 2023
- strtok_r 함수를 이용해서 tokenizing
- tokenizing한 token을 argv 배열에 저장
mywnajsldkf added a commit to mywnajsldkf/pintos that referenced this issue Jun 7, 2023
- file_name 파싱 결과를 담을 배열을 생성한다.
- argv 뒤에서부터 인자들을 userstack에 저장한다.
- 단어 정렬을 위해 패딩을 추가한다.
- argv를 채운다.
- rdi, rsi를 지정한다.
- fake address를 저장한다.
@mywnajsldkf
Copy link
Contributor Author

Passing Hexa dump Test

argument 개수에 따른 passing을 확인할 수 있다.

args-none

pintos -v -k -T 60 -m 20   --fs-disk=10 -p tests/userprog/args-none:args-none -- -q   -f run args-none

Screenshot 2023-06-13 at 2 34 46 PM

args-single onearg

pintos -v -k -T 60 -m 20   --fs-disk=10 -p tests/userprog/args-single:args-single -- -q   -f run 'args-single onearg'

Screenshot 2023-06-13 at 2 35 29 PM

args-multiple

pintos -v -k -T 60 -m 20   --fs-disk=10 -p tests/userprog/args-multiple:args-multiple -- -q   -f run 'args-multiple some arguments for you!'

Screenshot 2023-06-13 at 2 41 58 PM

args-many

pintos -v -k -T 60 -m 20   --fs-disk=10 -p tests/userprog/args-many:args-many -- -q   -f run 'args-many a b c d e f g h i j k l m n o p q r s t u v'

Screenshot 2023-06-13 at 2 43 25 PM

args-dbl-space

pintos -v -k -T 60 -m 20   --fs-disk=10 -p tests/userprog/args-dbl-space:args-dbl-space -- -q   -f run 'args-dbl-space two  spaces!'

Screenshot 2023-06-13 at 2 44 42 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant