仅 8670 行代码,Linux 内核第一版 (v0.01) 开源代码解读
转自:OSC开源社区(ID:oschina2013)
《Exploring the internals of Linux v0.01》是一篇解读 Linux 内核第一版开源代码的文章。此文今天在 Reddit 和 Hacker News 都冲上了热门。
原文:https://seiya.me/blog/reading-linux-v0.01
文章介绍道,Linux 内核首个开源版本 (v0.01) 的体积非常小,仅包含 10,239 行代码。如果除去注释和空行,只剩下 8,670 行。正因它足够小,所以方便理解,是了解类 UNIX 操作系统内核内部结构的良好起点。
部分要点 & 有趣的冷知识:
- v0.01 总共包含 66 个 system call,如下:access acctalarmbreakbrkchdirchmod
chownchrootclosecreat dup dup2 execve
exitfcntlforkfstat ftime getegid geteuidgetgidgetpgrpsetsid getpid getppidgetuid gtty ioctlkilllinklock lseek
mkdirmknod mount mpx niceopenpausephyspipeprof ptracereadrenamermdirsetgid setpgid setuid setup signalstatstime stty synctimetimesulimitumaskumount unameunlinkustatutimewaitpidwrite - 针对 i386 进行了深度硬编码
- Linux 内核最初的名字为 "FREAX"
# Makefile for the FREAX-kernel.
5 行代码实现 Kernel panic volatilevoidpanic(constchar * s)
{printk("Kernel panic: %s\n\r",s);
for(;;);}- Linus 当时没有 8MB RAM 的机器
*
For those with more memory than 8 Mb - tough luck. I've
*not got it, why should you :-) The source is here. Change
*it. (Seriously - it shouldn't be too difficult. ...
Linux v0.01 源代码下载:https://cdn.kernel.org/pub/linux/kernel/Historic/linux-0.01.tar.gz
最新评论
推荐文章
作者最新文章
你可能感兴趣的文章
Copyright Disclaimer: The copyright of contents (including texts, images, videos and audios) posted above belong to the User who shared or the third-party website which the User shared from. If you found your copyright have been infringed, please send a DMCA takedown notice to [email protected]. For more detail of the source, please click on the button "Read Original Post" below. For other communications, please send to [email protected].
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。