Coder Social home page Coder Social logo

diodesign / diosix Goto Github PK

View Code? Open in Web Editor NEW
188.0 10.0 11.0 49.52 MB

A lightweight, secure, multiprocessor bare-metal hypervisor written in Rust for RISC-V

Home Page: https://diosix.org/

License: MIT License

Rust 98.66% Dockerfile 0.62% Python 0.72%
rust riscv kernel microkernel hypervisor risc-v diosix

diosix's Introduction

Build License: MIT Language: Rust Platform: riscv64

Welcome guide

  1. About this project
  2. Quickstart using Qemu
  3. Quickstart using Google Cloud Run
  4. Run Diosix from source in a container
  5. Run Diosix from source without a container
  6. Frequently anticipated questions
  7. Contact, contributions, security, and code of conduct
  8. Copyright, distribution, and license

About this project

Diosix strives to be a lightweight, fast, and secure multiprocessor bare-metal hypervisor written in Rust for 64-bit RISC-V computers. Though this project is a work in progress, you can boot and use guest operating systems with it.

Below is a recording of a user logging into a RISC-V Linux guest OS on Diosix and using Micropython to print "hello world!"

asciicast

Quickstart using Qemu

To run a prebuilt version of Diosix and a RISC-V Linux guest within Qemu, first ensure you have installed a 64-bit RISC-V-capable version of the emulator. This is included in the qemu-system-misc package on Debian 10, for example.

Next, fetch from the binaries branch an executable containing the hypervisor and its guest:

wget https://github.com/diodesign/diosix/raw/binaries/diosix/diosix-0.0.2-debug-20210404

Run Diosix on a dual-core Qemu system with 1GB of RAM:

qemu-system-riscv64 -bios none -nographic -machine virt -smp 2 -m 1G -kernel diosix-0.0.2-debug-20210404

Once booted, the hypervisor will start its included Linux guest OS. When you see the following prompt, log into the guest as root with no password:

Welcome to Busybox/Linux with Micropython
buildroot-guest login: 

Micropython, zsh, and less are provided as well as BusyBox. Press Control-a then x to exit the Qemu RISC-V emulator. Note: the guest instance is temporary, and any data saved inside it will be lost when you end the emulation.

Quickstart using Google Cloud Run

To run RISC-V Linux on Diosix from your browser using Google Cloud, click the button below. You will need a Google Cloud account.

Run on Google Cloud

When prompted, confirm you trust the Diosix repository and allow Google Cloud Shell to make Google Cloud API calls. Cloud Shell will next ask you to choose which Google Cloud project and region to use for this process.

Once selected, Google Cloud Run will create a Docker container image of Diosix, built from its latest source code, with a prebuilt Linux guest OS.

To start this container, run this command in Cloud Shell:

docker run --rm -ti `docker images | grep -o -E "(gcr\.io\/){1}([a-z0-9\-]+)\/(diosix){1}"`

As with the Qemu quickstart guide, log into the guest using root as the username with no password. Press Control-a then x to exit the Qemu RISC-V emulator and shut down the container. Close the Cloud Shell to end the session.

Note: you will be billed by Google for any resources used to build and run this container beyond your free allowance. Cloud Run documentation is here.

Run Diosix from source in a container

To build Diosix from source and boot it within Qemu with a prebuilt guest OS within a Docker container on your own system, create a container image of the software:

git clone https://github.com/diodesign/diosix.git
cd diosix
docker build --tag diosix .

And start the container:

docker run -ti --rm diosix

As with Google Cloud Run, log into the provided guest Linux OS environment as root with no password. Press Control-a then x to exit the Qemu emulator and shut down and delete the container.

Run Diosix from source without a container

To build and run Diosix on real hardware, or within Qemu or Spike, from its latest source code without using Docker, follow these instructions.

Frequently anticipated questions

Q. What can Diosix do right now?

A. It initializes a compatible RISC-V system, and runs one or more guest operating systems in hardware-isolated virtualized environments called capsules. System services also run in capsules using a provided runtime. One such service offers a virtual console through which the user can interact with guest capsules.

