https://coscup.org/2021/en/session/39M73K
https://www.youtube.com/watch?v=L_Gyvdl_d_k
Engineers have plenty of debug tools for user space programs development, code tracing, debugging and analyzing. Except “printk”, do we have any other debug tools for Linux kernel development? The “KGDB” mentioned in Linux kernel document provides another possibility.
Will share how to experiment with the KGDB in a virtual machine. And, use GDB + OpenOCD + JTAG + Raspberry Pi in the real environment as the demo in this talk.
開發 user space 軟體時,工程師們有方便的 debug 工具進行查找、分析、除錯。但在 Linux kernel 的開發,除了 printk 外,還可以有哪些工具可以使用呢?從 Linux kernel document 可以看到 KGDB 相關的資訊,提供了在 kernel 除錯時的另一個可能性。
本次將分享,從建立最簡單環境的虛擬機機開始,到實際使用 GDB + OpenOCD + JTAG + Raspberry Pi 當作展示範例。
Launch the First Process in Linux SystemJian-Hong Pan
The session: https://coscup.org/2022/en/session/AGCMDJ
After Linux kernel boots, it will try to launch first process “init” in User Space. Then, the system begins the featured journey of the Linux distribution.
This sharing takes Busybox as the example and shows that how does Linux kernel find the “init” which directs to the Busybox. And, what will Busybox do and how to get the console. Try to make it like a simple Linux system.
Before Linux kernel launches “init” process, the file system and storage corresponding drivers/modules must be loaded to find the “init”. Besides, to mount the root file system correctly, the kernel boot command must include the root device and file system format parameters.
On the other hand, the Busybox directed from “init” is a lightweight program, but has rich functions, just like a Swiss Army Knife. So, it is usually used on the simple environment, like embedded Linux system.
This sharing will have a demo on a virtual machine first, then on the Raspberry Pi.
Drafts:
* https://hackmd.io/@starnight/Busbox_as_the_init
* https://hackmd.io/@starnight/Build_Alpines_Root_Filesystem_Bootstrap
Relate idea: https://hackmd.io/@starnight/Systems_init_and_Containers_COMMAND_Dockerfiles_CMD
The conversion of the ARM Linux kernel over to the Device Tree as the mechanism to describe the hardware has been a significant change for ARM kernel developers. Nowadays, all developers porting the Linux kernel on new ARM platforms, either new SOCs or new boards, have to work with the Device Tree. Based on practical examples, this talk intends to provide a ""getting started guide"" for newcomers in the Device Tree world: what is the Device Tree? How is it written and compiled? How do the bootloader and kernel interact? How are Device Tree bindings written and documented? What are the best practices for writing Device Trees and their bindings?
Video available at https://www.youtube.com/watch?v=m_NyYEBxfn8.
Agenda:
In this session, Shmulik Ladkani discusses the kernel's net_device abstraction, its interfaces, and how net-devices interact with the network stack. The talk covers many of the software network devices that exist in the Linux kernel, the functionalities they provide and some interesting use cases.
Speaker:
Shmulik Ladkani is a Tech Lead at Ravello Systems.
Shmulik started his career at Jungo (acquired by NDS/Cisco) implementing residential gateway software, focusing on embedded Linux, Linux kernel, networking and hardware/software integration.
51966 coffees and billions of forwarded packets later, with millions of homes running his software, Shmulik left his position as Jungo’s lead architect and joined Ravello Systems (acquired by Oracle) as tech lead, developing a virtual data center as a cloud service. He's now focused around virtualization systems, network virtualization and SDN.
Launch the First Process in Linux SystemJian-Hong Pan
The session: https://coscup.org/2022/en/session/AGCMDJ
After Linux kernel boots, it will try to launch first process “init” in User Space. Then, the system begins the featured journey of the Linux distribution.
This sharing takes Busybox as the example and shows that how does Linux kernel find the “init” which directs to the Busybox. And, what will Busybox do and how to get the console. Try to make it like a simple Linux system.
Before Linux kernel launches “init” process, the file system and storage corresponding drivers/modules must be loaded to find the “init”. Besides, to mount the root file system correctly, the kernel boot command must include the root device and file system format parameters.
On the other hand, the Busybox directed from “init” is a lightweight program, but has rich functions, just like a Swiss Army Knife. So, it is usually used on the simple environment, like embedded Linux system.
This sharing will have a demo on a virtual machine first, then on the Raspberry Pi.
Drafts:
* https://hackmd.io/@starnight/Busbox_as_the_init
* https://hackmd.io/@starnight/Build_Alpines_Root_Filesystem_Bootstrap
Relate idea: https://hackmd.io/@starnight/Systems_init_and_Containers_COMMAND_Dockerfiles_CMD
The conversion of the ARM Linux kernel over to the Device Tree as the mechanism to describe the hardware has been a significant change for ARM kernel developers. Nowadays, all developers porting the Linux kernel on new ARM platforms, either new SOCs or new boards, have to work with the Device Tree. Based on practical examples, this talk intends to provide a ""getting started guide"" for newcomers in the Device Tree world: what is the Device Tree? How is it written and compiled? How do the bootloader and kernel interact? How are Device Tree bindings written and documented? What are the best practices for writing Device Trees and their bindings?
Video available at https://www.youtube.com/watch?v=m_NyYEBxfn8.
Agenda:
In this session, Shmulik Ladkani discusses the kernel's net_device abstraction, its interfaces, and how net-devices interact with the network stack. The talk covers many of the software network devices that exist in the Linux kernel, the functionalities they provide and some interesting use cases.
Speaker:
Shmulik Ladkani is a Tech Lead at Ravello Systems.
Shmulik started his career at Jungo (acquired by NDS/Cisco) implementing residential gateway software, focusing on embedded Linux, Linux kernel, networking and hardware/software integration.
51966 coffees and billions of forwarded packets later, with millions of homes running his software, Shmulik left his position as Jungo’s lead architect and joined Ravello Systems (acquired by Oracle) as tech lead, developing a virtual data center as a cloud service. He's now focused around virtualization systems, network virtualization and SDN.
Linux offers an extensive selection of programmable and configurable networking components from traditional bridges, encryption, to container optimized layer 2/3 devices, link aggregation, tunneling, several classification and filtering languages all the way up to full SDN components. This talk will provide an overview of many Linux networking components covering the Linux bridge, IPVLAN, MACVLAN, MACVTAP, Bonding/Team, OVS, classification & queueing, tunnel types, hidden routing tricks, IPSec, VTI, VRF and many others.
Talk by Brendan Gregg for USENIX LISA 2019: Linux Systems Performance. Abstract: "
Systems performance is an effective discipline for performance analysis and tuning, and can help you find performance wins for your applications and the kernel. However, most of us are not performance or kernel engineers, and have limited time to study this topic. This talk summarizes the topic for everyone, touring six important areas of Linux systems performance: observability tools, methodologies, benchmarking, profiling, tracing, and tuning. Included are recipes for Linux performance analysis and tuning (using vmstat, mpstat, iostat, etc), overviews of complex areas including profiling (perf_events) and tracing (Ftrace, bcc/BPF, and bpftrace/BPF), and much advice about what is and isn't important to learn. This talk is aimed at everyone: developers, operations, sysadmins, etc, and in any environment running Linux, bare metal or the cloud."
The U-Boot is an "Universal Bootloader" ("Das U-Boot") is a monitor program that is under GPL. This production quality boot-loader is used as default boot loader by several board vendors. It is easily portable and easy to port and to debug by supporting PPC, ARM, MIPS, x86,m68k, NIOS, Microblaze architectures. Here is a presentation that introduces U-Boot.
The Linux Block Layer - Built for Fast StorageKernel TLV
The arrival of flash storage introduced a radical change in performance profiles of direct attached devices. At the time, it was obvious that Linux I/O stack needed to be redesigned in order to support devices capable of millions of IOPs, and with extremely low latency.
In this talk we revisit the changes the Linux block layer in the
last decade or so, that made it what it is today - a performant, scalable, robust and NUMA-aware subsystem. In addition, we cover the new NVMe over Fabrics support in Linux.
Sagi Grimberg
Sagi is Principal Architect and co-founder at LightBits Labs.
This presentation gives an overview of Linux kernel block I/O susbsystem functionality, importance of I/O schedulers in Block layer. It also describes the different types of I/O Schedulers including the Deadline I/O scheduler, Anticipatory I/O Scheduler, Complete Fair queuing I/O scheduler and Noop I/O scheduler.
Have a quick overview of most of the embedded linux components and their details. How ti build Embedded Linux Hardware & Software, and developing Embedded Products
Netronome's half-day tutorial on host data plane acceleration at ACM SIGCOMM 2018 introduced attendees to models for host data plane acceleration and provided an in-depth understanding of SmartNIC deployment models at hyperscale cloud vendors and telecom service providers.
Presenter Bios
Jakub Kicinski is a long term Linux kernel contributor, who has been leading the kernel team at Netronome for the last two years. Jakub’s major contributions include the creation of BPF hardware offload mechanisms in the kernel and bpftool user space utility, as well as work on the Linux kernel side of OVS offload.
David Beckett is a Software Engineer at Netronome with a strong technical background of computer networks including academic research with DDoS. David has expertise in the areas of Linux architecture and computer programming. David has a Masters Degree in Electrical, Electronic Engineering at Queen’s University Belfast and continues as a PhD student studying Emerging Application Layer DDoS threats.
Note: When you view the the slide deck via web browser, the screenshots may be blurred. You can download and view them offline (Screenshots are clear).
USENIX LISA2021 talk by Brendan Gregg (https://www.youtube.com/watch?v=_5Z2AU7QTH4). This talk is a deep dive that describes how BPF (eBPF) works internally on Linux, and dissects some modern performance observability tools. Details covered include the kernel BPF implementation: the verifier, JIT compilation, and the BPF execution environment; the BPF instruction set; different event sources; and how BPF is used by user space, using bpftrace programs as an example. This includes showing how bpftrace is compiled to LLVM IR and then BPF bytecode, and how per-event data and aggregated map data are fetched from the kernel.
Using the new extended Berkley Packet Filter capabilities in Linux to the improve performance of auditing security relevant kernel events around network, file and process actions.
Linux offers an extensive selection of programmable and configurable networking components from traditional bridges, encryption, to container optimized layer 2/3 devices, link aggregation, tunneling, several classification and filtering languages all the way up to full SDN components. This talk will provide an overview of many Linux networking components covering the Linux bridge, IPVLAN, MACVLAN, MACVTAP, Bonding/Team, OVS, classification & queueing, tunnel types, hidden routing tricks, IPSec, VTI, VRF and many others.
Talk by Brendan Gregg for USENIX LISA 2019: Linux Systems Performance. Abstract: "
Systems performance is an effective discipline for performance analysis and tuning, and can help you find performance wins for your applications and the kernel. However, most of us are not performance or kernel engineers, and have limited time to study this topic. This talk summarizes the topic for everyone, touring six important areas of Linux systems performance: observability tools, methodologies, benchmarking, profiling, tracing, and tuning. Included are recipes for Linux performance analysis and tuning (using vmstat, mpstat, iostat, etc), overviews of complex areas including profiling (perf_events) and tracing (Ftrace, bcc/BPF, and bpftrace/BPF), and much advice about what is and isn't important to learn. This talk is aimed at everyone: developers, operations, sysadmins, etc, and in any environment running Linux, bare metal or the cloud."
The U-Boot is an "Universal Bootloader" ("Das U-Boot") is a monitor program that is under GPL. This production quality boot-loader is used as default boot loader by several board vendors. It is easily portable and easy to port and to debug by supporting PPC, ARM, MIPS, x86,m68k, NIOS, Microblaze architectures. Here is a presentation that introduces U-Boot.
The Linux Block Layer - Built for Fast StorageKernel TLV
The arrival of flash storage introduced a radical change in performance profiles of direct attached devices. At the time, it was obvious that Linux I/O stack needed to be redesigned in order to support devices capable of millions of IOPs, and with extremely low latency.
In this talk we revisit the changes the Linux block layer in the
last decade or so, that made it what it is today - a performant, scalable, robust and NUMA-aware subsystem. In addition, we cover the new NVMe over Fabrics support in Linux.
Sagi Grimberg
Sagi is Principal Architect and co-founder at LightBits Labs.
This presentation gives an overview of Linux kernel block I/O susbsystem functionality, importance of I/O schedulers in Block layer. It also describes the different types of I/O Schedulers including the Deadline I/O scheduler, Anticipatory I/O Scheduler, Complete Fair queuing I/O scheduler and Noop I/O scheduler.
Have a quick overview of most of the embedded linux components and their details. How ti build Embedded Linux Hardware & Software, and developing Embedded Products
Netronome's half-day tutorial on host data plane acceleration at ACM SIGCOMM 2018 introduced attendees to models for host data plane acceleration and provided an in-depth understanding of SmartNIC deployment models at hyperscale cloud vendors and telecom service providers.
Presenter Bios
Jakub Kicinski is a long term Linux kernel contributor, who has been leading the kernel team at Netronome for the last two years. Jakub’s major contributions include the creation of BPF hardware offload mechanisms in the kernel and bpftool user space utility, as well as work on the Linux kernel side of OVS offload.
David Beckett is a Software Engineer at Netronome with a strong technical background of computer networks including academic research with DDoS. David has expertise in the areas of Linux architecture and computer programming. David has a Masters Degree in Electrical, Electronic Engineering at Queen’s University Belfast and continues as a PhD student studying Emerging Application Layer DDoS threats.
Note: When you view the the slide deck via web browser, the screenshots may be blurred. You can download and view them offline (Screenshots are clear).
USENIX LISA2021 talk by Brendan Gregg (https://www.youtube.com/watch?v=_5Z2AU7QTH4). This talk is a deep dive that describes how BPF (eBPF) works internally on Linux, and dissects some modern performance observability tools. Details covered include the kernel BPF implementation: the verifier, JIT compilation, and the BPF execution environment; the BPF instruction set; different event sources; and how BPF is used by user space, using bpftrace programs as an example. This includes showing how bpftrace is compiled to LLVM IR and then BPF bytecode, and how per-event data and aggregated map data are fetched from the kernel.
Using the new extended Berkley Packet Filter capabilities in Linux to the improve performance of auditing security relevant kernel events around network, file and process actions.
LAS16-403: GDB Linux Kernel Awareness
Speakers: Peter Griffin
Date: September 29, 2016
★ Session Description ★
The presentation will look at the ways in which GDB can be enhanced when debugging the Linux kernel to give it better knowledge of the underlying operating system to enable a better debugging experience. It will also provide a status of the current work being undertaken in this area by the ST landing team, a demo and potential future work.
★ Resources ★
Etherpad: pad.linaro.org/p/las16-403
Presentations & Videos: http://connect.linaro.org/resource/las16/las16-403/
★ Event Details ★
Linaro Connect Las Vegas 2016 – #LAS16
September 26-30, 2016
http://www.linaro.org
http://connect.linaro.org
Share the Experience of Using Embedded Development BoardJian-Hong Pan
(Including Demo videos at end of the description)
Due to the pandemic in the past few years, lacking chips became one of the reasons that vendors cannot produce products. That affects industry, automotive and IT, etc. In addition, many countries propose new policies/acts which start to investigate the source of products recently. Therefore, keeping the flexibility of the usage of parts to maintain the robustness of productivity and service is an important skill. This talk will list the toolchains & debug tools for common chip architectures and share some development experience.
This talk will share how to use the open source toolchain and debug tools to develop and debug, then flash the program to the ARM Cortex-M development board. The same idea can be used on other chip’s development boards. Will have some examples for ARM Cortex-A and RISC-V 32 & 64 Bits environment. Besides, will share the experience of sending patches to the debug tool and co-working with upstream, too.
Demo Videos:
* Develop with Nuvoton's NuTiny-SDK-NUC472 https://www.youtube.com/watch?v=Yz9uw2_9KS8
* Develop with Longan Nano https://www.youtube.com/watch?v=IFqDM_GLUfo
* Boot Custom Linux Image on Raspberry Pi 4B https://www.youtube.com/watch?v=t3PjTtf5MvU
* Boot Linux on QEMU RISC-V 64 Bits VM https://www.youtube.com/watch?v=8c7zfvJYzSo
* Develop with Arduino Nano https://www.youtube.com/watch?v=sU7X9Q35hhY
Linux Kernel Platform Development: Challenges and InsightsGlobalLogic Ukraine
This presentation is about the main tasks which Linux kernel platform engineers take care of. The talk includes real-life cases which help understand the role of respective specialists and might be helpful to those who consider such change in their careers.
The talk was delivered by Sam Protsenko (Software Engineer, Consultant, GlobalLogic) at GlobalLogic Embedded Career Day #2 on February 10, 2018.
More about GlobalLogic Embedded Career Day #2: https://www.globallogic.com/ua/events/globallogic-kyiv-embedded-career-day-2-materials
Embedded Recipes 2019 - Introduction to JTAG debuggingAnne Nicolas
This talk introduces JTAG debugging capabilities, both for debugging hardware and software. Marek first explains what the JTAG stands for and explains the operation of the JTAG state machine. This is followed by an introduction to free software JTAG tools, OpenOCD and urJTAG. Marek shortly explains how to debug software using those tools and how that ties into the JTAG state machine. However, JTAG was designed for testing hardware. Marek explains what boundary scan testing (BST) is, what are BSDL files and their format, and practically demonstrates how to blink an LED using BST and only free software tools.
Marek Vasut
All about the Linux boot process. Presented at linux.conf.au on January 25, 2018. Video at https://archive.org/details/lca2018-Linux_the_first_second . Associated blog posting at https://opensource.com/article/18/1/analyzing-linux-boot-process
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...PROIDEA
Users of modern Linux containerization technologies are frequently at loss with what kind of security guarantees are delivered by tools they use. Typical questions range from Can these be used to isolate software with known security shortcomings and rich history of security vulnerabilities? to even Can I used such technique to isolate user-generated and potentially hostile assembler payloads?
Modern Linux OS code-base as well as independent authors provide a plethora of options for those who desire to make sure that their computational loads are solidly confined. Potential users can choose from solutions ranging from Docker-like confinement projects, through Xen hypervisors, seccomp-bpf and ptrace-based sandboxes, to isolation frameworks based on hardware virtualization (e.g. KVM).
The talk will discuss available today techniques, with focus on (frequently overstated) promises regarding their strength. In the end, as they say: “Many speed bumps don’t make a wall
You have one of those fruity *Pi arm boards and cheep sensor from China? Some buttons and LEDs? Do I really need to learn whole new scripting language and few web technologies to read my temperature, blink a led or toggle a relay? No, because your Linux kernel already has drivers for them and all you need is device tree and cat.
HKG15-409: ARM Hibernation enablement on SoCs - a case studyLinaro
HKG15-409: ARM Hibernation enablement on SoCs - a case study
---------------------------------------------------
Speaker: Grygorii Strashko
Date: February 12, 2015
---------------------------------------------------
★ Session Summary ★
Hibernation on ARM devices is a long-wanted feature, with multiple ways of achieving it - in-kernel, fully userspace, or a combination. This presentation will give brief overview of these methods, and will discuss the effort required in enabling in-kernel ARM hibernation to the TI platform. We will also share the pre-requisites for enabling this on other SoCs.
--------------------------------------------------
★ Resources ★
Pathable: https://hkg15.pathable.com/meetings/250837
Video: https://www.youtube.com/watch?v=dJqCbTfKrMk
Etherpad: http://pad.linaro.org/p/hkg15-409
---------------------------------------------------
★ Event Details ★
Linaro Connect Hong Kong 2015 - #HKG15
February 9-13th, 2015
Regal Airport Hotel Hong Kong Airport
---------------------------------------------------
http://www.linaro.org
http://connect.linaro.org
Kernel Recipes 2015 - Kernel dump analysisAnne Nicolas
Kernel dump analysis
Cloud this, cloud that…It’s making everything easier, especially for web hosted services. But what about the servers that are not supposed to crash ? For applications making the assumption the OS won’t do any fault or go down, what can you write in your post-mortem once the server froze and has been restarted ? How to track down the bug that lead to service unavailability ?
In this talk, we’ll see how to setup kdump and how to panic a server to generate a coredump. Once you have the vmcore file, how to track the issue with “crash” tool to find why your OS went down. Last but not least : with “crash” you can also modify your live kernel, the same way you would do with gdb.
Adrien Mahieux – System administrator obsessed with performance and uptime, tracking down microseconds from hardware to software since 2011. The application must be seen as a whole to provide efficiently the requested service. This includes searching for bottlenecks and tradeoffs, design issues or hardware optimization.
UWE Linux Boot Camp 2007: Hacking embedded Linux on the cheapedlangley
Slides from a talk at the first ever UWE Linux Boot Camp in 2007, about getting started playing around with embedded Linux on a budget. The example system used is the Mattel Juicebox.
The presentation deals with the set of tools and features that can be used by Linux kernel developers for kernel debugging. Also, static analysis of kernel patches was addressed during speech. Special attention was given to access tools, tracing tools, and interactive debugging tools, namely: DebugFS, ftrace, and GDB.
This presentation by Aleksandr Bulyshchenko (Software Engineer, Consultant, GlobalLogic Kharkiv) was delivered at GlobalLogic Kharkiv Embedded TechTalk #1 on March 13, 2018.
This presentation gives overview or our Ganeti deployment
There is related YouTube playlist (in Croatian) with presentations https://www.youtube.com/playlist?list=PLDMnMa3XBHD_K6Rl2FBe2CC-MS6mdTOrJ
This presentation is about U-Boot: the most popular open source, primary boot loader used in embedded devices, as well as it's mechanisms and features.
The respective talk was held by Sam Protsenko (Software Engineer, Consultant, GlobalLogic) at GlobalLogic Mykolaiv Embedded TechTalk #1 on May 25, 2018.
Talk for Facebook Systems@Scale 2021 by Brendan Gregg: "BPF (eBPF) tracing is the superpower that can analyze everything, helping you find performance wins, troubleshoot software, and more. But with many different front-ends and languages, and years of evolution, finding the right starting point can be hard. This talk will make it easy, showing how to install and run selected BPF tools in the bcc and bpftrace open source projects for some quick wins. Think like a sysadmin, not like a programmer."
Similar to Let's trace Linux Lernel with KGDB @ COSCUP 2021 (20)
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...Jian-Hong Pan
Flatpak is a framework for distributing desktop applications and supported by most of Linux distributions. This talk shares how to package a HTTP server written in Python as a Flatpak app. And, runs it like a desktop application by launching a browser connecting to the server automatically.
https://hackmd.io/@starnight/Have_an_HTTP_Server_in_Flatpak
A Journey to Boot Linux on Raspberry PiJian-Hong Pan
Each processor/chip architecture has its own procedure to boot the kernel. It works with desgined partition layout and vendor specific firmwares/bootloaders in the boot partition. We can learn the related knowledge from the Raspbian image for Raspberry Pi, which is the board we can obtain easily. However, the diversity between the special booting procedures with specific firmwares/bootloaders increases the complexity for distribution maintainers. It will be great if there is a way to make it more generic that can be applied to most of the chip architectures/boards to boot up the system.
After referring to some Linux distributions, we learned U-Boot may play a role in the solution. It splits the booting procedure into hardware specific and generic system parts. This helps distribution maintainers deploy the generic system with OSTree, including device trees.
Let’s deep dive into this magic booting procedure!
Let's Have an IEEE 802.15.4 over LoRa Linux Device Driver for IoTJian-Hong Pan
Video: https://www.youtube.com/watch?v=_lGN-LDyl2I
在萬物聯網的時代,透過通訊技術將量測到的物理量傳送到遠端伺服器是很一般的作法。但要這「通訊」如何達到低成本、符合使用情境的條件,仍然是個經典的問題。
特別是在需要長距離、低功耗與長生命週期的需求下,或許以 Low-Power Wide-Area Network (LPWAN) 為基礎的 LoRa 通訊技術是個不錯的選擇。
若是在程式底層的部份,將此基礎建設的通訊技術寫成個 LoRa 的 Linux Device Driver,一般使用者就可以單純專注在應用層面的開發、降低進入門檻。
這次將介紹如何寫出這 IEEE 802.15.4 MAC over LoRa PHY 的 Linux Device Driver。
期望經由此 driver 合併 IEEE 802.15.4 MAC 的 Cluster Tree Network topology 與 LoRa PHY 的 link budget 優勢,達到超大範圍的通訊覆蓋面積,以達到相關需求。
In the Internet of Things' era, transferring the measured physical values to the servers through the communication technology is the popular usage template. However, finding the lowest cost method that fulfills the usage scenarios, power issues and the real time requirements still is a classic engineering problem.
Under the long range and low power consumption for longer life cycle conditions, LoRa which is based on Low-Power Wide-Area Network (LPWAN) might be one of the good choices. Moreover, if it goes with a LoRa Linux device driver, general users can focus on the development of related upper layer applications.
This time, I will introduce how to write an IEEE 802.15.4 MAC over LoRa PHY Linux device driver and its architecture. Hope this approach will gain more benefits by combining both advantages: Cluster Tree Network of IEEE 802.15.4 MAC and the good link budget of LoRa PHY.
The Considerations for Internet of Things @ 2017Jian-Hong Pan
物聯網是一門透過通訊,將端點蒐集到的資料,集中關聯分析,並將分析結果用以決策並回饋的工程藝術。
本次的分享將從物聯網的目的當作進入點,接著分享可能的佈署架構。並概述目前各個常用的通訊標準、協定,以及其所屬的角色。
除此之外,也會分享去年到柏林參加Linux Foundation舉辦的Open IoT Summit Europe 2016的心得。
在此,帶回一些國外對於物聯網節點的佈署、更新或維護的看法、作法。
另外,也會分享一些物聯網可能需要考量的資訊安全議題。
IoT is a kind of engineering art, which analyzes the collected data from
the device nodes through the communication and has the result for the
decision making and feedback.
This sharing goes for the purpose of IoT and it's deployment structure.
Then, the slide introduces the most used communication standards or
protocols in IoT and their roles.
Besides, also shares what I have got from the Open IoT Summit Europe 2016
which was held by Linux Foundation in Berlin last year.
It introduces how will the device nodes be deployed, updated and maintained.
Finally, the slide provides some security issues that should be considered
in IoT.
Build a Micro HTTP Server for Embedded SystemJian-Hong Pan
Apache HTTP Server, NGINX .. are famous web servers in the world. More and more web server frameworks come and follow up, like Node.js, Bottle of Python .., etc. All of them make us have the abilities to get or connect to the resources behind the web server. However, considering the limitations and portability, they may not be ported directly to the embedded system which has restricted resources. Therefore, we need to re-implement an HTTP server to fulfill that requirement.
I will introduce how do I use the convenience of Python to implement a Micro HTTP Server prototype according to RFC 2616/HTTP 1.1. Then, re-write the codes in C to build the Micro HTTP Server and do the automated testing with Python Unit Testing Framework. Finally, I combined the Micro HTTP Server with an RTOS and light the LEDs on an STM32F4-Discovery board.
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
I have heard many times that architecture is not important for the front-end. Also, many times I have seen how developers implement features on the front-end just following the standard rules for a framework and think that this is enough to successfully launch the project, and then the project fails. How to prevent this and what approach to choose? I have launched dozens of complex projects and during the talk we will analyze which approaches have worked for me and which have not.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Key Trends Shaping the Future of Infrastructure.pdf
Let's trace Linux Lernel with KGDB @ COSCUP 2021
1. Let's trace Linux Kernel
with KGDB
潘建宏 Jian-Hong Pan (StarNight)
@ COSCUP 2021
2. Who am I
潘建宏 / Jian-Hong Pan (StarNight)
Endless OS Foundation
You can find me at
● http://www.slideshare.net/chienhungpan/
● GitHub: starnight
● Email:
jhp [AT] endlessos.org
chienhung.pan [AT] gmail.com
3. Outline
● How to debug Linux kernel
● KGDB
○ The Linux kernel build config
● KGDB with VM (QEMU)
● KGDB with real system (Raspberry Pi 4B)
○ How does Raspberry Pi 4B boot kernel
○ Raspberry Pi 4B’s JTAG
○ OpenOCD & the JTAG adapter
○ Add U-Boot to catch up kernel boot
○ Real debug
● Reference
4. How to Debug Linux kernel???
● Read the kernel message log, then grep the key words in kernel
source codes.
● Add some more debug messages with printk like functions in
interesting parts.
● Kprobes, ftrace, eBPF ....
● Export the signals to GPIO pins!!!???
Basic idea is “trace the code path to understand why it goes here, there.”
Can kernel be debugged with GDB like the user space programs?
5. KGDB
The kernel debugger kgdb, hypervisors like QEMU or JTAG-based
hardware interfaces allow to debug the Linux kernel and its modules
during runtime using gdb.
- from Debugging kernel and modules via gdb
Host Target Machine
Debug Line
The debug line could be professional like
JTAG, or simple one like serial.
6. Build Linux Kernel on Host
Build the kernel with following configuration (at least)
● # CONFIG_RANDOMIZE_BASE is not set
● CONFIG_DEBUG_INFO=y
● # CONFIG_DEBUG_INFO_REDUCED is not set
● CONFIG_GDB_SCRIPTS=y
● CONFIG_FRAME_POINTER=y
7. Start with Virtual Environment - QEMU
Host Target Machine
(QEMU VM)
Debug Line
built kernel
Install
8. Install the Built Kernel into the Target Machine (VM)
Have a QEMU guest VM with an OS (for example, Debian) as the target
machine
1. Start the VM with 9p shared folder (on Host)
$ qemu-system-x86_64 -m 2048 -smp 2 qemu-images/debian.qcow2 -enable-kvm -virtfs
local,path=linux-stable/,mount_tag=host0,security_model=mapped-xattr,id=host_share
2. Create a folder for mounting the shared folder from host (on guest
VM)
$ mkdir linux-stable && sudo mount -t 9p -o trans=virtio host0 linux-stable/
3. Installed the built kernel into the guest VM (on guest VM)
$ cd linux-stable && sudo make install modules_install
9. Debug the Kernel on Target Machine (VM)
Host Target Machine
(QEMU VM)
Debug Line
built kernel gdb connection
10. Enable the gdb stub of QEMU/KVM
● Start the guest VM with enabled gdb stub (on Host)
$ qemu-system-x86_64 -m 2048 -smp 2 qemu-images/debian.qcow2 -s -S
● Must disable kvm
● Manual of qemu-system-x86_64:
-s
...
freeze CPU at startup (use 'c' to start execution)
-gdb dev accept gdb connection on 'dev'. (QEMU defaults to
starting the guest without waiting for gdb to connect;
use -S too if you want it to not start execution.)
-S shorthand for -gdb tcp::1234
11. Use GDB on Host
1. Start gdb in the linux project folder
$ cd /path/to/linux-stable && gdb vmlinux
2. Attach to the booted geust VM
(gdb) target remote localhost:1234
3. Use gdb: set break points, continue, debug …
# Add a break point for test
(gdb) break drm_core_init
Breakpoint 1 at 0xffffffff82a7ebf0: file drivers/gpu/drm/drm_drv.c, line 1116.
# Continue the kernel
(gdb) continue
Continuing.
Thread 1 hit Breakpoint 1, drm_core_init () at drivers/gpu/drm/drm_drv.c:1116
1116 drm_connector_ida_init();
(gdb) backtrace
#0 drm_core_init () at drivers/gpu/drm/drm_drv.c:1116
#1 0xffffffff81000d61 in do_one_initcall (fn=0xffffffff82a7ebf0 <drm_core_init>) at init/main.c:1205
12.
13. Let’s debug in the Real World!
Raspberry Pi as the target machine
14. Debug the Kernel on Target Machine (Raspberry Pi)
Target Machine
(Raspberry Pi)
Debug Line
JTAG
Host
built kernel
OpenOCD
15. How Debian Boots on Raspberry Pi 4B
● Download Debain images for Raspberry Pi 4B and install it by
following RaspberryPiImages
● The image has 2 partitions. First one is the boot partition.
● Here are the files in the boot partition
$ ls
bcm2711-rpi-4-b.dtb cmdline.txt fixup_cd.dat start4db.elf start_x.elf
bcm2837-rpi-3-a-plus.dtb config.txt fixup.dat start4.elf sysconf.txt
bcm2837-rpi-3-b.dtb fixup4cd.dat fixup_db.dat start4x.elf vmlinuz-5.10.0-7-arm64
bcm2837-rpi-3-b-plus.dtb fixup4.dat fixup_x.dat start_cd.elf
bcm2837-rpi-cm3-io3.dtb fixup4db.dat initrd.img-5.10.0-7-arm64 start_db.elf
bootcode.bin fixup4x.dat start4cd.elf start.elf
Device Boot Start End Sectors Size Id Type
/dev/sda1 8192 614399 606208 296M c W95 FAT32 (LBA)
/dev/sda2 614400 124735487 124121088 59.2G 83 Linux
16. Debian’s config.txt & cmdline.txt
$ cat config.txt
# Switch the CPU from ARMv7 into ARMv8 (aarch64) mode
arm_64bit=1
enable_uart=1
upstream_kernel=1
kernel=vmlinuz-5.10.0-7-arm64
# For details on the initramfs directive, see
# https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=10532
initramfs initrd.img-5.10.0-7-arm64
$ cat cmdline.txt
console=tty0 console=ttyS1,115200 root=/dev/mmcblk1p2 rw fsck.repair=yes net.ifnames=0 rootwait
17. Enable Raspberry Pi 4B’s JTAG
● The chip is BCM2711
● Raspberry Pi 4B maps JTAG pins to GPIO
○ Setting enable_jtag_gpio=1 selects Alt4 mode for GPIO pins 22-27, and
sets up some internal SoC connections, thus enabling the JTAG interface
for the ARM CPU.
Pin # Function
GPIO22 ARM_TRST
GPIO23 ARM_RTCK
GPIO24 ARM_TDO
GPIO25 ARM_TCK
GPIO26 ARM_TDI
GPIO27 ARM_TMS
Reference: Raspberry Pi Documentation's GPIO control in config.txt
18. Table 94. GPIO Pins Alternative
Function Assignment of
BCM2711 ARM Peripherals
JTAG interface
19. Open On-Chip Debugger (OpenOCD)
● It does so with the assistance of a debug adapter, which is a small
hardware module which helps provide the right kind of electrical
signaling to the target being debugged. These are required since
the debug host (on which OpenOCD runs) won’t usually have native
support for such signaling, or the connector needed to hook up to
the target.
● A JTAG Adapter supports JTAG signaling, and is used to
communicate with JTAG (IEEE 1149.1) compliant TAPs on your target
board. A TAP is a “Test Access Port”, a module which processes
special instructions and data. TAPs are daisy-chained within and
between chips and boards. JTAG supports debugging and boundary
scan operations.
● List of Debug Adapter Hardware, or search the list of tcl/interface in
OpenOCD repository directly
Reference: OpenOCD User's Guid - About
20. Try to Buy a JTAG Adatper
● I do not have much money :( $$$$$
● It is really hard to buy and get the electronic parts, due to the
pandemic.
● I have no idea why all of the JTAG adapters come from overseas.
● The shipment becomes extremely expensive and much longer
waiting time.
So, I can only suspend this study. Sad … T^T
Until ...
21. Thanks to Mat lend me a
FT2232H-56Q Mini Module
as a JTAG interface!!!
Hacking Thursday! Hurray!!!
22. JTAG interface
Table 3.13 FT2232H Pin
Configurations for 56-pin
VQFN package of FT2232H
Dual High Speed USB to
Multipurpose UART/FIFO IC
Datasheet
23. JTAG interface
Table 3.1 FT2232H-56Q Mini
Module Connection – CN2 of
FT2232H-56Q Mini Module
Datasheet
24. Prepare JTAG Interface cfg for OpenOCD
# Refer to tcl/interface/ftdi/minimodule.cfg
#
# FTDI MiniModule
#
# http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_FT2232H_Mini_Module.pdf
#
adapter driver ftdi
#ftdi_device_desc "FT2232H-56Q MiniModule"
ftdi_vid_pid 0x0403 0x6010
# Every pin set as high impedance except TCK, TDI, TDO and TMS
ftdi_layout_init 0x0008 0x000b
transport select jtag
# nTRST defined on pin CN2-13 of the MiniModule (pin ADBUS5 [AD5] on the FT2232H chip)
# This choice is arbitrary. Use other GPIO pin if desired.
ftdi_layout_signal nTRST -data 0x0020 -oe 0x0020
25. Execute OpenOCD with the cfgs
$ openocd -f minimodule.cfg -c "set USE_SMP 1" -f bcm2711.cfg -c "reset_config trst_only"
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
1
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Info : JTAG tap: bcm2711.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd), part: 0xba00, ver: 0x4)
Info : bcm2711.cpu0: hardware has 6 breakpoints, 4 watchpoints
Info : bcm2711.cpu1: hardware has 6 breakpoints, 4 watchpoints
Info : bcm2711.cpu2: hardware has 6 breakpoints, 4 watchpoints
Info : bcm2711.cpu3: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for bcm2711.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
Note: the patch tcl/board: Add Raspberry Pi 4 model B board
26. But the debug connection,
including gdb and OpenOCD is too
late to catch up the kernel boot.
And, Raspberry Pi does not expose
JTAG System Reset (SRST) pin.
27. The RUN/GLOBAL_EN pin on
Raspberry Pi boards might be
implemented as the
System Reset (SRST) pin.
Re: openocd, jtag, fyi
But, OpenOCD still cannot catch up
and halt target system on time.
29. 3th stage
Kernel boots
Boot Linux kernel via U-Boot on Raspberry Pi 4B
Raspberry Pi OS’ firmwares
3th stage
U-Boot loads kernel, initramfs and
device tree, then boots kernel with
boot script
1st stage
Boot from GPU with firmware in
ROM loads start4x.elf ... in FAT
2rd stage
Start4.elf loads DT,
kernel …
and starts CPU
U-Boot
30. Build U-Boot
1. Build U-Boot & install
$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- rpi_4_defconfig
$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu-
$ cp u-boot.bin <RPi image’s root partition path>/boot/kernel8.img
2. Prepare the boot script for U-Boot
3. Prepare the boot script and following configuration file for U-Boot
4. Get RPi 4B’s device tree blob from Raspberry Pi OS for U-Boot
5. Modify config.txt to make boot firmware load and execute the kernel8.img
34. The New Status of the Boot Partition
$ ls
bcm2711-rpi-4-b.dtb fixup4db.dat start4x.elf
bcm2837-rpi-3-a-plus.dtb fixup4x.dat start_cd.elf
bcm2837-rpi-3-b.dtb fixup_cd.dat start_db.elf
bcm2837-rpi-3-b-plus.dtb fixup.dat start.elf
bcm2837-rpi-cm3-io3.dtb fixup_db.dat start_x.elf
bootcode.bin fixup_x.dat sysconf.txt
boot.scr initrd.img-5.10.0-7-arm64 System.map-5.12.10
cmdline.txt initrd.img-5.12.10 uEnv.txt
config.txt kernel8.img vmlinux-5.12.10
dtbs start4cd.elf vmlinuz-5.10.0-7-arm64
fixup4cd.dat start4db.elf
fixup4.dat start4.elf
35.
36. Press any key to stop autoboot in U-Boot
U-Boot 2021.04 (Jun 20 2021 - 17:36:34 +0800)
...
scanning bus xhci_pci for devices... 3 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
U-Boot> boot
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
724 bytes read in 13 ms (53.7 KiB/s)
…
Starting kernel ...
Press a key to make U-boot paused,
then connect the GDB via OpenOCD + JTAG.
Finally, continue boot
37. Launch OpenOCD to Start GDB Server with JTAG
$ openocd -f minimodule.cfg -c "set USE_SMP 1" -f bcm2711.cfg -c "reset_config trst_only"
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
1
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Info : JTAG tap: bcm2711.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd), part: 0xba00, ver:
0x4)
Info : bcm2711.cpu0: hardware has 6 breakpoints, 4 watchpoints
Info : bcm2711.cpu1: hardware has 6 breakpoints, 4 watchpoints
Info : bcm2711.cpu2: hardware has 6 breakpoints, 4 watchpoints
Info : bcm2711.cpu3: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for bcm2711.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
38. Debug with GDB via the OpenOCD + JTAG
$ aarch64-linux-gnu-gdb vmlinux
...
Reading symbols from vmlinux...
(gdb) target extended-remote localhost:3333
Remote debugging using localhost:3333
0x000000003b39133c in ?? ()
(gdb) continue
Continuing.
^C
...
Program received signal SIGINT, Interrupt.
mem_serial_in (p=<optimized out>, offset=<optimized out>)
at drivers/tty/serial/8250/8250_port.c:399
399 return readb(p->membase + offset);
(gdb) hbreak drm_core_init
Hardware assisted breakpoint 1 at 0xffff80001115775c: file drivers/gpu/drm/drm_drv.c, line 1044.
(gdb) continue
Continuing.
...
Continue U-Boot to boot the kernal image
Intercept/Interrupt the kernal boot at a proper point
hbreak in Setting Breakpoints
39. Debug with GDB via the OpenOCD + JTAG (cont.)
Breakpoint 1, drm_core_init () at drivers/gpu/drm/drm_drv.c:1044
1044 drm_connector_ida_init();
(gdb) backtrace
#0 drm_core_init () at drivers/gpu/drm/drm_drv.c:1044
#1 0xffff800010012e80 in do_one_initcall (
fn=0xffff80001115775c <drm_core_init>) at init/main.c:1226
#2 0xffff8000111212b4 in do_initcall_level (
command_line=0xffff000040264500 "console", level=6) at init/main.c:1299
#3 do_initcalls () at init/main.c:1315
#4 do_basic_setup () at init/main.c:1335
#5 kernel_init_freeable () at init/main.c:1537
#6 0xffff800010c5419c in kernel_init (unused=<optimized out>)
at init/main.c:1424
#7 0xffff80001001448c in ret_from_fork () at arch/arm64/kernel/entry.S:955
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
40. Summary
● Some key items for KGDB in Linux kernel building config
● Tried KGDB with QEMU easily
○ Learned steps to debug the Lnux kernel on QEMU guest OS
● Tried KGDB with real physical system Raspberry Pi 4B
○ The JTAG interface, the adapter and corresponding hardware feature
○ BCM2711 on Raspberry Pi 4B’s JTAG feature and configuration
○ Debugged the Linux kernel on Raspberry Pi 4B with KGDB via OpenOCD + JTAG
adapter
● If you have some money, please buy a professional JTAG adapter. It
has less barriers and saves your time.
● KGDB is not the only way to debug Linux kernel. The printk series
might be good enough for most of cases. Especially, timing related
issues.
41. Reference
● Debugging kernel and modules via gdb
● JTAG
● OpenOCD
● Bare Metal Raspberry Pi 3B+: JTAG
● Baremetal Raspberry Pi 4 with FT2232H
● FT2232H Dual High Speed USB to Multipurpose UART/FIFO IC datasheet
● FT2232H-56Q Mini Module Datasheet
● Raspberry Pi → Documentation → The boot folder
● Device Tree
● RPi U-Boot
● GDB → Setting Breakpoints
● JTAG Reset on Raspberry Pi forum
● A Journey to Boot Linux on Raspberry Pi