FreeBSD

FreeBSD CAM/AHCI committed

| Kernel | #AHCI | #CAM | #FreeBSD

下周一的8.0-BETA2会包含这个。CAM/AHCI是按照CAM框架重写的AHCI驱动(之前是ata(4)),提供了包括NCQ等硬件特性的支持,并改善了对SATA光驱的支持。与OpenBSD的实现不同,FreeBSD实现通过扩展CAM框架使其直接对ATA设备提供支持。

阅读全文…( 本文约 201 字,阅读大致需要 1 分钟 )

FreeBSD CLang/LLVM项目终于进svn了

| Development | #Clang | #FreeBSD | #LLVM

如题。

不过这一次因为-CURRENT code slush的缘故,应该不会在 8.0-CURRENT 里面引入了(Ed在svn里面建立了另一个branch来做)。我想从各方面考虑,9.0-RELEASE里面正式砍掉gcc那一套东西应该不会是很困难的事情。传统上 FreeBSD 的代码用到了很多gcc的扩展,因此可能还需要一段时间。

阅读全文…( 本文约 197 字,阅读大致需要 1 分钟 )

Overhaul of libc Berkeley DB has been committed

| Development | #BerkeleyDB | #FreeBSD

First of all, thanks goes to all people who has helped me on this project, especially Pav (portmgr@) who gave it a twist on pointyhat.

It seems that this has taken me almost a month and 20 commits to get into the tree, after the code is ready. At the beginning, the changeset was ~200KB, and I believe it’s not good to just go ahead and commit it in one time, since it makes reviewing hard. Instead, I manually split it into smaller, functional related chunks, and commit it part-by-part.

阅读全文…( 本文约 250 字,阅读大致需要 2 分钟 )

Google SoC 2009/FreeBSD

| Development | #FreeBSD | #Google | #SoC

之前在水木社区发过,这里也发一下。

我们目前正在寻找有意参加这次活动的在校学生。Google Summer of Code 是由Google公司赞助的供在校学生参与开源项目的暑期活动。目前,FreeBSD已经被选为符合资格的 mentoring organization,这是 FreeBSD 第 5 年参与 GSoC。

重要的日期:

Google将为获得资助的学生提供每人 $4,500 的资助,分3次支付;同时,对于每个项目,Google还会为对应的开源项目提供 $500 的资助。

关于 FreeBSD 本次 SoC 活动的 网站

阅读全文…( 本文约 543 字,阅读大致需要 2 分钟 )

关于本地特权提升

FreeBSD 今天发布了 2009 年第 6 号安全公告 FreeBSD-SA-09:06.ktimer。这个安全公告适用于 7.0-RELEASE 以上到修正日期之前的所有 FreeBSD 版本。

由于这个安全公告修正的是一个零时差 (0-day,也就是发现者直接对问题进行了全面披露,而不是等待供应商修正之后再发布漏洞细节) 披露的漏洞,因此,适当地评估其风险并采取措施就非常重要。安全公告中提到,这是一个"Local privilege escalation"(本地特权提升问题),这种问题属于一类非常常见的(特别是 Linux 内核)、严重的安全漏洞,具体来说,通过一定的方法,登录在系统上的用户可以提升其权限,并实施进一步的攻击。

关于这类漏洞的一个常见的误解是,“本地"漏洞通常是没什么大碍的。然而,那种无关大碍的一类"本地"漏洞,指的是只能在本地控制台触发的问题。例如,如果手中有一张包含了某些工具的Windows PE光盘,用它启动系统便可以得到本地的管理员权限—-这是一个安全问题,但是并不严重,因为事实上如果别人能够接触本地系统,那么他就可以做任何事情。

而 FreeBSD-SA-09:06 指出的问题则不是这类问题。在其上下文中,“本地"是指能够登入系统的任何用户,以及能够以本地用户身份运行的服务进程。对于 Web 服务器而言,这是一个非常严重的安全威胁—-例如,如果在设计时因为疏忽而没有考虑上传文件是否有可能由于某种条件被执行,那么,之前这可能只是一个简单的 DoS 问题(例如,用户可以上传一个不停 fork() 的程序,将 www 用户的进程配额耗尽而导致新的服务请求无法被及时响应),而有了这个漏洞,这些问题便成了远程特权提升问题,其危害也就非常严重了。