Diosix supports systems with multiple CPU cores, and preemptively schedules capsules' virtual cores to run on their physical counterparts. It handles interrupts and exceptions, instruction emulation, serial IO, memory management and protection, and capsule and system service management.

It partially implements the SBI specification as implementation ID 5. It parses Device Tree configuration data from the motherboard firmware to discover the available hardware, and generates Device Tree structures describing virtualized environments for guest OSes to parse.

Q. Will you support other processor architectures?

A. Though the project is focused on RISC-V, Diosix is structured so that the hypervisor's core code is portable. Platform-specific code is kept separate and included during the build process: a port to another architecture would need to provide those platform-specific crates. If you want to contribute and maintain support for other architectures, please get in touch. Ports to other open hardware platforms, such as OpenPOWER, and architectures similar to RISC-V, such as Arm, would be welcome.

Q. Why no support for 32-bit RISC-V processors?

A. Diosix initally supported 32 and 64-bit RISC-V CPU cores. However, 32-bit support was dropped in March 2021 to prioritize fixing bugs, adding features, and updating documentation. If you wish to maintain RV32 support for Diosix, please get in touch.

Q. Does Diosix rely on KVM, Qemu, or similar?

A. No. Diosix is a strictly bare-metal, type-1 original hypervisor designed to run just above the ROM firmware level. It doesn't sit on top of any other virtualization library or layer, such as Linux's KVM, nor Xen. Qemu is used as a development environment, and it is not required to run Diosix on real hardware.

Q. What are the minimum requirements to run Diosix?

A. Diosix by default expects 1MB of RAM per CPU core plus space in memory to store the hypervisor and its payload, and space to run guests. For example, a quad-core system with a 32MB Diosix payload (containing the hypervisor, a guest OS, console system service, and boot banners), running three guests instances with 128MB of memory each, would comfortably fit within 512MB of host RAM. The exact requirements are tunable: if your target hardware has limited RAM, Diosix's footprint can be scaled down as well as up.

Contact, contributions, security issue reporting, and code of conduct

Email [email protected] if you have any questions or issues to raise, wish to get involved, or have source to contribute. If you have found a security flaw, please follow these steps to report the bug.

You can also submit pull requests or raise issues via GitHub, though please consider disclosing security-related matters privately. You are more than welcome to use the discussion boards to ask questions and suggest features.

Please observe the project's code of conduct when participating.

Copyright, distribution, and license

Copyright © Chris Williams, 2018-2021. See LICENSE for distribution and use of source code, binaries, and documentation.

More information can be found here on the contents of the guest OS binaries used by Diosix. The diosix.org illustration is a combination of artwork kindly provided by Katerina Limpitsouni and RISC-V International.

diosix's People

Contributors

diodesign 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

diosix's Issues

Information on porting to x86_64?

Hello,

Hope that all is well with you today.

In browsing the Internet, I came across your Diosix Type-1 Hypervisor and am interested in working with it.

Unfortunately, I run systems on the x86_64 platform but I saw in your documentation at:

https://diosix.org/#faq

Q. Will you support other processor architectures?

A. Though the project is focused on RISC-V, Diosix is structured so that the hypervisor’s core code is portable. Platform-specific code is kept separate and included during the build process: a port to another architecture would need to provide those platform-specific crates. If you want to contribute and maintain support for other architectures, please get in touch. Ports to other open hardware platforms, such as OpenPOWER, and architectures similar to RISC-V, such as Arm, would be welcome.

This suggests that it "might" be possible to set it up for the x86_64 platform and this is the part that I am interested in learning more about.

Could you please discuss this a bit more with me so that I can get a feel for what might need to done?
Thanks in advance and have a good day.

Panic_implementation

Apparently nightly changed some features around.

panic_handler is now panic_implementation

Btw: I really love your project, this will be really helpful 👍

Undefined reference to `abort`

When tried to build as it is suggested in the README file. Got this error:

