From owner-p4-projects@FreeBSD.ORG Wed Jan 11 21:10:35 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 44B38106567A; Wed, 11 Jan 2012 21:10:35 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00532106564A for ; Wed, 11 Jan 2012 21:10:34 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id E02B28FC17 for ; Wed, 11 Jan 2012 21:10:34 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id q0BLAY0u065517 for ; Wed, 11 Jan 2012 21:10:34 GMT (envelope-from rene@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id q0BLAYwW065505 for perforce@freebsd.org; Wed, 11 Jan 2012 21:10:34 GMT (envelope-from rene@FreeBSD.org) Date: Wed, 11 Jan 2012 21:10:34 GMT Message-Id: <201201112110.q0BLAYwW065505@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to rene@FreeBSD.org using -f From: Rene Ladan To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 204418 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 21:10:35 -0000 http://p4web.freebsd.org/@@204418?ac=10 Change 204418 by rene@rene_acer on 2012/01/11 21:10:12 IFC Affected files ... .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/bsdl-gpl/article.sgml#4 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml#120 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/euro/article.sgml#3 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/explaining-bsd/article.sgml#5 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/fonts/article.sgml#2 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/geom-class/article.sgml#2 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/portbuild/article.sgml#45 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/pxe/install.cfg#2 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/releng/article.sgml#9 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/wp-toolbox/article.sgml#2 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/arch-handbook/boot/chapter.sgml#4 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/arch-handbook/newbus/chapter.sgml#3 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/multimedia/chapter.sgml#14 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/porters-handbook/book.sgml#122 integrate .. //depot/projects/docproj_nl/share/pgpkeys/pgpkeys-developers.sgml#67 integrate .. //depot/projects/docproj_nl/share/sgml/man-refs.ent#37 integrate .. //depot/projects/docproj_nl/www/en/index.xsl#11 integrate .. //depot/projects/docproj_nl/www/en/releases/9.0R/Makefile#3 integrate .. //depot/projects/docproj_nl/www/en/releases/9.0R/installation.html#1 branch .. //depot/projects/docproj_nl/www/en/releases/index.sgml#14 integrate .. //depot/projects/docproj_nl/www/en/releng/index.sgml#46 integrate .. //depot/projects/docproj_nl/www/en/security/security.sgml#21 integrate .. //depot/projects/docproj_nl/www/en/where.sgml#16 integrate .. //depot/projects/docproj_nl/www/share/sgml/navibar.ent#12 integrate .. //depot/projects/docproj_nl/www/share/sgml/release.ent#41 integrate Differences ... ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/bsdl-gpl/article.sgml#4 (text+ko) ==== @@ -23,13 +23,12 @@ - $FreeBSD: doc/en_US.ISO8859-1/articles/bsdl-gpl/article.sgml,v 1.8 2008/10/11 10:43:29 brueffer Exp $ + $FreeBSD: doc/en_US.ISO8859-1/articles/bsdl-gpl/article.sgml,v 1.9 2012/01/11 01:21:32 eadler Exp $ &tm-attrib.freebsd; &tm-attrib.cvsup; &tm-attrib.intel; - &tm-attrib.xfree86; &tm-attrib.general; ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml#120 (text+ko) ==== @@ -1,4 +1,4 @@ - + + @@ -97,12 +96,15 @@ The X Window system, which handles graphical display. The X Window system used in most versions of BSD is maintained - by one of two separate projects, either the - &xfree86; project or the + by the X.Org project. - This is the same code as Linux uses. BSD does not normally - specify a graphical desktop such as GNOME or KDE, - though these are available. + &os; allows the user to choose from a variety of desktop + environments, such as Gnome, + KDE, or Xfce; + and lightweight window managers like + Openbox, + Fluxbox, or + Awesome. ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/fonts/article.sgml#2 (text+ko) ==== @@ -1,4 +1,4 @@ - + @@ -860,14 +860,6 @@ currently developing a useful set of FreeType tools: - - The freetype module is included with XFree86 4.x. For - more information please see the FreeBSD - Handbook or the XFree86 4.0.2 - Fonts page. - The xfsft font server for X11 can ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/geom-class/article.sgml#2 (text+ko) ==== @@ -22,13 +22,12 @@ - $FreeBSD: doc/en_US.ISO8859-1/articles/geom-class/article.sgml,v 1.8 2007/05/04 12:45:05 ceri Exp $ + $FreeBSD: doc/en_US.ISO8859-1/articles/geom-class/article.sgml,v 1.9 2012/01/11 02:13:00 eadler Exp $ &tm-attrib.freebsd; &tm-attrib.cvsup; &tm-attrib.intel; - &tm-attrib.xfree86; &tm-attrib.general; ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/portbuild/article.sgml#45 (text+ko) ==== @@ -11,7 +11,7 @@ The &os; Ports Management Team - $FreeBSD: doc/en_US.ISO8859-1/articles/portbuild/article.sgml,v 1.87 2012/01/07 00:15:52 linimon Exp $ + $FreeBSD: doc/en_US.ISO8859-1/articles/portbuild/article.sgml,v 1.89 2012/01/07 16:19:04 linimon Exp $ 2003 @@ -2460,7 +2460,8 @@ - Edit /var/portbuild/scripts/buildenv. + (Only necessary for old codebase): + Edit /var/portbuild/scripts/buildenv. @@ -2510,7 +2511,8 @@ - Only after the first time a + (Only necessary for old codebase): + Only after the first time a dopackages has been run for the arch: add the arch to /var/portbuild/scripts/dopackagestats. @@ -2601,9 +2603,7 @@ # mkdir -p /a/portbuild # cd /a/portbuild # -# chmod 775 . - -ln -s ../arch/archive/errorlogs arch-errorlogs +# chmod 775 . ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/pxe/install.cfg#2 (text+ko) ==== @@ -1,6 +1,6 @@ # $Wintelcom: src/freebsd/pxe/doc/install.cfg,v 1.1 2000/07/14 12:42:05 bright Exp $ -# $FreeBSD: doc/en_US.ISO8859-1/articles/pxe/install.cfg,v 1.2 2003/11/23 18:50:32 ceri Exp $ +# $FreeBSD: doc/en_US.ISO8859-1/articles/pxe/install.cfg,v 1.3 2012/01/11 01:21:58 eadler Exp $ # This is the installation configuration file for our rackmounted FreeBSD # cluster machines @@ -66,13 +66,7 @@ # OK, everything is set. Do it! installCommit -package=XFree86-3.3.6 -packageAdd - -#package=XFree86-aoutlibs-3.3.3 -#packageAdd - -package=XFree86-contrib-3.3.6 +package=xorg-server-1.10.4_1,1 packageAdd package=arpwatch-2.1.a4 ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/releng/article.sgml#9 (text+ko) ==== @@ -37,13 +37,12 @@ - $FreeBSD: doc/en_US.ISO8859-1/articles/releng/article.sgml,v 1.87 2011/07/24 21:27:50 gjb Exp $ + $FreeBSD: doc/en_US.ISO8859-1/articles/releng/article.sgml,v 1.88 2012/01/11 00:41:43 eadler Exp $ &tm-attrib.freebsd; &tm-attrib.cvsup; &tm-attrib.intel; - &tm-attrib.xfree86; &tm-attrib.general; @@ -716,33 +715,6 @@ For more information about the release build infrastructure, please see &man.release.7;. - - - - Building <application>&xfree86;</application> - - &xfree86; is an important component for many desktop users. - Prior to &os; 4.6-RELEASE, releases used &xfree86; - 3.X by default. - The easiest way to build these versions is to use the - src/release/scripts/X11/build_x.sh script. - This script requires that &xfree86; and Tcl/Tk already be - installed on the build host. After compiling the necessary X - servers, the script will package all of the files into tarballs - that &man.sysinstall.8; expects to find in the - XF86336 directory of the installation - media. - - Beginning with &os; 4.6-RELEASE, &man.sysinstall.8; - installs &xfree86; 4.X by default, as a - set of normal packages. These can either be the - packages generated by the package-building cluster or packages - built from an appropriately tagged ports tree. - - Beginning with &os; 5.3-RELEASE, &man.sysinstall.8; - installs &xorg; packages instead of &xfree86; packages by - default. - It is important to remove any site-specific settings from /etc/make.conf. For example, it would be unwise to distribute binaries that were built on a system @@ -795,8 +767,7 @@ make release. The only changes that should be made to the disc1 directory are the addition of - a tools directory, &xfree86;, and as many popular + a tools directory, and as many popular third party software packages as will fit on the disc. The tools directory contains software that allow users to create installation floppies from other operating systems. This disc @@ -814,13 +785,6 @@ src/usr.sbin/sysinstall. Optionally, you may choose to update sysinstall.8. - If an alternate version of &xfree86; is to be provided, then - &man.sysinstall.8; must be updated to reflect the new location - and installation instructions. The relevant code is contained - in src/usr.sbin/sysinstall. - Specifically, the files dist.c, - menus.c, and - config.c will need to be updated. ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/wp-toolbox/article.sgml#2 (text+ko) ==== @@ -28,7 +28,7 @@ - $FreeBSD: doc/en_US.ISO8859-1/articles/wp-toolbox/article.sgml,v 1.6 2007/02/22 19:01:42 simon Exp $ + $FreeBSD: doc/en_US.ISO8859-1/articles/wp-toolbox/article.sgml,v 1.7 2012/01/11 01:21:58 eadler Exp $ &tm-attrib.freebsd; @@ -36,7 +36,6 @@ &tm-attrib.intel; &tm-attrib.microsoft; &tm-attrib.symantec; - &tm-attrib.xfree86; &tm-attrib.general; ==== //depot/projects/docproj_nl/en_US.ISO8859-1/books/arch-handbook/boot/chapter.sgml#4 (text+ko) ==== @@ -3,20 +3,20 @@ Copyright (c) 2002 Sergey Lyubka All rights reserved -$FreeBSD: doc/en_US.ISO8859-1/books/arch-handbook/boot/chapter.sgml,v 1.28 2009/11/28 11:14:28 danger Exp $ +$FreeBSD: doc/en_US.ISO8859-1/books/arch-handbook/boot/chapter.sgml,v 1.32 2012/01/10 02:50:25 wblock Exp $ --> - Sergey + Sergey Lyubka Contributed by - Bootstrapping and kernel initialization + Bootstrapping and Kernel Initialization Synopsis @@ -62,41 +62,34 @@ using the table that follows. Please note that the actual data may differ from machine to machine: - + - - - may vary - + + + Output (may vary) BIOS (firmware) messages - + - - -F1 FreeBSD + + F1 FreeBSD F2 BSD -F5 Disk 2 - - +F5 Disk 2 boot0 - + - - ->>FreeBSD/i386 BOOT + + >>FreeBSD/i386 BOOT Default: 1:ad(1,a)/boot/loader -boot: - - +boot: boot2This - prompt will appear if the user presses a key just after - selecting an OS to boot at the boot0 - stage. - + prompt will appear if the user presses a key just + after selecting an OS to boot at the + boot0 + stage. + - - -BTX loader 1.0 BTX version is 1.01 + + BTX loader 1.0 BTX version is 1.01 BIOS drive A: is disk0 BIOS drive C: is disk1 BIOS 639kB/64512kB available memory @@ -105,24 +98,20 @@ (jkh@bento.freebsd.org, Mon Nov 20 11:41:23 GMT 2000) /kernel text=0x1234 data=0x2345 syms=[0x4+0x3456] Hit [Enter] to boot immediately, or any other key for command prompt -Booting [kernel] in 9 seconds..._ - +Booting [kernel] in 9 seconds..._ + loader + - loader - - - - - Copyright (c) 1992-2002 The FreeBSD Project. + + Copyright (c) 1992-2002 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 4.6-RC #0: Sat May 4 22:49:02 GMT 2002 devnull@kukas:/usr/obj/usr/src/sys/DEVNULL Timecounter "i8254" frequency 1193182 Hz - - kernel - - + kernel + + @@ -136,9 +125,9 @@ after a power on is well defined: it is a 32-bit value of 0xfffffff0. The instruction pointer register points to code to be executed by the processor. One of the registers is the - cr1 32-bit control register, and its value - just after the reboot is 0. One of the cr1's bits, the bit PE - (Protected Enabled) indicates whether the processor is running + cr0 32-bit control register, and its value + just after the reboot is 0. One of the cr0's bits, the bit PE + (Protection Enabled) indicates whether the processor is running in protected or real mode. Since at boot time this bit is cleared, the processor boots in real mode. Real mode means, among other things, that linear and physical addresses are @@ -150,8 +139,8 @@ so that it points to a BIOS memory block. BIOS stands for Basic Input Output - System, and it is a chip on the motherboard that has - a relatively small amount of read-only memory (ROM). This + System, and it is a chip on the motherboard that + has a relatively small amount of read-only memory (ROM). This memory contains various low-level routines that are specific to the hardware supplied with the motherboard. So, the processor will first jump to the address 0xfffffff0, which really resides @@ -167,7 +156,7 @@ CD-ROM, harddisk etc. The very last thing in the POST is the INT - 0x19 instruction. That instruction reads 512 bytes + 0x19 instruction. That instruction reads 512 bytes from the first sector of boot device into the memory at address 0x7c00. The term first sector originates from harddrive architecture, where the magnetic plate is divided @@ -178,19 +167,20 @@ from 0, but sectors - starting from 1), has a special meaning. It is also called Master Boot Record, or MBR. The remaining sectors on the first track are never used Some - utilities such as &man.disklabel.8; may store the information in - this area, mostly in the second - sector.. + utilities such as &man.disklabel.8; may store the + information in this area, mostly in the second + sector.. - <literal>boot0</literal> stage + <literal>boot0</literal> Stage MBR Take a look at the file /boot/boot0. This is a small 512-byte file, and it is exactly what FreeBSD's installation procedure wrote to your harddisk's MBR if you chose - the bootmanager option at installation time. + the bootmanager option at installation + time. As mentioned previously, the INT 0x19 instruction loads an MBR, i.e. the boot0 @@ -214,19 +204,19 @@ - the 1-byte filesystem type + the 1-byte filesystem type - the 1-byte bootable flag + the 1-byte bootable flag - the 6 byte descriptor in CHS format + the 6 byte descriptor in CHS format - the 8 byte descriptor in LBA format + the 8 byte descriptor in LBA format @@ -269,7 +259,7 @@ - <literal>boot2</literal> stage + <literal>boot2</literal> Stage You might wonder, why boot2 comes after boot0, and not boot1. Actually, there is a @@ -316,7 +306,7 @@ The boot2 binary is created in special way: - sys/boot/i386/boot2/Makefile + sys/boot/i386/boot2/Makefile: boot2: boot2.ldr boot2.bin ${BTX}/btx/btx btxld -v -E ${ORG2} -f bin -b ${BTX}/btx/btx -l boot2.ldr \ -o boot2.ld -P 1 boot2.bin @@ -346,30 +336,36 @@ virtual v86 mode - virtual v86 mode. That means, the BTX is a v86 - monitor. Real mode instructions like pushf, popf, cli, sti, if - called by the client, will work. + + virtual v86 mode. That means, the BTX is a v86 monitor. + Real mode instructions like pushf, popf, cli, sti, if called + by the client, will work. + - Interrupt Descriptor Table (IDT) is set up so - all hardware interrupts are routed to the default BIOS's - handlers, and interrupt 0x30 is set up to be the syscall - gate. + + Interrupt Descriptor Table (IDT) is set up so all + hardware interrupts are routed to the default BIOS's + handlers, and interrupt 0x30 is set up to be the syscall + gate. + - Two system calls: exec and - exit, are defined: + + Two system calls: exec and + exit, are defined: - sys/boot/i386/btx/lib/btxsys.s: + sys/boot/i386/btx/lib/btxsys.s: .set INT_SYS,0x30 # Interrupt number # # System call: exit # -__exit: xorl %eax,%eax # BTX system +__exit: xorl %eax,%eax # BTX system int $INT_SYS # call 0x0 # # System call: exec # -__exec: movl $0x1,%eax # BTX system - int $INT_SYS # call 0x1 +__exec: movl $0x1,%eax # BTX system + int $INT_SYS # call 0x1 + BTX creates a Global Descriptor Table (GDT): @@ -392,8 +388,8 @@ segment pointed to by the SEL_SCODE (supervisor code) selector, as shown from the code that creates an IDT: - mov $SEL_SCODE,%dh # Segment selector -init.2: shr %bx # Handle this int? + mov $SEL_SCODE,%dh # Segment selector +init.2: shr %bx # Handle this int? jnc init.3 # No mov %ax,(%di) # Set handler offset mov %dh,0x2(%di) # and selector @@ -415,7 +411,7 @@ boot device, physical memory available, envp pointer etc. The definition for it is: - /usr/include/machine/bootinfo.h + /usr/include/machine/bootinfo.h: struct bootinfo { u_int32_t bi_version; u_int32_t bi_kernelname; /* represents a char * */ @@ -438,28 +434,29 @@ u_int32_t bi_modulep; /* preloaded modules */ }; - boot2 enters into an infinite loop waiting - for user input, then calls load(). If the - user does not press anything, the loop breaks by a timeout, so - load() will load the default file - (/boot/loader). Functions ino_t - lookup(char *filename) and int xfsread(ino_t - inode, void *buf, size_t nbyte) are used to read the - content of a file into memory. /boot/loader - is an ELF binary, but where the ELF header is prepended with - a.out's struct exec structure. - load() scans the loader's ELF header, loading - the content of /boot/loader into memory, and - passing the execution to the loader's entry: + boot2 enters into an infinite loop + waiting for user input, then calls load(). + If the user does not press anything, the loop breaks by a + timeout, so load() will load the default + file (/boot/loader). Functions + ino_t lookup(char *filename) and + int xfsread(ino_t inode, void *buf, size_t + nbyte) are used to read the content of a file into + memory. /boot/loader is an ELF binary, but + where the ELF header is prepended with a.out's struct + exec structure. load() scans the + loader's ELF header, loading the content of + /boot/loader into memory, and passing the + execution to the loader's entry: - sys/boot/i386/boot2/boot2.c: + sys/boot/i386/boot2/boot2.c: __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), MAKEBOOTDEV(dev_maj[dsk.type], 0, dsk.slice, dsk.unit, dsk.part), 0, 0, 0, VTOP(&bootinfo)); - <application>loader</application> stage + <application>loader</application> Stage loader is a BTX client as well. I will not describe it here in detail, there is a comprehensive @@ -470,18 +467,18 @@ the kernel is loaded into memory, it is being called by the loader: - sys/boot/common/boot.c: + sys/boot/common/boot.c: /* Call the exec handler from the loader matching the kernel */ module_formats[km->m_loader]->l_exec(km); - Kernel initialization + Kernel Initialization - Let us take a look at the command that links the kernel. This - will help us identify the exact location where the loader passes - execution to the kernel. This location is the kernel's actual entry - point. + Let us take a look at the command that links the kernel. + This will help identify the exact location where the loader + passes execution to the kernel. This location is the kernel's + actual entry point. sys/conf/Makefile.i386: ld -elf -Bdynamic -T /usr/src/sys/conf/ldscript.i386 -export-dynamic \ @@ -489,8 +486,8 @@ <lots of kernel .o files> ELF - A few interesting things can be seen in this line. First, - the kernel is an ELF dynamically linked binary, but the dynamic + A few interesting things can be seen here. First, the + kernel is an ELF dynamically linked binary, but the dynamic linker for kernel is /red/herring, which is definitely a bogus file. Second, taking a look at the file sys/conf/ldscript.i386 gives an idea about @@ -498,13 +495,13 @@ compiling a kernel. Reading through the first few lines, the string - sys/conf/ldscript.i386: + sys/conf/ldscript.i386: ENTRY(btext) says that a kernel's entry point is the symbol `btext'. This symbol is defined in locore.s: - sys/i386/i386/locore.s: + sys/i386/i386/locore.s: .text /********************************************************************** * @@ -513,11 +510,11 @@ */ NON_GPROF_ENTRY(btext) - First what is done is the register EFLAGS is set to a - predefined value of 0x00000002, and then all the segment - registers are initialized: + First, the register EFLAGS is set to a predefined value of + 0x00000002. Then all the segment registers are + initialized: - sys/i386/i386/locore.s + sys/i386/i386/locore.s: /* Don't trust what the BIOS gives for eflags. */ pushl $PSL_KERNEL popfl @@ -539,34 +536,31 @@ - - - recover_bootinfo + + + recover_bootinfo + This routine parses the parameters to the kernel + passed from the bootstrap. The kernel may have been + booted in 3 ways: by the loader, described above, by the + old disk boot blocks, or by the old diskless boot + procedure. This function determines the booting method, + and stores the struct bootinfo + structure into the kernel memory. + - This routine parses the parameters to the kernel - passed from the bootstrap. The kernel may have been - booted in 3 ways: by the loader, described above, by the - old disk boot blocks, and by the old diskless boot - procedure. This function determines the booting method, - and stores the struct bootinfo - structure into the kernel memory. - + + identify_cpu + This functions tries to find out what CPU it is + running on, storing the value found in a variable + _cpu. + - - identify_cpu - - This functions tries to find out what CPU it is - running on, storing the value found in a variable - _cpu. - - - - create_pagetables - - This function allocates and fills out a Page Table - Directory at the top of the kernel memory area. - - + + create_pagetables + This function allocates and fills out a Page Table + Directory at the top of the kernel memory area. + + @@ -580,6 +574,7 @@ movl %eax, %cr4 Then, enabling paging: + /* Now enable paging */ movl R(_IdlePTD), %eax movl %eax,%cr3 /* load ptd addr into mmu */ @@ -597,7 +592,7 @@ /* now running relocated at KERNBASE where the system is linked to run */ begin: - The function init386() is called, with + The function init386() is called with a pointer to the first free physical page, after that mi_startup(). init386 is an architecture dependent initialization function, and @@ -617,57 +612,56 @@ <function>init386()</function> init386() is defined in - sys/i386/i386/machdep.c and performs - low-level initialization, specific to the i386 chip. The - switch to protected mode was performed by the loader. The - loader has created the very first task, in which the kernel - continues to operate. Before running straight away to the - code, I will enumerate the tasks the processor must complete - to initialize protected mode execution: + sys/i386/i386/machdep.c and performs + low-level initialization specific to the i386 chip. The + switch to protected mode was performed by the loader. The + loader has created the very first task, in which the kernel + continues to operate. Before looking at the code, consider + the tasks the processor must complete to initialize protected + mode execution: - + Initialize the kernel tunable parameters, passed from the bootstrapping program. - + - + Prepare the GDT. - + Prepare the IDT. - + Initialize the system console. - + Initialize the DDB, if it is compiled into kernel. - + Initialize the TSS. - + Prepare the LDT. - + Set up proc0's pcb. - parameters - What init386() first does is - initialize the tunable parameters passed from bootstrap. This - is done by setting the environment pointer (envp) and calling - init_param1(). The envp pointer has been - passed from loader in the bootinfo - structure: + parameters + init386() initializes the tunable + parameters passed from bootstrap by setting the environment + pointer (envp) and calling init_param1(). + The envp pointer has been passed from loader in the + bootinfo structure: sys/i386/i386/machdep.c: kern_envp = (caddr_t)bootinfo.bi_envp + KERNBASE; @@ -676,45 +670,45 @@ init_param1(); init_param1() is defined in - sys/kern/subr_param.c. That file has a - number of sysctls, and two functions, - init_param1() and - init_param2(), that are called from - init386(): + sys/kern/subr_param.c. That file has a + number of sysctls, and two functions, + init_param1() and + init_param2(), that are called from + init386(): - sys/kern/subr_param.c + sys/kern/subr_param.c: hz = HZ; TUNABLE_INT_FETCH("kern.hz", &hz); TUNABLE_<typename>_FETCH is used to fetch the value - from the environment: + from the environment: - /usr/src/sys/sys/kernel.h + /usr/src/sys/sys/kernel.h: #define TUNABLE_INT_FETCH(path, var) getenv_int((path), (var)) - Sysctl kern.hz is the system clock tick. Along with - this, the following sysctls are set by - init_param1(): kern.maxswzone, - kern.maxbcache, kern.maxtsiz, kern.dfldsiz, kern.maxdsiz, kern.dflssiz, - kern.maxssiz, kern.sgrowsiz. + Sysctl kern.hz is the system clock + tick. Additionally, these sysctls are set by + init_param1(): kern.maxswzone, + kern.maxbcache, kern.maxtsiz, kern.dfldsiz, kern.maxdsiz, + kern.dflssiz, kern.maxssiz, kern.sgrowsiz. - Global Descriptors Table (GDT) + Global Descriptors Table + (GDT) Then init386() prepares the Global - Descriptors Table (GDT). Every task on an x86 is running in - its own virtual address space, and this space is addressed by - a segment:offset pair. Say, for instance, the current - instruction to be executed by the processor lies at CS:EIP, - then the linear virtual address for that instruction would be - the virtual address of code segment CS + EIP. For - convenience, segments begin at virtual address 0 and end at a - 4Gb boundary. Therefore, the instruction's linear virtual - address for this example would just be the value of EIP. - Segment registers such as CS, DS etc are the selectors, - i.e. indexes, into GDT (to be more precise, an index is not a - selector itself, but the INDEX field of a selector). - FreeBSD's GDT holds descriptors for 15 selectors per - CPU: + Descriptors Table (GDT). Every task on an x86 is running in + its own virtual address space, and this space is addressed by + a segment:offset pair. Say, for instance, the current + instruction to be executed by the processor lies at CS:EIP, + then the linear virtual address for that instruction would be + the virtual address of code segment CS + EIP. + For convenience, segments begin at virtual address 0 and end + at a 4Gb boundary. Therefore, the instruction's linear + virtual address for this example would just be the value of + EIP. Segment registers such as CS, DS etc are the selectors, + i.e. indexes, into GDT (to be more precise, an index is not a + selector itself, but the INDEX field of a selector). FreeBSD's + GDT holds descriptors for 15 selectors per CPU: sys/i386/i386/machdep.c: union descriptor gdt[NGDT * MAXCPU]; /* global descriptor table */ @@ -740,22 +734,23 @@ #define GBIOSARGS_SEL 14 /* BIOS interface (Arguments) */ >>> TRUNCATED FOR MAIL (1000 lines) <<<