Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RISC-V Instruction Set Architecture Support #128

Open
IBPX opened this issue Jul 8, 2017 · 3 comments
Open

RISC-V Instruction Set Architecture Support #128

IBPX opened this issue Jul 8, 2017 · 3 comments

Comments

@IBPX
Copy link
Contributor

IBPX commented Jul 8, 2017

Would it be possible to support RISC-V in the future?

GCC has support for RISC-V beginning in version 7.1.

@ccstevens
Copy link
Collaborator

Yes, porting to the RISC-V architecture should be possible. At a glance, it looks to be fairly new - lacking a standard supervisor-mode instruction set. Is this correct? It appears that Linux, FreeBSD, NetBSD, and Fedora have added support for RISC-V, so there must be enough documentation to get going.

That said, porting to a new architecture is a large task, starting with getting the third-party tool chain set up to cross compile. We're still on GCC 6.3.0, but it's nice that GCC 7.1 has support. Upgrading GCC would be the first step. Then comes writing the disassembler for the Minoca debugger to allow you to debug the boot process. It also looks like there is QEMU support for RISC-V, which may make getting over the initial boot hurdle easier.

Do you have a RISC-V platform in mind? Any interest in tackling the port yourself? The previous paragraph is fair warning that it's not a one weekend project, but it would be fun.

@IBPX
Copy link
Contributor Author

IBPX commented Jul 9, 2017

At a glance, it looks to be fairly new - lacking a standard supervisor-mode instruction set. Is this correct?

Yes. I believe the supervisor-mode instruction set is currently in the draft stage, while most of the rest of the ISA is standardized.

I do not have a specific platform in mind; RISC-V is very young, and as far as I can tell there are only a handful of chips being made so far.

I would like to work on this, but I believe it is beyond my abilities, and my knowledge of C is very limited. I will definitely be poking around though, and perhaps I will find it easier than expected.

@ccstevens
Copy link
Collaborator

Thanks for the added information. If you do start poking around, don't hesitate to ask questions.

If you get to disassembler, the main code is in disasm.c and branches out to the various architectures - armdis.c, x86dis.c, etc. You'd want to add a riscvdis.c file.

IBPX added a commit to IBPX/os that referenced this issue Oct 3, 2017
evangreen pushed a commit that referenced this issue Oct 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants