Code Monkey home page Code Monkey logo

baremetal-riscv-renode's Introduction

Development

https://blog.y2kbugger.com/baremetal-riscv-renode-1.html

After building toolschains, open VSCode to a subfolder project

Toolchains

Toolchain submodules will not auto-update. You must manually checkout an updated version and rebuild the toolchain.

make clean-deep
make toolchain

Running

Change into one of the example directory and activate the toolchain.

cd 1_blinky
source ../activate-toolchains.sh

Then in separate terminals start the tty watcher

make uart-poll

and start the simulation

make start

Debugging

Then in 3 separate terminals start the tty watcher

make uart-poll

and start the simulation

make start

and then start the debugger

make debug

Help

For all information on all makefile targets run

make help

baremetal-riscv-renode's People

Contributors

y2kbugger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

baremetal-riscv-renode's Issues

Renode crashes after running helloworld

Hi Zak,
I was just exploring the kos on renode as you explained in your articles.

After setting everything up, i was able to get "kos>" shell and execute commands.

"?" worked fine, but when i enter "h", it prints "Hello world" and then renode crashes. I checked again and again, its crashing every time for "h" and "e", AFTER printing outputs.

Probable fix:

After digging a little deep, i saw that in the switch case of handle_interrupt() in baremetal.c, only case 4 (yield) has schedule and clear timer called, when i change the code to add those in case 3 (exit) like BELOW , "h" and "e" commands seem to work fine.

void handle_interrupt()
{
...
switch (syscall_no) {
case 2: // stop
current_process->status = Stopped;
break;
case 3: // exit
current_process->status = Dead;
schedule_processes();
clear_timer();
break;
case 4: // yield
current_process->status = Ready;
schedule_processes();
clear_timer();
break;
...
}

I don't know what exactly is the real source of the bug. Please check. Thanks for the articles and this repo.

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.