阅读全文…( 本文约 898 字,阅读大致需要 2 分钟 )

为什么FreeBSD没有CIRCLEQ_*

| Development | #algorithm | #API | #BSD | #FreeBSD | #OpenBSD

最近在看 Berkeley DB,发现一套 FreeBSD 上没有的宏, CIRCLEQ_*

看了一下,这组宏是来自 4.4BSD 的,因此 FreeBSD 曾经有过这个宏;后来, phk 在 2000 年 12 月 29 日从 FreeBSD 里面把它拿掉了(SVN revision 70469),当时的说明如下:

阅读全文…( 本文约 324 字,阅读大致需要 1 分钟 )

OpenJDK on FreeBSD

| Development | #FreeBSD | #Java

Maho今天正式commit了 OpenJDKport,表面上看这是一小步,但在我看来这却是一项历史性的进步,因为终于可以不再受到之前那个 click-through 许可证的限制了(也就是说,可以几乎没有任何限制地随光盘,或者通过网站提供可用的jdk源代码和二进制版本了)。

阅读全文…( 本文约 147 字,阅读大致需要 1 分钟 )

Progress on LLVM clang

| Development | #Clang | #FreeBSD | #GCC | #LLVM

As some of you already know, FreeBSD, along with some other Open Source projects, is moving away from GCC due to GPLv3. From a technology perspective, this also makes sense since the (likely) candidate, BSD-style licensed, LLVM based clang, a C compiler, is making reasonably good progress.

So, what should we expect from LLVM or clang?

Here is a good comparison between GCC and clang. Despite GCC is popular, considerably more mature, and supports more languages (especially C++, which clang’s support is incomplete at this moment), clang provides cleaner AST (Abstract Syntax Tree), much more modularized (if you take a look at GCC’s history, Richard Stallman intentionally made GCC’s code not reusable in other software), provided much more information for optimizer, is much faster and use much less memory, etc.

For FreeBSD, currently, clang can compile its kernel with only very few tweaks.

阅读全文…( 本文约 315 字,阅读大致需要 2 分钟 )

New strlen(3) committed

| Development | #FreeBSD | #strlen

Finally, I got my strlen(3) [1] committed against -HEAD. This is a long story, to put it short, I had proposed assembly version of some string operations at the point of 2005, but these was never committed due to a hard disk failure, and as Bruce pointed out, having the hand optimized assembly code use a different algorithm is not good in general.

Therefore, I have take some time on it and reimplemented the idea in C, resulting in a portable (say, you can use it on any 32-bit or 64-bit processors, and it can be easily extended to 128-bit) version.

So, is it important for *YOU*?

Generally speaking, it should not. Performance sensitive programs should, by all means, avoid C style string operations. Think a 5x better strlen(3) would boost performance of your application since it uses strlen(3) in critical path? Think again!

However, I found it valuable. There is difference in worldstone, where I saw some minor improvements. Micro-benchmark indicates that this version is at most 2x slower when the string is very short, but 5x faster for strings that is at least word-length long.

[1] Note: the version has been further revised to provide better comment and match style(9).

阅读全文…( 本文约 295 字,阅读大致需要 2 分钟 )

7.1-RELEASE升级流量冲击导致portsnap服务同步受阻

许多老派的 FreeBSD 用户喜欢用源代码方式升级。运行了十多年的基于 cvsup 的同步机制由于有很多镜像支持因此一直没有遇到太大的问题,但是 FreeBSD 6.1 开始引入的 freebsd-update 提供了新的以二进制形式更新系统的方法,最近几年 FreeBSD 内核的许多改进已经使编译自定义的内核不再像以前那样重要了。

阅读全文…( 本文约 193 字,阅读大致需要 1 分钟 )