xv6-riscv | dennis ritchie 's and ken thompson

 by   mit-pdos C Version: Current License: Non-SPDX

kandi X-RAY | xv6-riscv Summary

kandi X-RAY | xv6-riscv Summary

xv6-riscv is a C library. xv6-riscv has no bugs, it has no vulnerabilities and it has medium support. However xv6-riscv has a Non-SPDX License. You can download it from GitHub.

xv6 is a re-implementation of dennis ritchie's and ken thompson's unix version 6 (v6). xv6 loosely follows the structure and style of v6, but is implemented for a modern risc-v multiprocessor using ansi c. xv6 is inspired by john lions's commentary on unix 6th edition (peer to peer communications; isbn: 1-57398-013-7; 1st edition (june 14, 2000)). see also which provides pointers to on-line resources for v6. the following people have made contributions: russ cox (context switching, locking), cliff frey (mp), xiao yu (mp), nickolai zeldovich, and austin clements. we are also grateful for the bug reports and patches contributed by silas boyd-wickizer, anton burtsev, dan cross, cody cutler, mike cat, tej chajed, asami doi, eyalz800, , nelson elhage, saar ettinger, alice ferrazzi, nathaniel filardo, peter froehlich, yakir goaron,shivam handa, bryan henry, jaichenhengjie, jim huang, alexander kapshuk, anders kaseorg, kehao95, wolfgang keller, jonathan kimmitt, eddie kohler,
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              xv6-riscv has a medium active ecosystem.
              It has 4020 star(s) with 1572 fork(s). There are 77 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 31 open issues and 37 have been closed. On average issues are closed in 77 days. There are 34 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of xv6-riscv is current.

            kandi-Quality Quality

              xv6-riscv has 0 bugs and 0 code smells.

            kandi-Security Security

              xv6-riscv has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              xv6-riscv code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              xv6-riscv has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              xv6-riscv releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of xv6-riscv
            Get all kandi verified functions for this library.

            xv6-riscv Key Features

            No Key Features are available at this moment for xv6-riscv.

            xv6-riscv Examples and Code Snippets

            No Code Snippets are available at this moment for xv6-riscv.

            Community Discussions

            QUESTION

            syscall assembly in ser/usys.S for the xv6 os
            Asked 2021-Dec-22 at 19:20

            In the user/usys.S here a fragment which is generate by the usys.pl script

            ...

            ANSWER

            Answered 2021-Dec-22 at 19:20

            Let's just talk about sleep. In one of your earlier questions, you posted a link to the user.h header file. That header file tells your C compiler what arguments the function takes and what the function returns, on this line:

            Source https://stackoverflow.com/questions/70453897

            QUESTION

            Use of __attribute__((noreturn)) for the exit function declaration in 'user.h' of the xv6 source code?
            Asked 2021-Dec-21 at 18:52

            In the user.h

            https://github.com/mit-pdos/xv6-riscv/blob/a1da53a5a12e21b44a2c79d962a437fa2107627c/user/user.h#L6

            exit is only syscall defined this way int exit(int) __attribute__((noreturn)); why this is needed for the exit function declaration?

            ...

            ANSWER

            Answered 2021-Dec-21 at 18:50

            I don't think the noreturn attribute is strictly required, but it helps.

            The noreturn attribute tells the compiler that the exit function will never return. In theory, this allows the compiler to better understand the possible code paths of any code that calls exit, so it can display more accurate warnings and optimize the code better.

            Source https://stackoverflow.com/questions/70440257

            QUESTION

            What is the use of stat.h in cat.c file of the xv6 os?
            Asked 2021-Dec-19 at 13:38

            What is the use of the stat.h header in cat.c?

            Here you have the cat.c

            https://github.com/mit-pdos/xv6-riscv/blob/riscv/user/cat.c

            Here you have the stat.h

            https://github.com/mit-pdos/xv6-riscv/blob/riscv/kernel/stat.h

            I do not see any direct use of the stat struct in the cat.c so I wonder if there is an indirect one.

            ...

            ANSWER

            Answered 2021-Dec-19 at 13:38

            It was added in this commit probably because user.h uses the struct stat * datatype

            Source https://stackoverflow.com/questions/70410572

            QUESTION

            I can't understand this line of code in xv6
            Asked 2021-Jun-04 at 13:21

            Despite consulting the documentation, I still can't understand this line:swtch(&c->scheduler, &p->context);.

            My question: I know this line is to switch p->context, including save registers and restore registers, but I can't understand the pc change in this process, that is what execution order of this code? After theswtch(&c->scheduler, &p->context); is executed, is it immedidate to execute c->proc = 0;, then the effect of executing c->proc=p; disappears? I am confused now.

            code link: https://github.com/mit-pdos/xv6-riscv/blob/riscv/kernel/proc.c line 456

            ...

            ANSWER

            Answered 2021-Jun-04 at 13:21

            This is literally the code that was so confusing that its original authors wrote "You are not expected to understand this" in the comments, so don't feel bad for not understanding it.

            The key thing you may have missed is that p->context contains an address where swtch is to resume execution of process p. It's set up, for instance, here:

            Source https://stackoverflow.com/questions/67836212

            QUESTION

            make qemu on xv6-riscv gets stucked at qemu-system-riscv64 ... command
            Asked 2021-Mar-20 at 06:47

            On Ubuntu 20.04, I installed the xv6 project using the page Tools Used in 6.828

            ...

            ANSWER

            Answered 2021-Mar-20 at 06:47

            This has been mentioned in Tools Used in 6.S081

            At this moment in time, it seems that the package qemu-system-misc has received an update that breaks its compatibility with our kernel. If you run make qemu and the script appears to hang after

            Source https://stackoverflow.com/questions/66390948

            QUESTION

            How to implement sleep utility in RISC-V?
            Asked 2020-Aug-04 at 08:17

            I want to implement sleep utility that receives number of seconds as an input and pauses for given seconds on a educatational xv6 operation system that runs on risc-v processors.

            The OS already have system call that get number of ticks and pauses: https://github.com/mit-pdos/xv6-riscv/blob/riscv/kernel/sysproc.c#L56

            Timers are initialized using a timer vector: https://github.com/mit-pdos/xv6-riscv/blob/riscv/kernel/kernelvec.S#L93 The timer vector is initialized with CLINT_MTIMECMP function that tells timer controller when to wake the next interrupt.

            What I do not understand is how to know the time between the ticks and how many ticks are done during 1 second.

            ...

            ANSWER

            Answered 2020-Aug-04 at 08:17

            Edit: A quick google of "qemu timebase riscv mtime" found a google groups chat which states that RDTIME is nanoseconds since boot and mtime is an emulated 10Mhz clock.

            I haven't done a search to find the information you need, but I think I have some contextual information that would help you find it. I would recommend searching QEMU documentation / code (probably from Github search)for how mtime and mtimecmp work.

            In section 10.1 (Counter - Base Counter and Timers) of specification1, it is explained that the RDTIME psuedo-instruction should have some fixed tick rate that can be determined based on the implementation 2. That tick rate would also be shared for mtimecmp and mtime as defined in the privileged specification 3.

            I would presume the ticks used be the sleep system call would be the same as these ticks from the specifications. In that case, xv6 is just a kernel and wouldn't then define how many ticks/second there are. It seems that xv6 is made to run on top of qemu so the definition of ticks/second should be defined somewhere in the qemu code and might be documented.

            From the old wiki for QEMU-riscv it should be clear that the SiFive CLINT defines the features xv6 needs to work, but I doubt that it specifies how to know the tickrate. Spike also supports the CLINT interface so it may also be instructive to search for the code in spike that handles it.

            1 I used version 20191213 of the unprivileged specification as a reference

            2

            The RDTIME pseudoinstruction reads the low XLEN bits of the time CSR, which counts wall-clock real time that has passed from an arbitrary start time in the past. RDTIMEH is an RV32I-only in- struction that reads bits 63–32 of the same real-time counter. The underlying 64-bit counter should never overflow in practice. The execution environment should provide a means of determining the period of the real-time counter (seconds/tick). The period must be constant. The real-time clocks of all harts in a single user application should be synchronized to within one tick of the real-time clock. The environment should provide a means to determine the accuracy of the clock.

            3

            3.1.10 Machine Timer Registers (mtime and mtimecmp) Platforms provide a real-time counter, exposed as a memory-mapped machine-mode read-write register, mtime. mtime must run at constant frequency, and the platform must provide a mechanism for determining the timebase of mtime.

            Source https://stackoverflow.com/questions/63207142

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install xv6-riscv

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/mit-pdos/xv6-riscv.git

          • CLI

            gh repo clone mit-pdos/xv6-riscv

          • sshUrl

            git@github.com:mit-pdos/xv6-riscv.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link