Coder Social home page Coder Social logo

svm_kernel's Introduction

==== WORK IN PROGRESS ====

Current status: Implementic acpi & srat support

Description

x86_64 HPC AMD kernel written in Rust. Optimized for hypervisor usage.

Setup & Debug Build

Clone the repo with submodules:

$ git clone --recursive <url>

Install the rust nightly toolchain:

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.49.0-nightly (ffa2e7ae8 2020-10-24)

Install the dependencies listed in shell.nix or execute nix-shell shell.nix if on NixOS.

Install cargo dependencies:

$ cargo install bootimage

Run in qemu with:

$ cargo run

Close the instance with CTRL+A,X or CTRL+C

Build on filechange:

$ cd svm_kernel
$ ./watch.sh

Release build:

Execute:

$ cargo run --release

The resulting file lies in: target/x86_64-os/release/bootimage-svm_kernel.bin Flash it with:

$ dd bs=5M if=target/x86_64-os/release/bootimage-svm_kernel.bin of=/dev/MYDEVICE

OR Edit the file Cargo.toml and change build-command to ["build", "--release"] Then execute cargo bootimage

Generate & view assembly

$ cargo asm

You can find the asm file in target/x86_64-os/release/deps/svm_kernel-*.s

Debug with gdb

$ qemu-kvm -cpu qemu64,+svm,vendor=AuthenticAMD -drive format=raw,file=target/x86_64-os/debug/bootimage-svm_kernel.bin -nographic -s -S

In another shell execute:

$ rust-gdb target/x86_64-os/debug/svm_kernel -ex "target remote:1234"

In gdb every core is handled like a thread. This means with the commands:

(gdb) thread

You have to use hb instead of b in gdb when using qemu-kvm. If not the breakpoints get ignored.

Debug with radare2

$ r2 -B 0x200000 target/x86_64-os/debug/svm_kernel

Run tests

To execute tests run:

$ cargo test

Run specific test:

$ cargo test --test heap_allocator

Resources

svm_kernel's People

Contributors

qubasa avatar

Watchers

 avatar

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.