인프런 영문 브랜드 로고
인프런 영문 브랜드 로고
NEW
Hardware

/

Embedded IoT

RISC-V Architecture Through Debugging - Part 2

This book explains the core concepts and practical tips of RISC-V, the latest open-source CPU architecture, in an easy and detailed manner.

27 students are taking this course

cpu-architecture
cpu
riscv

This course is prepared for Basic Learners.

What you will learn!

  • I can confidently answer and explain questions related to RISC-V in a technical interview.

  • You can learn the operating principles of exceptions, interrupt controllers, and calling conventions, which are core functions of RISC-V.

  • You can use the TRACE32 simulator program to practice debugging features such as Exception, Interrupt Controller, and Calling Convention.

  • You can find out how the RISC-V architecture is utilized in operating system kernels such as the Linux kernel.

  • I can analyze the startup code of bootloaders or Linux kernels running on RISC-V.

In the modern systems software industry
The Emerging RISC-V Architecture

Recently, the RISC-V architecture, an open source-based CPU architecture, is on the rise. If you look at IT-related media articles or news, you can immediately see the following:

  • Big tech companies like nVidia, Intel, and Qualcomm are developing RISC-V-based products (chipsets).

  • The number of startup companies designing various chips using RISC-V in Korea is increasing, and the proportion of products developed based on RISC-V devices is increasing.

  • When designing AI semiconductors, RISC-V-based CPU architecture is widely used.

  • 15 billion devices are expected to be RISC-V-based by 2026.

  • In the graduate school (processor design), various studies are being conducted using a toolkit that can design RISC-V CPUs.

Embedded and system software companies are increasingly developing products using RISC-V CPU architectures, so job seekers need to prepare for RISC-V during technical interviews.

Background on creating the lecture

For beginners, the RISC-V architecture is difficult to learn. Here are some reasons why:

  • I don't know what is important among the vast content that makes up RISC-V.

  • I don't know which functions of RISC-V are used in real projects.

  • No matter how hard you read the RISC-V specification document, it is difficult to understand it right away.


  • It is difficult to know what the term itself that describes RISC-V means.


Compared to the Arm architecture, there is not enough information on the RISC-V architecture, and there is a lack of information that specifically and easily explains RISC-V. I created this lecture to help system software developers, including new developers, overcome the difficulties they face when learning RISC-V.

Key differentiating points of the lecture

1. Debugging RISC-V architecture with TRACE32 simulator program (educational use)

What is the shortcut to learning RISC-V architecture (registers, assembly instructions, privileged mode)? It is through hands-on debugging practice.

By taking this course, you can download the educational TRACE32 simulator program from 'Inflearn lecture materials' and use the TRACE32 simulator program to practice registers, assembly instructions, and privilege mode of the RISC-V architecture.

For reference, the TRACE32 debugger and related programs are widely used throughout system software development. The TRACE32 program requires a license to run.

2. Provide five kernel memory dumps extracted from the RISC-V board.

The most important ability required in the process of developing system software is problem solving ability. Among these, the ability to analyze and solve crash problems is the most required. In this lecture, we will debug five kernel crash memory dumps extracted from Vision-Five 2, one of the most popular RISC-V boards, and practice debugging exceptions and calling conventions. Those who take the lecture can download the five memory dumps along with the TRACE32 program and debug exceptions and calling conventions themselves.

3. Select key contents and explain them easily.

Beginners often first obtain and analyze reference documents when learning RISC-V, but it is difficult for beginners to get a sense of which RISC-V content to learn first. This is because it is difficult to know what to learn well first. In this lecture, we will carefully select and explain the content that can be applied in practice and must be well-known. For example, we will open memory dumps and kernel logs received from RISC-V-based devices and explain registers and assembly instructions in an easy and detailed manner.

4. Explain with specific examples along with software and stack.

RISC-V is mostly learned by those who want to do well in system software development or to enter this field. In this lecture, we will explain various examples of how RISC-V is utilized in real-world projects.

  • How software runs on RISC-V systems

  • What is the boot process in a RISC-V system?

  • How to Debug and Reverse on RISC-V Systems

By taking this course, you can quickly and naturally acquire a practical feel for the content of the RISC-V architecture.

5. Explain RISC-V compared to Arm architecture

Looking at the ecosystem of the system software industry, the ecosystem of the embedded and chipset industry will be centered around the Arm architecture until 2024. Many system software developers are familiar with the Arm processor or Arm architecture. In this lecture, we will explain the core concepts of RSIC-V along with the Arm architecture.

  • Types of exceptions and how to handle them

  • Structure and processing method of interrupt controller

  • How Calling Conventions are Handled (Registers Used and Related Assembly Instructions)

The educator is the author of a book on Arm architecture, and is better able to explain RISC-V compared to the Arm architecture than anyone else.

Learn about these things 📕

It explains the basic concepts of exceptions in detail and provides an easy-to-understand explanation of the core features of exceptions defined in the RISC-V architecture.

Describes the execution flow of exceptions, a core feature of the RISC-V architecture. It also explains in detail how exceptions are handled in a system consisting of machine mode and user mode.

Describes the exception codes that indicate the cause of the exception as defined in the RISC-V architecture, and also explains the flow of exception handling with memory abort.

From a software development perspective, it details the execution flow when exceptions and crashes occur.

It explains the flow of exceptions by analyzing assembly instructions line by line. It also explains how exceptions are handled on the stack when they occur.

