Skip to content

Latest commit

 

History

History
81 lines (47 loc) · 3.93 KB

File metadata and controls

81 lines (47 loc) · 3.93 KB

Functional Testing

This document presents the results of various functional tests performed on the SCore operating system.

RustSBI Startup

RustSBI Startup

Kernel Startup and Memory Initialization

Kernel Startup

Application Loading and Shell Startup

Show Applications and Start Shell

Application Tests

initproc Application

Functionality: This is the initial process loaded by the process manager, responsible for launching the user shell. initproc test

shell Application

Functionality: Implements a simple user shell that allows users to input and execute commands. When the user presses Enter, the program forks a new child process to execute the command, then waits for the child to terminate and prints its exit code. If the user presses Backspace (BS) or Delete (DEL), the last character is removed from the input line. The shell loops continuously.

yield Application

Functionality: This application tests the yield system call. It loops five times, calling yield_() in each iteration to relinquish CPU control, and then prints a message upon resuming execution. !yield test

forktest Application

Functionality: Tests the fork and waitpid system calls. It creates 30 child processes in a loop. Each child prints a message and exits immediately. The parent process waits for all children to complete and then prints a success message. !forktest

forktree Application

Functionality: Builds a process binary tree with a depth of 4. Each node is a process. The main process creates its children, which in turn create their own children, down to the depth limit. Each process prints its PID and its path in the tree before exiting. The main process sleeps for 3000 ms after all descendants have finished. !forktree test

sleep Application

Functionality: The parent process forks a child. The child process executes a sleepy function, which loops five times, calling sleep to pause for a short duration and then printing a message. The child then exits. The parent process waits for the child to terminate using waitpid, calculates the total execution time, and prints the duration. !sleep test

stack_overflow Application

Functionality: This program demonstrates a stack overflow. It defines a recursive function f that increments a depth counter with each call and prints the depth every 10 levels. Since there is no base case, the recursion continues indefinitely, eventually causing a stack overflow and a segmentation fault, which terminates the program. !stack_overflow test

huge_write Application

Functionality: Tests file write performance. It creates a 1 KiB buffer, fills it with incrementing byte values, and opens a file named "testf" (creating it if it doesn't exist). It then writes 1 GB of data to the file in a loop, measures the time taken, calculates the write speed, and finally closes the file and prints the results. !huge_write test

cat_filea Application

Functionality: A simple file reader that opens a file named "filea", reads its contents, and prints them to the console. The program panics if the file cannot be opened. After reading, it closes the file descriptor and exits.

Without filea: !cat_filea without file

With filea: !cat_filea with file

proc_scheduling Application

Functionality: Tests the priority setting system call. It creates two child processes, "child[1]" and "child[2]", and sets different priorities for them (50 and 100) to observe the scheduling behavior. !proc_scheduling test

fantastic_text Application

Functionality: Demonstrates how to use ANSI escape sequences to control the display of text in the terminal (e.g., colors, styles). !fantastic_text test

shutdown Application

Functionality: Tests the shutdown system call to power off the operating system. !shutdown test