Go to file
2023-01-16 04:54:34 +00:00
apps Make umka_os use a start up script, don't hardcode 2023-01-16 02:51:46 +00:00
img Fix samehash and lookup_v5 tests 2023-01-09 04:07:36 +00:00
linux Create platform specific I/O module, prepare for io_uring 2023-01-16 04:54:34 +00:00
test Fix samehash and lookup_v5 tests 2023-01-09 04:07:36 +00:00
tools Use sgdisk to partition images 2023-01-09 02:07:42 +00:00
vdisk Create platform specific I/O module, prepare for io_uring 2023-01-16 04:54:34 +00:00
windows Create platform specific I/O module, prepare for io_uring 2023-01-16 04:54:34 +00:00
.gitattributes Improve build on Windows via llvm-mingw 2021-12-13 16:57:05 +03:00
.gitignore Make umka_os use a start up script, don't hardcode 2023-01-16 02:51:46 +00: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
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 Sync LodePNG with upstream 2022-06-28 12:25:04 +04:00
lodepng.h Sync LodePNG with upstream 2022-06-28 12:25:04 +04:00
makefile Create platform specific I/O module, prepare for io_uring 2023-01-16 04:54:34 +00: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 Fix samehash and lookup_v5 tests 2023-01-09 04:07:36 +00:00
shell.c Create platform specific I/O module, prepare for io_uring 2023-01-16 04:54:34 +00:00
shell.h Update copyright headers and years 2022-06-27 21:36:56 +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 Update {gen,mk}samehash tools for xfs, add new fat* and ext* tests 2023-01-09 02:07:28 +00:00
trace_lbr.c Speed up coverage, not drastically 2022-06-28 17:10:21 +04:00
trace_lbr.h Update copyright headers and years 2022-06-27 21:36:56 +04:00
trace.c Update copyright headers and years 2022-06-27 21:36:56 +04:00
trace.h Update copyright headers and years 2022-06-27 21:36:56 +04: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 Create platform specific I/O module, prepare for io_uring 2023-01-16 04:54:34 +00:00
umka_gen_devices_dat.c Update copyright headers and years 2022-06-27 21:36:56 +04:00
umka_os.c Make umka_os use a start up script, don't hardcode 2023-01-16 02:51:46 +00:00
umka_os.us Make umka_os use a start up script, don't hardcode 2023-01-16 02:51:46 +00:00
umka_shell.c Use sgdisk to partition images 2023-01-09 02:07:42 +00:00
umka.asm Make umka_os use a start up script, don't hardcode 2023-01-16 02:51:46 +00:00
umka.h Make umka_os use a start up script, don't hardcode 2023-01-16 02:51:46 +00:00
umka.ld Implement basic variables (to hide pointers from logs) 2022-05-31 17:43:41 +04:00
util.c Update copyright headers and years 2022-06-27 21:36:56 +04:00
util.h Update copyright headers and years 2022-06-27 21:36:56 +04:00
vdisk.c Create platform specific I/O module, prepare for io_uring 2023-01-16 04:54:34 +00:00
vdisk.h Create platform specific I/O module, prepare for io_uring 2023-01-16 04:54:34 +00:00
vnet.c Clean up vnet, update README 2022-06-28 12:23:14 +04:00
vnet.h Update copyright headers and years 2022-06-27 21:36:56 +04: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 run, test and debug
architecture-independent parts of the kernel in your favorite developer
environment.

What works now:
 * block layer (disk, cache, partition, MBR, GPT),
 * file systems except iso9660 (fat*, exfat, ext*, xfs),
 * UI and graphics (geometric primitives, windows, winmap, cursors),
 * basic network (configuration, ping replies),
 * interrupts (via signals),
 * threads and processes,
 * scheduler,
 * slab allocator,
 * events,
 * synchronization primitives,
 * unpacker,
 * string functions,
 * other minor functions.


umka_shell
----------

is an interactive shell with commands that are wrappers around KolibriOS kernel
syscalls and other internal 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


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 - make directories with names in range

mkfilepattern - make a file with contents of specific pattern

lfbviewx - framebuffer viewer for X


BUILD
-----

Linux:

$ KOLIBRIOS=/path/to/kolibrios HOST=linux CC=gcc make

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

Windows:

Same but specify HOST=windows and your favourite C compiler.


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
-------

# Run all the tests

    $ HOST=linux make -B

# Copy ACPI tables and PCI configs

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

# Manage tap device

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


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

# lfbviewx

Allow reading process_vm_readv syscall.

    # sysctl -w kernel.yama.ptrace_scope=0

# umka_os

To create tap devices.

    # setcap cap_net_admin+ep umka_os

To load apps at 0 address.

    # 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

[6] Miniz by Rich Geldreich
    https://github.com/richgel999/miniz

[7] QEMU by Fabrice Bellard and others
    https://www.qemu.org