Units
Translation components API.
See the Weblate's Web API documentation for detailed description of the API.
GET /api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/units/?format=api&page=4
https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/units/?format=api&page=5", "previous": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/units/?format=api&page=3", "results": [ { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ " boot2: boot2.ld\n\t@set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \\\n\t echo \"$$x bytes available\"; test $$x -ge 0\n\tdd if=boot2.ld of=boot2 obs=7680 conv=osync\n\n boot2.ld: boot2.ldr boot2.bin ../btx/btx/btx\n\tbtxld -v -E 0x2000 -f bin -b ../btx/btx/btx -l boot2.ldr \\\n\t -o boot2.ld -P 1 boot2.bin\n\n boot2.ldr:\n\tdd if=/dev/zero of=boot2.ldr bs=512 count=1\n\n boot2.bin: boot2.out\n\tobjcopy -S -O binary boot2.out boot2.bin\n\n boot2.out: ../btx/lib/crt0.o boot2.o sio.o\n\tld -Ttext 0x2000 -o boot2.out\n\n boot2.o: boot2.s\n\t${CC} ${ACFLAGS} -c boot2.s\n\n boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c\n\t${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c\n\tsed -e '/align/d' -e '/nop/d' \"MISSING\" boot2.s.tmp > boot2.s\n\trm -f boot2.s.tmp\n\n boot2.h: boot1.out\n\t${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \\\n\t { x = $$1 - ORG1; \\\n\t printf(\"#define XREADORG %#x\\n\", REL1 + x) }' \\\n\t ORG1=`printf \"%d\" ${ORG1}` \\\n\t REL1=`printf \"%d\" ${REL1}` > ${.TARGET}" ], "previous_source": "", "target": [ " boot2: boot2.ld\n\t@set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \\\n\t echo \"$$x bytes available\"; test $$x -ge 0\n\tdd if=boot2.ld of=boot2 obs=7680 conv=osync\n\n boot2.ld: boot2.ldr boot2.bin ../btx/btx/btx\n\tbtxld -v -E 0x2000 -f bin -b ../btx/btx/btx -l boot2.ldr \\\n\t -o boot2.ld -P 1 boot2.bin\n\n boot2.ldr:\n\tdd if=/dev/zero of=boot2.ldr bs=512 count=1\n\n boot2.bin: boot2.out\n\tobjcopy -S -O binary boot2.out boot2.bin\n\n boot2.out: ../btx/lib/crt0.o boot2.o sio.o\n\tld -Ttext 0x2000 -o boot2.out\n\n boot2.o: boot2.s\n\t${CC} ${ACFLAGS} -c boot2.s\n\n boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c\n\t${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c\n\tsed -e '/align/d' -e '/nop/d' \"MISSING\" boot2.s.tmp > boot2.s\n\trm -f boot2.s.tmp\n\n boot2.h: boot1.out\n\t${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \\\n\t { x = $$1 - ORG1; \\\n\t printf(\"#define XREADORG %#x\\n\", REL1 + x) }' \\\n\t ORG1=`printf \"%d\" ${ORG1}` \\\n\t REL1=`printf \"%d\" ${REL1}` > ${.TARGET}" ], "id_hash": 8633688708039404565, "content_hash": 8633688708039404565, "location": "book.translate.xml:1439", "context": "", "note": "(itstool) path: figure/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 156, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 129, "source_unit": "https://translate-dev.freebsd.org/api/units/102302/?format=api", "priority": 100, "id": 34037, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=f7d10622fffd6c15", "url": "https://translate-dev.freebsd.org/api/units/34037/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.486033Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The mechanism for building <filename>boot2</filename> is far more elaborate. Let us point out the most relevant facts. The dependency list is as follows:" ], "previous_source": "", "target": [ "" ], "id_hash": 4451372489452716113, "content_hash": 4451372489452716113, "location": "book.translate.xml:1473", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 157, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 23, "source_unit": "https://translate-dev.freebsd.org/api/units/102303/?format=api", "priority": 100, "id": 34039, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=bdc673b1dcc68051", "url": "https://translate-dev.freebsd.org/api/units/34039/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.505527Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ " boot2: boot2.ld\n boot2.ld: boot2.ldr boot2.bin ${BTXDIR}/btx/btx\n boot2.bin: boot2.out\n boot2.out: ${BTXDIR}/lib/crt0.o boot2.o sio.o\n boot2.o: boot2.s\n boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c\n boot2.h: boot1.out" ], "previous_source": "", "target": [ " boot2: boot2.ld\n boot2.ld: boot2.ldr boot2.bin ${BTXDIR}/btx/btx\n boot2.bin: boot2.out\n boot2.out: ${BTXDIR}/lib/crt0.o boot2.o sio.o\n boot2.o: boot2.s\n boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c\n boot2.h: boot1.out" ], "id_hash": -4387557941644265093, "content_hash": -4387557941644265093, "location": "book.translate.xml:1480", "context": "", "note": "(itstool) path: figure/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 158, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 20, "source_unit": "https://translate-dev.freebsd.org/api/units/102304/?format=api", "priority": 100, "id": 34040, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=431c434c60d9797b", "url": "https://translate-dev.freebsd.org/api/units/34040/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.524690Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Note that initially there is no header file <filename>boot2.h</filename>, but its creation depends on <filename>boot1.out</filename>, which we already have. The rule for its creation is a bit terse, but the important thing is that the output, <filename>boot2.h</filename>, is something like this:" ], "previous_source": "", "target": [ "" ], "id_hash": -6143428697633700527, "content_hash": -6143428697633700527, "location": "book.translate.xml:1489", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 159, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 41, "source_unit": "https://translate-dev.freebsd.org/api/units/102305/?format=api", "priority": 100, "id": 34042, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=2abe2826169a4551", "url": "https://translate-dev.freebsd.org/api/units/34042/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.540489Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>sys/boot/i386/boot2/boot2.h</filename>" ], "previous_source": "", "target": [ "<filename>sys/boot/i386/boot2/boot2.h</filename>" ], "id_hash": 7338451382584820606, "content_hash": 7338451382584820606, "location": "book.translate.xml:1497", "context": "", "note": "(itstool) path: figure/title", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 160, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/102306/?format=api", "priority": 100, "id": 34043, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=e5d76aa6d471437e", "url": "https://translate-dev.freebsd.org/api/units/34043/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.552095Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Recall that <filename>boot1</filename> was relocated (i.e., copied from <literal>0x7c00</literal> to <literal>0x700</literal>). This relocation will now make sense, because as we will see, the <acronym>BTX</acronym> server reclaims some memory, including the space where <filename>boot1</filename> was originally loaded. However, the <acronym>BTX</acronym> server needs access to <filename>boot1</filename>'s <literal>xread</literal> function; this function, according to the output of <filename>boot2.h</filename>, is at location <literal>0x725</literal>. Indeed, the <acronym>BTX</acronym> server uses the <literal>xread</literal> function from <filename>boot1</filename>'s relocated code. This function is now accessible from within the <filename>boot2</filename> client." ], "previous_source": "", "target": [ "" ], "id_hash": 2986992908778763261, "content_hash": 2986992908778763261, "location": "book.translate.xml:1502", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 162, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 80, "source_unit": "https://translate-dev.freebsd.org/api/units/102307/?format=api", "priority": 100, "id": 34047, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=a973ee398a5e73fd", "url": "https://translate-dev.freebsd.org/api/units/34047/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.571637Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "We next build <filename>boot2.s</filename> from files <filename>boot2.h</filename>, <filename>boot2.c</filename> and <filename>/usr/src/sys/boot/common/ufsread.c</filename>. The rule for this is to compile the code in <filename>boot2.c</filename> (which includes <filename>boot2.h</filename> and <filename>ufsread.c</filename>) into assembly code. Having <filename>boot2.s</filename>, the next rule assembles <filename>boot2.s</filename>, creating the object file <filename>boot2.o</filename>. The next rule directs the linker to link various files (<filename>crt0.o</filename>, <filename>boot2.o</filename> and <filename>sio.o</filename>). Note that the output file, <filename>boot2.out</filename>, is linked to execute at address <literal>0x2000</literal>. Recall that <filename>boot2</filename> will be executed in user mode, within a special user segment set up by the <acronym>BTX</acronym> server. This segment starts at <literal>0xa000</literal>. Also, remember that the <filename>boot2</filename> portion of <filename>boot</filename> was copied to address <literal>0xc000</literal>, that is, offset <literal>0x2000</literal> from the start of the user segment, so <filename>boot2</filename> will work properly when we transfer control to it. Next, <filename>boot2.bin</filename> is created from <filename>boot2.out</filename> by stripping its symbols and format information; boot2.bin is a <emphasis>raw</emphasis> binary. Now, note that a file <filename>boot2.ldr</filename> is created as a 512-byte file full of zeros. This space is reserved for the bsdlabel." ], "previous_source": "", "target": [ "" ], "id_hash": 1656382787934526792, "content_hash": 1656382787934526792, "location": "book.translate.xml:1519", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 163, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 168, "source_unit": "https://translate-dev.freebsd.org/api/units/102308/?format=api", "priority": 100, "id": 34049, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=96fca75ea6e89d48", "url": "https://translate-dev.freebsd.org/api/units/34049/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.581559Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Now that we have files <filename>boot1</filename>, <filename>boot2.bin</filename> and <filename>boot2.ldr</filename>, only the <acronym>BTX</acronym> server is missing before creating the all-in-one <filename>boot</filename> file. The <acronym>BTX</acronym> server is located in <filename>/usr/src/sys/boot/i386/btx/btx</filename>; it has its own <filename>Makefile</filename> with its own set of rules for building. The important thing to notice is that it is also compiled as a <emphasis>raw</emphasis> binary, and that it is linked to execute at address <literal>0x9000</literal>. The details can be found in <filename>/usr/src/sys/boot/i386/btx/btx/Makefile</filename>." ], "previous_source": "", "target": [ "" ], "id_hash": 7504267553389118903, "content_hash": 7504267553389118903, "location": "book.translate.xml:1548", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 164, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 73, "source_unit": "https://translate-dev.freebsd.org/api/units/102309/?format=api", "priority": 100, "id": 34050, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=e82483949b3f85b7", "url": "https://translate-dev.freebsd.org/api/units/34050/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.590206Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The <acronym>BTX</acronym> server prepares a simple environment and switches from 16-bit real mode to 32-bit protected mode, right before passing control to the client. This includes initializing and updating the following data structures:" ], "previous_source": "", "target": [ "" ], "id_hash": 2580015905768097474, "content_hash": 2580015905768097474, "location": "book.translate.xml:1581", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 166, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 33, "source_unit": "https://translate-dev.freebsd.org/api/units/102310/?format=api", "priority": 100, "id": 34053, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=a3ce0ecbfa2a46c2", "url": "https://translate-dev.freebsd.org/api/units/34053/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.608289Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<primary>virtual v86 mode</primary>" ], "previous_source": "", "target": [ "" ], "id_hash": 8156693648717910784, "content_hash": 8156693648717910784, "location": "book.translate.xml:1587", "context": "", "note": "(itstool) path: sect1/indexterm", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 167, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/102311/?format=api", "priority": 100, "id": 34055, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=f13265a851841300", "url": "https://translate-dev.freebsd.org/api/units/34055/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.621494Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Modifies the <literal>Interrupt Vector Table (IVT)</literal>. The <acronym>IVT</acronym> provides exception and interrupt handlers for Real-Mode code." ], "previous_source": "", "target": [ "" ], "id_hash": -2723847320111262009, "content_hash": -2723847320111262009, "location": "book.translate.xml:1590", "context": "", "note": "(itstool) path: listitem/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 168, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 16, "source_unit": "https://translate-dev.freebsd.org/api/units/102312/?format=api", "priority": 100, "id": 34056, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=5a32f34b3e5e56c7", "url": "https://translate-dev.freebsd.org/api/units/34056/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.646342Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The <literal>Interrupt Descriptor Table (IDT)</literal> is created. Entries are provided for processor exceptions, hardware interrupts, two system calls and V86 interface. The IDT provides exception and interrupt handlers for Protected-Mode code." ], "previous_source": "", "target": [ "" ], "id_hash": -3563239355067836220, "content_hash": -3563239355067836220, "location": "book.translate.xml:1597", "context": "", "note": "(itstool) path: listitem/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 169, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 31, "source_unit": "https://translate-dev.freebsd.org/api/units/102313/?format=api", "priority": 100, "id": 34058, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=4e8cd4af777d58c4", "url": "https://translate-dev.freebsd.org/api/units/34058/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.664299Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "A <literal>Task-State Segment (TSS)</literal> is created. This is necessary because the processor works in the <emphasis>least</emphasis> privileged level when executing the client (<filename>boot2</filename>), but in the <emphasis>most</emphasis> privileged level when executing the <acronym>BTX</acronym> server." ], "previous_source": "", "target": [ "" ], "id_hash": -1679125189854323457, "content_hash": -1679125189854323457, "location": "book.translate.xml:1605", "context": "", "note": "(itstool) path: listitem/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 170, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 34, "source_unit": "https://translate-dev.freebsd.org/api/units/102314/?format=api", "priority": 100, "id": 34059, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=68b28c8945529cff", "url": "https://translate-dev.freebsd.org/api/units/34059/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.685423Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Real-mode code and data are necessary when switching back to real mode from protected mode, as suggested by the Intel manuals." ], "previous_source": "", "target": [ "" ], "id_hash": 4868471269580487262, "content_hash": 4868471269580487262, "location": "book.translate.xml:1619", "context": "", "note": "(itstool) path: footnote/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 171, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 21, "source_unit": "https://translate-dev.freebsd.org/api/units/102315/?format=api", "priority": 100, "id": 34060, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=c39048d34e8a3a5e", "url": "https://translate-dev.freebsd.org/api/units/34060/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.701965Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The <acronym>GDT</acronym> (Global Descriptor Table) is set up. Entries (descriptors) are provided for supervisor code and data, user code and data, and real-mode code and data. <_:footnote-1/>" ], "previous_source": "", "target": [ "" ], "id_hash": -183496275650601868, "content_hash": -183496275650601868, "location": "book.translate.xml:1614", "context": "", "note": "(itstool) path: listitem/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 172, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 27, "source_unit": "https://translate-dev.freebsd.org/api/units/102316/?format=api", "priority": 100, "id": 34062, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=7d74171c083d1c74", "url": "https://translate-dev.freebsd.org/api/units/34062/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.714067Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Let us now start studying the actual implementation. Recall that <filename>boot1</filename> made a jump to address <literal>0x9010</literal>, the <acronym>BTX</acronym> server's entry point. Before studying program execution there, note that the <acronym>BTX</acronym> server has a special header at address range <literal>0x9000-0x900f</literal>, right before its entry point. This header is defined as follows:" ], "previous_source": "", "target": [ "" ], "id_hash": 8620327439433472063, "content_hash": 8620327439433472063, "location": "book.translate.xml:1625", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 173, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 51, "source_unit": "https://translate-dev.freebsd.org/api/units/102317/?format=api", "priority": 100, "id": 34063, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=f7a18e223afc183f", "url": "https://translate-dev.freebsd.org/api/units/34063/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.731259Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>sys/boot/i386/btx/btx/btx.S</filename>" ], "previous_source": "", "target": [ "<filename>sys/boot/i386/btx/btx/btx.S</filename>" ], "id_hash": 3866658205063318682, "content_hash": 3866658205063318682, "location": "book.translate.xml:1634, book.translate.xml:1665, book.translate.xml:1694, book.translate.xml:1735, book.translate.xml:1763, book.translate.xml:1834, book.translate.xml:1860, book.translate.xml:1911", "context": "", "note": "(itstool) path: figure/title", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 174, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/102318/?format=api", "priority": 100, "id": 34064, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=b5a92126aca60c9a", "url": "https://translate-dev.freebsd.org/api/units/34064/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.740990Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "start:\t\t\t\t\t\t# Start of code\n/*\n * BTX header.\n */\nbtx_hdr:\t.byte 0xeb\t\t\t# Machine ID\n\t\t.byte 0xe\t\t\t# Header size\n\t\t.ascii \"BTX\"\t\t\t# Magic\n\t\t.byte 0x1\t\t\t# Major version\n\t\t.byte 0x2\t\t\t# Minor version\n\t\t.byte BTX_FLAGS\t\t\t# Flags\n\t\t.word PAG_CNT-MEM_ORG>>0xc\t# Paging control\n\t\t.word break-start\t\t# Text size\n\t\t.long 0x0\t\t\t# Entry address" ], "previous_source": "", "target": [ "start:\t\t\t\t\t\t# Start of code\n/*\n * BTX header.\n */\nbtx_hdr:\t.byte 0xeb\t\t\t# Machine ID\n\t\t.byte 0xe\t\t\t# Header size\n\t\t.ascii \"BTX\"\t\t\t# Magic\n\t\t.byte 0x1\t\t\t# Major version\n\t\t.byte 0x2\t\t\t# Minor version\n\t\t.byte BTX_FLAGS\t\t\t# Flags\n\t\t.word PAG_CNT-MEM_ORG>>0xc\t# Paging control\n\t\t.word break-start\t\t# Text size\n\t\t.long 0x0\t\t\t# Entry address" ], "id_hash": -2979844910848480664, "content_hash": -2979844910848480664, "location": "book.translate.xml:1636", "context": "", "note": "(itstool) path: figure/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 175, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 54, "source_unit": "https://translate-dev.freebsd.org/api/units/102319/?format=api", "priority": 100, "id": 34066, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=56a576d76b1eea68", "url": "https://translate-dev.freebsd.org/api/units/34066/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.765265Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Note the first two bytes are <literal>0xeb</literal> and <literal>0xe</literal>. In the IA-32 architecture, these two bytes are interpreted as a relative jump past the header into the entry point, so in theory, <filename>boot1</filename> could jump here (address <literal>0x9000</literal>) instead of address <literal>0x9010</literal>. Note that the last field in the <acronym>BTX</acronym> header is a pointer to the client's (<filename>boot2</filename>) entry point. This field is patched at link time." ], "previous_source": "", "target": [ "" ], "id_hash": -8884740591099829498, "content_hash": -8884740591099829498, "location": "book.translate.xml:1651", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 176, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 67, "source_unit": "https://translate-dev.freebsd.org/api/units/102320/?format=api", "priority": 100, "id": 34068, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=04b30f817a002306", "url": "https://translate-dev.freebsd.org/api/units/34068/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.781852Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Immediately following the header is the <acronym>BTX</acronym> server's entry point:" ], "previous_source": "", "target": [ "" ], "id_hash": -7057184552592476325, "content_hash": -7057184552592476325, "location": "book.translate.xml:1661", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 177, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 10, "source_unit": "https://translate-dev.freebsd.org/api/units/102321/?format=api", "priority": 100, "id": 34070, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=1e0fd80a3c59f75b", "url": "https://translate-dev.freebsd.org/api/units/34070/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.790255Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "/*\n * Initialization routine.\n */\ninit:\t\tcli\t\t\t\t# Disable interrupts\n\t\txor %ax,%ax\t\t\t# Zero/segment\n\t\tmov %ax,%ss\t\t\t# Set up\n\t\tmov $0x1800,%sp\t\t# stack\n\t\tmov %ax,%es\t\t\t# Address\n\t\tmov %ax,%ds\t\t\t# data\n\t\tpushl $0x2\t\t\t# Clear\n\t\tpopfl\t\t\t\t# flags" ], "previous_source": "", "target": [ "/*\n * Initialization routine.\n */\ninit:\t\tcli\t\t\t\t# Disable interrupts\n\t\txor %ax,%ax\t\t\t# Zero/segment\n\t\tmov %ax,%ss\t\t\t# Set up\n\t\tmov $0x1800,%sp\t\t# stack\n\t\tmov %ax,%es\t\t\t# Address\n\t\tmov %ax,%ds\t\t\t# data\n\t\tpushl $0x2\t\t\t# Clear\n\t\tpopfl\t\t\t\t# flags" ], "id_hash": -3176526003486683688, "content_hash": -3176526003486683688, "location": "book.translate.xml:1667", "context": "", "note": "(itstool) path: figure/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 178, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 38, "source_unit": "https://translate-dev.freebsd.org/api/units/102322/?format=api", "priority": 100, "id": 34071, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=53eab66e06628dd8", "url": "https://translate-dev.freebsd.org/api/units/34071/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.802159Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Our next code block clears (sets to <literal>0</literal>) the memory range <literal>0x5e00-0x8fff</literal>. This range is where the various data structures will be created:" ], "previous_source": "", "target": [ "" ], "id_hash": -2605315173380673169, "content_hash": -2605315173380673169, "location": "book.translate.xml:1689", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 180, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 23, "source_unit": "https://translate-dev.freebsd.org/api/units/102324/?format=api", "priority": 100, "id": 34074, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=5bd80fa742b5b16f", "url": "https://translate-dev.freebsd.org/api/units/34074/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.825253Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "/*\n * Initialize memory.\n */\n\t\tmov $0x5e00,%di\t\t# Memory to initialize\n\t\tmov $(0x9000-0x5e00)/2,%cx\t# Words to zero\n\t\trep\t\t\t\t# Zero-fill\n\t\tstosw\t\t\t\t# memory" ], "previous_source": "", "target": [ "/*\n * Initialize memory.\n */\n\t\tmov $0x5e00,%di\t\t# Memory to initialize\n\t\tmov $(0x9000-0x5e00)/2,%cx\t# Words to zero\n\t\trep\t\t\t\t# Zero-fill\n\t\tstosw\t\t\t\t# memory" ], "id_hash": 7102389878318387376, "content_hash": 7102389878318387376, "location": "book.translate.xml:1696", "context": "", "note": "(itstool) path: figure/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 181, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 23, "source_unit": "https://translate-dev.freebsd.org/api/units/102325/?format=api", "priority": 100, "id": 34076, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=e290c1f6d97f50b0", "url": "https://translate-dev.freebsd.org/api/units/34076/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.836525Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Next, the real-mode <acronym>IVT</acronym> (Interrupt Vector Table is updated. The <acronym>IVT</acronym> is an array of segment/offset pairs for exception and interrupt handlers. The <acronym>BIOS</acronym> normally maps hardware interrupts to interrupt vectors <literal>0x8</literal> to <literal>0xf</literal> and <literal>0x70</literal> to <literal>0x77</literal> but, as will be seen, the 8259A Programmable Interrupt Controller, the chip controlling the actual mapping of hardware interrupts to interrupt vectors, is programmed to remap these interrupt vectors from <literal>0x8-0xf</literal> to <literal>0x20-0x27</literal> and from <literal>0x70-0x77</literal> to <literal>0x28-0x2f</literal>. Thus, interrupt handlers are provided for interrupt vectors <literal>0x20-0x2f</literal>. The reason the <acronym>BIOS</acronym>-provided handlers are not used directly is because they work in 16-bit real mode, but not 32-bit protected mode. Processor mode will be switched to 32-bit protected mode shortly. However, the <acronym>BTX</acronym> server sets up a mechanism to effectively use the handlers provided by the <acronym>BIOS</acronym>:" ], "previous_source": "", "target": [ "" ], "id_hash": 4136485347942891611, "content_hash": 4136485347942891611, "location": "book.translate.xml:1713", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 183, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 134, "source_unit": "https://translate-dev.freebsd.org/api/units/102326/?format=api", "priority": 100, "id": 34079, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=b967bf8206be805b", "url": "https://translate-dev.freebsd.org/api/units/34079/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.860770Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "/*\n * Update real mode IDT for reflecting hardware interrupts.\n */\n\t\tmov $intr20,%bx\t\t\t# Address first handler\n\t\tmov $0x10,%cx\t\t\t# Number of handlers\n\t\tmov $0x20*4,%di\t\t\t# First real mode IDT entry\ninit.0:\t\tmov %bx,(%di)\t\t\t# Store IP\n\t\tinc %di\t\t\t\t# Address next\n\t\tinc %di\t\t\t\t# entry\n\t\tstosw\t\t\t\t# Store CS\n\t\tadd $4,%bx\t\t\t# Next handler\n\t\tloop init.0\t\t\t# Next IRQ" ], "previous_source": "", "target": [ "/*\n * Update real mode IDT for reflecting hardware interrupts.\n */\n\t\tmov $intr20,%bx\t\t\t# Address first handler\n\t\tmov $0x10,%cx\t\t\t# Number of handlers\n\t\tmov $0x20*4,%di\t\t\t# First real mode IDT entry\ninit.0:\t\tmov %bx,(%di)\t\t\t# Store IP\n\t\tinc %di\t\t\t\t# Address next\n\t\tinc %di\t\t\t\t# entry\n\t\tstosw\t\t\t\t# Store CS\n\t\tadd $4,%bx\t\t\t# Next handler\n\t\tloop init.0\t\t\t# Next IRQ" ], "id_hash": -5364329879369892315, "content_hash": -5364329879369892315, "location": "book.translate.xml:1737", "context": "", "note": "(itstool) path: figure/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 184, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 60, "source_unit": "https://translate-dev.freebsd.org/api/units/102327/?format=api", "priority": 100, "id": 34080, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=358e12656a24be25", "url": "https://translate-dev.freebsd.org/api/units/34080/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.872085Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The next block creates the <acronym>IDT</acronym> (Interrupt Descriptor Table). The <acronym>IDT</acronym> is analogous, in protected mode, to the <acronym>IVT</acronym> in real mode. That is, the <acronym>IDT</acronym> describes the various exception and interrupt handlers used when the processor is executing in protected mode. In essence, it also consists of an array of segment/offset pairs, although the structure is somewhat more complex, because segments in protected mode are different than in real mode, and various protection mechanisms apply:" ], "previous_source": "", "target": [ "" ], "id_hash": -7681065202050831339, "content_hash": -7681065202050831339, "location": "book.translate.xml:1751", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 185, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 76, "source_unit": "https://translate-dev.freebsd.org/api/units/102328/?format=api", "priority": 100, "id": 34082, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=15675fe50f256c15", "url": "https://translate-dev.freebsd.org/api/units/34082/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.881591Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "/*\n * Create IDT.\n */\n\t\tmov $0x5e00,%di\t\t\t# IDT's address\n\t\tmov $idtctl,%si\t\t\t# Control string\ninit.1:\t\tlodsb\t\t\t\t# Get entry\n\t\tcbw\t\t\t\t# count\n\t\txchg %ax,%cx\t\t\t# as word\n\t\tjcxz init.4\t\t\t# If done\n\t\tlodsb\t\t\t\t# Get segment\n\t\txchg %ax,%dx\t\t\t# P:DPL:type\n\t\tlodsw\t\t\t\t# Get control\n\t\txchg %ax,%bx\t\t\t# set\n\t\tlodsw\t\t\t\t# Get handler offset\n\t\tmov $SEL_SCODE,%dh\t\t# Segment selector\ninit.2:\t\tshr %bx\t\t\t\t# Handle this int?\n\t\tjnc init.3\t\t\t# No\n\t\tmov %ax,(%di)\t\t\t# Set handler offset\n\t\tmov %dh,0x2(%di)\t\t# and selector\n\t\tmov %dl,0x5(%di)\t\t# Set P:DPL:type\n\t\tadd $0x4,%ax\t\t\t# Next handler\ninit.3:\t\tlea 0x8(%di),%di\t\t# Next entry\n\t\tloop init.2\t\t\t# Till set done\n\t\tjmp init.1\t\t\t# Continue" ], "previous_source": "", "target": [ "/*\n * Create IDT.\n */\n\t\tmov $0x5e00,%di\t\t\t# IDT's address\n\t\tmov $idtctl,%si\t\t\t# Control string\ninit.1:\t\tlodsb\t\t\t\t# Get entry\n\t\tcbw\t\t\t\t# count\n\t\txchg %ax,%cx\t\t\t# as word\n\t\tjcxz init.4\t\t\t# If done\n\t\tlodsb\t\t\t\t# Get segment\n\t\txchg %ax,%dx\t\t\t# P:DPL:type\n\t\tlodsw\t\t\t\t# Get control\n\t\txchg %ax,%bx\t\t\t# set\n\t\tlodsw\t\t\t\t# Get handler offset\n\t\tmov $SEL_SCODE,%dh\t\t# Segment selector\ninit.2:\t\tshr %bx\t\t\t\t# Handle this int?\n\t\tjnc init.3\t\t\t# No\n\t\tmov %ax,(%di)\t\t\t# Set handler offset\n\t\tmov %dh,0x2(%di)\t\t# and selector\n\t\tmov %dl,0x5(%di)\t\t# Set P:DPL:type\n\t\tadd $0x4,%ax\t\t\t# Next handler\ninit.3:\t\tlea 0x8(%di),%di\t\t# Next entry\n\t\tloop init.2\t\t\t# Till set done\n\t\tjmp init.1\t\t\t# Continue" ], "id_hash": 1300439549934066630, "content_hash": 1300439549934066630, "location": "book.translate.xml:1765", "context": "", "note": "(itstool) path: figure/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 186, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 107, "source_unit": "https://translate-dev.freebsd.org/api/units/102329/?format=api", "priority": 100, "id": 34084, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=920c16e171b05bc6", "url": "https://translate-dev.freebsd.org/api/units/34084/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.901539Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Each entry in the <literal>IDT</literal> is 8 bytes long. Besides the segment/offset information, they also describe the segment type, privilege level, and whether the segment is present in memory or not. The construction is such that interrupt vectors from <literal>0</literal> to <literal>0xf</literal> (exceptions) are handled by function <literal>intx00</literal>; vector <literal>0x10</literal> (also an exception) is handled by <literal>intx10</literal>; hardware interrupts, which are later configured to start at interrupt vector <literal>0x20</literal> all the way to interrupt vector <literal>0x2f</literal>, are handled by function <literal>intx20</literal>. Lastly, interrupt vector <literal>0x30</literal>, which is used for system calls, is handled by <literal>intx30</literal>, and vectors <literal>0x31</literal> and <literal>0x32</literal> are handled by <literal>intx31</literal>. It must be noted that only descriptors for interrupt vectors <literal>0x30</literal>, <literal>0x31</literal> and <literal>0x32</literal> are given privilege level 3, the same privilege level as the <filename>boot2</filename> client, which means the client can execute a software-generated interrupt to this vectors through the <literal>int</literal> instruction without failing (this is the way <filename>boot2</filename> use the services provided by the <acronym>BTX</acronym> server). Also, note that <emphasis>only</emphasis> software-generated interrupts are protected from code executing in lesser privilege levels. Hardware-generated interrupts and processor-generated exceptions are <emphasis>always</emphasis> handled adequately, regardless of the actual privileges involved." ], "previous_source": "", "target": [ "" ], "id_hash": -1161115060019621191, "content_hash": -1161115060019621191, "location": "book.translate.xml:1791", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 187, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 192, "source_unit": "https://translate-dev.freebsd.org/api/units/102330/?format=api", "priority": 100, "id": 34085, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=6fe2e401382c92b9", "url": "https://translate-dev.freebsd.org/api/units/34085/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.921854Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "/*\n * Initialize TSS.\n */\ninit.4:\t\tmovb $_ESP0H,TSS_ESP0+1(%di)\t# Set ESP0\n\t\tmovb $SEL_SDATA,TSS_SS0(%di)\t# Set SS0\n\t\tmovb $_TSSIO,TSS_MAP(%di)\t# Set I/O bit map base" ], "previous_source": "", "target": [ "/*\n * Initialize TSS.\n */\ninit.4:\t\tmovb $_ESP0H,TSS_ESP0+1(%di)\t# Set ESP0\n\t\tmovb $SEL_SDATA,TSS_SS0(%di)\t# Set SS0\n\t\tmovb $_TSSIO,TSS_MAP(%di)\t# Set I/O bit map base" ], "id_hash": -6869348602766819085, "content_hash": -6869348602766819085, "location": "book.translate.xml:1836", "context": "", "note": "(itstool) path: figure/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 189, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 24, "source_unit": "https://translate-dev.freebsd.org/api/units/102332/?format=api", "priority": 100, "id": 34088, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=20ab2bd755c200f3", "url": "https://translate-dev.freebsd.org/api/units/34088/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.948458Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Note that a value is given for the Privilege Level 0 stack pointer and stack segment in the <acronym>TSS</acronym>. This is needed because, if an interrupt or exception is received while executing <filename>boot2</filename> in Privilege Level 3, a change to Privilege Level 0 is automatically performed by the processor, so a new working stack is needed. Finally, the I/O Map Base Address field of the <acronym>TSS</acronym> is given a value, which is a 16-bit offset from the beginning of the <acronym>TSS</acronym> to the I/O Permission Bitmap and the Interrupt Redirection Bitmap." ], "previous_source": "", "target": [ "" ], "id_hash": -1027753079507680865, "content_hash": -1027753079507680865, "location": "book.translate.xml:1844", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 190, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 91, "source_unit": "https://translate-dev.freebsd.org/api/units/102333/?format=api", "priority": 100, "id": 34090, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=71bcb004fb21819f", "url": "https://translate-dev.freebsd.org/api/units/34090/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.959723Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "After the <acronym>IDT</acronym> and <acronym>TSS</acronym> are created, the processor is ready to switch to protected mode. This is done in the next block:" ], "previous_source": "", "target": [ "" ], "id_hash": 7349416389061565404, "content_hash": 7349416389061565404, "location": "book.translate.xml:1855", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 191, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 23, "source_unit": "https://translate-dev.freebsd.org/api/units/102334/?format=api", "priority": 100, "id": 34091, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=e5fe5f445872dbdc", "url": "https://translate-dev.freebsd.org/api/units/34091/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.973736Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "/*\n * Bring up the system.\n */\n\t\tmov $0x2820,%bx\t\t\t# Set protected mode\n\t\tcallw setpic\t\t\t# IRQ offsets\n\t\tlidt idtdesc\t\t\t# Set IDT\n\t\tlgdt gdtdesc\t\t\t# Set GDT\n\t\tmov %cr0,%eax\t\t\t# Switch to protected\n\t\tinc %ax\t\t\t\t# mode\n\t\tmov %eax,%cr0\t\t\t#\n\t\tljmp $SEL_SCODE,$init.8\t\t# To 32-bit code\n\t\t.code32\ninit.8:\t\txorl %ecx,%ecx\t\t\t# Zero\n\t\tmovb $SEL_SDATA,%cl\t\t# To 32-bit\n\t\tmovw %cx,%ss\t\t\t# stack" ], "previous_source": "", "target": [ "/*\n * Bring up the system.\n */\n\t\tmov $0x2820,%bx\t\t\t# Set protected mode\n\t\tcallw setpic\t\t\t# IRQ offsets\n\t\tlidt idtdesc\t\t\t# Set IDT\n\t\tlgdt gdtdesc\t\t\t# Set GDT\n\t\tmov %cr0,%eax\t\t\t# Switch to protected\n\t\tinc %ax\t\t\t\t# mode\n\t\tmov %eax,%cr0\t\t\t#\n\t\tljmp $SEL_SCODE,$init.8\t\t# To 32-bit code\n\t\t.code32\ninit.8:\t\txorl %ecx,%ecx\t\t\t# Zero\n\t\tmovb $SEL_SDATA,%cl\t\t# To 32-bit\n\t\tmovw %cx,%ss\t\t\t# stack" ], "id_hash": -3142992793104469553, "content_hash": -3142992793104469553, "location": "book.translate.xml:1862", "context": "", "note": "(itstool) path: figure/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 192, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 62, "source_unit": "https://translate-dev.freebsd.org/api/units/102335/?format=api", "priority": 100, "id": 34093, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=5461d8b4fb6531cf", "url": "https://translate-dev.freebsd.org/api/units/34093/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.990070Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "First, a call is made to <literal>setpic</literal> to program the 8259A <acronym>PIC</acronym> (Programmable Interrupt Controller). This chip is connected to multiple hardware interrupt sources. Upon receiving an interrupt from a device, it signals the processor with the appropriate interrupt vector. This can be customized so that specific interrupts are associated with specific interrupt vectors, as explained before. Next, the <acronym>IDTR</acronym> (Interrupt Descriptor Table Register) and <acronym>GDTR</acronym> (Global Descriptor Table Register) are loaded with the instructions <literal>lidt</literal> and <literal>lgdt</literal>, respectively. These registers are loaded with the base address and limit address for the <acronym>IDT</acronym> and <acronym>GDT</acronym>. The following three instructions set the Protection Enable (PE) bit of the <literal>%cr0</literal> register. This effectively switches the processor to 32-bit protected mode. Next, a long jump is made to <literal>init.8</literal> using segment selector SEL_SCODE, which selects the Supervisor Code Segment. The processor is effectively executing in CPL 0, the most privileged level, after this jump. Finally, the Supervisor Data Segment is selected for the stack by assigning the segment selector SEL_SDATA to the <literal>%ss</literal> register. This data segment also has a privilege level of <literal>0</literal>." ], "previous_source": "", "target": [ "" ], "id_hash": -9219325870920758886, "content_hash": -9219325870920758886, "location": "book.translate.xml:1879", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 193, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 181, "source_unit": "https://translate-dev.freebsd.org/api/units/102336/?format=api", "priority": 100, "id": 34095, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=000e5ff76b33099a", "url": "https://translate-dev.freebsd.org/api/units/34095/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:43.997534Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Our last code block is responsible for loading the <acronym>TR</acronym> (Task Register) with the segment selector for the <acronym>TSS</acronym> we created earlier, and setting the User Mode environment before passing execution control to the <filename>boot2</filename> client." ], "previous_source": "", "target": [ "" ], "id_hash": -3834820010159720543, "content_hash": -3834820010159720543, "location": "book.translate.xml:1904", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 194, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 36, "source_unit": "https://translate-dev.freebsd.org/api/units/102337/?format=api", "priority": 100, "id": 34096, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=4ac7fb84bcdeb7a1", "url": "https://translate-dev.freebsd.org/api/units/34096/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.005104Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "/*\n * Launch user task.\n */\n\t\tmovb $SEL_TSS,%cl\t\t# Set task\n\t\tltr %cx\t\t\t\t# register\n\t\tmovl $0xa000,%edx\t\t# User base address\n\t\tmovzwl %ss:BDA_MEM,%eax\t\t# Get free memory\n\t\tshll $0xa,%eax\t\t\t# To bytes\n\t\tsubl $ARGSPACE,%eax\t\t# Less arg space\n\t\tsubl %edx,%eax\t\t\t# Less base\n\t\tmovb $SEL_UDATA,%cl\t\t# User data selector\n\t\tpushl %ecx\t\t\t# Set SS\n\t\tpushl %eax\t\t\t# Set ESP\n\t\tpush $0x202\t\t\t# Set flags (IF set)\n\t\tpush $SEL_UCODE\t\t\t# Set CS\n\t\tpushl btx_hdr+0xc\t\t# Set EIP\n\t\tpushl %ecx\t\t\t# Set GS\n\t\tpushl %ecx\t\t\t# Set FS\n\t\tpushl %ecx\t\t\t# Set DS\n\t\tpushl %ecx\t\t\t# Set ES\n\t\tpushl %edx\t\t\t# Set EAX\n\t\tmovb $0x7,%cl\t\t\t# Set remaining\ninit.9:\t\tpush $0x0\t\t\t# general\n\t\tloop init.9\t\t\t# registers\n\t\tpopa\t\t\t\t# and initialize\n\t\tpopl %es\t\t\t# Initialize\n\t\tpopl %ds\t\t\t# user\n\t\tpopl %fs\t\t\t# segment\n\t\tpopl %gs\t\t\t# registers\n\t\tiret\t\t\t\t# To user mode" ], "previous_source": "", "target": [ "/*\n * Launch user task.\n */\n\t\tmovb $SEL_TSS,%cl\t\t# Set task\n\t\tltr %cx\t\t\t\t# register\n\t\tmovl $0xa000,%edx\t\t# User base address\n\t\tmovzwl %ss:BDA_MEM,%eax\t\t# Get free memory\n\t\tshll $0xa,%eax\t\t\t# To bytes\n\t\tsubl $ARGSPACE,%eax\t\t# Less arg space\n\t\tsubl %edx,%eax\t\t\t# Less base\n\t\tmovb $SEL_UDATA,%cl\t\t# User data selector\n\t\tpushl %ecx\t\t\t# Set SS\n\t\tpushl %eax\t\t\t# Set ESP\n\t\tpush $0x202\t\t\t# Set flags (IF set)\n\t\tpush $SEL_UCODE\t\t\t# Set CS\n\t\tpushl btx_hdr+0xc\t\t# Set EIP\n\t\tpushl %ecx\t\t\t# Set GS\n\t\tpushl %ecx\t\t\t# Set FS\n\t\tpushl %ecx\t\t\t# Set DS\n\t\tpushl %ecx\t\t\t# Set ES\n\t\tpushl %edx\t\t\t# Set EAX\n\t\tmovb $0x7,%cl\t\t\t# Set remaining\ninit.9:\t\tpush $0x0\t\t\t# general\n\t\tloop init.9\t\t\t# registers\n\t\tpopa\t\t\t\t# and initialize\n\t\tpopl %es\t\t\t# Initialize\n\t\tpopl %ds\t\t\t# user\n\t\tpopl %fs\t\t\t# segment\n\t\tpopl %gs\t\t\t# registers\n\t\tiret\t\t\t\t# To user mode" ], "id_hash": 1368442191278842409, "content_hash": 1368442191278842409, "location": "book.translate.xml:1913", "context": "", "note": "(itstool) path: figure/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 195, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 140, "source_unit": "https://translate-dev.freebsd.org/api/units/102338/?format=api", "priority": 100, "id": 34098, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=92fdaeec32d52229", "url": "https://translate-dev.freebsd.org/api/units/34098/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.019805Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Note that the client's environment include a stack segment selector and stack pointer (registers <literal>%ss</literal> and <literal>%esp</literal>). Indeed, once the <acronym>TR</acronym> is loaded with the appropriate stack segment selector (instruction <literal>ltr</literal>), the stack pointer is calculated and pushed onto the stack along with the stack's segment selector. Next, the value <literal>0x202</literal> is pushed onto the stack; it is the value that the EFLAGS will get when control is passed to the client. Also, the User Mode code segment selector and the client's entry point are pushed. Recall that this entry point is patched in the <acronym>BTX</acronym> header at link time. Finally, segment selectors (stored in register <literal>%ecx</literal>) for the segment registers <literal>%gs, %fs, %ds and %es</literal> are pushed onto the stack, along with the value at <literal>%edx</literal> (<literal>0xa000</literal>). Keep in mind the various values that have been pushed onto the stack (they will be popped out shortly). Next, values for the remaining general purpose registers are also pushed onto the stack (note the <literal>loop</literal> that pushes the value <literal>0</literal> seven times). Now, values will be started to be popped out of the stack. First, the <literal>popa</literal> instruction pops out of the stack the latest seven values pushed. They are stored in the general purpose registers in order <literal>%edi, %esi, %ebp, %ebx, %edx, %ecx, %eax</literal>. Then, the various segment selectors pushed are popped into the various segment registers. Five values still remain on the stack. They are popped when the <literal>iret</literal> instruction is executed. This instruction first pops the value that was pushed from the <acronym>BTX</acronym> header. This value is a pointer to <filename>boot2</filename>'s entry point. It is placed in the register <literal>%eip</literal>, the instruction pointer register. Next, the segment selector for the User Code Segment is popped and copied to register <literal>%cs</literal>. Remember that this segment's privilege level is 3, the least privileged level. This means that we must provide values for the stack of this privilege level. This is why the processor, besides further popping the value for the EFLAGS register, does two more pops out of the stack. These values go to the stack pointer (<literal>%esp</literal>) and the stack segment (<literal>%ss</literal>). Now, execution continues at <literal>boot0</literal>'s entry point." ], "previous_source": "", "target": [ "" ], "id_hash": 8627215923189205664, "content_hash": 8627215923189205664, "location": "book.translate.xml:1945", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 196, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 360, "source_unit": "https://translate-dev.freebsd.org/api/units/102339/?format=api", "priority": 100, "id": 34100, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=f7ba072c56494aa0", "url": "https://translate-dev.freebsd.org/api/units/34100/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.031790Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "It is important to note how the User Code Segment is defined. This segment's <emphasis>base address</emphasis> is set to <literal>0xa000</literal>. This means that code memory addresses are <emphasis>relative</emphasis> to address 0xa000; if code being executed is fetched from address <literal>0x2000</literal>, the <emphasis>actual</emphasis> memory addressed is <literal>0xa000+0x2000=0xc000</literal>." ], "previous_source": "", "target": [ "" ], "id_hash": 4788582523689735347, "content_hash": 4788582523689735347, "location": "book.translate.xml:1991", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 197, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 46, "source_unit": "https://translate-dev.freebsd.org/api/units/102340/?format=api", "priority": 100, "id": 34101, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=c274766f2e2b94b3", "url": "https://translate-dev.freebsd.org/api/units/34101/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.043265Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<application>boot2</application> Stage" ], "previous_source": "", "target": [ "<application>boot2</application> 阶段" ], "id_hash": -5970729556632366879, "content_hash": -5970729556632366879, "location": "book.translate.xml:2002", "context": "", "note": "(itstool) path: sect1/title", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 198, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/102341/?format=api", "priority": 100, "id": 34103, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=2d23b51a3f0090e1", "url": "https://translate-dev.freebsd.org/api/units/34103/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.051719Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<literal>boot2</literal> defines an important structure, <literal>struct bootinfo</literal>. This structure is initialized by <literal>boot2</literal> and passed to the loader, and then further to the kernel. Some nodes of this structures are set by <literal>boot2</literal>, the rest by the loader. This structure, among other information, contains the kernel filename, <acronym>BIOS</acronym> harddisk geometry, <acronym>BIOS</acronym> drive number for boot device, physical memory available, <literal>envp</literal> pointer etc. The definition for it is:" ], "previous_source": "", "target": [ "boot2 定义了很重要的引导信息数据结构。此结构由 boot2 初始化,然后传递到加载程序,再传到内核。" ], "id_hash": -6013498388983336778, "content_hash": -6013498388983336778, "location": "book.translate.xml:2004", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 10, "fuzzy": true, "translated": false, "approved": false, "position": 199, "has_suggestion": true, "has_comment": false, "has_failing_check": true, "num_words": 67, "source_unit": "https://translate-dev.freebsd.org/api/units/102342/?format=api", "priority": 100, "id": 34104, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=2c8bc3137b43b0b6", "url": "https://translate-dev.freebsd.org/api/units/34104/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.064674Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>/usr/include/machine/bootinfo.h:</filename>\nstruct bootinfo {\n\tu_int32_t\tbi_version;\n\tu_int32_t\tbi_kernelname;\t\t/* represents a char * */\n\tu_int32_t\tbi_nfs_diskless;\t/* struct nfs_diskless * */\n\t\t\t\t/* End of fields that are always present. */\n#define\tbi_endcommon\tbi_n_bios_used\n\tu_int32_t\tbi_n_bios_used;\n\tu_int32_t\tbi_bios_geom[N_BIOS_GEOM];\n\tu_int32_t\tbi_size;\n\tu_int8_t\tbi_memsizes_valid;\n\tu_int8_t\tbi_bios_dev;\t\t/* bootdev BIOS unit number */\n\tu_int8_t\tbi_pad[2];\n\tu_int32_t\tbi_basemem;\n\tu_int32_t\tbi_extmem;\n\tu_int32_t\tbi_symtab;\t\t/* struct symtab * */\n\tu_int32_t\tbi_esymtab;\t\t/* struct symtab * */\n\t\t\t\t/* Items below only from advanced bootloader */\n\tu_int32_t\tbi_kernend;\t\t/* end of kernel space */\n\tu_int32_t\tbi_envp;\t\t/* environment */\n\tu_int32_t\tbi_modulep;\t\t/* preloaded modules */\n};" ], "previous_source": "", "target": [ "<filename>/usr/include/machine/bootinfo.h:</filename>\nstruct bootinfo {\n\tu_int32_t\tbi_version;\n\tu_int32_t\tbi_kernelname;\t\t/* represents a char * */\n\tu_int32_t\tbi_nfs_diskless;\t/* struct nfs_diskless * */\n\t\t\t\t/* End of fields that are always present. */\n#define\tbi_endcommon\tbi_n_bios_used\n\tu_int32_t\tbi_n_bios_used;\n\tu_int32_t\tbi_bios_geom[N_BIOS_GEOM];\n\tu_int32_t\tbi_size;\n\tu_int8_t\tbi_memsizes_valid;\n\tu_int8_t\tbi_bios_dev;\t\t/* bootdev BIOS unit number */\n\tu_int8_t\tbi_pad[2];\n\tu_int32_t\tbi_basemem;\n\tu_int32_t\tbi_extmem;\n\tu_int32_t\tbi_symtab;\t\t/* struct symtab * */\n\tu_int32_t\tbi_esymtab;\t\t/* struct symtab * */\n\t\t\t\t/* Items below only from advanced bootloader */\n\tu_int32_t\tbi_kernend;\t\t/* end of kernel space */\n\tu_int32_t\tbi_envp;\t\t/* environment */\n\tu_int32_t\tbi_modulep;\t\t/* preloaded modules */\n};" ], "id_hash": -2125307982371317696, "content_hash": -2125307982371317696, "location": "book.translate.xml:2015", "context": "", "note": "(itstool) path: sect1/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 200, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 97, "source_unit": "https://translate-dev.freebsd.org/api/units/102343/?format=api", "priority": 100, "id": 34106, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=628163a680749840", "url": "https://translate-dev.freebsd.org/api/units/34106/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.072964Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<literal>boot2</literal> enters into an infinite loop waiting for user input, then calls <function>load()</function>. If the user does not press anything, the loop breaks by a timeout, so <function>load()</function> will load the default file (<filename>/boot/loader</filename>). Functions <function>ino_t lookup(char *filename)</function> and <function>int xfsread(ino_t inode, void *buf, size_t nbyte)</function> are used to read the content of a file into memory. <filename>/boot/loader</filename> is an <acronym>ELF</acronym> binary, but where the <acronym>ELF</acronym> header is prepended with <filename>a.out</filename>'s <literal>struct exec</literal> structure. <function>load()</function> scans the loader's ELF header, loading the content of <filename>/boot/loader</filename> into memory, and passing the execution to the loader's entry:" ], "previous_source": "", "target": [ "" ], "id_hash": -535595067217392689, "content_hash": -535595067217392689, "location": "book.translate.xml:2038", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 201, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 95, "source_unit": "https://translate-dev.freebsd.org/api/units/102344/?format=api", "priority": 100, "id": 34107, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=78912f1fc30e4bcf", "url": "https://translate-dev.freebsd.org/api/units/34107/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.090581Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>sys/boot/i386/boot2/boot2.c:</filename>\n __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK),\n\t MAKEBOOTDEV(dev_maj[dsk.type], 0, dsk.slice, dsk.unit, dsk.part),\n\t 0, 0, 0, VTOP(&bootinfo));" ], "previous_source": "", "target": [ "<filename>sys/boot/i386/boot2/boot2.c:</filename>\n __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK),\n\t MAKEBOOTDEV(dev_maj[dsk.type], 0, dsk.slice, dsk.unit, dsk.part),\n\t 0, 0, 0, VTOP(&bootinfo));" ], "id_hash": 6034750704103665590, "content_hash": 6034750704103665590, "location": "book.translate.xml:2055", "context": "", "note": "(itstool) path: sect1/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 202, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 16, "source_unit": "https://translate-dev.freebsd.org/api/units/102345/?format=api", "priority": 100, "id": 34109, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=d3bfbdcaba232fb6", "url": "https://translate-dev.freebsd.org/api/units/34109/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.102996Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<application>loader</application> Stage" ], "previous_source": "", "target": [ "" ], "id_hash": 7669939997045749287, "content_hash": 7669939997045749287, "location": "book.translate.xml:2062", "context": "", "note": "(itstool) path: sect1/title", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 203, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/102346/?format=api", "priority": 100, "id": 34110, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=ea7119ca4c78f627", "url": "https://translate-dev.freebsd.org/api/units/34110/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.110811Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The main task for the loader is to boot the kernel. When the kernel is loaded into memory, it is being called by the loader:" ], "previous_source": "", "target": [ "" ], "id_hash": 7677802247694766307, "content_hash": 7677802247694766307, "location": "book.translate.xml:2070", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 205, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 25, "source_unit": "https://translate-dev.freebsd.org/api/units/102347/?format=api", "priority": 100, "id": 34113, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=ea8d08772d8ad0e3", "url": "https://translate-dev.freebsd.org/api/units/34113/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.128548Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>sys/boot/common/boot.c:</filename>\n /* Call the exec handler from the loader matching the kernel */\n module_formats[km->m_loader]->l_exec(km);" ], "previous_source": "", "target": [ "" ], "id_hash": -239740427163272830, "content_hash": -239740427163272830, "location": "book.translate.xml:2074", "context": "", "note": "(itstool) path: sect1/programlisting", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 206, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 14, "source_unit": "https://translate-dev.freebsd.org/api/units/102348/?format=api", "priority": 100, "id": 34114, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=7cac455a08a1f982", "url": "https://translate-dev.freebsd.org/api/units/34114/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.134961Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Kernel Initialization" ], "previous_source": "", "target": [ "" ], "id_hash": 7604723004062176301, "content_hash": 7604723004062176301, "location": "book.translate.xml:2080", "context": "", "note": "(itstool) path: sect1/title", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 207, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/102349/?format=api", "priority": 100, "id": 34115, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=e9896747d85e142d", "url": "https://translate-dev.freebsd.org/api/units/34115/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.146613Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "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." ], "previous_source": "", "target": [ "" ], "id_hash": -5817494449657258624, "content_hash": -5817494449657258624, "location": "book.translate.xml:2082", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 208, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 35, "source_unit": "https://translate-dev.freebsd.org/api/units/102350/?format=api", "priority": 100, "id": 34116, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=2f441b9ed55f5d80", "url": "https://translate-dev.freebsd.org/api/units/34116/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.156666Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>sys/conf/Makefile.i386:</filename>\nld -elf -Bdynamic -T /usr/src/sys/conf/ldscript.i386 -export-dynamic \\\n-dynamic-linker /red/herring -o kernel -X locore.o \\\n<lots of kernel .o files>" ], "previous_source": "", "target": [ "" ], "id_hash": -6035252348018218813, "content_hash": -6035252348018218813, "location": "book.translate.xml:2087", "context": "", "note": "(itstool) path: sect1/programlisting", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 209, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 20, "source_unit": "https://translate-dev.freebsd.org/api/units/102351/?format=api", "priority": 100, "id": 34117, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=2c3e79f7328828c3", "url": "https://translate-dev.freebsd.org/api/units/34117/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.164941Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<primary>ELF</primary>" ], "previous_source": "", "target": [ "<primary> ELF </primary>" ], "id_hash": -133206920132354043, "content_hash": -133206920132354043, "location": "book.translate.xml:2092", "context": "", "note": "(itstool) path: sect1/indexterm", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 210, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/102352/?format=api", "priority": 100, "id": 34119, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=7e26c1030be32005", "url": "https://translate-dev.freebsd.org/api/units/34119/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.176518Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "A few interesting things can be seen here. First, the kernel is an ELF dynamically linked binary, but the dynamic linker for kernel is <filename>/red/herring</filename>, which is definitely a bogus file. Second, taking a look at the file <filename>sys/conf/ldscript.i386</filename> gives an idea about what <application>ld</application> options are used when compiling a kernel. Reading through the first few lines, the string" ], "previous_source": "", "target": [ "" ], "id_hash": -87050160901393335, "content_hash": -87050160901393335, "location": "book.translate.xml:2093", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 211, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 60, "source_unit": "https://translate-dev.freebsd.org/api/units/102353/?format=api", "priority": 100, "id": 34121, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=7ecabc5701d4f449", "url": "https://translate-dev.freebsd.org/api/units/34121/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.184257Z" } ] }{ "count": 2721, "next": "