系统与基础设施jamesmolloy.co.uk
自己动手写 Unix
Roll your own Unix
2009 — 2015,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这是 James Molloy 撰写的一系列从零编写类 Unix 操作系统的入门教程,涵盖引导、内核初始化、中断、内存管理、文件系统等主题,面向想动手学习操作系统底层原理的开发者。
为什么经久不衰:自己写一个玩具操作系统是学习计算机底层机制最有效的方式之一,这套教程门槛低、结构清晰,多年来一直是入门经典。
HN 评论精选
写业余 OS 是很好的学习项目,而且这类技能在实际工作中也真的用得上
这个教程很不错。osdev wiki 上有不少嚼碎了的参考资料,虽然偏 x86,但这恰恰对我很有价值。写自己的业余操作系统是了解计算机内部结构、磨练底层编程技能的绝佳项目。别以为这些技能在工作中用不上——我们公司就有一个几千行代码的内部小型操作系统,用于芯片出厂测试和数百万台设备上的专用任务,看起来就像教科书式的业余操作系统。
exDM69查看英文原文
This is a quite nice tutorial. There's a quite bit of half-chewed reference material in the osdev wiki. It's quite x86 centric, but that's what makes it especially valuable to me. I already have OS books that I read in Uni courses: http://wiki.osdev.org/ Writing your own hobby operating system is a very nice project to learn about your computer's internals and hone your low level programming skills. Here's the start of my hobby OS: https://github.com/rikusalminen/danjeros Also, don't be fooled to thinking that you won't need the skills professionally, because Linux/Windows/*BSD already exists. In fact, at work we have an original in-house small "toy" operating system, but it's not a toy. It's actually used for testing new system on chips when they roll out the factory as well as doing some special purpose tasks on actual devices that are shipped to millions of customers. It's only a few thousand lines of code and looks a lot like one of these schoolbook/hobby operating systems. Unfortunately, I cannot tell you anything more about it.
推荐 xv6 作为同类教学操作系统资源
另可参见 xv6,一个简洁的类 Unix 教学操作系统,还有配套教材。
enneff查看英文原文
Also see xv6, "a simple Unix-like teaching operating system": http://pdos.csail.mit.edu/6.828/2011/xv6.html and its textbook: http://pdos.csail.mit.edu/6.828/2011/xv6/book-rev6.pdf
教程理论讲得好,但原代码有缺陷,建议用作者后来更新的版本
我记得 James 正在为教程重写更好的代码库。这个网站的理论部分不错,但代码有问题,更新后的代码托管在 Google Code 上。
stephen_g查看英文原文
I'm not sure if he updated it on the site linked above (it's not loading for me), but as I remember James was working on a better code base for his tutorials. The theory on this website was good but the code had problems. The updated code was hosted at Google code - http://code.google.com/p/jamesm-tutorials/source/browse/
建议参考 Linux 0.11 源码中的 vsprintf 实现
他在“屏幕”一章提到可以参考 linux 0.1 的代码,其中 vsprintf 的实现相当整洁,可以复制该函数来实现 printf()。
notaddicted查看英文原文
He mentions in "The Screen" You could also have a scout at the linux0.1 code - that has an implementation of vsprintf which is quite neat and tidy. You could copy that function then use it to implement printf() here are the goods: http://oldlinux.org/lxr/http/source/kernel/vsprintf.c?v=0.11#L92
历次讨论
同类还值得读
TTY 揭秘(2008)
The TTY demystified (2008)
经典文章深入剖析了 Unix/Linux 中 TTY 子系统的工作原理,包括线路规程、终端驱动、信号与控制字符等机制。
系统与基础设施上首页 11 次 · 2009–2025linusakesson.net编辑精选为什么 GNU grep 这么快
Why GNU grep is Fast
FreeBSD 邮件列表上一篇广为流传的帖子,解释 GNU grep 为什么快:核心在于 Boyer-Moore 字符串搜索算法配合精心优化的内部循环和 I/O,让程序在搜索时“…
系统与基础设施上首页 9 次 · 2010–2022lists.freebsd.orgXplain:为普通人讲解 X11
Xplain – Explaining X11 for the rest of us
《Xplain》是作者(HN 用户 Jasper_)写的一系列 X11 长文,用他在浏览器中重建的 X11 绘图模型做交互演示,讲解 X11 的绘图模型与窗口系统设计。
系统与基础设施上首页 6 次 · 2013–2020magcius.github.io编辑精选旋风教程:为 Linux 创建极小 ELF 可执行文件(1999)
A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux (1999)
breadbox 写于 1999 年的经典教程,主题是如何为 Linux 手工构造并裁剪出体积极小的 ELF 可执行文件。
系统与基础设施上首页 6 次 · 2007–2025muppetlabs.comPostgreSQL 内部原理
The internals of PostgreSQL
《The Internals of PostgreSQL》是一本免费在线书籍,系统讲解 PostgreSQL 的内部实现,包括查询处理、并发控制、WAL、缓冲区管理等核心机制。
系统与基础设施上首页 5 次 · 2017–2025interdb.jp编辑精选