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 206 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
/* Reads from a file into a bad address.
The process must be terminated with -1 exit code. */
#include <syscall.h>
#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, (char *) &handle - 4096, 1);
fail ("survived reading data into bad address");
}
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected ([<<'EOF']);
(pt-bad-read) begin
(pt-bad-read) open "sample.txt"
pt-bad-read: exit(-1)
EOF
pass;
/* Allocates and writes to a 64 kB object on the stack.
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 stk_obj[65536];
struct arc4 arc4;
arc4_init (&arc4, "foobar", 6);
memset (stk_obj, 0, sizeof stk_obj);
arc4_crypt (&arc4, stk_obj, sizeof stk_obj);
msg ("cksum: %lu", cksum (stk_obj, sizeof stk_obj));
}
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(pt-big-stk-obj) begin
(pt-big-stk-obj) cksum: 3256410166
(pt-big-stk-obj) end
EOF
pass;
/* Read from an address 4,096 bytes below the stack pointer.
The process must be terminated with -1 exit code. */
#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 -4096(%esp), %eax");
}
# -*- 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;