The Linux Kernel Hacker's Encyclopedia Michael Still a ... APM Acronym definition Advanced Power Management Definition Advanced Power Management is The code was originally contributed by Stephen Rothwell having been funded by NEC Australia. It is currently maintained by Avery Pennarun, having also been maintained by Rik Faith in the past. The code is licensed under the terms of the GNU GPL version 2 or later. It first appeared in kernel kernel 1.3.46. Implementation source files arch/i386/kernel.apm.c include/linux/apm_bios.h References APM version 1 specification: ftp://ftp.intel.com/pub/IAL/software_specs/apmv11.doc APM version 2 specification: http://www.microsoft.com/hwdev/busbios/amp_12.htm Homepage: http://worldvisions.ca/~apenwarr/apmd/ See also ACPI Entry history Entry created: Tue Mar 18 10:43:00 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Unfinalized Avery Pennarun Definition Current maintainer of the APM code for the Linux kernel. References Homepage: http://worldvisions.ca/~apenwarr/index.html Entry history Entry created: Tue Mar 18 19:19:10 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Unfinalized b ... Binary Definition Binary is the base two representation of numbers. This means that all values are expressed solely in terms of ones and zeros. References ... See also Octal Decimal Hexadecimal Entry history Entry created: Entry owner: Michael Still (mikal@stillhq.com) Status: TODO BitKeeper Definition BitKeeper is a source code management package developed by Larry McVoy in consultation with Linus Torvalds. It is a commercial product, but is made available for use on Open Source projects such as the kernel for free so long as a variety of conditions are met. BitKeeper is a compeditor to CVS, SCCS, CSSC and other similar source code management tools. It has been the center of a large amount of controversy since adopted by Linus Torvalds. References Homepage: http://www.bitmover.com Entry history Entry created: Wed Mar 19 12:46:58 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Unfinalized c ... cpuid Acronym definition Intel CPU instruction mnemonic. Definition The linux kernel for x86 includes support for the cpuid instruction. The following code is used as of 2.5.59: /* * Generic CPUID function */ static inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx) { __asm__("cpuid" : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx) : "0" (op)); } Other architectures implement cpuid functions as well. This inline assembly specifies that output from this instruction will go to the EAX, EBX, ECX, and EDX registers. In input operand is constrained to being the same as the 0th output operand, in other words EAX. The cpuid instruction has three input operand values, each which return a different set of information about the target processor. Refer to the Intel instruction set reference for more information. There is a program by Phil Karn (KA9Q) called cpuid which calls this instruction as well. Implementation source files /include/asm-i386/processor.h References Intel instruction set manual Entry history Entry created: Wed Mar 19 21:26:37 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Unfinalized d ... Dave Jones Definition Linux kernel hacker working for Suse based in the UK. Contributions include various kernel hacks, as well as x86info. References Homepage: http://www.codemonkey.org.uk/ Blog: http://diary.codemonkey.org.uk/ Entry history Entry created: Tue Mar 18 19:57:55 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Unfinalized DCE Acronym definition Data Circuit-terminating Equipment Data Communications Equipment Definition This is the RS323 serial standard term for a computer or terminal. The standard envisaged that a DCE would be used to communicate with a DTE. A DCE is effectively a modem. References A RS323 tutorial: http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html Entry history Entry created: Wed Mar 26 19:53:44 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Finalized Decimal Definition ... References ... See also Binary Octal Hexadecimal Entry history Entry created: Entry owner: Michael Still (mikal@stillhq.com) Status: TODO DTE Acronym definition Data Terminal Equipment Definition This is the RS323 serial standard term for a computer or terminal. The standard envisaged that a DTE would be used to communicate with a DCE. References A RS323 tutorial: http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html Entry history Entry created: Wed Mar 26 19:53:44 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Finalized e ... f ... g ... GCC Acronym definition GNU CC Definition ... References ... See also Inline assembly Entry history Entry created: Wed Mar 19 21:29:25 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: TODO Greg Lehey Definition Greg is a former member of OzLabs, who used to work for LinuxCare and then the IBM Linux Technology Center. He is a member of the FreeBSD core team, and wrote The Complete FreeBSD. He is also responsible for the vinum filesystem. References Homepage: http://www.lemis.com/~grog/ Blog: http://www.lemis.com/~grog/diary.html Entry history Entry created: Wed Mar 19 12:28:13 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Unfinalized h ... Hexadecimal Definition Hexadecimal is a counting system based on sixteen digits (0,1, 2, 3, 4, 5, 6, 7). To expand an hexadecimal number to decimal, multiply each digit in the number with the corresponding power of sixteen. The following shell script demonstrates this: #!/bin/bash # Take an hexadecimal number and output it's decimal version hexadecimal=$1 length=`echo $hexadecimal | wc -c | tr -d " "` power=1 while [ $length -gt 2 ] do power=$(( $power * 16 )) length=$(( $length - 1 )) done decimal=0 while [ "%$hexadecimal%" != "%%" ] do digit=`echo $hexadecimal | cut -b 1` echo -n "Hexadecimal = $hexadecimal, Digit = $digit, Power = $power, Value = " value=$(( $digit * $power )) echo $value decimal=$(( $decimal + value )) power=$(( $power / 16 )) hexadecimal=`echo $hexadecimal | sed 's/^.//'` done echo "" echo "Result = $decimal" The following shell script example shows how to convert a decimal number to hexadecimal from first principles: #!/bin/bash # Take a decimal number and output it's hexadecimal quotient=$1 while [ $quotient -ne 0 ] do remainder=$(( $quotient % 16 )) hexadecimal="$remainder$hexadecimal" quotient=$(( $quotient / 16 )) done echo $hexadecimal References Computer Engineering Hardware Design by M Morris Mano published by Prentice Hall 1988 See also Binary Octal Decimal Entry history Entry created: Thu Mar 20 15:20:12 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Finalized i ... Inline assembly Definition GCC provides support for inline assembly with the following construct: asm ( assembler template : output operands (optional) : input operands (optional) : list of clobbered registers (optional) ); In addition, constraints may be applied to operands to force them to use specific registers or memory addresses. Constrains may be as follows: r any register a %eax b %ebx c %ecx d %edx S %esi D %edi m in memory Numeric same constraint as that numbered input variable See the excellent article in the references below for more information. References Article: http://www-106.ibm.com/developerworks/library/l-ia.html Entry history Entry created: Wed Mar 19 21:28:22 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Finalized j ... Jones, Dave See Dave Jones Entry history Entry created: Tue Mar 18 19:57:55 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Finalized k ... l ... WORD See Greg Lehey Entry history Entry created: Wed Mar 19 12:28:13 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Finalized m ... Martin Pool Definition Martin is a member of the Ozlabs team based in Canberra, Australia. As such, he is a former employee of LinuxCare, VA, and currently works for HP. His development work includes Samba, rsync, rproxy, distcc, PikiPiki, n4, snapfs, newuserfs, Apache and Keyring for PalmOS. References Homepage: http://sourcefrog.net/mbp/ Blog: http://www.advogato.org/person/mbp/ Entry history Entry created: Tue Mar 18 19:48:52 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Unfinalized Michael Still Definition Some guy who made a bunch of entries in this document. References Homepage: http://www.stillhq.com/ Blog: http://www.stillhq.com/cgi-bin/getpage?area=diary&page=index.htm Entry history Entry created: Tue Mar 18 19:29:39 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Unfinalized MSR Acronym definition Model Specific Register Definition Many CPU manufacturers include undocumented registers on their processors. Because these registers are model specific, they can be used to help identify the model of the processor installed on a given machine. The Intel instructions to read and write to MSRs are RDMSR and WRMSR respectively. These instructions allow access to the MSR specified in the ECX register. Implementation source files ... References Undocumented Pentium MSRs: http://x86.ddj.com/articles/p5msr/pentiummsrs.htm Entry history Entry created: Tue Mar 18 20:48:32 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Unfinalized n ... o ... Octal Definition Octal is a counting system based on eight digits (0,1, 2, 3, 4, 5, 6, 7). To expand an octal number to decimal, multiply each digit in the number with the corresponding power of eight. The following shell script demonstrates this: #!/bin/bash # Take an octal number and output it's decimal version octal=$1 length=`echo $octal | wc -c | tr -d " "` power=1 while [ $length -gt 2 ] do power=$(( $power * 8 )) length=$(( $length - 1 )) done decimal=0 while [ "%$octal%" != "%%" ] do digit=`echo $octal | cut -b 1` echo -n "Octal = $octal, Digit = $digit, Power = $power, Value = " value=$(( $digit * $power )) echo $value decimal=$(( $decimal + value )) power=$(( $power / 8 )) octal=`echo $octal | sed 's/^.//'` done echo "" echo "Result = $decimal" The following shell script example shows how to convert a decimal number to octal from first principles: #!/bin/bash # Take a decimal number and output it's octal quotient=$1 while [ $quotient -ne 0 ] do remainder=$(( $quotient % 8 )) octal="$remainder$octal" quotient=$(( $quotient / 8 )) done echo $octal References Computer Engineering Hardware Design by M Morris Mano published by Prentice Hall 1988 See also Binary Decimal Hexadecimal Entry history Entry created: Thu Mar 20 15:20:12 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Finalized Ozlabs Definition Originally the Australian division of LinuxCare and based in Canberra. Members include Anton Blanchard, Hugh Blemings, David Gibson, Greg Lehey, Martin Pool, Stephen Rothwell, Rusty Russell, Martin Schwenke, Andrew Tridgell and Christopher Yeoh. References http://www.ozlabs.org Entry history Entry created: Tue Mar 18 18:18:55 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Unfinalized p ... Pennarun, Avery See Avery Pennarun Entry history Entry created: Tue Mar 18 19:19:10 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Finalized Pool, Martin See Martin Pool Entry history Entry created: Tue Mar 18 19:48:52 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Finalized q ... r ... Rothwell, Stephen See Stephen Rothwell Entry history Entry created: Tue Mar 18 18:12:33 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Finalized s ... Stephen Rothwell Definition Stephen appeared on the Linux scene with his contribution of APM support whilst working at NEC. He is a member of Ozlabs, and currently works for the IBM Linux Technology Center. References Homepage: http://www.canb.auug.org.au/~sfr/ Entry history Entry created: Tue Mar 18 18:12:33 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Unfinalized Still, Michael See Michael Still Entry history Entry created: Tue Mar 18 19:29:39 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Finalized t ... TSC Acronym definition Time Stamp Counter Definition TODO Entry history Entry created: Wed Apr 30 20:18:06 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Unfinalized u ... v ... w ... x ... x86info Definition x86info is an application maintained by Dave Jones to identify CPUs fitted to a system. To quote the README file... Somewhere in the mists of time, there was a program by Phil Karn (KA9Q) called cpuid, which identified CPU. It didn't get updated very often, and quickly got out of date. It also didn't do much more than just simple decoding. x86info was written to succeed Phils work. Initially, it borrowed some bits from his code, but the last remnants are now long gone. Additional functionality has been added, such as support for SMP, and building on non-Linux platforms. For problems specific to the Cygwin/Win32 port, contact Matthew Gregan <mgregan@jade.co.nz>. Features: - SMP support. - Recognition of all Intel/AMD/IDT/Cyrix/VIA CPUs. - Parsing of model specific registers. - Approximation of current CPU MHz. Caveats: * For usage of the MSR / SMP functions, x86info needs the x86 cpuid driver provided with the Linux kernel 2.2.18 / 2.4.0, and the appropriate nodes in /dev To set up these devices, do the following.. mkdir /dev/cpu for i in 0 1 2 3 4 5 6 7 do mkdir /dev/cpu/$i ; cd /dev/cpu/$i mknod cpuid c 203 $i mknod msr c 202 $i done * If you are using the cpuid / msr drivers built as modules as opposed to built into the kernel, then you should ensure the following is in your /etc/modules.conf alias char-major-202 msr alias char-major-203 cpuid * To build under Win32/Cygwin, uncomment the second line in the Makefile, otherwise some files will fail to build. * Usage under Win32 is somewhat limited at present: - no support for reading MSRs (anyone want to write a driver?) * FreeBSD / OpenBSD / NetBSD also have the same limitations. Info on the command line switches can be found in the man page. References Homepage: http://www.codemonkey.org.uk See also cpuid Entry history Entry created: Tue Mar 18 20:02:15 EST 2003 Entry owner: Michael Still (mikal@stillhq.com) Status: Unfinalized y ... z ...