Go to file
2022-06-26 12:44:16 +04:00
apps Configure tap via C code. No shell commands needed 2022-06-26 12:44:16 +04:00
img Wrap fs_execute, works for umka_os tool! 2022-06-25 02:41:23 +04:00
linux umka_os: Load very basic userspace KolibriOS app 2022-05-26 16:45:36 +04:00
test Wrap fs_execute, works for umka_os tool! 2022-06-25 02:41:23 +04:00
tools Add tup build stub. 2022-03-12 00:20:40 +04:00
windows Improve build on Windows via llvm-mingw 2021-12-13 16:57:05 +03:00
.gitattributes Improve build on Windows via llvm-mingw 2021-12-13 16:57:05 +03:00
.gitignore Wrap fs_execute, works for umka_os tool! 2022-06-25 02:41:23 +04:00
bestline.c Use bestline library, update test logs 2022-05-30 02:08:15 +04:00
bestline.h Use bestline library, update test logs 2022-05-30 02:08:15 +04:00
covpreproc.c Introduce COVERAGE_ON/OFF macros, rename shell functions to shell_*. 2020-03-10 00:03:57 +03:00
fill.cur Add wrappers/tests for keyboard, mouse and cursors 2022-05-29 01:55:13 +04:00
GPL2.txt Collect coverage via LBR profiling. 2019-10-09 02:35:47 +03:00
GPL3.txt Collect coverage via LBR profiling. 2019-10-09 02:35:47 +03:00
indent_begin_end.py Add script indent_begin_end.py to make logs more readable. 2020-05-19 14:21:47 +03:00
LICENSE Collect coverage via LBR profiling. 2019-10-09 02:35:47 +03:00
lodepng.c Update LodePNG, add -Wswitch-enum option. 2020-02-20 00:59:16 +03:00
lodepng.h Update LodePNG, add -Wswitch-enum option. 2020-02-20 00:59:16 +03:00
makefile Use bestline library, update test logs 2022-05-30 02:08:15 +04:00
network.obj Compile in /init.inc 2022-05-30 21:47:49 +04:00
optparse.c Use optparse library 2022-05-29 19:17:00 +04:00
optparse.h Use optparse library 2022-05-29 19:17:00 +04:00
README Use optparse library 2022-05-29 19:17:00 +04:00
shell.c Wrap fs_execute, works for umka_os tool! 2022-06-25 02:41:23 +04:00
shell.h Get rid of ctx->fout, use stdout instead 2022-05-31 21:10:43 +04:00
spray.cur Add wrappers/tests for keyboard, mouse and cursors 2022-05-29 01:55:13 +04:00
system.inc Run net stack, jump to the osloop. Compiles, doesn't crash. 2020-05-09 05:15:57 +03:00
TODO Fix reading at the end of file, update tests, add TODO. 2019-10-27 03:54:38 +03:00
trace_lbr.c Make it work on win32 2021-12-12 21:54:02 +03:00
trace_lbr.h Introduce COVERAGE_ON/OFF macros, rename shell functions to shell_*. 2020-03-10 00:03:57 +03:00
trace.c New tests and images for coverage. Don't use sudo for mkfs. 2020-03-11 06:02:33 +03:00
trace.h New tests and images for coverage. Don't use sudo for mkfs. 2020-03-11 06:02:33 +03:00
tup.config Add tup build stub. 2022-03-12 00:20:40 +04:00
tup.config.template Add tup build stub. 2022-03-12 00:20:40 +04:00
Tupfile.lua Add tup build stub. 2022-03-12 00:20:40 +04:00
umka_fuse.c Implement and export more acpi wrappers. 2021-11-03 17:28:03 +03:00
umka_gen_devices_dat.c Build with clang optionally 2021-12-13 01:07:42 +03:00
umka_os.c Configure tap via C code. No shell commands needed 2022-06-26 12:44:16 +04:00
umka_ping.c Configure tap via C code. No shell commands needed 2022-06-26 12:44:16 +04:00
umka_shell.c Get rid of ctx->fout, use stdout instead 2022-05-31 21:10:43 +04:00
umka.asm Wrap fs_execute, works for umka_os tool! 2022-06-25 02:41:23 +04:00
umka.h Wrap fs_execute, works for umka_os tool! 2022-06-25 02:41:23 +04:00
umka.ld Implement basic variables (to hide pointers from logs) 2022-05-31 17:43:41 +04:00
util.c Add write_devices_dat shell command, 043_#acpi_m012.t test 2021-11-17 20:56:32 +03:00
util.h Add write_devices_dat shell command, 043_#acpi_m012.t test 2021-11-17 20:56:32 +03:00
vdisk.c Make it work on win32 2021-12-12 21:54:02 +03:00
vdisk.h Implement and export more acpi wrappers. 2021-11-03 17:28:03 +03:00
vnet.c Make it work on win32 2021-12-12 21:54:02 +03:00
vnet.h Implement and export more acpi wrappers. 2021-11-03 17:28:03 +03:00

