-
Notifications
You must be signed in to change notification settings - Fork 52
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
Modified basic-syscall and syscall-wrappers infrastructure #78
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having the tests only in the solution/
folder doesn't seem to be the way to go. Students will have a hard time working in support/src
, but running the checker in ../../solution/tests/
. Add a command to the makefiles so that make skels
also copies the tests to the support/
folder.
In addition, fix the linter failures.
chapters/software-stack/system-calls/drills/tasks/basic-syscall/solution/src/.gitignore
Outdated
Show resolved
Hide resolved
chapters/software-stack/system-calls/drills/tasks/basic-syscall/solution/src/Makefile
Outdated
Show resolved
Hide resolved
chapters/software-stack/system-calls/drills/tasks/basic-syscall/solution/src/arm/Makefile
Outdated
Show resolved
Hide resolved
chapters/software-stack/system-calls/drills/tasks/basic-syscall/solution/src/arm/.gitignore
Outdated
Show resolved
Hide resolved
chapters/software-stack/system-calls/drills/tasks/basic-syscall/solution/tests/checker.sh
Outdated
Show resolved
Hide resolved
chapters/software-stack/system-calls/drills/tasks/syscall-wrapper/solution/tests/checker.sh
Outdated
Show resolved
Hide resolved
touch out/out1.out | ||
touch out/out2.out | ||
touch out/out3.out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
out="out/out.out" | ||
ref="ref/out.ref" | ||
|
||
head -n 3 "$out" > /tmp/out.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? Just use out.out
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Students should implement the getpid syscall wrapper. I assumed it should not be tested, so the checker evaluates just the first three lines of output(read and write syscalls).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be tested. Students need a way to be sure they're using the right syscall number.
if [ $? -eq 0 ]; then | ||
echo "main ...................... passed ... 10" | ||
else | ||
echo "main ...................... failed ... 0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only tests read()
and write()
. To test itoa()
and reverse_string()
, change the former's name to os_itoa()
or something and compare their outputs to itoa()
and strrev()
. You can test getpid()
by changing its name in syscall.asm
to os_getpid()
and comparing its output to the real getpid()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the main()
function to test itoa()
and reverse_string()
separately before testing getpid()
using itoa()
.
Fuck me. TIL that [1] https://stackoverflow.com/a/58898320 |
7333120
to
4cd60c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just add the make
commands to the checkers and update the paths to the binaries. Regarding testing syscall-wrapper
granularly, let's leave it as it is for now and I'll convert this into an issue for a later time so we can merge this now.
chapters/software-stack/system-calls/drills/tasks/basic-syscall/solution/src/hello.asm
Outdated
Show resolved
Hide resolved
chapters/software-stack/system-calls/drills/tasks/basic-syscall/solution/src/hello.asm
Outdated
Show resolved
Hide resolved
chapters/software-stack/system-calls/drills/tasks/basic-syscall/solution/src/hello.asm
Show resolved
Hide resolved
chapters/software-stack/system-calls/drills/tasks/basic-syscall/solution/tests/checker.sh
Show resolved
Hide resolved
chapters/software-stack/system-calls/drills/tasks/basic-syscall/solution/tests/checker.sh
Outdated
Show resolved
Hide resolved
chapters/software-stack/system-calls/drills/tasks/syscall-wrapper/solution/tests/checker.sh
Show resolved
Hide resolved
if cmp -s "$ref" /tmp/out.txt; then | ||
echo "main ...................... passed ... 10" | ||
else | ||
echo "main ...................... failed ... 0" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should make this test more granular: test each functionality individually, not all of them at once.
…l` and `syscall-wrappers` In addition, the skeleton files are generated from the solutions by using `make skels`. Signed-off-by: Sorin Birchi <[email protected]> Signed-off-by: Teodor Dutu <[email protected]>
Published at https://cs-pub-ro.github.io/operating-systems/78/ |
Added checkers and modified files
Prerequisite Checklist
Description of changes