Coder Social home page Coder Social logo

bupt-os / rros Goto Github PK

View Code? Open in Web Editor NEW
532.0 8.0 33.0 272.71 MB

RROS is a dual-kernel OS for satellites or other scenarios that need both real-time and general-purpose abilities. RROS = RTOS (Rust) + Linux (C).

Home Page: https://bupt-os.github.io/website/

License: Other

Makefile 0.23% Roff 0.02% C 97.94% Assembly 0.98% Shell 0.30% Perl 0.12% C++ 0.02% Awk 0.01% Python 0.12% sed 0.01% Rust 0.22% Yacc 0.01% Lex 0.01% UnrealScript 0.01% SmPL 0.02% Gherkin 0.01% XS 0.01% Raku 0.01% Clojure 0.01% M4 0.01%

rros's Issues

mmap file_operation in control factory may exist some errors

  • mmap file_operation calls remap_pfn_range with a parameter PAGE_SHARED. Is there a bug here regarding constant values?
  • mmap file_operation calls remap_pfn_range with a parameter ptn, which is returned by function named rust_helper_pa. Is there an error regarding the return value type?

There is a bug in poll.rs

Hi All!
Last year I contributed the poll factory code, and I made tests poll-close.c and poll-nested.c passed. But I find something goes wrong when the poll-close test runs in a loop shell. This shell just runs poll-close test 10 times and the kernel will throw an invalid address request.
This error occurs in the function rros_drop_watchpoints which is written at 565 lines in poll.rs.
Following is the error message:

