From c02e05d4077f5d9f8a0c27de2e9cd0d4abb013bd Mon Sep 17 00:00:00 2001 From: Vojtech Horky Date: Fri, 27 Sep 2024 10:15:09 +0200 Subject: [PATCH] Doc: toolchain installation as a separate page --- doc/tutorial/index.rst | 1 + doc/tutorial/mini-kernel.rst | 46 ++++---------------------------- doc/tutorial/toolchain.rst | 51 ++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 41 deletions(-) create mode 100644 doc/tutorial/toolchain.rst diff --git a/doc/tutorial/index.rst b/doc/tutorial/index.rst index e145dad..f63a53c 100644 --- a/doc/tutorial/index.rst +++ b/doc/tutorial/index.rst @@ -16,5 +16,6 @@ not yet installed MSIM. :maxdepth: 1 interactive-mode + toolchain mini-kernel riscv-virtual-memory diff --git a/doc/tutorial/mini-kernel.rst b/doc/tutorial/mini-kernel.rst index 787ed72..3646229 100644 --- a/doc/tutorial/mini-kernel.rst +++ b/doc/tutorial/mini-kernel.rst @@ -14,47 +14,11 @@ a source code of small kernel that you can play with. Toolchain setup --------------- -Because probably you do not run on a MIPS or a RISC-V machine, you will need -a so-called cross-compiler. That is compiler that produces code for -a different architecture (platform) that the one we are compiling on. -Some compilers provide this feature in their base installation, for some one -needs to build the compiler with special configuration options. - -We will use the standard GNU toolchain (GCC and binutils) compiler for -MIPS and RISC-V in this tutorial. - -Cross-compiler is not a standard package available on all machines. We can -either compile it from sources or find a special package for our distribution. - -If you happen to use some RPM-based distribution, we provide cross-compiler -toolchain in our -`COPR repository `__. -The packages are built based on -`these SPEC files `__. - -With a properly setup system, the following should install all the required -tools. - -.. code-block:: shell - - # You might already have these - dnf install make gcc git - # Probably not needed if you use COPR already - dnf install dnf-plugins-core - # Enable our repository - dnf copr enable d3s/main - # Install toolchain for MIPS - dnf install mffd3s-binutils-mipsel-linux-gnu mffd3s-gcc-mipsel-linux-gnu - # Install toolchain for RISC-V - dnf install mffd3s-binutils-riscv32-unknown-elf mffd3s-gcc-riscv32-unknown-elf - # Install MSIM - dnf install msim - -We also provide a script to -`build the toolchain from sources `__ -and also a set of -`Docker images `__ -(based on Fedora and using the COPR repository mentioned above). +We expect that you have a cross-compiler toolchain already installed so +that you can try the examples yourself. + +Please, refer to our `instructions `__ if you need help with +installing a toolchain. Once you have your toolchain ready, we can dive into kernel code for real :-). diff --git a/doc/tutorial/toolchain.rst b/doc/tutorial/toolchain.rst new file mode 100644 index 0000000..bb42eb8 --- /dev/null +++ b/doc/tutorial/toolchain.rst @@ -0,0 +1,51 @@ +Cross-compiler toolchain setup +============================== + +This page describes how to install the toolchain (i.e., compiler, linker and +other utilities) to be able to compile for MIPS or RISC-V architecture. +That is needed if we want to run our own code in MSIM. +It is not required if we want to play with binary images only +(e.g. we can get a plug-and-play +`image of HelenOS for MSIM `__ that way). + +Because we do not run on a MIPS or a RISC-V machine, we will need +a so-called cross-compiler. That is compiler that produces code for +a different architecture (platform) that the one we are compiling on. +Some compilers provide this feature in their base installation, for some one +needs to build the compiler with special configuration options. + +We will use the standard GNU toolchain (GCC and binutils) compiler for +MIPS and RISC-V in our tutorials. + +Cross-compiler is not a standard package available on all machines. We can +either compile it from sources or find a special package for our distribution. + +If you happen to use some RPM-based distribution, we provide cross-compiler +toolchain in our +`COPR repository `__. +The packages are built based on +`these SPEC files `__. + +With a properly setup system, the following should install all the required +tools. + +.. code-block:: shell + + # You might already have these + dnf install make gcc git + # Probably not needed if you use COPR already + dnf install dnf-plugins-core + # Enable our repository + dnf copr enable d3s/main + # Install toolchain for MIPS + dnf install mffd3s-binutils-mipsel-linux-gnu mffd3s-gcc-mipsel-linux-gnu + # Install toolchain for RISC-V + dnf install mffd3s-binutils-riscv32-unknown-elf mffd3s-gcc-riscv32-unknown-elf + # Install MSIM + dnf install msim + +We also provide a script to +`build the toolchain from sources `__ +and also a set of +`Docker images `__ +(based on Fedora and using the COPR repository mentioned above).