PKUOS - Pintos
Pintos source browser for PKU Operating System course
Functions
main.h File Reference

Go to the source code of this file.

Functions

void test_main (void)
 tests/main.h More...
 

Function Documentation

◆ test_main()

void test_main ( void  )

tests/main.h

tests/main.h

tests/main.h

This must fail, because that directory is non-empty.

tests/main.h

This must fail.

tests/main.h

Then delete most of them, for two reasons. First, "tar" limits file names to 100 characters (which could be extended to 256 without much trouble). Second, a full disk has no room for the tar archive.

tests/main.h

This should terminate the process with a -1 exit code.

tests/main.h

Sets the stack pointer (esp) to an invalid value and invokes a system call, which should then terminate the process with a -1 exit code.

tests/main.h

The second close must either fail silently or terminate with exit code -1.

tests/main.h

This is valid, so it must succeed.

tests/main.h

The process must be terminated with exit code -1.

tests/main.h

The process must be terminated with -1 exit code.

tests/main.h

Must kill process.

tests/main.h

The exec system call must return -1.

tests/main.h

(Pintos does not have inheritance of file handles, so this must fail.) The parent process then attempts to use the file handle, which must succeed.

tests/main.h

The process must be terminated with -1 exit code because the argument to the system call would be above the top of the user address space.

tests/main.h

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.

tests/main.h

This must work.

tests/main.h

This may fail or terminate the process with -1 exit code.

tests/main.h

The first call must wait in the usual way and return the exit code. The second wait call must return -1 immediately.

tests/main.h

Tries to write to a mapping present in the parent. The process must be terminated with -1 exit code.

tests/main.h

Then dereferences the address that we tried to map, and the process must be terminated with -1 exit code.

tests/main.h

This must succeed.

tests/main.h

From Godmar Back.

< Save a copy of the stack pointer.

< Move stack pointer to bottom of page.

< Push 32 bytes on stack at once.

< Restore copied stack pointer.

< Tell GCC we destroyed eax.

Definition at line 17 of file syn-read.c.

References ACTUAL, arc4_crypt(), arc4_init(), buf, buf1, buf2, buf_a, buf_b, BUF_SIZE, buffer, byte_cnt(), chdir(), CHECK, check_file(), check_file_handle(), check_file_size(), check_tell(), CHILD_CNT, CHUNK_SIZE, cksum(), close(), compare_bytes(), copy_string_across_boundary(), create(), exec(), exec_children(), exit(), fail(), file_name, FILE_SIZE, get_bad_boundary(), get_boundary_area(), halt(), arc4::i, init(), INT_MAX, INT_MIN, inumber(), make_tree(), MAP_FAILED, memcmp(), memcpy(), memset(), merge(), mkdir(), mmap(), msg(), munmap(), name, NULL, open(), parallel_merge(), quiet, random_bytes(), random_init(), read(), readdir(), READDIR_MAX_LEN, remove(), remove_tree(), return_block_size(), ROUND_DOWN, seek(), seq_test(), shuffle(), SIZE, snprintf(), sort_chunks(), start, STDOUT_FILENO, strcmp(), strlen(), SYS_EXEC, SYS_EXIT, test_main(), verify(), wait(), wait_children(), wrap_open(), write(), write_some_bytes(), and x.

Referenced by main(), and test_main().

Here is the caller graph for this function: