From owner-freebsd-doc Fri Jun 14 6:51:48 2002 Delivered-To: freebsd-doc@freebsd.org Received: from mx1.eskimo.com (mx1.eskimo.com [204.122.16.48]) by hub.freebsd.org (Postfix) with ESMTP id CF5B737B417 for ; Fri, 14 Jun 2002 06:51:01 -0700 (PDT) Received: from eskimo.com (ripper@eskimo.com [204.122.16.13]) by mx1.eskimo.com (8.9.1a/8.8.8) with ESMTP id GAA00347; Fri, 14 Jun 2002 06:50:59 -0700 Received: (from ripper@localhost) by eskimo.com (8.9.1a/8.9.1) id GAA13475; Fri, 14 Jun 2002 06:50:59 -0700 (PDT) Date: Fri, 14 Jun 2002 06:50:59 -0700 (PDT) Message-Id: <200206141350.GAA13475@eskimo.com> From: Ross Lippert To: devnull@uptsoft.com Cc: freebsd-doc@freebsd.org In-reply-to: <20020614113942.A20213@oasis.uptsoft.com> (message from Sergey Lyubka on Fri, 14 Jun 2002 11:39:42 +0300) Subject: Re: [devnull@asitatech.ie: Re: an addition to developer-handbook] Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org OK, here are some new diff's. Some were errors I hadn't caught before (and some I had) and some were changes I made because I got a better understanding of the material when I read it (like BTX). When talking about init, you mention that it is covered in "the book". Which book do you mean? do you mean "the FreeBSD Developer's Handbook" or "the FreeBSD Handbook" or something else? Just put something a tad more specific there. It would not hurt to run a spellchecker on it. If I were writing it, I'd do something like w3m boot.html > boot.txt to strip out the tags and then ispell boot.txt or better yet aspell boot.txt It is a pain to spellcheck stuff with a lot of code in it, which is why I'm not doing it for you, but think about the main of having to fix every error spotted by your readers if you don't fix it ahead of time. Oh one last thing. I do not know whether the proper term to use is harddisk or hard disk or hard-disk. I have normalized every occurrence in your text to harddisk so whichever you decide you can easily find and replace all occurrences. -r --- Serg Fri Jun 14 09:39:28 2002 +++ Serg.orig Fri Jun 14 09:20:28 2002 @@ -16,7 +16,7 @@ Synopsis This chapter is an overview of the boot and system initialization - process, starting from the BIOS (firmware) POST, to the first user process + process, starting from the BIOS(firmware) POST, to the first user process creation. Since the initial steps of system startup are very architecture dependent, the IA-32 architecture was chosen as example. @@ -24,8 +24,8 @@ Overview - A computer running FreeBSD can boot by several methods, - although the most common method, booting from a harddisk where the OS is + Computer running FreeBSD can boot by several methods, + although the most common method, booting from harddisk where the OS is installed, will be discussed here. The boot process is divided into several steps: @@ -119,7 +119,7 @@ is well defined: it is a 32-bit value of 0xffffff00. 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 + register, and it's value just after the reboot is 0. One of the cr1's bits, the bit PE (Protected Enabled) indicates whether the processor is running in protected or real mode. Since at boot time this bit is cleared, the @@ -150,7 +150,7 @@ 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 to a number + hard drive architecture, where the magnetic plate is divided to a number of cylindrical tracks. Tracks are numbered, and every track is divided by a number (usually 64) sectors. Track number 0 is the outermost on the magnetic plate, and sector 1, the first sector (tracks, or, cylinders, @@ -182,7 +182,7 @@ starting from offset 0x1be, called the partition table. It has 4 records of 16 bytes each, called partition records, which represent how the - harddisk(s) are partitioned, or, in FreeBSD's terminology, sliced. + hardisk(s) are partitioned, or, in FreeBSD's terminology, sliced. One byte of those 16 says whether a partition (slice) is bootable or not. Exactly one record must have that flag set, otherwise boot0's code will refuse to proceed. @@ -201,7 +201,7 @@ the same information, but in different ways: LBA (Logical Block Addressing) has the starting sector for the partition and the partition's length, while CHS (Cylinder Head Sector) - has coordinates for the first and last sectors of the partition. + has a coordinates for the first and last sectors of the partition. The boot manager scans the partition table and prints the menu on the screen so the user can select what disk and what slice to boot. @@ -274,7 +274,7 @@ This Makefile snippet shows that &man.btxld.8; is used to link the binary. BTX, which stands for BooT eXtender, is a piece of code that provides a protected mode environment for the program, called the - client, that it is linked with. So boot2 is a BTX client, i.e. it uses + client, that it linked with. So boot2 is a BTX client, i.e. it uses the sevice provided by BTX. The btxld utility is the linker. It links @@ -508,8 +508,8 @@ orl $CR0_PE|CR0_PG,%eax /* enable paging */ movl %eax,%cr0 /* and let's page NOW! */ - The next three lines of code are because the paging was set, - so the jump is needed to continue the execution in virtualized address + The next three lines of code are due to the paging was set, + so the jump is nedded to continue the execution in virtualized address space: pushl $begin /* jump to high virtualized address */ @@ -518,9 +518,9 @@ /* now running relocated at KERNBASE where the system is linked to run */ begin: - The function init386() is called, + The funtion init386() is called, with a pointer to the first free physical page, after that - mi_startup(). init386() is an architecture dependent + mi_startup(). init386 is an architecture dependent initialization function, and mi_startup() is an architecture independent one. The kernel never returns from mi_startup(), and by calling it, the kernel finishes booting: @@ -546,19 +546,19 @@ Initialize the kernel tunable parameters, passed from - the bootstapping program. - Prepare the GDT. - Prepare the IDT. + bootstapping program. + Prepare GDT. + Prepare IDT. Initialize the system console. - Initialize the DDB, if it is compiled into kernel. + Initialize DDB, if it is compiled into kernel. - Initialize the TSS. - Prepare the LDT. + Initialize TSS. + Prepare LDT. Setup proc0's pcb. - What init386() first does is initialize the tunable parameters + What init386() first does is initialize 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: @@ -595,7 +595,7 @@ 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 + begin at virtual address 0 and end at 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 @@ -739,7 +739,7 @@ SYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t, copyright) - The subsystem ID for this object is SI_SUB_COPYRIGHT (0x0800001), + The subsystem ID for this oject is SI_SUB_COPYRIGHT (0x0800001), which comes right after the SI_SUB_CONSOLE (0x0800000). So, the copyright message will be printed out first, just after the console initialization. @@ -828,7 +828,7 @@ extern struct linker_set sysinit_set; /* XXX */ The struct linker_set is defined as - follows: + following: /usr/include/linker_set.h: struct linker_set { int ls_length; @@ -836,7 +836,7 @@ }; - The first node will be equal to the number of sysinit objects, + The first node will be equal to a number of a sysinit objects, and the second node will be a NULL-terminated array of pointers to them. @@ -885,7 +885,7 @@ The create_init() allocates a new process by calling fork1(), but does not mark it runnable. When this new process is scheduled for execution by the scheduler, - the start_init() will be called. That function is + a start_init() will be called. That function is defined in init_main.c. It tries to load and exec the init binary, probing /sbin/init first, then /sbin/oinit, @@ -903,4 +903,3 @@ - To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message