First commit, Vystem v0.1

This commit is contained in:
2026-03-31 22:15:00 +02:00
commit e15daed8c0
462 changed files with 134655 additions and 0 deletions

10
docs/kerneltools/index.md Normal file
View File

@@ -0,0 +1,10 @@
# Kernel tools
## Introduction
For somes usages, like generating payloads datas or checking certains files, a few python scripts are included with the kernel.
## Summary
1) [Virtual memory checker](vmemcheck.md)
2) [Payloads generator](payloads.md)

View File

@@ -0,0 +1,28 @@
# Payloads generator
## Introduction
Payloads for the TAB subsystem are generated by special python scripts. Each script prints the generated file inside the terminal. For details about how the contents of the payloads are used, see [TAB documentation](../shelter/tab.md)
## Pez subsystem payload
File: `shelter/tools/generator/pez_alloc_free_payload_gen.py`
This script generates two arrays of `sh_uint64`:
- `test_pez_physical_size`: 2000 values that should be interpreted as pages count. Half of them are 1. The other half ranges from 2 to 1000. In the other half, higher values are less likely to appear as their value rises.
- `test_pez_physical_alloc`: 4000 values ranging 0 to 1999, each one appearing twice.
## Radix tree subsystem
File: `shelter/tools/generator/radix_tree_payload_gen.py`
This script generates three arrays of `sh_uint64`, containing 10000 random 8 bytes unsigned integers each: `test_keys`, `test_values` and `test_search`.
## Malloc subsystem
File: `shelter/tools/generator/malloc_payload_gen.py`
This script generate three arrays of `sh_uint64`:
- `test_malloc_small_size`: 10000 values that should be interpreted as size in bytes. They range from 1 to 1024, higher values are less likely to appear as their value rises.
- `test_malloc_big_size`: 1000 values ranging from 1 to 25, higher values are less likely to appear as their value rises.
- `test_malloc_big_alloc`: 2000 values ranging 0 to 999, each one appearing twice.

View File

@@ -0,0 +1,24 @@
# Virtual memory checker
## Introduction
This file is responsible for checking that there is no overlapp between virtual pages range defined in `shelter/lib/include/memory/vmem_layout.h`. For the full documentation about this file, please see [virtual memory layout documentation](../shelter/memory/vmemlayout.md).
## Usage
The script is located inside `shelter/tools/checker/vmem_layout_checker.py`.
It can be used like that:
``` bash
python shelter/tools/checker/vmem_layout_checker.py <path to header file>
```
## Detailled processus
1) Open provided file, parse it and print the list of valid regions.
2) Generate `cfile.c` to let the compiler do the hard work of parsing macro declaration
3) Compile (the `gcc` compiler must be accessible inside the path) and run the generated C program
4) Recover the output of the program, parse it to obtain start and size of each virtual region
5) Check for overlaps and return an error if something went bad during the processus
The compiled program and the C file are deleted afterward.