Several days ago, I come across 2 posts which introduce OpenBSD Hackathon : Historical: My first OpenBSD Hackathon and Michael W. Lucas: Visiting the OpenBSD t2k13 Hackathon. From the reading, I find OpenBSD is a really distinctive and amazing project, especially after browsing its neat code mirror in github, which makes sure my assumption. So I decided to make my hands dirty on it.

Last weekend, I installed OpenBSD on an old machine, and checked out its fresh code from CVS repository. Because I think reading its code can let me get a better understanding about OpenBSD , even Unix philosophy, I decides to take the dmesg as the first experiment. During the reading, the following code gave me a hit unexpectedly:

...... mib[1] = startupmsgs ? KERN_CONSBUFSIZE : KERN_MSGBUFSIZE; len = sizeof(msgbufsize); if (sysctl(mib, 2, &msgbufsize, &len, NULL, 0)) err(1, "sysctl: KERN_MSGBUFSIZE"); ...... mib[1] = startupmsgs ? KERN_CONSBUF : KERN_MSGBUF; len = msgbufsize; if (sysctl(mib, 2, bufdata, &len, NULL, 0)) err(1, "sysctl: KERN_MSGBUF"); ......