riscv32-elf-ld: /home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/kernel-f5bc6e927e6214b5.kernel.eylniip0-cgu.0.rcgu.o: in function `core::result::unwrap_failed':
          kernel.eylniip0-cgu.0:(.text._ZN4core6result13unwrap_failed17h039c92a70aa18ed7E+0x56): undefined reference to `abort'

The full output:

% ./build.sh --triple riscv32imac-unknown-none-elf --platform sifive_u34
Building for riscv32 SiFive Freedom U34 series
   Compiling diosix v2.0.0 (/home/pkukushkin/own/diosix)                                                                            
warning: function is never used: `kernel_irq_handler`                                                                               
  --> src/kernel/irq.rs:21:1                                                                                                        
   |                                                                                                                                
21 | pub extern "C" fn kernel_irq_handler(context: IRQContext)                                                                      
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                      
   |                                                                                                                                
   = note: #[warn(dead_code)] on by default                                                                                         
                                                                                                                                    
warning: function is never used: `exception`                                                                                        
  --> src/kernel/irq.rs:33:1                                                                                                        
   |                                                                                                                                
33 | fn exception(irq: IRQ)                                                                                                         
   | ^^^^^^^^^^^^^^^^^^^^^^                                                                                                         
                                                                                                                                    
warning: function is never used: `interrupt`                                                                                        
  --> src/kernel/irq.rs:47:1                                                                                                        
   |                                                                                                                                
47 | fn interrupt(_irq: platform::common::IRQ)                                                                                      
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                      
                                                                                                                                    
warning: function is never used: `abort`                                                                                            
  --> src/kernel/abort.rs:19:1                                                                                                      
   |                                                                                                                                
19 | pub extern "C" fn abort() -> !                                                                                                 
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                 
                                                                                                                                    
warning: function is marked #[no_mangle], but not exported                                                                          
  --> src/kernel/irq.rs:21:1                                                                                                        
   |                                                                                                                                
21 | / pub extern "C" fn kernel_irq_handler(context: IRQContext)                                                                    
22 | | {                                                                                                                            
23 | |   let irq = platform::common::irq::dispatch(context);                                                                        
24 | |                                                                                                                              
...  |                                                                                                                              
29 | |   };                                                                                                                         
30 | | }                                                                                                                            
   | |_^                                                                                                                            
   |                                                                                                                                
   = note: #[warn(private_no_mangle_fns)] on by default                                                                             
   = help: try exporting the item with a `pub use` statement                                                                        
                                                                                                                                    
warning: function is marked #[no_mangle], but not exported                                                                          
  --> src/kernel/abort.rs:19:1                                                                                                      
   |                                                                                                                                
19 | / pub extern "C" fn abort() -> !                                                                                               
20 | | {                                                                                                                            
21 | |   kalert!("Abort handler reached!");                                                                                         
22 | |   loop {}                                                                                                                    
23 | | }                                                                                                                            
   | |_^                                                                                                                            
   |                                                                                                                                
   = help: try exporting the item with a `pub use` statement                                                                        
                                                                                                                                    