Practice exceptions by executing assembly instructions with the T32 debugging practice program. It explains in detail which CSR (scause, mcause) registers are changed when an exception is triggered.

We will explain in detail the exception handler processed in the Linux kernel while practicing causing an exception with the TRACE32 program.

By analyzing a memory dump obtained from a RISC-V based board, we explain how exceptions work in the RISC-V architecture: analyze the kernel log, analyze the call stack.

We will practice debugging page tables using the TRACE32 program. This will help us to understand specifically what caused the exception.

Describes the basic operation of the interrupt controller defined in the RISC-V architecture. Explains the structure of PLIC and CLIC in an easy-to-understand manner.

We review exception codes related to interrupts and explain the structure of the Platform Level Interrupt Controller (PLIC).

Describes the core hardware components that make up a PLIC and provides an easy-to-understand explanation of the CSR registers that control the PLIC.

We will explain the Calling Convention introduced in the RISC-V architecture and review the registers that support the Calling Convention.

Explains the big picture of how arguments passed to a function are processed.

Analyze assembly instructions that support the calling convention of RISC-V architecture. Also analyze example assembly instructions - c.sdsp instruction analysis.

Analyze assembly instructions that support the calling convention of the RISC-V architecture. Also analyze example assembly instructions - c.ldsp instruction analysis.

Analyze assembly instructions that support the calling convention of the RISC-V architecture. Also analyze example assembly instructions - c.ldsp instruction analysis.


We will go through a hands-on exercise to restore a broken call stack using TRACE32 debugging.


In this TRACE32 debugging exercise, we will analyze a memory dump caused by a stack overflow.


Based on my experience writing books and giving lectures
More in-depth and detailed than anyone else!

The author of the unprecedented 'Arm Architecture (Armv8-A, Armv7-A)' and 'Linux Kernel' books in the domestic system software field. He is also a working developer who knows the latest system software trends (electric vehicles, system semiconductors - system software) the best, and an educator who is most active in spreading knowledge in the system software field.

  • Author of 'Structure and Principles of Arm Architecture for System Software Development' ( 2024, Korean Academy of Sciences Outstanding Book Award )

  • Author of 'Learning the Structure and Principles of the Linux Kernel through Debugging' ( 2021, Korean Academy of Sciences Outstanding Book Award )

  • 'Programmers Dev Course: Linux System and Kernel Expert' Main Instructor

  • June 2022, Korea Computer Conference (KCC2022) - Tutorial presentation [Conquering the Linux Kernel using ftrace]

  • LG Electronics 'Linux Kernel' and 'Armv8 Architecture' In-house Instructor ( including domestic and overseas developers ) - (2020~2024)

Recommended for
these people!

Who is this course right for?

  • Junior developer looking to build expertise in system software, including system semiconductors (fabless) and electric vehicle fields (autonomous driving, infotainment).

  • A job seeker who wants to develop system software in the fields of system semiconductors (fabless) and electric vehicles.

  • System software developers (system semiconductors, electric vehicles) who want to know how to debug in practice by utilizing the features of the RISC-V architecture.

  • A developer from another field looking to transition their career into system software.

  • A college student aiming to go to graduate school in the field of system software (memory, file system, operating system).

Need to know before starting?

  • Computer Architecture

  • C language

  • Operating system

Hello
This is

4,740

Students

93

Reviews

75

Answers

4.9

Rating

19

Courses

국내 시스템 소프트웨어 분야에서 전무후무한! 'Arm 아키텍처(Armv8-A, Armv7-A)'와 '리눅스 커널' 책을 쓴 저자(2권의 책 모두 대한민국 학술원 우수도서에 선정)이며, 최신 시스템 소프트웨어 트렌드(전기자동차, 시스템 반도체- 시스템 소프트웨어)를 가장 잘 알고 있는 현업 개발자입니다. 또한 시스템 소프트웨어 분야에서 가장 지식 전파 활동을 활발하게 하는 교육자입니다. 

  • '시스템 소프트웨어 개발을 위한 Arm 아키텍처의 구조와 원리'(2024년, 대한민국 학술원 우수도서상) 저자

  • '디버깅을 통해 배우는 리눅스 커널의 구조와 원리' (2021년, 대한민국 학술원 우수도서상) 저자

  • '프로그래머스 데브 코스: 리눅스 시스템 및 커널 전문가' 메인 강사

  • 2022년 6월, 한국컴퓨터종합학술대회 (KCC2022) - 튜토리얼 발표 [ftrace를 이용해 리눅스 커널 정복하기]

  • LG전자 '리눅스 커널' 및 'Armv8 아키텍처' 사내 강사(국내 및 해외 개발자 포함) - (2020년~현재)

국내에서 어느 누구보다 리눅스 커널과 Arm 아키텍처(Armv8-A, Armv7-A)를 잘 설명할 수 있는 교육자라고 자신있게 말씀드릴 수 있습니다.

주요 로드맵 🎯

'시스템 소프트웨어 개발자를 위한 Arm - basic course'

'시스템 소프트웨어 개발자를 위한 Arm - advanced course'

 

시스템 소프트웨어 개발자를 위한 Linux kernel - basic course

체계적으로 Arm 아키텍처(Armv8-A, Armv7-A)와 리눅스 커널을 배우시려는 분은 로드맵(전체 강의 30% 할인)을 활용하시면 좋습니다.

Curriculum

All

86 lectures ∙ (11hr 2min)

Course Materials:

Lecture resources
Published: 
Last updated: 

Reviews

Not enough reviews.
Become the author of a review that helps everyone!