Git Product home page Git Product logo

ktf's Introduction

KTF - Kernel Test Framework

GitHub release C/C++ CI (GCC) C/C++ CI (CLang) Docker Run Test test-clang-format Coverity Scan

KTF is a small and simple OS kernel, that enables writing low-level software tests for supported machine architectures (currently: x86-64).

Features overview

  • Machine architecture: x86-64, x86-32 in the baking
  • SMP support with basic Per-CPU pages
  • (very) Basic Physical Memory Management (PMM) and Virtual Memory Management (VMM)
  • Very basic slab allocator
  • Local APIC support
  • Initial MP tables parsing
  • Basic ACPI tables parsing
  • Simple UART driver
  • (very) Simple VGA driver

Some more features are in the making. Check out the issues.

Getting Started

The quick start is to run the following commands. The content of the file tests/test.c will be executed. Note, the last command will block.

Build a ktf.iso from scratch, in the docker container.

make clean
make docker:ktf.iso

Boot the resulting image:

make boot

Build instructions

Requirements

You may need to install the following (unless you already have it):

  • GRUB2 bootloader tools - grub2-common package (e.g. apt install grub2-common)
  • ISO generation tools - xorriso, grub-pc-bin, and mtools package (e.g. apt install xorriso grub-pc-bin mtools)

Kernel image build (for example to be used with QEMU)

  • Native
make
  • Docker
make docker:all

bootable ISO generation (for example to boot KTF as a guest under Xen or on a bare-metal machine)

  • Native
make ktf.iso
  • Docker
make docker:ktf.iso

The make command generates the kernel64.bin multiboot-compatible ELF file, that you can directly boot with QEMU. The make ktf.iso command takes the kernel64.bin, places it in grub/boot/ directory hierarchy and generates a ktf.iso out of the grub/ (using grub/boot/grub/grub.cfg as a default GRUB config).

Fedora

KTF builds and runs on Fedora, but you will need to tweak some of the commands. Create a Makeconf.local file with the following content (tested with Fedora 32):

DIST=$(shell grep NAME= /etc/os-release | cut -d= -f2)
ifeq ($(DIST),Fedora)
GRUB_FILE := grub2-file
GRUB_MKIMAGE := grub2-mkimage
GRUB_MODULES += normal
QEMU_BIN := qemu-kvm
DOCKER_MOUNT_OPTS := :Z
endif

Running the kernel

QEMU (KVM or not)

Main Makefile has several targets that make booting KTF with QEMU easier. The Makefile detects if the host system is linux and enables KVM support if so. Default parameters for QEMU can be found in the Makefile under QEMU_PARAMS variable.

For booting run:

make boot

For debugging run:

make boot_debug

For debugging with gdb run:

make gdb

Xen guest

Use the following guest domain config example for booting KTF with Xen:

name="kernel64"
builder="hvm"
memory=1024

serial= [ 'file:/tmp/kernel.log', 'pty' ]

disk = [ '/home/user/ktf.iso,,hdc,cdrom' ]

on_reboot = "destroy"

vcpus=1

You need to generate a bootable ISO for this.

Adding new tests

New tests can be added by adding a new function in a file in the tests folder. Each test signature must be the same as test_fn provided in test.h. Tests can be enabled in grub.cfg by adding the option with key tests and values the comma-separated list of function names, such as tests=test1,test2,unit_tests.

Style

The style for this project is defined in .clang-format file in the main directory of this repository.

Use the following command to apply the style automatically to the file you modify:

clang-format -style=file -Werror -i MODIFIED_FILE

For more information refer to: https://clang.llvm.org/docs/ClangFormat.html

This project uses https://github.com/DoozyX/clang-format-lint-action action workflow to detect style mismatches automatically. For more information refer to: https://github.com/marketplace/actions/clang-format-lint

Running the clang-format workflow locally

Build clang-format-lint container

docker build -t clang-format-lint github.com/DoozyX/clang-format-lint-action

This has to be done only once.

Patch your files

make style

Running the one-line-scan workflow locally

Build the ktf-one-line-scan container

  • first, download the one-line-scan base image