error: linking with `riscv32-elf-ld` failed: exit code: 1                                                                           
  |                                                                                                                                 
  = note: "riscv32-elf-ld" "-L" "/home/pkukushkin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/kernel-f5bc6e927e6214b5.kernel.eylniip0-cgu.0.rcgu.o" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/kernel-f5bc6e927e6214b5.kernel.eylniip0-cgu.1.rcgu.o" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/kernel-f5bc6e927e6214b5.kernel.eylniip0-cgu.2.rcgu.o" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/kernel-f5bc6e927e6214b5.kernel.eylniip0-cgu.3.rcgu.o" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/kernel-f5bc6e927e6214b5.kernel.eylniip0-cgu.4.rcgu.o" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/kernel-f5bc6e927e6214b5.kernel.eylniip0-cgu.5.rcgu.o" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/kernel-f5bc6e927e6214b5.kernel.eylniip0-cgu.6.rcgu.o" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/kernel-f5bc6e927e6214b5.kernel.eylniip0-cgu.7.rcgu.o" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/kernel-f5bc6e927e6214b5.kernel.eylniip0-cgu.8.rcgu.o" "-o" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/kernel-f5bc6e927e6214b5" "--gc-sections" "-L" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps" "-L" "/home/pkukushkin/own/diosix/target/release/deps" "-L" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/build/diosix-a0cb742e0343cb8c/out" "-L" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/build/diosix-a0cb742e0343cb8c/out" "-L" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/build/diosix-a0cb742e0343cb8c/out" "-L" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/build/diosix-a0cb742e0343cb8c/out" "-L" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/build/diosix-a0cb742e0343cb8c/out" "-L" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/build/diosix-a0cb742e0343cb8c/out" "-L" "/home/pkukushkin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib" "-Bstatic" "--whole-archive" "-lentry" "--no-whole-archive" "--whole-archive" "-lserial" "--no-whole-archive" "--whole-archive" "-lirq" "--no-whole-archive" "--whole-archive" "-lutils" "--no-whole-archive" "--whole-archive" "-lconsts" "--no-whole-archive" "--whole-archive" "-latomics" "--no-whole-archive" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/libplatform-b259f12999087a7e.rlib" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/libcommon-ebe915d491305f12.rlib" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/libhermit_dtb-ce69622086d2f810.rlib" "/home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/libbyteorder-b26fa9469004fc14.rlib" "/home/pkukushkin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcore-a83244677bb7b80c.rlib" "/home/pkukushkin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-66da1cd884dc7f8e.rlib" "-Tsrc/platform/riscv32/sifive_u34/link.ld" "-Bdynamic"
  = note: riscv32-elf-ld: /home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/kernel-f5bc6e927e6214b5.kernel.eylniip0-cgu.0.rcgu.o: in function `core::result::unwrap_failed':
          kernel.eylniip0-cgu.0:(.text._ZN4core6result13unwrap_failed17h039c92a70aa18ed7E+0x56): undefined reference to `abort'     
          riscv32-elf-ld: /home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/kernel-f5bc6e927e6214b5.kernel.eylniip0-cgu.2.rcgu.o: in function `kmain':
          kernel.eylniip0-cgu.2:(.text.kmain+0x190): undefined reference to `abort'                                                 
          riscv32-elf-ld: /home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/kernel-f5bc6e927e6214b5.kernel.eylniip0-cgu.7.rcgu.o: in function `rust_begin_unwind':
          kernel.eylniip0-cgu.7:(.text.rust_begin_unwind+0x98): undefined reference to `abort'                                      
          riscv32-elf-ld: /home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/build/diosix-a0cb742e0343cb8c/out/libirq.a(irq.o): in function `irq_machine_handler':
          (.text+0x7c): undefined reference to `kernel_irq_handler'                                                                 
          riscv32-elf-ld: /home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/libcommon-ebe915d491305f12.rlib(common-ebe915d491305f12.common.7p0l84du-cgu.1.rcgu.o): in function `common::devicetree::get_ram_size':
          common.7p0l84du-cgu.1:(.text._ZN6common10devicetree12get_ram_size17h50b7f9c20faec30bE+0xce): undefined reference to `abort'
          riscv32-elf-ld: /home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/libhermit_dtb-ce69622086d2f810.rlib(hermit_dtb-ce69622086d2f810.hermit_dtb.f3h2hg1a-cgu.0.rcgu.o): in function `core::str::traits::<impl core::slice::SliceIndex<str> for core::ops::range::RangeTo<usize>>::index::{{closure}}':
          hermit_dtb.f3h2hg1a-cgu.0:(.text._ZN4core3str6traits103_$LT$impl$u20$core..slice..SliceIndex$LT$str$GT$$u20$for$u20$core..ops..range..RangeTo$LT$usize$GT$$GT$5index28_$u7b$$u7b$closure$u7d$$u7d$17h5560586b1973a5b1E+0x14): undefined reference to `abort'
          riscv32-elf-ld: /home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/libhermit_dtb-ce69622086d2f810.rlib(hermit_dtb-ce69622086d2f810.hermit_dtb.f3h2hg1a-cgu.0.rcgu.o): in function `core::str::traits::<impl core::slice::SliceIndex<str> for core::ops::range::RangeFrom<usize>>::index::{{closure}}':
          hermit_dtb.f3h2hg1a-cgu.0:(.text._ZN4core3str6traits105_$LT$impl$u20$core..slice..SliceIndex$LT$str$GT$$u20$for$u20$core..ops..range..RangeFrom$LT$usize$GT$$GT$5index28_$u7b$$u7b$closure$u7d$$u7d$17hfa85dc0daab64c6aE+0x1a): undefined reference to `abort'
          riscv32-elf-ld: /home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/libhermit_dtb-ce69622086d2f810.rlib(hermit_dtb-ce69622086d2f810.hermit_dtb.f3h2hg1a-cgu.0.rcgu.o): in function `hermit_dtb::Dtb::get_property':
          hermit_dtb.f3h2hg1a-cgu.0:(.text._ZN10hermit_dtb3Dtb12get_property17hb4fa852c51ed2636E+0x360): undefined reference to `abort'
          riscv32-elf-ld: hermit_dtb.f3h2hg1a-cgu.0:(.text._ZN10hermit_dtb3Dtb12get_property17hb4fa852c51ed2636E+0x374): undefined reference to `abort'
          riscv32-elf-ld: /home/pkukushkin/own/diosix/target/riscv32imac-unknown-none-elf/release/deps/libhermit_dtb-ce69622086d2f810.rlib(hermit_dtb-ce69622086d2f810.hermit_dtb.f3h2hg1a-cgu.0.rcgu.o):hermit_dtb.f3h2hg1a-cgu.0:(.text._ZN10hermit_dtb3Dtb12get_property17hb4fa852c51ed2636E+0x3ca): more undefined references to `abort' follow