[   79.822868] Unable to handle kernel paging request at virtual address dead0000000000d0
[   79.826177] Mem abort info:
[   79.826321]   ESR = 0x96000004
[   79.826538]   EC = 0x25: DABT (current EL), IL = 32 bits
[   79.826749]   SET = 0, FnV = 0
[   79.826858]   EA = 0, S1PTW = 0
[   79.826975] Data abort info:
[   79.827065]   ISV = 0, ISS = 0x00000004
[   79.827292]   CM = 0, WnR = 0
[   79.827458] [dead0000000000d0] address between user and kernel address ranges
[   79.833567] Internal error: Oops: 96000004 [#1] SMP
[   79.833621] Modules linked in:
[   79.833639] CPU: 0 PID: 618 Comm: new_thread_lhy0 Not tainted 5.13.19-v8+ #2
[   79.833646] Hardware name: linux,dummy-virt (DT)
[   79.833652] IRQ stage: Linux
[   79.833658] pstate: 90000005 (NzcV daif -PAN -UAO -TCO BTYPE=--)
[   79.833665] pc : _RNvMs_NtCshGpAVYOtgW1_5alloc7raw_vecINtB4_6RawVecNtNtCshGpAVYOtgW1_4init4poll17RrosPollConnectorE3ptrBP_+0x8/0x18
[   79.833673] lr : _RNvMs_NtCshGpAVYOtgW1_5alloc3vecINtB4_3VecNtNtCshGpAVYOtgW1_4init4poll17RrosPollConnectorE10as_mut_ptrBI_+0xc/0x14
[   79.833681] sp : ffffffc011bf3c00
[   79.833686] x29: ffffffc011bf3c00 x28: ffffff8006525318 x27: ffffff8006615b98
[   79.833824] x26: 0000000000000000 x25: ffffffc010ccdb80 x24: ffffffc010ccdb68
[   79.833846] x23: ffffffc010ccdb50 x22: dead0000000000c8 x21: 0000000000000038
[   79.833868] x20: dead000000000100 x19: dead0000000000d0 x18: ffffffc010cca880
[   79.833890] x17: 0000000000000000 x16: 00000000000000b4 x15: 00000000000000de
[   79.833911] x14: 0000000000000040 x13: 0000000000000000 x12: ffffff80091ca998
[   79.833933] x11: 0000000000000000 x10: ffffffc01136b000 x9 : 0000000000000000
[   79.833954] x8 : ffffffffffffffc8 x7 : 6f6e203a736f7272 x6 : ffffffc0115b52b0
[   79.833975] x5 : 000000008020001f x4 : 0000000000000080 x3 : 0000000000000001
[   79.833997] x2 : ffffff8005239e00 x1 : ffffff80052d3a80 x0 : dead0000000000d0
[   79.834018] Call trace:
[   79.834025]  _RNvMs_NtCshGpAVYOtgW1_5alloc7raw_vecINtB4_6RawVecNtNtCshGpAVYOtgW1_4init4poll17RrosPollConnectorE3ptrBP_+0x8/0x18
[   79.834033]  _RNvMs_NtCshGpAVYOtgW1_5alloc3vecINtB4_3VecNtNtCshGpAVYOtgW1_4init4poll17RrosPollConnectorE10as_mut_ptrBI_+0xc/0x14
[   79.834042]  _RNvXs9_NtCshGpAVYOtgW1_5alloc3vecINtB5_3VecNtNtCshGpAVYOtgW1_4init4poll17RrosPollConnectorENtNtNtCshGpAVYOtgW1_4core3ops5deref8DerefMut9deref_mutBJ_+0x14/0x28
[   79.834053]  _RNvMs_NtCshGpAVYOtgW1_5alloc3vecINtB4_3VecNtNtCshGpAVYOtgW1_4init4poll17RrosPollConnectorE12as_mut_sliceBI_+0xc/0x14
[   79.834061]  _RNvNtCshGpAVYOtgW1_4init4poll21rros_drop_watchpoints+0xa4/0x1e8
[   79.834068]  _RNvNtCshGpAVYOtgW1_4init4file16drop_watchpoints+0x28/0x34
[   79.834075]  rust_uninstall_inband_fd+0x58/0x74
[   79.834081]  uninstall_inband_fd+0x1c/0x40
[   79.834086]  pick_file+0xf0/0x138
[   79.834092]  close_fd+0x30/0x54
[   79.834097]  __arm64_sys_close+0x20/0x50
[   79.834103]  invoke_syscall+0x4c/0x124
[   79.834109]  el0_svc_common+0xbc/0x130
[   79.834114]  do_el0_svc+0x30/0x8c
[   79.834120]  el0_svc+0x2c/0x8c
[   79.834125]  el0_sync_handler+0x84/0xe4
[   79.834133]  el0_sync+0x198/0x1c0
[   79.834139] Code: a8c17bfd d65f03c0 a9bf7bfd 910003fd (f9400000) 
[   79.834146] ---[ end trace c17059f3ccb71b43 ]---

Lack of SMP support in the kernel.

Currently in the RROS kernel can only support running on a single CPU, all tasks are executed concurrently on a single CPU, and does not provide the function of executing multiple tasks in parallel on multiple CPUs.

However, in complex real-time application scenarios, multiple tasks are often triggered at the same time. Moreover, current computer hardware often has multiple CPU cores to provide better processing performance, such as the common SMP (Symmetric Multi-processing) architecture. If there is no corresponding SMP support in the kernel, there is no way to improve performance even with multiple CPUs. Therefore, it is necessary to provide SMP support for RROS.

In order to implement SMP support in RROS, kernel modifications are required, involving changes to the scheduling subsystem, clock subsystem, interrupt subsystem, and so on. Eventually, it will be possible to support parallel execution of multiple tasks in RROS.

Remove all warnings generated during compilation.

Compiling the code on the current mainline will generate a lot of warnings, part of which is caused by the wrapper of the RFL layer not writing comments, and part of which is caused by the irregularity of the code. Therefore, these warnings need to be removed to standardize the code. This work roughly includes the following parts:

  1. Add documentation for the RFL part code.
  2. Modify some wrapper's format in RFL layer.
  3. Remove redundant comments in the RROS code.
  4. Standardize code and eliminate some irregular codes.

Failed to build "Hello World" application

Hello, I tried to build demo application as described on this page https://bupt-os.github.io/website/docs/introduction/quick-start/ and get the following error:

root@891d48fefc59:~/hello_world# LIBEVL=/root/libevl/ make
aarch64-linux-gnu-gcc -o demo demo.c -I. -I/root/libevl//include /root/libevl//lib/libevl-0.a -lrt -static
In file included from demo.c:8:
/root/libevl//include/evl/proxy.h:14:10: fatal error: uapi/evl/proxy.h: No such file or directory
   14 | #include <uapi/evl/proxy.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:20: demo] Error 1

It looks like that this file is missing in docker image:

root@891d48fefc59:~/hello_world# find / -name "proxy.h"
/root/libevl/include/eshi/evl/proxy.h
/root/libevl/include/evl/proxy.h

Any ideas how to fix?

miss unsafe documentation

// rust/kernel/kernelh.rs
    arg1: *const c_char,
    arg2: *const c_char,
) -> *mut c_char {
    unsafe { bindings::kasprintf(gfp, fmt, arg1, arg2) }

There should be an unsafe comment above the unsafe block.

Need a `new` method in `Timespec64`

The purpose of struct Timespec64's existence is to avoid using bindings. But now it doesn't have a new method, we have to import bindings::timespec64 when we want to init a Timespec64. That makes me upset😢

Failed to build kernel

I configured build environment in Docker using Dockerfile from manual and proceed with Quick start steps (https://bupt-os.github.io/website/docs/introduction/quick-start/). On Compile Kernel Step (4) I got the following error:

  RUSTC L rust/build_error.o
  EXPORTS rust/exports_alloc_generated.h
  RUSTC L rust/kernel.o
error[E0425]: cannot find function `skb_alloc_oob_head` in module `bindings`
  --> rust/kernel/skbuff.rs:11:24
   |
11 |     unsafe { bindings::skb_alloc_oob_head(gfp_mask) }
   |                        ^^^^^^^^^^^^^^^^^^ not found in `bindings`

error[E0425]: cannot find function `__netdev_alloc_oob_skb` in module `bindings`
      --> rust/kernel/skbuff.rs:35:24
       |
35     |       unsafe { bindings::__netdev_alloc_oob_skb(dev, len, gfp_mask) }
       |                          ^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `__netdev_alloc_skb`
       | 
      ::: /root/RROS/rust/bindings_generated.rs:132602:5
       |
132602 | /     pub fn __netdev_alloc_skb(
132603 | |         dev: *mut net_device,
132604 | |         length: c_types::c_uint,
132605 | |         gfp_mask: gfp_t,
132606 | |     ) -> *mut sk_buff;
       | |______________________- similarly named function `__netdev_alloc_skb` defined here

error: aborting due to 2 previous errors

kindly ask to help to resolve it

Add `monitor factory` in RROS

The RROS project lacks the capability for inter-thread synchronization, including: mutexs, semaphores, and condition variables. A monitor factory is needed to implement this functionality. For real-time operating systems, it is necessary to ensure that the kernel does not experience deadlock while implementing synchronization mechanisms, and to implement priority inheritance and the ceiling protocol.

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.