Skip to content

baptleduc/xinul

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xinul - RISC-V Mini Kernel

Xinul is a Linux-inspired kernel designed for the RISC-V architecture. Developed as part of the PCSEA RISC-V academic project at Ensimag - Grenoble INP under the supervision of Mathieu Barbe and Frédéric Petrot.

Project Structure

  • src/: Kernel and user-space code — see specific README inside
  • exemple/: Small examples to verify the working environment
  • docker/: Docker image for cross-compilation — see specific README inside

For more details, consult the specific READMEs or visit the wiki.

Project Status

All specified syscalls are implemented and validated in supervisor and user modes.

Supervisor Mode

We ported initial user-mode tests to supervisor mode to ease syscall implementation and added custom tests for Test Driven Development.
Note: Supervisor test numbering differs from user tests due to a different porting order.

Blocking I/O tests (test19 and shell) are disabled by default in CI; enable them by uncommenting lines 37-38 in src/kernel/tests/tests.c.
Run supervisor tests by adding this line in kernel_start() (src/kernel/start.c):

start_supervisor(kernel_tests_supervisor, 4000, 128, "tests", NULL);

User Mode

All user mode tests pass (including semaphore tests, see Semaphores), except test 22, which involves malicious access and is not required to be handled per the project specs. To run these tests, add the line

start("autotest", 4000, 128, NULL);

in the function kernel_start() in src/kernel/start.c. This creates a dedicated process for running the tests. This line is commented out by default because test 22 fails and causes CI to fail.

Implemented Extensions

Semaphores

Semaphore extension implemented. Enable semaphore tests by adding the WITH_SEM test option in src/user/Makefile line 79.

Console

The console supports control codes 21 (Ctrl+U) and 23 (Ctrl+W) to clear the entire line or the last entered word, respectively.

Shell

We created a shell user application acting as a command interpreter. To launch the shell, add

start("shell", 4000, 128, NULL);

to kernel_start() in src/kernel/start.c.

Usage

Type help to list available commands:

shell> help

Exit with:

shell> q
# or
shell> exit

Implemented commands include ps, sinfo, echo, and exit as specified, plus extra commands to better showcase kernel features.

Custom Commands

call

Directly executes a syscall:

call [-h|--help]

Examples:

shell> call sleep 5       # Runs sleep(5) syscall  
shell> call start test1 4000 128 0  # Launches test1 using start syscall  

exec

Runs a user program (equivalent to call start <prog> 4000 128 0):

shell> exec test1

clear

Clears the console:

shell> clear

License

This project is covered by a custom End User License Agreement (EULA). Please see the LICENSE file for full details on usage restrictions and intellectual property rights.

By using this software, you agree to comply with the terms outlined in the license.

About

Minimalist RISC-V kernel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •