Linux/RISC-V installation

119 views
Skip to first unread message

J Osmany

unread,
Mar 7, 2016, 12:14:39 PM3/7/16
to sw-...@groups.riscv.org

Hello


I have been trying the get the RISC-V tools installed on my Linux work environment. I have followed the tutorial @ https://github.com/riscv/riscv-tools


After  quite a few iterations i have mixed fortunes and just wanted to get a sanity check.


1. Finally managed to get the basic-build.sh script to complete.

Am i correct in thinking that i have now successfully installed a) riscv-fesvr and b)riscv-isa-sim tools ?


If so, can i execute the simple hello_world.c code and run it on riscv-isa-sim tool? If not, what other tools do i need installed to achive this?


2. Assuming i have Verilog code for a RISC-V implementation, i can simulate that Verilog code using any Verilog simulator. How can i simulate the Verilog implementation on riscv-isa-sim-tool?


3. After the success of running basic-build.sh script, i proceed to build "riscv64-unknown-linux-gnu-gcc" by running the "make linux" command. This currently fails with the following message:



configure: error: GNU libc requires kernel header files from
Linux 2.6.32 or later to be installed before configuring.
The kernel header files are found usually in /usr/include/asm and
/usr/include/linux; make sure these directories use files from
Linux 2.6.32 or later.  This check uses <linux/version.h>, so
make sure that file was built correctly when installing the kernel header
files.  To use kernel headers not from /usr/include/linux, use the
configure option --with-headers.
make: *** [stamps/build-glibc-linux64] Error 1



I am trying to understand the error message and try to make progress.



Assuming i finally get this "make linux" command to complete okay, what will i have achieved? What has been generated? What things will i be able to do after that?



Apologies if the above questions are very basic, but i am a HW person and this stuff is quite new to me.


Best Regards


JO



Masanori Ogino

unread,
Mar 7, 2016, 5:26:45 PM3/7/16
to J Osmany, sw-...@groups.riscv.org
Hello,

2016-03-08 2:14 GMT+09:00 J Osmany <liv...@hotmail.co.uk>:
> 1. Finally managed to get the basic-build.sh script to complete.
>
> Am i correct in thinking that i have now successfully installed a)
> riscv-fesvr and b)riscv-isa-sim tools ?

Yes.

> If so, can i execute the simple hello_world.c code and run it on
> riscv-isa-sim tool? If not, what other tools do i need installed to achive
> this?

You will need a C toolchain for "bare-metal" (I mean, without any OS)
RISC-V programs to compile, and you will need `pk` program to execute.
Both of the tools will be built with the build.sh script included in
riscv-tools and it builds riscv-fesvr and riscv-isa-sim too.

> 2. Assuming i have Verilog code for a RISC-V implementation, i can simulate
> that Verilog code using any Verilog simulator. How can i simulate the
> Verilog implementation on riscv-isa-sim-tool?

No, you can't. riscv-isa-sim is a simulator of RISC-V processors, not
a RTL (nor gate-level) simulator for RISC-V processors written in HDL.

> 3. After the success of running basic-build.sh script, i proceed to build
> "riscv64-unknown-linux-gnu-gcc" by running the "make linux" command. This
> currently fails with the following message:
>
>
>
> configure: error: GNU libc requires kernel header files from
> Linux 2.6.32 or later to be installed before configuring.
> The kernel header files are found usually in /usr/include/asm and
> /usr/include/linux; make sure these directories use files from
> Linux 2.6.32 or later. This check uses <linux/version.h>, so
> make sure that file was built correctly when installing the kernel header
> files. To use kernel headers not from /usr/include/linux, use the
> configure option --with-headers.
> make: *** [stamps/build-glibc-linux64] Error 1

Could you see any .h files in the ${RISCV}/usr/include/linux directory?
It seems that installation of linux header in an earlier stage of
`make linux` has been failed.

> Assuming i finally get this "make linux" command to complete okay, what will
> i have achieved? What has been generated? What things will i be able to do
> after that?

Then you will get a C toolchain for Linux on RISC-V, so you will be
able to compile a Linux program running on RISC-V.

--
Masanori Ogino

J Osmany

unread,
Mar 8, 2016, 2:08:30 AM3/8/16
to Masanori Ogino, sw-...@groups.riscv.org
Thanks for the clarification.

Best Regards

JO

________________________________________
From: masano...@gmail.com <masano...@gmail.com> on behalf of Masanori Ogino <masanor...@gmail.com>
Sent: 07 March 2016 22:26
To: J Osmany
Cc: sw-...@groups.riscv.org
Subject: Re: [sw-dev] Linux/RISC-V installation
Reply all
Reply to author
Forward
0 new messages