docker build -t one-line-scan \
    https://raw.githubusercontent.com/awslabs/one-line-scan/master/tools/Dockerfile
  • create the KTF specific one-line-scan image, including necessary tools for building
 docker build -t ktf-one-line-scan \
    --build-arg USER_ID=$(id -u) \
    --build-arg GROUP_ID=$(id -g) \
    --build-arg USER=$USER \
    --file tools/docker/OnelineScanDockerfile .

This has to be done only once.

Scan your current working directory

  • per default, one-line-scan scans against the diff between HEAD and origin/mainline commit
make onelinescan

Credits and Attributions

  • Parts of the KTF project are inspired by and based on XTF project [1] developed by Andrew Cooper of Citrix.

[1] http://xenbits.xenproject.org/docs/xtf/

Security

See CONTRIBUTING for more information.

Community

Maintainers and users of KTF communicate in Slack. We set up a Slack workspace and we're actively sharing ideas, bugs and anything related to KTF there. Feel free to join us: Slack invite link

License

GitHub

This project is licensed under the BSD 2-Clause License.

ktf's People

Contributors

82marbag avatar amazon-auto avatar bjoernd avatar connojd avatar dkgupta-amzn avatar markusboehme avatar megamaddin avatar minipli-oss avatar nmanthey avatar sktt avatar wipawel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ktf's Issues

[Feature] Integrate ACPICA

