Giter VIP home page Giter VIP logo

k23's Introduction

k23

Experimental WASM Microkernel Operating System

Manual k23 Discord

MIT licensed

About

k23 is an active research project exploring a more secure, modular, and easy to develop for operating system by using WebAssembly as the primary execution environment.

Contributing

I believe OS development should be fun, easy, and approachable. If you would like to hack on k23, fork it for your own experiments or just hang out and philosophize about computers. Be my guest! You can join our small, but growing community of likeminded, awesome people that all believe better computer system are possible!

k23's People

Contributors

jonaskruckenberg avatar renovate[bot] avatar

Stargazers

3h2oto avatar CodingWithJamal avatar Akhilesh Manda avatar Andrejs Agejevs avatar Arman A. avatar 爱可可-爱生活 avatar Aamer Alduais avatar Horváth Bálint avatar Sambhav avatar Leo Shimonaka avatar Sebastian Bolaños avatar Yatsu avatar  avatar Nabeen Tiwaree avatar Mukilan Thiyagarajan avatar Fabio S. avatar Chojan Shang avatar Fabiano Frizzo avatar Ramees Mohammed M M avatar Patricio Bonilla avatar  avatar Daniel Rangel avatar Aqdas Ahmad Khan avatar Aashutosh Rathi avatar Ahmetcan Aksu avatar  avatar Alvin avatar Monzer Omer avatar Wbert Adrián Castro Vera avatar  avatar Barrett Otte avatar Yiannis Marangos avatar Gabriele Modena avatar Second Datke avatar Jose Quintana avatar 文宇祥 avatar Catherine avatar Tony Bai avatar Mnv avatar  avatar Vasu Singh avatar Daniel Kloimwieder avatar Abang Obed avatar Santiago Fraire Willemoes avatar  avatar Zoo Sky avatar Chen Kai avatar  avatar plein avatar Dean Srebnik avatar Kenta Kubo avatar Jeff Hykin avatar Justin Goncalves avatar Junfeng Liu avatar Ben Mickler avatar orzogc avatar Zicklag avatar Cameron Ward avatar Codie@123 avatar LowLevelLover avatar  avatar antx avatar Daniel Jackson avatar  avatar Oliver Gerlach avatar CULT PONY avatar m0x avatar Tom avatar Jesse Stuart avatar カメ子 avatar Daniel Macovei avatar Mendy Berger avatar Marenda SA avatar Longbing Zheng avatar :Levi. avatar LordCasser avatar Hamzah Ahmed avatar Ahmed Tadde avatar Spencer Wilson avatar Erdem Ersoy avatar Krzysztof Zduniak avatar Natalie Cuthbert avatar Christian Legnitto avatar  avatar Kishan Devani avatar Will_i_code avatar Gabe Meikle avatar aramya avatar Stanislav Alekseev avatar Alex Ionescu avatar Justin Moon avatar Faded Weiss avatar Hrvoje Bandov avatar Dorian Ayllón avatar Can Evgin avatar Sven Sackers avatar  avatar duli avatar Caoimhe avatar  avatar

Watchers

Jesse Stuart avatar timelyportfolio avatar Max Bruckner avatar  avatar toks avatar  avatar

k23's Issues

WASM: Extended Name Section

This is the tracking issue for the Extended Name Section proposal.

A preliminary implementation (temporarily disabled) can be found here

// fn parse_name_section(&mut self, reader: NameSectionReader<'wasm>) -> WasmResult<()> {
// for subsection in reader {
// match subsection? {
// Name::Module { name, .. } => {
// self.result.module.debug_info.names.module_name = Some(name);
// }
// Name::Function(names) => {
// for name in names {
// let name = name?;
//
// // Skip this naming if it's naming a function that
// // doesn't actually exist.
// if (name.index as usize) >= self.result.module.functions.len() {
// continue;
// }
//
// self.result
// .module
// .debug_info
// .names
// .func_names
// .insert(FuncIndex::from_u32(name.index), name.name);
// }
// }
// Name::Local(names) => {
// for naming in names {
// let name = naming?;
// let mut result = HashMap::default();
//
// for name in name.names {
// let name = name?;
//
// // Skip this naming if it's naming a function that
// // doesn't actually exist.
// if (name.index as usize) >= self.result.module.functions.len() {
// continue;
// }
//
// result.insert(name.index, name.name);
// }
//
// self.result
// .module
// .debug_info
// .names
// .locals_names
// .insert(FuncIndex::from_u32(name.index), result);
// }
// }
// Name::Global(names) => {
// for name in names {
// let name = name?;
// self.result
// .module
// .debug_info
// .names
// .global_names
// .insert(GlobalIndex::from_u32(name.index), name.name);
// }
// }
// Name::Data(names) => {
// for name in names {
// let name = name?;
// self.result
// .module
// .debug_info
// .names
// .data_names
// .insert(DataIndex::from_u32(name.index), name.name);
// }
// }
// Name::Label(_) => log::debug!("unused name subsection label"),
// Name::Type(_) => log::debug!("unused name subsection type"),
// Name::Table(_) => log::debug!("unused name subsection table"),
// Name::Memory(_) => log::debug!("unused name subsection memory"),
// Name::Element(_) => log::debug!("unused name subsection element"),
// Name::Field(_) => log::debug!("unused name subsection field"),
// Name::Tag(_) => log::debug!("unused name subsection tag"),
// Name::Unknown { .. } => {}
// }
// }
//
// Ok(())
// }

Fault on invalid write

Hey, thanks for putting this up! I just tried running it, but it seems to be getting stuck on an unhandled exception:

