How can i download the spike simulator for RISC-V in ubuntu? - riscv

I am new to RISC-V and i need the spike simulator for performance analysis of my c code. But i am not sure how to download the simulator on ubuntu.
Help will be much appreciated!!
Thank you.

you can get it via run next command in console:
git clone git#github.com:riscv/riscv-isa-sim.git, when you stay in desired dir.
How to build it please read on page of repository:
https://github.com/riscv/riscv-isa-sim
Also before you start i can advice you to read these documents:
Volume I: User-Level ISA,
Volume II: Privileged Architecture
Here: https://github.com/riscv/riscv-isa-manual
All you need to start you can find here:
https://github.com/riscv/riscv-tools - programming tools.
https://github.com/ucb-bar/chipyard - verilog code generators and simulators.

Related

How to compile the Linux kernel to be as small as possible?

I'm working on a side project which requires me to configure and compile a tiny Linux System based on Ubuntu.
The result should be a tiny OS with the following features:
A Bootloader
A Kernel
A Process
A Thread
Miscellaneous (if possible)
A File System
Virtual memory
A Console
I read lots of documents about it, one of them being: http://users.cecs.anu.edu.au/~okeefe/p2b/buildMin/buildMin.html#toc3
I deleted the file system, and recompiled the kernel using make xconfig. I tried to deactivate modules and configurations many times, but it's not working for me.
How can I configure the kernel for the OS with only the features I listed above? What options can I disable or enable while still having a working system?
Having the Kernel very small is not important for Ubuntu, so maybe choosing Ubuntu is part of your problem. I would use as starting point what OpenWRT does. They do a good work making the Kernel small and it is easy to get started. OpenWrt Buildroot – Usage
try Linux From Scratch. It is a step by step approach on building a minimal Linux system from which you can evolve later on. http://www.linuxfromscratch.org/.
Use Gentoo Linux distribution - it's great for practicing on creation of Linux systems. Gentoo has excellent setup documentation, for example about configuring the kernel.
And Gentoo is a little easier and faster to setup than Linux From Scratch (LFS). If you want to go deeper, then LFS may be a good learning step too.

Getting started with Jetson Tegra K1

After working for a long time on my Arduino Due, I needed a better and more powerful prototyping platform for my future projects. For which, I have placed an order for NVIDIA Jetson Tegra K1 board which runs on linux and supports CUDA based development. Being a newbie to Linux, I have no idea where to start from and what to do for getting started with code execution on the Jetson board. Please suggest the initial steps required and from where can I get familiar to Linux environment...
Thank you
I found eLinux.org's page on Jetson TK1 very helpful. I especially recommend the tutorials.
Search Nvidia site for their resources on Jetson TK1: mailing list, IRC chat, toolchain etc.
https://developer.nvidia.com/linux-tegra-rel-21
and in github there are abundant development source codes:
https://www.google.com.sg/search?num=100&client=ubuntu&hs=AuY&channel=fs&q=site%3Agithub.com+jetson+tk1
And notice that the main CPU is ARM based. And since cross-compilation is done on x86, and so perhaps you must learn all the cross-development knowhow as well.
As a newbie, I think you should first watch some video, read some unboxing experience, and start with GUI installation:
https://www.youtube.com/watch?v=ghqM8pzJZxg
http://jetsonhacks.com/2014/06/29/blog/
https://askubuntu.com/questions/548209/how-can-i-prevent-my-nvidia-jetson-tk1-from-automatically-booting-the-gui-black
https://devtalk.nvidia.com/default/topic/788964/embedded-systems/jetson-tk1-gui-doesn-t-start-properly/
https://devtalk.nvidia.com/default/topic/773182/embedded-systems/jetson-tk1-gui-not-loading-but-booting-properly-/
The "Grinch Kernel" mentioned above is here:
https://devtalk.nvidia.com/default/topic/795734/embedded-systems/-customkernel-the-grinch-21-2-1-for-jetson-tk1/

Working on Linux-How to add a system call from the basics?