Is your feature request related to a problem? Please describe.
Support all of the ACPI spec by integrating with ACPICA (https://www.acpica.org/)

Describe the solution you'd like
Integrate Intel's code and provide KTF wrappers as needed.

Describe alternatives you've considered
So far we're parsing a few ACPI tables manually. But that will stop as soon as we hit AML-encoded tables (i.e., those we'd need for device discovery #84).

Docker build checking workflow

Is your feature request related to a problem? Please describe.
Docker build checking workflow.

Describe the solution you'd like
As part of workflow on github, perform sanity check of building KTF using docker and ensure nothing breaks in build.

[Feature] IOAPIC detection and configuration

Add support for IOAPIC detection and configuration.

Describe the solution you'd like
Use MP tables and ACPI tables for detection of IOAPIC and interrupt sources.
Configure basic support and routing for the common interrupts.

Additional context
BSP (CPU0) should receive and process all interrupts to avoid noise distribution among AP CPUs.
Ideally this should be easily configurable.

[BUG] FADT support and keyboard infinite loop

Describe the bug
init_keyboard() (ref) consumes the leftover bytes before initializing the device. If there are no devices, the function loops forever. The correct way to check whether some PS2 device exists is to use the FADT.

To Reproduce
Steps to reproduce the behavior:

  1. Run KTF with no PS2 device
  2. Loop forever

Expected behavior
PS2 support is dropped.

Logs

Additional context

[BUG] Do not build with stdlib/stdinc anywhere

Describe the bug
We are using -nostdinc -nostdlib for ASM files right now, but not for C files. We do that because it allows us to conveniently pull in some type definitions like stdint.h. This is still dangerous as there may be substantial differences between the build environments, so we should rather ship our own headers and really build independent of the installed libC environment. Also, there is no reason to rely on stdlib features.

[Feature] add basic memmove

Is your feature request related to a problem? Please describe.
We use memcpy instead of preferable memmove for VGA buffer scrolling.

Describe the solution you'd like
Implement basic memmove function and fix VGA scrolling.

Add symbols handling

  • generate and append .sym section
  • add functionality to find a symbol address based on its name
  • dump call stack on panic

[Feature] Microcode update functionality

Is your feature request related to a problem? Please describe.

Add functionality allowing to update microcode of CPUs and dump currently loaded ucode metadata.

Describe the solution you'd like

Add interface to store and update microcode payloads matching detected CPUs.
Add interface to display metadata of currently loaded microcode.

[BUG] handle ACPI tables bigger than 4K

Describe the bug
ACPI table parsing code crashes on pages larger than 4K (or crossing page boundary).
acpi_map_table() maps in only first page of a table, which results in a #PF if tables spans multiple 4K pages.

To Reproduce
Steps to reproduce the behavior:
Boot on a system supporting large tables.

Expected behavior
Map whole ACPI tables based on their size available in their header.

[BUG] User mode trip breaks kernel mode flags

Describe the bug
After return to kernel mode from user mode certain CPU flags are clobbered.

To Reproduce
Steps to reproduce the behavior:

  1. sti()
  2. call into user mode
  3. IF cleared

Expected behavior
Kernel mode CPU flags are preserved across user mode trip.

[Feature] Add basic bitmap implementation

Is your feature request related to a problem? Please describe.

Bitfields used to implement bitmaps have limited number of bits (32 or 64 based on the sizeof(uint64_t)).
Certain flags and map-or-mask-fields require more than the limit.

Describe the solution you'd like

Implement array-based bitmap implementation without upper bit-count limit (bitmap_t).

Add the following API functions:

  • bitmap_find_first_set()
  • bitmap_find_first_clear()
  • bitmap_set_bit()
  • bitmap_clear_bit()
  • bitmap_is_set()

Where possible try to use CPU optimized solution using dedicated ISA instruction.

[Feature] Semaphores support

Is your feature request related to a problem? Please describe.
Synchronization between threads or mutual exclusion must for now be performed manually with spinlocks.

Describe the solution you'd like
Add support for semaphores and mutex.

Describe alternatives you've considered
Use spinlocks and barriers to do this manually.

Additional context

[Feature] Build multiple test images

Is your feature request related to a problem? Please describe.
We build a single kernel64.bin image right now. We might want to build multiple different demo images. (In fact, we already have two images, one for KTF_UNIT_TEST=true and one for KTF_UNIT_TEST=false -- this is hard-coded into test.c right now.)

Describe the solution you'd like
We could have tests/ subdirectories and build separate images per subdirectory. I'm happy with other alternatives, too.

[Feature] Implement a basic bootloader

Is your feature request related to a problem? Please describe.
Grub is multi purpose; it works now, but may not always provide the features we need with a custom bootloader. It may impose a limiting factor when we need more flexibility.

Describe the solution you'd like
A ktf-specific bootloader, which at least provides in a predefined memory location the memory layout of the system.

Describe alternatives you've considered
Keeping grub.

Additional context

[BUG] When compiling with -O0 instead of -O3, Qemu does not boot KTF

Describe the bug
When replacing "-O3" with "-O0", QEMU fails to boot the resulting boot image

To Reproduce
Steps to reproduce the behavior:

  1. replace -O3 with -O0
  2. run tools/ci/build-docker.sh
  3. run "make boot", will fail

Expected behavior
The above sequence will print "All Tests Done", if run with "-O3". Running with "-O0" does not, but results in a failure.

Logs

make boot
QEMU START
COM1: 3f8, COM2: 2f8
CPU: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
Frequency: 1800 MHz
Initialize Physical Memory Manager
Avail memory frames: (total size: 8190 MB)
  4 KB: 640
  2048 KB: 1022
  1048576 KB: 6
Initialize Per CPU structures
Initialize SLAB
Initializing ACPI support
ACPI: RSDP [0xf6840] v00 BOCHS 
ACPI: RSDT [0x3ffe1662] 0030 (v0001 BOCHS  0001 BXPC 00000001)
ACPI: FACP [0x3ffe14b6] 0074 (v0001 BOCHS  0001 BXPC 00000001)
ACPI: APIC [0x3ffe15aa] 0080 (v0001 BOCHS  0001 BXPC 00000001)
ACPI: HPET [0x3ffe162a] 0038 (v0001 BOCHS  0001 BXPC 00000001)
ACPI: [MADT] LAPIC Addr: 0xfee00000, Flags: 00000001
ACPI: [MADT] APIC Processor ID: 0, APIC ID: 0, Flags: 00000001
ACPI: [MADT] APIC Processor ID: 1, APIC ID: 1, Flags: 00000001
ACPI: [MADT] IOAPIC ID: 0, Base Address: 0xfec00000, GSI Base: 0x00000000
ACPI: [MADT] IRQ Src Override: Bus: ISA, IRQ: 0x00, GSI: 0x00000002, Polarity:    Bus Spec, Trigger:  Bus Spec
ACPI: [MADT] IRQ Src Override: Bus: ISA, IRQ: 0x05, GSI: 0x00000005, Polarity: Active High, Trigger:     Level
ACPI: [MADT] IRQ Src Override: Bus: ISA, IRQ: 0x09, GSI: 0x00000009, Polarity: Active High, Trigger:     Level
ACPI: [MADT] IRQ Src Override: Bus: ISA, IRQ: 0x0a, GSI: 0x0000000a, Polarity: Active High, Trigger:     Level
ACPI: [MADT] IRQ Src Override: Bus: ISA, IRQ: 0x0b, GSI: 0x0000000b, Polarity: Active High, Trigger:     Level
ACPI: [MADT] Local APIC NMI LINT#: CPU UID: ff, Polarity:    Bus Spec, Trigger:  Bus Spec, LINT#: 0x01
CPU0: Initializing APIC mode: XAPIC -> XAPIC
Initializing tasks
Initializing SMP support (CPUs: 2)
qemu-system-x86_64: terminating on signal 2

[Feature] Add support for HVM start_info page

Is your feature request related to a problem? Please describe.
In order to support PVH boot protocol (See rust-vmm issue) add proper detection and handling for HVM start_info page (info).
This is needed to enhance Xen support as well as enable rust-vmm and Firecracker support.

Describe the solution you'd like
Detect and parse HVM start_info page. Add handling for memory map entries, cmdline entry and module entries.

Run KTF on Fedora 32

KTF currently is built and tested on Ubuntu. I'd like to get those features on my Fedora, too. Let's be a bit more configurable.

CPU features and flags enumeration via CPUID

Add detection of CPU specific features and flags as provided by cpuid instruction.
Implement infrastructure to easily consume the flags and add them as a guard for already existing features (e.g. rdtscp instruction, 1GB huge pages, etc).

[Feature] add CPUID processor brand string handling and parsing

Is your feature request related to a problem? Please describe.

We need a simple and universal method for obtaining a CPU clock frequency scale to be able to translate TSC returned ticks into {n,u,m}seconds.
For now, let's ignore auto frequency scaling, turbo boosting and other features.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Implement CPUID returned processor brand string handling as described here: https://www.felixcloutier.com/x86/cpuid#the-processor-brand-string-method and display it upon KTF start.

Add extracting the processor frequency from the brand string (example algorithm is described here:
https://www.felixcloutier.com/x86/cpuid#extracting-the-processor-frequency-from-brand-strings)

Describe alternatives you've considered

Some alternative methods are described here: https://wiki.osdev.org/Detecting_CPU_Speed but let's ignore them for now.

QEMU should not require sudo

KTF's Makefile comes with a couple of example targets that launch QEMU. These targets partially use sudo to launch QEMU. This should not be necessary in most cases and I'd consider it dangerous to launch any tool via sudo if not absolutely necessary. Let's make non-sudo the default.

Add exception tables support

  • implement heapsort (or any other fast and low space algorithm)
  • add default handling for registered exceptions
  • add customizable handling for registered exceptions
  • add exceptions logging

[Feature] Add support for Inter-Processor Interrupts

Is your feature request related to a problem? Please describe.
In order to execute all-CPUs tasks like TLB shootdown, full system pause, etc, the IPI interface is needed. It will allow to have all or just a subset of system's CPUs execute requested routine.
It's also needed to test certain APIC functionality.

Describe the solution you'd like
Add interface to easily send IPIs across various ranges of CPUs.
Add functions like send_ipi(), smp_call_function() and/or on_selected_cpus().

[BUG] Makefile fails when KVM is unsupported on Linux

Describe the bug

I'm running the make commands to use ktf on Linux. The Makefile doesn't take into consideration when Linux does not support KVM.

To Reproduce
Steps to reproduce the behavior:

  1. Run make boot with a Linux system which does not support KVM
  2. See error:
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory

Expected behavior
Fallback to docker.

Logs

Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory

Additional context

[BUG] SMP support broken

Describe the bug
SMP support is broken. The only processor running is the BSP.

All processors will execute this line (smp.c:70) because PERCPU_GET(bsp) always returns !=0. This is the first commit breaking SMP support.

To Reproduce
Steps to reproduce the behavior:

  1. Run KTF
  2. Only the BSP will be running

If you want to add some code to verify, you can use:

    task_t *t1 = new_task("t1", f, NULL); // < any function f will do
    task_t *t2 = new_task("t2", f, NULL);
    schedule_task(t1, 1);
    schedule_task(t2, 2);

Expected behavior
All available CPUs are being used (tasks are being scheduled).

Logs

Additional context

[Feature] UART serial console input

Currently the UART serial console only supports output. Add input, to have a fully bidirectional serial console via UART.

Add interrupt driven input handling and unify it with the handling of i8042 keyboard input.

[Feature] Add debug-keys support

Is your feature request related to a problem? Please describe.
When UART input or PS/2 keyboard support is added, we can add debug keys support for various runtime actions.

Describe the solution you'd like
I would implement a register_debugkey(key, callback, help_msg) interface to assign callback functions to dedicated key combinations.

I would support the following keys:

  • '?' - list all registered keys, functions and help msgs
  • 'p' - pause execution of BSP (or all CPUs - that would require IPI support)
  • 'u' - unpause the above
  • 'r' - dump register content
  • 't' - dump page tables content
  • 'c' - crash
  • '+' - toggle debug mode

Add call into realmode

Implement:

  • infrastructure to enter real mode from long mode and protected mode
  • real mode function call functionality with passing arguments and retrieving results

Implement time management

Add:

  • timers support
  • HPET
  • APIC
  • PIT
  • jiffies support
  • jiffies
  • basic CPU frequency detection
  • CPU frequency detection (e.g. via CPUID processor brand string parsing) to get a scale for tsc (Issue: #80 )
  • Ticks to nanoseconds scale based on CPU frequency
  • CPU frequency calibration based on PIT
  • CPU frequency calibration based on APIC Timer
  • sleep functions with granularity:
  • nano seconds
  • micro seconds
  • mili seconds

[BUG] `make boot` regenerates ISO

Describe the bug
'make boot' shouldn't regenerate the ISO and should only attempt to boot.
Or if it is regenerating that ISO, it should do so inside docker container.

Reason: There is an EFI loader bug (which should root cause) due to which input parameters to kernel (multiboot header, etc) gets messed up. If host has EFI enabled and grub efi loaders are present, In ISO generation step local EFI boot loader is picked up and that breaks the boot.

To Reproduce
Steps to reproduce the behavior:

  1. Ubuntu host with UEFI configuration (I've IT managed ubuntu host)
  2. make boot
  3. Boot will get stuck
  4. If you do make boot_debug , you'll see KTF getting crashed quite early.

Expected behavior
make boot should result in boot up.

Logs
root@u4a105d5c7f745d:/home/ANT.AMAZON.COM/dkgupta/sources/github/KTF/ktf/ktf_mainrepo/ktf/ktf# make boot
GEN ISO boot.iso
QEMU START

It's getting stuck and no logs come on screen.

Additional context
Add any other context about the problem here.

Implement buddy allocator (Physical Memory Manager)

Current PMM implementation is very basic and deal only with 4K, 2M and 1G frame sizes.
Extend it to a full buddy allocator, by implementing support for splitting and merging frames of various sizes into pages of orders ranging from 0 to 18.

[Feature] Device detection

Is your feature request related to a problem? Please describe.
We should determine available devices, their metadata, and I/O resources.

Describe the solution you'd like
Parse ACPI/PCI buses etc. to get an understanding of devices available.

Additional context
This is a prerequisite for having device drivers.

[BUG] Static Code Analysis findings

I used the one line scan tool to create a list of findings for cppcheck and Infer. The two tools produce a bunch of issues.

Describe the bug
The below list of code analysis findings should be analyzed, and eventually addressed.

To Reproduce
Run the following (assuming infer and cppcheck are present)

https://github.com/awslabs/one-line-scan.git
./one-line-scan -o infer_files --trunc-existing --no-gotocc --infer -- make -B
./one-line-scan -o cppcheck_files --trunc-existing --no-gotocc --cppcheck -- make -B

Expected behavior
All enumerated bugs are false positives.

Additional context
I filtered cppchecks shift and overflow warnings.

List of findings

arch/x86/boot/multiboot.c:102: (style:variableScope) The scope of the variable 'avail' can be reduced.
arch/x86/boot/multiboot.c:113: (portability:arithOperationsOnVoidPointer) 'r->start' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.
arch/x86/boot/multiboot.c:126: (portability:arithOperationsOnVoidPointer) 'r->start' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.
arch/x86/traps.c:110: [ERROR] NULL_DEREFERENCE pointer `percpu` last assigned on line 106 could be null and is dereferenced at line 110, column 5.
common/acpi.c:79: (portability:arithOperationsOnVoidPointer) 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.
common/acpi.c:117: (portability:arithOperationsOnVoidPointer) 'kmap(mfn,0,1|2|32|64)' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.
common/acpi.c:123: [ERROR] NULL_DEREFERENCE pointer `rsdt` last assigned on line 121 could be null and is dereferenced at line 123, column 27.
common/acpi.c:135: [ERROR] NULL_DEREFERENCE pointer `xsdt` last assigned on line 133 could be null and is dereferenced at line 135, column 27.
common/acpi.c:160: [ERROR] NULL_DEREFERENCE pointer `madt` last assigned on line 157 could be null and is dereferenced at line 160, column 58.
common/acpi.c:162: (portability:arithOperationsOnVoidPointer) '(void*)(unsigned long)(madt)' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.
common/acpi.c:163: (portability:arithOperationsOnVoidPointer) 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.
common/console.c:83: (style:funcArgNamesDifferent) Function 'register_console_callback' argument 1 names different: declaration 'func' definition 'cb'.
common/sched.c:163: [ERROR] INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32.
include/arch/x86/pagetable.h:230: [ERROR] NULL_DEREFERENCE pointer `l2e` last assigned on line 228 could be null and is dereferenced at line 230, column 24.
lib/string.c:206: (style:variableScope) The scope of the variable 'c' can be reduced.
mm/pmm.c:90: (portability:arithOperationsOnVoidPointer) 'r->end' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.
mm/pmm.c:90: (portability:arithOperationsOnVoidPointer) 'r->start' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.
mm/slab.c:235: (style:redundantAssignment) Variable 'alloc_pages' is reassigned a value before the old one has been used.
smp/mptables.c:87: (portability:arithOperationsOnVoidPointer) 'sysm_addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.
include/arch/x86/apic.h:83: (portability:arithOperationsOnVoidPointer) '(void*)(unsigned long)(4276092928U)' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.
include/arch/x86/apic.h:87: (portability:arithOperationsOnVoidPointer) '(void*)(unsigned long)(4276092928U)' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.
include/mm/vmm.h:48: (portability:arithOperationsOnVoidPointer) 'get_free_pages(order,flags)' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.
include/mm/vmm.h:52: (portability:arithOperationsOnVoidPointer) 'get_free_page(flags)' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.

[Feature] Support to parse/load ELF/Object module

Is your feature request related to a problem? Please describe.
KTF doesn't have ability to understand/load an ELF/object module.

Describe the solution you'd like
In order to launch automated tests, it's desirable to not compile KTF with test code each time.
Instead outside test content generator can generate code, compile it into object module and provide to KTF to load it at desirable address and execute it.

Describe alternatives you've considered
I am not aware of any alternatives to this.

Additional context
Add any other context or screenshots about the feature request here.

[Feature] User mode tasks

Is your feature request related to a problem? Please describe.
All tasks must now run as root.

Describe the solution you'd like
I would like to test user mode tasks, not only kernel mode.

Describe alternatives you've considered

Additional context

[Feature] Add full Local APIC interface

Is your feature request related to a problem? Please describe.
Implement Local APIC interface providing easy to use access to all LAPIC registers and abstracting common functionality.

Describe the solution you'd like
Implement primitive functions to access all LAPIC registers and higher level functions abstracting common configuration patterns. Add data structures simplifying access to APIC registers' data fields.
Detect supported modes and base address (MP tables and ACPI's MADT structures).

Implement SLAB allocator

Add basic SLAB allocator with support of predefined sizes.

Implement kmalloc() and kfree() interface.

[Feature] Random Number Generation

Is your feature request related to a problem? Please describe.
I want to create random numbers.

Describe the solution you'd like
Add a PRNG and random/srand functions to KTF.

Additional context
We may want configurable selection of PRNG or a real RNG depending on use case.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.