❯ just run-riscv64
...
riscv_cpu_do_interrupt: hart:0, async:0, cause:0000000000000007, epc:0x000000008020aa2a, tval:0x0001000380ae6000, desc=fault_store
Invalid write at addr 0x1000380AE6000, size 4, region '(null)', reason: rejected
riscv_cpu_do_interrupt: hart:0, async:0, cause:0000000000000007, epc:0x000000008020aa2a, tval:0x0001000380ae6000, desc=fault_store
Invalid write at addr 0x1000380AE6000, size 4, region '(null)', reason: rejected
...

This is with

❯ cargo --version
cargo 1.81.0-nightly (4ed7bee47 2024-06-25)

❯ qemu-system-riscv64 --version
QEMU emulator version 6.2.0 (Debian 1:6.2+dfsg-2ubuntu6.21)

Looking at the binaries, the faulting address seems to be here:

❯ riscv64-unknown-elf-objdump -d target/riscv64gc-unknown-none-elf/debug/loader

000000008020aa1c <_ZN6loader4arch7riscv649fillstack17hca16c52fb1691861E>:
    8020aa1c:   2b383337                lui     t1,0x2b383
    8020aa20:   030a                    slli    t1,t1,0x2
    8020aa22:   ace30313                addi    t1,t1,-1330 # 2b382ace <$d.168+0x2b20fb28>
    8020aa26:   405102b3                sub     t0,sp,t0
    8020aa2a:   0062a023                sw      t1,0(t0) # 20000 <$d.18+0x2c5>
    8020aa2e:   02a1                    addi    t0,t0,8
    8020aa30:   fe22ede3                bltu    t0,sp,8020aa2a <_ZN6loader4arch7riscv649fillstack17hca16c52fb1691861E+0xe>
    8020aa34:   8082                    ret
        ...

By the way, how is enabling of logging supposed to work? Just by setting the RUST_LOG env variable?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

cargo
Cargo.toml
  • onlyerror 0.1.4
  • log 0.4.21
  • bitflags 2.6.0
  • cfg-if 1.0.0
  • linked_list_allocator 0.10.5
  • arrayvec 0.7.4
  • ed25519-dalek 2.1.1
  • object 0.36.0
  • lz4_flex 0.11
  • lock_api 0.4.12
  • unicode-width 0.1.9
  • memchr 2.4.1
  • bumpalo 3.14.0
  • rustc-demangle 0.1.24
  • postcard 1.0.8
  • talc 4.4.1
  • hashbrown 0.14.5
  • wasmparser 0.214.0
  • target-lexicon 0.12.14
  • serde 1.0.203
  • rand_core 0.6.4
  • clap 4.5.7
  • env_logger 0.11.3
  • anstyle 1.0.7
  • cargo_metadata 0.18.1
  • proc-macro2 1
  • quote 1
  • syn 2
  • toml 0.8.14
build/bootimg-runner/Cargo.toml
  • serde 1.0.203
  • toml 0.8.14
kernel/Cargo.toml
libs/dtb-parser/Cargo.toml
libs/fxhash/Cargo.toml
libs/gimli/Cargo.toml
  • indexmap 2.2.6
  • test-assembler 0.1.6
libs/kstd/Cargo.toml
libs/ktest/Cargo.toml
libs/ktest/macros/Cargo.toml
libs/uart-16550/Cargo.toml
libs/vmm/Cargo.toml
libs/wasm-encoder/Cargo.toml
libs/wast/Cargo.toml
libs/wat/Cargo.toml
loader/Cargo.toml
loader/api/Cargo.toml
loader/api/macros/Cargo.toml
github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • Swatinem/rust-cache v2
  • extractions/setup-just v2
  • actions/checkout v4
  • Swatinem/rust-cache v2
  • extractions/setup-just v2
  • actions/checkout v4
  • EmbarkStudios/cargo-deny-action v2
  • actions/checkout v4
  • Swatinem/rust-cache v2
  • extractions/setup-just v2
.github/workflows/manual.yml
  • actions/checkout v4
  • actions/configure-pages v5
  • actions/upload-pages-artifact v3
  • actions/deploy-pages v4
.github/workflows/qemu.yml
  • actions/upload-artifact v4
.github/workflows/spelling.yml
  • actions/checkout v4

  • Check this box to trigger a request for Renovate to run again on this repository

WASM: Instrument and Tracing Technology

This is the tracking issue for the Instrument and Tracing Technology proposal as well as general guest instrumentation features

The corresponding proposal is not very well fleshed out, but the need for tracing and instrumentation features that allow developers and developer tools to trace back generated machine code to source code, measure execution times etc.

feat: allow filtering log messages

Currently all log messages are emitted regardless of level or origin. As cranelift and other dependencies produce lots of messages it would be very helpful to filter which messages are emitted.

Having a similar system to what env_logger does would be very helpful, env vars could be set at compile time or better yet passed to the kernel by the loader.

For reference the current log implementation for the kernel and loader respectively can be found here: https://github.com/JonasKruckenberg/k23/blob/main/kernel/src/logger.rs https://github.com/JonasKruckenberg/k23/blob/main/loader/src/logger.rs

PCI support

The pci_types crate is likely useful for this. It is used by Redox OS too.

WASM: Memory64

This is the tracking issue for the Memory64 proposal.

Open Questions

  • Bounds checks?
  • Multiple Memories?

refactor(vmm): Allow specifying `vmm::Mode` at runtime

Currently the chosen memory mode for the system is set at compile-time (by all structs being generic over M: vmm::Mode).

Ideally however, we would be able to chose the "right" memory mode based on the CPU feature set. This probably requires removing the generic, making vmm::Mode object-safe and passing it as a &mut dyn vmm::Mode throughout (or a static MODE variable similar to how logs logger works?).

Support for declaring a chosen memory mode is already implemented in the loader_api::LoaderConfig struct, just not utilised yet.

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.