I am new to Linux. I want to add a system call to linux. But I don't know from where to begin.Can somebody please guide me through the whole process? From installing Linux to getting the kernel source code. I don't know where will I run or test or write the modified source code. Please help me with that also. I searched online for the linux kernel source code but it is giving me a lot of options of GIT files. What are they? How do I install them?
thank you.
Here are some good tutorials for adding system calls to kernel
http://arvindsraj.wordpress.com/2012/10/05/adding-hello-world-system-call-to-linux/
http://blog.techveda.org/adding-system-calls-linux-kernel-3-5-x/
http://www.cs.rochester.edu/~sandhya/csc256/assignments/adding-a-system-call.html
http://seshagiriprabhu.wordpress.com/2012/11/15/adding-a-simple-system-call-to-the-linux-3-2-0-kernel-from-scratch/
http://appusajeev.wordpress.com/2010/11/13/implementing-a-system-call-in-linux-kernel-2-6-35/
Check this Linux Kernel Module Programming Guide . It gives you brief information on system calls and basic tutorials demonstrating their role in Linux Kernel.

Operating System in Java

We a team of 10 people are set out to build an Operating System for mobiles/tablet from scratch.
I then came by this link awesome-link
which has a load of OS briefed. But we would like to build the OS in Java on top of linux kernel(possible?) .
I would like to know whether the project is feasible and if yes, from where should I start ?
And with all the knowledge and right resources(assume), will it be possible to build an OS with all the mobile functionalities within 6 months?
Any help is much appreciated. Thanks.
But we would like to build the OS in Java on top of linux kernel(possible?)
Yes, what do you think Android is made of (of course it's not just Java + Linux kernel, but both are inside Android)?
I would like to know whether the project is feasible and if yes, from where should I start ?
Ever written an OS? How well do you know Linux kernel APIs? Do you know what's missing from Linux kernel to build a full featured OS? Answer those, they're your starting point.
And with all the knowledge and right resources(assume), will it be possible to build an OS with all the mobile functionalities within 6 months?
"All mobile functionalities" is biased, what is "all"? Be specific.
Please make enough research and planning before you are set out to start such a difficult, yet excellent journey.
Make sure you know what you should do, right from the technologies you are gonna use, the architecture you are planning to establish upon, the pros and cons of all the approach, the issues with the current OS and your idea of correcting those issues.
With a site like SO for your help, it is never a question of feasibility, but you would require the determination and the perseverance to achieve it.
Finally, all the best!!
You have Android build on scaled down Linux Kernel and apk is build through java & sdk manager. So you have the things in your hand, similarly ubuntu touch is also coming. What you can do is to customize things as per your requirements as per your architecture.
For ubuntu touch :- https://wiki.ubuntu.com/Touch/Building
For Your own customized Android:- http://source.android.com/source/index.html
Thanks & Regards,
Alok Thaker

How to start off with a embedded linux development environment

I come from a windows background and i am proficient with the .net platform. For work, i need to bring up a custom embedded system platform. We have bought the pandaboard ES as the test platform. The application is to stream images over the wifi. If you think about it, we are building something similar to a netgear router - the only difference being when you log into the device it serves images.
Because my background is in windows i am not quite sure how to start off with embedded linux development. in reading through various sites i have come to the conclusion that going to linux as development host is the best option.
Can some one point to me in the right direction regarding the set up. I have a windows machine that will be used for development purposes. I can either do a virtual box or setup a partition for linux. But the finer details are what throwing me off..what i need to know is
1) once i install linux what other software do I need - Code blocks,
2) what about toolchain
3) How to debug - through serial port ?
4) Is there a way to send the image built directly to the CF card?
Thanks
i suggest you to install linux on your desktop or laptop, perhaps
In a virtual machine.
Then, learn to compile on the command line (the order of program arguments to gcc is important).
Start an editor like emacs. Take half an hour to follow its tutorial.
Edit the helloworld.c file.
Compile it with
gcc -Wall -g helloworld.c -o hello
Improve it till no warnings are given.
Use
./hello
To run it.
Learn to use make with your own Makefile.
Use a version control system like git.
Learn to use cross compilation tools.
addenda
See also my answer here and also this answer.
Cross-building is not very different from native Linux building, except for the names of the cross-compilation tools.
But my feeling is that installing Linux and learning to develop Linux applications on Linux will teach you a lot of skills necessary for cross-development targeted for embedded Linux systems. So read material about Advanved Linux Programming and Advanced Unix Programming.
Remote debugging thru the serial port should be possible.

Resources