UMKa -- User-Mode KolibriOS developer tools
===========================================

This is a common project for a set of KolibriOS developer tools which are based
on original KolibriOS kernel code wrapped and hacked as to run in the UNIX
programming environment. The idea is to make userspace UNIX tools that use as
much unchanged KolibriOS kernel source as possible to test
architecture-independent parts of the kernel in your favorite developer
environment.


umka_shell
----------

is an interactive shell with commands that are wrappers around KolibriOS kernel
syscalls and other internal functions. What works now: block layer including
disk cache, FS, UI and graphics, scheduler, ACPI/AML interpreter,
synchronization primitives, strings, slab allocator, events, unpacker, other
minor functions.

It can also be used for automated testing by feeding it a file of commands
instead of typing them.

Example:
    $ umka_shell < mytest.t > mytest.out.log


umka_fuse
---------

is like umka_shell above but commands are translated from FUSE calls, not
entered manually or read from a file. Can *potentially* be used to run xfstests
(cross-fs-tests) and automated tests against reference FS implementation.


umka_os
-------

is KolibriOS kernel running main loop (osloop), scheduler and all the threads
including network stack.


tools
-----

mkdirrange

mkfilepattern

lfbviewx


BUILD
-----

$ KOLIBRIOS=/path/to/kolibrios make

/path/to/kolibrios is where you checked out 'svn co svn://kolibrios.org'.


Architecture
------------

Kernel services are replaced with stubs, wrappers around userspace
implementation or libc calls. Block devices are emulated with regular files.
Framebuffer can be dumped to disk as image file.


Testing
-------

sudo cp --parents /sys/firmware/acpi/tables/?SDT* /sys/bus/pci/devices/*/config .


Troubleshooting
---------------

# lfbviewx

Allow reading process_vm_readv syscall.

    # sysctl -w kernel.yama.ptrace_scope=0

# umka_os

Managing tap devices.

    # ip tuntap add dev tap0 mode tap
    # ip link set tap0 address 00:11:00:00:00:00
    # ip addr add 10.50.0.1/24 dev tap0
    # ip link set up dev tap0
    # ip tuntap del dev tap0 mode tap

To create tap devices.

    # setcap cap_net_admin+ep ../umka_os

Not yet used, but may be one day.

    # sysctl -w vm.mmap_min_addr=0


Links & Acknowledgements
------------------------

[1] Filesystem in Userspace library
    https://github.com/libfuse/libfuse

[2] LodePNG by Lode Vandevenne
    https://lodev.org/lodepng/

[3] Optparse by Christopher Wellons
    https://github.com/skeeto/optparse

[4] Universal TUN/TAP device driver by Maxim Krasnyansky and others
    https://www.kernel.org/doc/html/v5.12/networking/tuntap.html

[5] Bestline by Justine Tunney
    https://github.com/jart/bestline