Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • y2-rhymansaib/pintos_student
1 result
Select Git revision
Show changes
Showing
with 6 additions and 217 deletions
# Percentage of the testing point total designated for each set of
# tests.
20.0% tests/threads/Rubric.alarm
40.0% tests/threads/Rubric.priority
40.0% tests/threads/Rubric.mlfqs
30.0% tests/threads/Rubric.alarm
70.0% tests/threads/Rubric.priority
#40.0% tests/threads/Rubric.mlfqs
......@@ -7,9 +7,9 @@ alarm-negative priority-change priority-donate-one \
priority-donate-multiple priority-donate-multiple2 \
priority-donate-nest priority-donate-sema priority-donate-lower \
priority-fifo priority-preempt priority-sema priority-condvar \
priority-donate-chain \
mlfqs-load-1 mlfqs-load-60 mlfqs-load-avg mlfqs-recent-1 mlfqs-fair-2 \
mlfqs-fair-20 mlfqs-nice-2 mlfqs-nice-10 mlfqs-block)
priority-donate-chain)
#mlfqs-load-1 mlfqs-load-60 mlfqs-load-avg mlfqs-recent-1 mlfqs-fair-2 \
#mlfqs-fair-20 mlfqs-nice-2 mlfqs-nice-10 mlfqs-block)
# Sources for tests.
tests/threads_SRC = tests/threads/tests.c
......
/* Invokes a system call with the stack pointer (%esp) set to a
bad address. The process must be terminated with -1 exit
code.
For Project 3: The bad address lies approximately 64MB below
the code segment, so there is no ambiguity that this attempt
must be rejected even after stack growth is implemented.
Moreover, a good stack growth heuristics should probably not
grow the stack for the purpose of reading the system call
number and arguments. */
#include "tests/lib.h"
#include "tests/main.h"
......
Functionality of virtual memory subsystem:
- Test stack growth.
3 pt-grow-stack
3 pt-grow-stk-sc
3 pt-big-stk-obj
3 pt-grow-pusha
- Test paging behavior.
3 page-linear
3 page-parallel
3 page-shuffle
4 page-merge-seq
4 page-merge-par
4 page-merge-mm
4 page-merge-stk
- Test "mmap" system call.
2 mmap-read
2 mmap-write
2 mmap-shuffle
2 mmap-twice
2 mmap-unmap
1 mmap-exit
3 mmap-clean
2 mmap-close
2 mmap-remove
Robustness of virtual memory subsystem:
- Test robustness of page table support.
2 pt-bad-addr
3 pt-bad-read
2 pt-write-code
3 pt-write-code2
4 pt-grow-bad
- Test robustness of "mmap" system call.
1 mmap-bad-fd
1 mmap-inherit
1 mmap-null
1 mmap-zero
2 mmap-misalign
2 mmap-over-code
2 mmap-over-data
2 mmap-over-stk
2 mmap-overlap
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_USER_FAULTS => 1, [<<'EOF']);
(pt-grow-bad) begin
pt-grow-bad: exit(-1)
EOF
pass;
/* Expand the stack by 32 bytes all at once using the PUSHA
instruction.
This must succeed. */
#include <string.h>
#include "tests/arc4.h"
#include "tests/cksum.h"
#include "tests/lib.h"
#include "tests/main.h"
void
test_main (void)
{
asm volatile
("movl %%esp, %%eax;" /* Save a copy of the stack pointer. */
"andl $0xfffff000, %%esp;" /* Move stack pointer to bottom of page. */
"pushal;" /* Push 32 bytes on stack at once. */
"movl %%eax, %%esp" /* Restore copied stack pointer. */
: : : "eax"); /* Tell GCC we destroyed eax. */
}
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(pt-grow-pusha) begin
(pt-grow-pusha) end
EOF
pass;
/* Demonstrate that the stack can grow.
This must succeed. */
#include <string.h>
#include "tests/arc4.h"
#include "tests/cksum.h"
#include "tests/lib.h"
#include "tests/main.h"
void
test_main (void)
{
char stack_obj[4096];
struct arc4 arc4;
arc4_init (&arc4, "foobar", 6);
memset (stack_obj, 0, sizeof stack_obj);
arc4_crypt (&arc4, stack_obj, sizeof stack_obj);
msg ("cksum: %lu", cksum (stack_obj, sizeof stack_obj));
}
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(pt-grow-stack) begin
(pt-grow-stack) cksum: 3424492700
(pt-grow-stack) end
EOF
pass;
/* This test checks that the stack is properly extended even if
the first access to a stack location occurs inside a system
call.
From Godmar Back. */
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
#include "tests/lib.h"
#include "tests/main.h"
void
test_main (void)
{
int handle;
int slen = strlen (sample);
char buf2[65536];
/* Write file via write(). */
CHECK (create ("sample.txt", slen), "create \"sample.txt\"");
CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\"");
CHECK (write (handle, sample, slen) == slen, "write \"sample.txt\"");
close (handle);
/* Read back via read(). */
CHECK ((handle = open ("sample.txt")) > 1, "2nd open \"sample.txt\"");
CHECK (read (handle, buf2 + 32768, slen) == slen, "read \"sample.txt\"");
CHECK (!memcmp (sample, buf2 + 32768, slen), "compare written data against read data");
close (handle);
}
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(pt-grow-stk-sc) begin
(pt-grow-stk-sc) create "sample.txt"
(pt-grow-stk-sc) open "sample.txt"
(pt-grow-stk-sc) write "sample.txt"
(pt-grow-stk-sc) 2nd open "sample.txt"
(pt-grow-stk-sc) read "sample.txt"
(pt-grow-stk-sc) compare written data against read data
(pt-grow-stk-sc) end
EOF
pass;
/* Try to write to the code segment using a system call.
The process must be terminated with -1 exit code. */
#include "tests/lib.h"
#include "tests/main.h"
void
test_main (void)
{
int handle;
CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\"");
read (handle, (void *) test_main, 1);
fail ("survived reading data into code segment");
}
/* Try to write to the code segment.
The process must be terminated with -1 exit code. */
#include "tests/lib.h"
#include "tests/main.h"
void
test_main (void)
{
*(int *) test_main = 0;
fail ("writing the code segment succeeded");
}
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::vm::process_death;
check_process_death ('pt-write-code');