当前位置: 首页 > news >正文

Porting Linux to a new processor architecture, part 1: The basics

Although a simple port may count as little as 4000 lines of code—exactly 3,775 for the mmu-less Hitachi 8/300 recently reintroduced in Linux 4.2-rc1—getting the Linux kernel running on a new processor architecture is a difficult process. Worse still, there is not much documentation available describing the porting process. The aim of this series of three articles is to provide an overview of the procedure, or at least one possible procedure, that can be followed when porting the Linux kernel to a new processor architecture.

虽然一个简单的移植可能只需要约 4000 行代码——例如在 Linux 4.2-rc1 中重新引入的无 MMU 的 Hitachi 8/300 架构只用了 3775 行代码——但让 Linux 内核运行在一个新的处理器架构上仍然是一个困难的过程。更糟糕的是,几乎没有关于移植流程的文档可供参考。这三篇文章的目标是提供一个大致的流程概览,或者至少是一个可供遵循的 Linux 内核移植到新处理器架构的流程。

After spending countless hours becoming almost fluent in many of the supported architectures, I discovered that a well-defined skeleton shared by the majority of ports exists. Such a skeleton can logically be split into two parts that intersect a great deal. The first part is the boot code, meaning the architecture-specific code that is executed from the moment the kernel takes over from the bootloader until init is finally executed. The second part concerns the architecture-specific code that is regularly executed once the booting phase has been completed and the kernel is running normally. This second part includes starting new threads, dealing with hardware interrupts or software exceptions, copying data from/to user applications, serving system calls, and so on.

在花费了无数小时并几乎熟悉了许多已有架构之后,我发现大多数移植版本之间都存在一个明确的通用框架。这个框架在逻辑上可以划分为两个部分,它们之间有大量交叉。第一部分是启动代码,指的是从内核接管引导加载程序开始,到最终执行 init 之间所运行的架构相关代码。第二部分则是系统启动完成、内核正常运行后周期性执行的架构相关代码。这部分包括启动新线程、处理中断和异常、与用户空间进行数据拷贝、响

相关文章:

  • 2025年best好用的3dsmax插件和脚本
  • Kaamel白皮书:MCP中毒攻击与安全加固
  • 深入理解 Webpack 核心机制与编译流程
  • 08.webgl_buffergeometry_attributes_none ,three官方示例+编辑器+AI快速学习
  • .NET 8 + Angular WebSocket 高并发性能优化
  • python 的 ​uv、pip​ 和 ​conda​ 对比和技术选型
  • 学习笔记:Conda 环境共享
  • go语言实现IP归属地查询
  • 链表面试题6之回文结构
  • HTTP3
  • MYSQL 子查询
  • 解析文件加密软件,文件加密软件是什么?2025最新分享
  • 华为FAT AP配置 真机
  • 集成学习——Bagging,Boosting
  • 计算机网络|| 路由器和交换机的配置
  • 网络服务实训室建设规划设计方案
  • LegoGPT,卡内基梅隆大学推出的乐高积木设计模型
  • sqlmap使用入门
  • Matlab 列车纵向滑模二阶自抗扰算法和PID对比
  • Spring Cache的详细使用
  • 广东韶关一镇干部冲进交通事故火海救人,获授“见义勇为”奖励万元
  • 香港将展“天方奇毯”,从地毯珍品看伊斯兰艺术
  • 科学家用AI寻找外星生命
  • 体坛联播|巴萨4比3打服皇马,利物浦2比2战平阿森纳
  • 高培勇:中国资本市场的发展应将预期因素全面纳入分析和监测体系
  • 综艺还有怎样的新可能?挖掘小众文化领域