Diosix fails to build

The latest commit (406502c) of diosix fails to build when invoking just. I was doing a clean clone of the repo using git clone --recurse-submodules https://github.com/diodesign/diosix.git and invoked just quiet=no

Output:

% just quiet=no
--> Building debug-grade Diosix for riscv64gc-unknown-none-elf systems
--> Ensuring Rust can build for riscv64gc-unknown-none-elf
info: component 'rust-std' for target 'riscv64gc-unknown-none-elf' is up to date
--> Building system services
    Updating crates.io index
   Compiling memchr v2.3.4
   Compiling regex-syntax v0.6.23
   Compiling proc-macro2 v1.0.24
   Compiling semver-parser v0.7.0
   Compiling spin v0.5.2
   Compiling unicode-xid v0.2.1
   Compiling serde v1.0.124
   Compiling syn v1.0.64
   Compiling serde_derive v1.0.124
   Compiling scopeguard v1.1.0
   Compiling bit_field v0.10.1
   Compiling spin v0.7.1
   Compiling lazy_static v1.4.0
   Compiling semver v0.9.0
   Compiling lock_api v0.3.4
   Compiling spinning_top v0.1.1
   Compiling rustc_version v0.2.3
   Compiling linked_list_allocator v0.8.11
   Compiling aho-corasick v0.7.15
   Compiling bare-metal v0.2.5
   Compiling quote v1.0.9
   Compiling regex v1.4.5
   Compiling riscv-target v0.1.2
   Compiling toml v0.5.8
   Compiling riscv v0.6.0
   Compiling supervisor v0.0.1 (/home/ubuntu/temp/diosix/src/services/src/supervisor-riscv)
   Compiling diosix-services v1.0.0 (/home/ubuntu/temp/diosix/src/services)
