Documentation/Platforms/OpenRISC: Difference between revisions

From QEMU
No edit summary
No edit summary
Line 2: Line 2:
OpenRISC is an open source processor architecture. While instruction sets like x86 are proprietary and owned by a single company, OpenRISC is free. Its main use is as a processor on an embedded system.
OpenRISC is an open source processor architecture. While instruction sets like x86 are proprietary and owned by a single company, OpenRISC is free. Its main use is as a processor on an embedded system.


== Suggested command-line ==
== Full system emulation ==
To boot linux you can run
To boot linux you can run the following.


  qemu-system-or1k -m 1024 -nographic -kernel <kernel file> -net nic,model=opencores_eth -net tap,name=or1k
   qemu-system-or1k -cpu or1200 -M or1k-sim -kernel $LINUX/vmlinux -serial stdio -nographic -monitor none
   qemu-system-or1k -cpu or1200 -M or1k-sim -kernel $LINUX/vmlinux -serial stdio -nographic -monitor none


== Command line for user process ==
== User mode emulation ==


Using qemu linux-user we can run and debug OpenRISC binaries on your host linux.
Using QEMU user mode emulation we can run and debug OpenRISC binaries on your host linux.


   $ cat main.c
   $ cat main.c
Line 24: Line 23:


== Links ==
== Links ==
[https://www.youtube.com/watch?v=dYcxLHf0Ez4 Video introducing OpenRISC]<br>
* [https://www.youtube.com/watch?v=dYcxLHf0Ez4 Video introducing OpenRISC]
[http://openrisc.io/ The OpenRISC project site]<br>
* [http://openrisc.io/ The OpenRISC project site]
[https://github.com/openrisc/doc/blob/master/openrisc-arch-1.1-rev0.pdf?raw=true OpenRISC 1000 specification]<br>
* [https://github.com/openrisc/doc/blob/master/openrisc-arch-1.1-rev0.pdf?raw=true OpenRISC 1000 specification]
* [https://github.com/openrisc/or1k-gcc/releases GCC toolchain releases and binaries]


== Contacts ==
== Contacts ==
Maintainer: [mailto:proljc@gmail.com Jia Liu]
Maintainer: [mailto:proljc@gmail.com Jia Liu]

Revision as of 12:23, 23 February 2017

Description

OpenRISC is an open source processor architecture. While instruction sets like x86 are proprietary and owned by a single company, OpenRISC is free. Its main use is as a processor on an embedded system.

Full system emulation

To boot linux you can run the following.

 qemu-system-or1k -cpu or1200 -M or1k-sim -kernel $LINUX/vmlinux -serial stdio -nographic -monitor none

User mode emulation

Using QEMU user mode emulation we can run and debug OpenRISC binaries on your host linux.

 $ cat main.c
 #include <stdio.h>
 int main() {
    printf ("hello\n");
    return 0;
 }
 $ or1k-linux-musl-gcc main.c
 # Here $LDPATH/lib/ld-musl-or1k.so.1 is linked to or1k-linux-musl/lib/libc.so
 $ qemu-or1k -L $LDPATH ./a.out 
 hello

Links

Contacts

Maintainer: Jia Liu