Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _posts/2019-03-10-riscv-from-scratch-1.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ In this first post, we'll talk a little bit about what RISC-V is and why it's im

RISC-V is an open-source, free-to-use ISA that began as a project at UC-Berkeley in 2010. The free-to-use aspect has been instrumental in its success and is quite a stark contrast to many other architectures. Take ARM for example - in order to create an ARM-compatible processor, you must pay an upfront fee of [$1M - $10M as well as a 0.5% - 2% royalty fee per-chip](https://www.anandtech.com/show/7112/the-arm-diaries-part-1-how-arms-business-model-works/2). This free and open model makes RISC-V an attractive option to many groups of people - hardware startups who can't foot the bill to create an ARM or other licensing-required processor, academic institutions, and (obviously) the open-source community.

RISC-V's meteoric rise in popularity hasn't gone unnoticed. [ARM launched a now-taken down website](https://abopen.com/news/rattled-arm-launches-anti-risc-v-marketing-campaign/) that attempted (rather unsuccessfully) to highlight supposed benefits of ARM over RISC-V. RISC-V is backed by [a ton of major companies](https://riscv.org/members-at-a-glance/), including Google, Nvidia, and Western Digital.
RISC-V's meteoric rise in popularity hasn't gone unnoticed. [ARM launched a now-taken down website](https://abopen.com/news/rattled-arm-launches-anti-risc-v-marketing-campaign/) that attempted (rather unsuccessfully) to highlight supposed benefits of ARM over RISC-V. RISC-V is backed by [a ton of major companies](https://riscv.org/membership/members/), including Google, Nvidia, and Western Digital.

### QEMU and RISC-V toolchain setup

Expand Down
2 changes: 1 addition & 1 deletion _posts/2019-04-27-riscv-from-scratch-2.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ Well, since the default `crt0` isn't doing what we need it to, we have one obvio

Fortunately for us, we are far from the first to ask this question, and a good solution exists. GNU's linking program, `ld`, [provides a way for us to define a symbol](https://web.archive.org/web/20190525173911/https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/assignments.html) which would be accessible from our `crt0`. We can use this, among other functions provided by `ld`, to create a `__stack_top` symbol definition that is reasonably flexible across multiple different CPUs.

Rather than writing our own linker file from scratch, it is going to make more sense to take the default linker script that `ld` uses and modify it slightly to expose any additional symbols we want. What is a linker script, you might be wondering? [This snippet summarizes it well:](http://www.scoberlin.de/content/media/http/informatik/gcc_docs/ld_3.html)
Rather than writing our own linker file from scratch, it is going to make more sense to take the default linker script that `ld` uses and modify it slightly to expose any additional symbols we want. What is a linker script, you might be wondering? This snippet from a [now dead link](https://scgberlin.de/content/media/http/informatik/gcc_docs/ld_3.html) summarizes it well:

> The main purpose of the linker script is to describe how the sections in the input files should be mapped into the output file, and to control the memory layout of the output file.

Expand Down