error: linking with `riscv64-linux-gnu-ld` failed: exit code: 1
  |
  = note: "riscv64-linux-gnu-ld" "-nostartfiles" "-L" "/home/ubuntu/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/riscv64gc-unknown-none-elf/lib" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.100v2shtrliots8x.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.12ep3mmhc6dj5fnh.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.1avnfmvj30bt9bku.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.1bb27rzb4a0dfjp2.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.1d8zw0v1diyyjlag.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.1hhiwjtrfa3ucwuo.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.1nu8yvfoe1gwv02c.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.1oddxpnzhkl1xipe.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.1sohgf12z483xcw5.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.1spkmqg05nky0f9i.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.1vxp2b02839sflx5.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.1vy6khjzh3svzx2m.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.1zfxxyr4208zife2.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.21q7g64wpr8pxeap.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.24efxi6jj5odfvjz.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.264zviuew05893f4.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.2ajh04rlnq9tpm6e.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.2g9c0dc8lspz6kav.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.2rkvgh4u07qpc9d7.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.2ztugj8zdrol9wuf.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.30zimewwnct8wry2.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.37pygl7xuvemngne.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.3c7ti2fqrmzpy3zb.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.3k288lv6dmis101p.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.3mgtpzrnwonigf3y.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.3o0zoi09ck27rrse.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.3peyayssqbx09dmb.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.3plxgcfmvagvcyrn.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.3tunfpfno03i64hf.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.3utn88mh79ibnm2x.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.3ys0n2cx211kh3r9.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.45hnsdddh4nep6b.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.45zvssyqboww946r.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.496ebu93c6vu72mc.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4arbxjd4e2z3rq1o.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4beo3xm3y2cw7ww3.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4c02gg3mr4eh8nea.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4c6b5j97y6lfp6er.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4easln8t7o8ovyuc.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4ehrr1ur2orp6uy9.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4fovth147rkryhtc.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4hieqhgdqo8sqmvm.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4ixe1jq7z4xrm88x.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4k6vf6qr8mqyedpj.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4kff9y3l0zd3xbyt.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4lgw2wbxsqzi5tnv.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4tak3ek41v1zk0r1.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4tglt6a2m1hvqhbk.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4ugmqj3hm68ciuqy.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4y4x2ducpuwkydk1.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4yjya6qpcuouip5.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.4z5rdfm5poghcaxk.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.57bqeacloymar4bh.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.6bxf10qc3xfskjo.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.buv90q9dj3crion.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.m33duvfeq6gb8pt.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.n9wti139t97t7gs.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.nv227vbqwatwwoa.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.osf1id40euuhw3.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.un1hubvuq71e8jn.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.x7aiq4a9fwy19xs.rcgu.o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.z8989st91i67btt.rcgu.o" "-o" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/gooey-8073e498eb41c45c.326xa2o4atoeqpi4.rcgu.o" "--gc-sections" "-L" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps" "-L" "/home/ubuntu/temp/diosix/src/services/target/debug/deps" "-L" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/build/diosix-services-08273ac74e689f54/out" "-L" "/home/ubuntu/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/riscv64gc-unknown-none-elf/lib" "-Bstatic" "--whole-archive" "-lmason-bundle" "--no-whole-archive" "--start-group" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/libsupervisor-23833f2ff29fb3a3.rlib" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/liblinked_list_allocator-61d6e6898e9fc29c.rlib" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/libspinning_top-bde1d62664c03035.rlib" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/liblock_api-e4723366850a7c79.rlib" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/libscopeguard-f4f9de0a9a69797c.rlib" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/libriscv-9ace5bdf7852cc73.rlib" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/libbit_field-9d02f2fc1f5ccc0b.rlib" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/libbare_metal-7594edd708b873cd.rlib" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/libspin-e001ea58601280ce.rlib" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/liblazy_static-498a4a25c3c761aa.rlib" "/home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/deps/libspin-af647bf234b573e8.rlib" "/home/ubuntu/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/riscv64gc-unknown-none-elf/lib/liballoc-aa39dc0fc06f43e0.rlib" "/home/ubuntu/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/riscv64gc-unknown-none-elf/lib/librustc_std_workspace_core-e30a52609bcf09ba.rlib" "/home/ubuntu/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/riscv64gc-unknown-none-elf/lib/libcore-5f3ec282930f4c98.rlib" "--end-group" "/home/ubuntu/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/riscv64gc-unknown-none-elf/lib/libcompiler_builtins-141bb7bc8ac65192.rlib" "-Tsrc/supervisor-riscv/link.ld" "-pie" "--no-dynamic-linker" "-Bdynamic"
  = note: riscv64-linux-gnu-ld: /home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/build/diosix-services-08273ac74e689f54/out/libmason-bundle.a(entry.o): can't link double-float modules with soft-float modules
          riscv64-linux-gnu-ld: failed to merge target specific data of file /home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/build/diosix-services-08273ac74e689f54/out/libmason-bundle.a(entry.o)
          riscv64-linux-gnu-ld: /home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/build/diosix-services-08273ac74e689f54/out/libmason-bundle.a(irq.o): can't link double-float modules with soft-float modules
          riscv64-linux-gnu-ld: failed to merge target specific data of file /home/ubuntu/temp/diosix/src/services/target/riscv64gc-unknown-none-elf/debug/build/diosix-services-08273ac74e689f54/out/libmason-bundle.a(irq.o)
          riscv64-linux-gnu-ld: warning: section `.bss' type changed to PROGBITS
          

error: aborting due to previous error

error: could not compile `diosix-services`

To learn more, run the command again with --verbose.
error: Recipe `_services` failed on line 204 with exit code 101
just quiet=no  75.42s user 3.79s system 461% cpu 17.148 total
101 

Compiling with custom build riscv tools (gcc/binutils)

What do you need to do to use a custom built tools for compiling?

In the other issue you said to change the ld/ar
To override the linker paths, you need to edit the .cargo/config files in src/hypervisor and src/services and change the appropriate settings

Are there other settings to change the other tools?

Currently it fails:
Compiling diosix-services v1.0.0 (/media/marckarasek/source/diosix/src/services)
error: failed to run custom build command for diosix-services v1.0.0 (/media/marckarasek/source/diosix/src/services)

Caused by:
process didn't exit successfully: /media/marckarasek/source/diosix/src/services/target/debug/build/diosix-services-f5f431a80a102f38/build-script-build (exit code: 101)
--- stderr
thread 'main' panicked at 'Failed to execute command to assemble src/supervisor-riscv/asm/entry.s: Os { code: 2, kind: NotFound, message: "No such file or directory" }', ../mason/build.rs:323:10
stack backtrace:
0: rust_begin_unwind
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:493:5
1: core::panicking::panic_fmt
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/panicking.rs:92:14
2: core::option::expect_none_failed
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/option.rs:1329:5
3: core::result::Result<T,E>::expect
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/result.rs:997:23
4: build_script_build::assemble
at ./../mason/build.rs:310:18
5: build_script_build::assemble_directory
at ./../mason/build.rs:281:21
6: build_script_build::main
at ./../mason/build.rs:176:9
7: core::ops::function::FnOnce::call_once
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.
error: Recipe _services failed on line 204 with exit code 101

mips?

topic said mips, but i dont see the mips code.

Failed to build due to rust error[E0557]

https://github.com/diodesign/supervisor-riscv.git had a dependency on linked_list_allocator version = "0.8.11" which had a dependency on lock_api 0.3.0 which was causing the build error below.

The failed build due to an "error[E0557]: feature has been removed" for #![feature(const_fn)]

updating the dependency for linked_list_allocator to version 0.9.1 moves the dependent lock_api lib up to 0.4.5 like so:
├── linked_list_allocator v0.9.1
│ └── spinning_top v0.2.4
│ └── lock_api v0.4.5
│ └── scopeguard v1.1.0

This fixes the build.
suggest also updating the riscv dependency to 0.7.0
As well as spin to 0.9.2 (which also has a lock_api dependency)

thanks!

failed to load source for dependency `devicetree`

Seems some files are missing from repo?

$ cargo build --target riscv64gc-unknown-none-elf
error: failed to get `devicetree` as a dependency of package `diosix v2.0.0 (/rust/src/diosix)`

Caused by:
  failed to load source for dependency `devicetree`

Caused by:
  Unable to update /rust/src/diosix/src/devicetree

Caused by:
  failed to read `/rust/src/diosix/src/devicetree/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

$ ls /rust/src/diosix/src/devicetree/
# nothing

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.