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=6
https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/units/?format=api&page=7", "previous": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/units/?format=api&page=5", "results": [ { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>sys/i386/i386/machdep.c:</filename>\n\tcninit();\n/* skipped */\n#ifdef DDB\n\tkdb_init();\n\tif (boothowto & RB_KDB)\n\t\tDebugger(\"Boot flags requested debugger\");\n#endif" ], "previous_source": "", "target": [ "<filename>sys/i386/i386/machdep.c:</filename>\n\tcninit();\n/* skipped */\n#ifdef DDB\n\tkdb_init();\n\tif (boothowto & RB_KDB)\n\t\tDebugger(\"Boot flags requested debugger\");\n#endif" ], "id_hash": -6981032766099564613, "content_hash": -6981032766099564613, "location": "book.translate.xml:2382", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 262, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 17, "source_unit": "https://translate-dev.freebsd.org/api/units/102404/?format=api", "priority": 100, "id": 34199, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=1f1e63afb345d7bb", "url": "https://translate-dev.freebsd.org/api/units/34199/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.804758Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The Task State Segment is another x86 protected mode structure, the TSS is used by the hardware to store task information when a task switch occurs." ], "previous_source": "", "target": [ "" ], "id_hash": -8437846211166343488, "content_hash": -8437846211166343488, "location": "book.translate.xml:2391", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 263, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 26, "source_unit": "https://translate-dev.freebsd.org/api/units/102405/?format=api", "priority": 100, "id": 34200, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=0ae6bf939a0deec0", "url": "https://translate-dev.freebsd.org/api/units/34200/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.820810Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The Local Descriptors Table is used to reference userland code and data. Several selectors are defined to point to the LDT, they are the system call gates and the user code and data selectors:" ], "previous_source": "", "target": [ "" ], "id_hash": 3196138467114696134, "content_hash": 3196138467114696134, "location": "book.translate.xml:2395", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 264, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 34, "source_unit": "https://translate-dev.freebsd.org/api/units/102406/?format=api", "priority": 100, "id": 34201, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=ac5af70081553dc6", "url": "https://translate-dev.freebsd.org/api/units/34201/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.830818Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>/usr/include/machine/segments.h:</filename>\n#define\tLSYS5CALLS_SEL\t0\t/* forced by intel BCS */\n#define\tLSYS5SIGR_SEL\t1\n#define\tL43BSDCALLS_SEL\t2\t/* notyet */\n#define\tLUCODE_SEL\t3\n#define\tLSOL26CALLS_SEL\t4\t/* Solaris >= 2.6 system call gate */\n#define\tLUDATA_SEL\t5\n/* separate stack, es,fs,gs sels ? */\n/* #define\tLPOSIXCALLS_SEL\t5*/\t/* notyet */\n#define LBSDICALLS_SEL\t16\t/* BSDI system call gate */\n#define NLDT\t\t(LBSDICALLS_SEL + 1)" ], "previous_source": "", "target": [ "<filename>/usr/include/machine/segments.h:</filename>\n#define\tLSYS5CALLS_SEL\t0\t/* forced by intel BCS */\n#define\tLSYS5SIGR_SEL\t1\n#define\tL43BSDCALLS_SEL\t2\t/* notyet */\n#define\tLUCODE_SEL\t3\n#define\tLSOL26CALLS_SEL\t4\t/* Solaris >= 2.6 system call gate */\n#define\tLUDATA_SEL\t5\n/* separate stack, es,fs,gs sels ? */\n/* #define\tLPOSIXCALLS_SEL\t5*/\t/* notyet */\n#define LBSDICALLS_SEL\t16\t/* BSDI system call gate */\n#define NLDT\t\t(LBSDICALLS_SEL + 1)" ], "id_hash": 5275050140155920594, "content_hash": 5275050140155920594, "location": "book.translate.xml:2400", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 265, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 64, "source_unit": "https://translate-dev.freebsd.org/api/units/102407/?format=api", "priority": 100, "id": 34202, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=c934be27705e40d2", "url": "https://translate-dev.freebsd.org/api/units/34202/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.840223Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Next, proc0's Process Control Block (<literal>struct pcb</literal>) structure is initialized. proc0 is a <literal>struct proc</literal> structure that describes a kernel process. It is always present while the kernel is running, therefore it is declared as global:" ], "previous_source": "", "target": [ "" ], "id_hash": -3375022578427973314, "content_hash": -3375022578427973314, "location": "book.translate.xml:2412", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 266, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 36, "source_unit": "https://translate-dev.freebsd.org/api/units/102408/?format=api", "priority": 100, "id": 34204, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=512982d8b7e0b13e", "url": "https://translate-dev.freebsd.org/api/units/34204/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.854850Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>sys/kern/kern_init.c:</filename>\n struct\tproc proc0;" ], "previous_source": "", "target": [ "<filename>sys/kern/kern_init.c:</filename>\n struct\tproc proc0;" ], "id_hash": 6633032551096858061, "content_hash": 6633032551096858061, "location": "book.translate.xml:2418", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 267, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 4, "source_unit": "https://translate-dev.freebsd.org/api/units/102409/?format=api", "priority": 100, "id": 34205, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=dc0d43f63fbb35cd", "url": "https://translate-dev.freebsd.org/api/units/34205/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.879171Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The structure <literal>struct pcb</literal> is a part of a proc structure. It is defined in <filename>/usr/include/machine/pcb.h</filename> and has a process's information specific to the i386 architecture, such as registers values." ], "previous_source": "", "target": [ "" ], "id_hash": 5076352805835658877, "content_hash": 5076352805835658877, "location": "book.translate.xml:2421", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 268, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 30, "source_unit": "https://translate-dev.freebsd.org/api/units/102410/?format=api", "priority": 100, "id": 34206, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=c672d3fb3264567d", "url": "https://translate-dev.freebsd.org/api/units/34206/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.892024Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<function>mi_startup()</function>" ], "previous_source": "", "target": [ "" ], "id_hash": 1564374249417566217, "content_hash": 1564374249417566217, "location": "book.translate.xml:2429", "context": "", "note": "(itstool) path: sect2/title", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 269, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/102411/?format=api", "priority": 100, "id": 34207, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=95b5c617684d6809", "url": "https://translate-dev.freebsd.org/api/units/34207/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.901432Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "This function performs a bubble sort of all the system initialization objects and then calls the entry of each object one by one:" ], "previous_source": "", "target": [ "" ], "id_hash": -8539288599434478753, "content_hash": -8539288599434478753, "location": "book.translate.xml:2431", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 270, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 23, "source_unit": "https://translate-dev.freebsd.org/api/units/102412/?format=api", "priority": 100, "id": 34209, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=097e5a430c2a3b5f", "url": "https://translate-dev.freebsd.org/api/units/34209/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.912575Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>sys/kern/init_main.c:</filename>\n\tfor (sipp = sysinit; *sipp; sipp++) {\n\n\t\t/* ... skipped ... */\n\n\t\t/* Call function */\n\t\t(*((*sipp)->func))((*sipp)->udata);\n\t\t/* ... skipped ... */\n\t}" ], "previous_source": "", "target": [ "<filename>sys/kern/init_main.c:</filename>\n\tfor (sipp = sysinit; *sipp; sipp++) {\n\n\t\t/* ... skipped ... */\n\n\t\t/* Call function */\n\t\t(*((*sipp)->func))((*sipp)->udata);\n\t\t/* ... skipped ... */\n\t}" ], "id_hash": -7779069779624108203, "content_hash": -7779069779624108203, "location": "book.translate.xml:2435", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 271, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 24, "source_unit": "https://translate-dev.freebsd.org/api/units/102413/?format=api", "priority": 100, "id": 34210, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=140b31402e875f55", "url": "https://translate-dev.freebsd.org/api/units/34210/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.924469Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Although the sysinit framework is described in the <link xlink:href=\"@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/developers-handbook\">Developers' Handbook</link>, I will discuss the internals of it." ], "previous_source": "", "target": [ "" ], "id_hash": 9214748624941737830, "content_hash": 9214748624941737830, "location": "book.translate.xml:2445", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 272, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 18, "source_unit": "https://translate-dev.freebsd.org/api/units/102414/?format=api", "priority": 100, "id": 34212, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=ffe15d0d742be766", "url": "https://translate-dev.freebsd.org/api/units/34212/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.935586Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<primary>sysinit objects</primary>" ], "previous_source": "", "target": [ "" ], "id_hash": -1313667393749987949, "content_hash": -1313667393749987949, "location": "book.translate.xml:2448", "context": "", "note": "(itstool) path: sect2/indexterm", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 273, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/102415/?format=api", "priority": 100, "id": 34213, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=6dc4ea772a84cd93", "url": "https://translate-dev.freebsd.org/api/units/34213/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.943244Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Every system initialization object (sysinit object) is created by calling a SYSINIT() macro. Let us take as example an <literal>announce</literal> sysinit object. This object prints the copyright message:" ], "previous_source": "", "target": [ "" ], "id_hash": 7200047033617167390, "content_hash": 7200047033617167390, "location": "book.translate.xml:2449", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 274, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 28, "source_unit": "https://translate-dev.freebsd.org/api/units/102416/?format=api", "priority": 100, "id": 34215, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=e3ebb4a12cdb341e", "url": "https://translate-dev.freebsd.org/api/units/34215/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.952776Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>sys/kern/init_main.c:</filename>\nstatic void\nprint_caddr_t(void *data __unused)\n{\n\tprintf(\"%s\", (char *)data);\n}\nSYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t, copyright)" ], "previous_source": "", "target": [ "<filename>sys/kern/init_main.c:</filename>\nstatic void\nprint_caddr_t(void *data __unused)\n{\n\tprintf(\"%s\", (char *)data);\n}\nSYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t, copyright)" ], "id_hash": 7004483192504627371, "content_hash": 7004483192504627371, "location": "book.translate.xml:2454", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 275, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 16, "source_unit": "https://translate-dev.freebsd.org/api/units/102417/?format=api", "priority": 100, "id": 34216, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=e134ec5a2c6eb0ab", "url": "https://translate-dev.freebsd.org/api/units/34216/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.962037Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The subsystem ID for this object 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." ], "previous_source": "", "target": [ "" ], "id_hash": 5637474535384892305, "content_hash": 5637474535384892305, "location": "book.translate.xml:2462", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 276, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 30, "source_unit": "https://translate-dev.freebsd.org/api/units/102418/?format=api", "priority": 100, "id": 34218, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=ce3c5538a7ed4391", "url": "https://translate-dev.freebsd.org/api/units/34218/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.971626Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Let us take a look at what exactly the macro <literal>SYSINIT()</literal> does. It expands to a <literal>C_SYSINIT()</literal> macro. The <literal>C_SYSINIT()</literal> macro then expands to a static <literal>struct sysinit</literal> structure declaration with another <literal>DATA_SET</literal> macro call:" ], "previous_source": "", "target": [ "" ], "id_hash": 1511362111051524297, "content_hash": 1511362111051524297, "location": "book.translate.xml:2467", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 277, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 35, "source_unit": "https://translate-dev.freebsd.org/api/units/102419/?format=api", "priority": 100, "id": 34220, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=94f96fd51c35e8c9", "url": "https://translate-dev.freebsd.org/api/units/34220/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.983222Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>/usr/include/sys/kernel.h:</filename>\n #define C_SYSINIT(uniquifier, subsystem, order, func, ident) \\\n static struct sysinit uniquifier ## _sys_init = { \\ subsystem, \\\n order, \\ func, \\ ident \\ }; \\ DATA_SET(sysinit_set,uniquifier ##\n _sys_init);\n\n#define\tSYSINIT(uniquifier, subsystem, order, func, ident)\t\\\n\tC_SYSINIT(uniquifier, subsystem, order,\t\t\t\\\n\t(sysinit_cfunc_t)(sysinit_nfunc_t)func, (void *)ident)" ], "previous_source": "", "target": [ "<filename>/usr/include/sys/kernel.h:</filename>\n #define C_SYSINIT(uniquifier, subsystem, order, func, ident) \\\n static struct sysinit uniquifier ## _sys_init = { \\ subsystem, \\\n order, \\ func, \\ ident \\ }; \\ DATA_SET(sysinit_set,uniquifier ##\n _sys_init);\n\n#define\tSYSINIT(uniquifier, subsystem, order, func, ident)\t\\\n\tC_SYSINIT(uniquifier, subsystem, order,\t\t\t\\\n\t(sysinit_cfunc_t)(sysinit_nfunc_t)func, (void *)ident)" ], "id_hash": 7985575502398292238, "content_hash": 7985575502398292238, "location": "book.translate.xml:2474", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 278, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 44, "source_unit": "https://translate-dev.freebsd.org/api/units/102420/?format=api", "priority": 100, "id": 34221, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=eed2769c2b83010e", "url": "https://translate-dev.freebsd.org/api/units/34221/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:44.993945Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The <literal>DATA_SET()</literal> macro expands to a <literal>MAKE_SET()</literal>, and that macro is the point where all the sysinit magic is hidden:" ], "previous_source": "", "target": [ "" ], "id_hash": -6094547853950179290, "content_hash": -6094547853950179290, "location": "book.translate.xml:2484", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 279, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 20, "source_unit": "https://translate-dev.freebsd.org/api/units/102421/?format=api", "priority": 100, "id": 34223, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=2b6bd10462ae2826", "url": "https://translate-dev.freebsd.org/api/units/34223/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.014660Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>/usr/include/linker_set.h:</filename>\n#define MAKE_SET(set, sym)\t\t\t\t\t\t\\\n\tstatic void const * const __set_##set##_sym_##sym = &sym;\t\\\n\t__asm(\".section .set.\" #set \",\\\"aw\\\"\");\t\t\t\t\\\n\t__asm(\".long \" #sym);\t\t\t\t\t\t\\\n\t__asm(\".previous\")\n#endif\n#define TEXT_SET(set, sym) MAKE_SET(set, sym)\n#define DATA_SET(set, sym) MAKE_SET(set, sym)" ], "previous_source": "", "target": [ "<filename>/usr/include/linker_set.h:</filename>\n#define MAKE_SET(set, sym)\t\t\t\t\t\t\\\n\tstatic void const * const __set_##set##_sym_##sym = &sym;\t\\\n\t__asm(\".section .set.\" #set \",\\\"aw\\\"\");\t\t\t\t\\\n\t__asm(\".long \" #sym);\t\t\t\t\t\t\\\n\t__asm(\".previous\")\n#endif\n#define TEXT_SET(set, sym) MAKE_SET(set, sym)\n#define DATA_SET(set, sym) MAKE_SET(set, sym)" ], "id_hash": -6756313831103837745, "content_hash": -6756313831103837745, "location": "book.translate.xml:2488", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 280, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 35, "source_unit": "https://translate-dev.freebsd.org/api/units/102422/?format=api", "priority": 100, "id": 34224, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=223cc05df9ff49cf", "url": "https://translate-dev.freebsd.org/api/units/34224/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.025993Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "In our case, the following declaration will occur:" ], "previous_source": "", "target": [ "" ], "id_hash": 8350588221470106715, "content_hash": 8350588221470106715, "location": "book.translate.xml:2498", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 281, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 8, "source_unit": "https://translate-dev.freebsd.org/api/units/102423/?format=api", "priority": 100, "id": 34226, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=f3e33fbe7e49645b", "url": "https://translate-dev.freebsd.org/api/units/34226/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.038327Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "static struct sysinit announce_sys_init = {\n\tSI_SUB_COPYRIGHT,\n\tSI_ORDER_FIRST,\n\t(sysinit_cfunc_t)(sysinit_nfunc_t) print_caddr_t,\n\t(void *) copyright\n};\n\nstatic void const *const __set_sysinit_set_sym_announce_sys_init =\n &announce_sys_init;\n__asm(\".section .set.sysinit_set\" \",\\\"aw\\\"\");\n__asm(\".long \" \"announce_sys_init\");\n__asm(\".previous\");" ], "previous_source": "", "target": [ "static struct sysinit announce_sys_init = {\n\tSI_SUB_COPYRIGHT,\n\tSI_ORDER_FIRST,\n\t(sysinit_cfunc_t)(sysinit_nfunc_t) print_caddr_t,\n\t(void *) copyright\n};\n\nstatic void const *const __set_sysinit_set_sym_announce_sys_init =\n &announce_sys_init;\n__asm(\".section .set.sysinit_set\" \",\\\"aw\\\"\");\n__asm(\".long \" \"announce_sys_init\");\n__asm(\".previous\");" ], "id_hash": -3718861001638618734, "content_hash": -3718861001638618734, "location": "book.translate.xml:2500", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 282, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 28, "source_unit": "https://translate-dev.freebsd.org/api/units/102424/?format=api", "priority": 100, "id": 34227, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=4c63f39f5446d992", "url": "https://translate-dev.freebsd.org/api/units/34227/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.049045Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The first <literal>__asm</literal> instruction will create an ELF section within the kernel's executable. This will happen at kernel link time. The section will have the name <literal>.set.sysinit_set</literal>. The content of this section is one 32-bit value, the address of announce_sys_init structure, and that is what the second <literal>__asm</literal> is. The third <literal>__asm</literal> instruction marks the end of a section. If a directive with the same section name occurred before, the content, i.e., the 32-bit value, will be appended to the existing section, so forming an array of 32-bit pointers." ], "previous_source": "", "target": [ "" ], "id_hash": 5931975852285354111, "content_hash": 5931975852285354111, "location": "book.translate.xml:2513", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 283, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 89, "source_unit": "https://translate-dev.freebsd.org/api/units/102425/?format=api", "priority": 100, "id": 34229, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=d2529c9bd3a9e07f", "url": "https://translate-dev.freebsd.org/api/units/34229/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.066641Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Running <application>objdump</application> on a kernel binary, you may notice the presence of such small sections:" ], "previous_source": "", "target": [ "" ], "id_hash": 7142942615169930636, "content_hash": 7142942615169930636, "location": "book.translate.xml:2526", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 284, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 15, "source_unit": "https://translate-dev.freebsd.org/api/units/102426/?format=api", "priority": 100, "id": 34230, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=e320d476ac34158c", "url": "https://translate-dev.freebsd.org/api/units/34230/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.073226Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<prompt>%</prompt> <userinput>objdump -h /kernel</userinput>\n 7 .set.cons_set 00000014 c03164c0 c03164c0 002154c0 2**2\n CONTENTS, ALLOC, LOAD, DATA\n 8 .set.kbddriver_set 00000010 c03164d4 c03164d4 002154d4 2**2\n CONTENTS, ALLOC, LOAD, DATA\n 9 .set.scrndr_set 00000024 c03164e4 c03164e4 002154e4 2**2\n CONTENTS, ALLOC, LOAD, DATA\n 10 .set.scterm_set 0000000c c0316508 c0316508 00215508 2**2\n CONTENTS, ALLOC, LOAD, DATA\n 11 .set.sysctl_set 0000097c c0316514 c0316514 00215514 2**2\n CONTENTS, ALLOC, LOAD, DATA\n 12 .set.sysinit_set 00000664 c0316e90 c0316e90 00215e90 2**2\n CONTENTS, ALLOC, LOAD, DATA" ], "previous_source": "", "target": [ "<prompt>%</prompt> <userinput>objdump -h /kernel</userinput>\n 7 .set.cons_set 00000014 c03164c0 c03164c0 002154c0 2**2\n CONTENTS, ALLOC, LOAD, DATA\n 8 .set.kbddriver_set 00000010 c03164d4 c03164d4 002154d4 2**2\n CONTENTS, ALLOC, LOAD, DATA\n 9 .set.scrndr_set 00000024 c03164e4 c03164e4 002154e4 2**2\n CONTENTS, ALLOC, LOAD, DATA\n 10 .set.scterm_set 0000000c c0316508 c0316508 00215508 2**2\n CONTENTS, ALLOC, LOAD, DATA\n 11 .set.sysctl_set 0000097c c0316514 c0316514 00215514 2**2\n CONTENTS, ALLOC, LOAD, DATA\n 12 .set.sysinit_set 00000664 c0316e90 c0316e90 00215e90 2**2\n CONTENTS, ALLOC, LOAD, DATA" ], "id_hash": 2942875023246993662, "content_hash": 2942875023246993662, "location": "book.translate.xml:2530", "context": "", "note": "(itstool) path: sect2/screen", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 285, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 70, "source_unit": "https://translate-dev.freebsd.org/api/units/102427/?format=api", "priority": 100, "id": 34232, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=a8d7313ddb01a8fe", "url": "https://translate-dev.freebsd.org/api/units/34232/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.087786Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "This screen dump shows that the size of .set.sysinit_set section is 0x664 bytes, so <literal>0x664/sizeof(void *)</literal> sysinit objects are compiled into the kernel. The other sections such as <literal>.set.sysctl_set</literal> represent other linker sets." ], "previous_source": "", "target": [ "" ], "id_hash": -829785140113656989, "content_hash": -829785140113656989, "location": "book.translate.xml:2544", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 286, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 33, "source_unit": "https://translate-dev.freebsd.org/api/units/102428/?format=api", "priority": 100, "id": 34234, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=747c02cfbba0b363", "url": "https://translate-dev.freebsd.org/api/units/34234/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.101572Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "By defining a variable of type <literal>struct linker_set</literal> the content of <literal>.set.sysinit_set</literal> section will be <quote>collected</quote> into that variable:" ], "previous_source": "", "target": [ "" ], "id_hash": 4277126781191968589, "content_hash": 4277126781191968589, "location": "book.translate.xml:2550", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 287, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 19, "source_unit": "https://translate-dev.freebsd.org/api/units/102429/?format=api", "priority": 100, "id": 34235, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=bb5b68257441d74d", "url": "https://translate-dev.freebsd.org/api/units/34235/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.109367Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>sys/kern/init_main.c:</filename>\n extern struct linker_set sysinit_set; /* XXX */" ], "previous_source": "", "target": [ "<filename>sys/kern/init_main.c:</filename>\n extern struct linker_set sysinit_set; /* XXX */" ], "id_hash": -7816780891078984674, "content_hash": -7816780891078984674, "location": "book.translate.xml:2555", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 288, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 8, "source_unit": "https://translate-dev.freebsd.org/api/units/102430/?format=api", "priority": 100, "id": 34237, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=13853731d42cfc1e", "url": "https://translate-dev.freebsd.org/api/units/34237/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.118072Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The <literal>struct linker_set</literal> is defined as follows:" ], "previous_source": "", "target": [ "" ], "id_hash": -5681077536630586037, "content_hash": -5681077536630586037, "location": "book.translate.xml:2558", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 289, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 7, "source_unit": "https://translate-dev.freebsd.org/api/units/102431/?format=api", "priority": 100, "id": 34238, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=3128c2147faec54b", "url": "https://translate-dev.freebsd.org/api/units/34238/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.135726Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>/usr/include/linker_set.h:</filename>\n struct linker_set {\n\tint\tls_length;\n\tvoid\t*ls_items[1];\t\t/* really ls_length of them, trailing NULL */\n};" ], "previous_source": "", "target": [ "<filename>/usr/include/linker_set.h:</filename>\n struct linker_set {\n\tint\tls_length;\n\tvoid\t*ls_items[1];\t\t/* really ls_length of them, trailing NULL */\n};" ], "id_hash": 1889076778052395843, "content_hash": 1889076778052395843, "location": "book.translate.xml:2561", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 290, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 17, "source_unit": "https://translate-dev.freebsd.org/api/units/102432/?format=api", "priority": 100, "id": 34240, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=9a3759522540a343", "url": "https://translate-dev.freebsd.org/api/units/34240/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.152423Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The first node will be equal to the number of a sysinit objects, and the second node will be a NULL-terminated array of pointers to them." ], "previous_source": "", "target": [ "" ], "id_hash": -2568685987996658611, "content_hash": -2568685987996658611, "location": "book.translate.xml:2567", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 291, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 26, "source_unit": "https://translate-dev.freebsd.org/api/units/102433/?format=api", "priority": 100, "id": 34241, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=5c5a31b411ef944d", "url": "https://translate-dev.freebsd.org/api/units/34241/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.163664Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Returning to the <function>mi_startup()</function> discussion, it is must be clear now, how the sysinit objects are being organized. The <function>mi_startup()</function> function sorts them and calls each. The very last object is the system scheduler:" ], "previous_source": "", "target": [ "" ], "id_hash": 3005195104334664118, "content_hash": 3005195104334664118, "location": "book.translate.xml:2571", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 292, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 34, "source_unit": "https://translate-dev.freebsd.org/api/units/102434/?format=api", "priority": 100, "id": 34243, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=a9b49906729c51b6", "url": "https://translate-dev.freebsd.org/api/units/34243/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.174673Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>/usr/include/sys/kernel.h:</filename>\nenum sysinit_sub_id {\n\tSI_SUB_DUMMY\t\t= 0x0000000,\t/* not executed; for linker*/\n\tSI_SUB_DONE\t\t= 0x0000001,\t/* processed*/\n\tSI_SUB_CONSOLE\t\t= 0x0800000,\t/* console*/\n\tSI_SUB_COPYRIGHT\t= 0x0800001,\t/* first use of console*/\n...\n\tSI_SUB_RUN_SCHEDULER\t= 0xfffffff\t/* scheduler: no return*/\n};" ], "previous_source": "", "target": [ "<filename>/usr/include/sys/kernel.h:</filename>\nenum sysinit_sub_id {\n\tSI_SUB_DUMMY\t\t= 0x0000000,\t/* not executed; for linker*/\n\tSI_SUB_DONE\t\t= 0x0000001,\t/* processed*/\n\tSI_SUB_CONSOLE\t\t= 0x0800000,\t/* console*/\n\tSI_SUB_COPYRIGHT\t= 0x0800001,\t/* first use of console*/\n...\n\tSI_SUB_RUN_SCHEDULER\t= 0xfffffff\t/* scheduler: no return*/\n};" ], "id_hash": -3295153264316541005, "content_hash": -3295153264316541005, "location": "book.translate.xml:2577", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 293, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 39, "source_unit": "https://translate-dev.freebsd.org/api/units/102435/?format=api", "priority": 100, "id": 34244, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=5245439087f197b3", "url": "https://translate-dev.freebsd.org/api/units/34244/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.185298Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The system scheduler sysinit object is defined in the file <filename>sys/vm/vm_glue.c</filename>, and the entry point for that object is <function>scheduler()</function>. That function is actually an infinite loop, and it represents a process with PID 0, the swapper process. The proc0 structure, mentioned before, is used to describe it." ], "previous_source": "", "target": [ "" ], "id_hash": -817070612134094699, "content_hash": -817070612134094699, "location": "book.translate.xml:2587", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 294, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 48, "source_unit": "https://translate-dev.freebsd.org/api/units/102436/?format=api", "priority": 100, "id": 34246, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=74a92e9b77561895", "url": "https://translate-dev.freebsd.org/api/units/34246/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.196365Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The first user process, called <emphasis>init</emphasis>, is created by the sysinit object <literal>init</literal>:" ], "previous_source": "", "target": [ "" ], "id_hash": -4486600143633545917, "content_hash": -4486600143633545917, "location": "book.translate.xml:2594", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 295, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 13, "source_unit": "https://translate-dev.freebsd.org/api/units/102437/?format=api", "priority": 100, "id": 34248, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=41bc64f0bd818543", "url": "https://translate-dev.freebsd.org/api/units/34248/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.205332Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>sys/kern/init_main.c:</filename>\nstatic void\ncreate_init(const void *udata __unused)\n{\n\tint error;\n\tint s;\n\n\ts = splhigh();\n\terror = fork1(&proc0, RFFDG | RFPROC, &initproc);\n\tif (error)\n\t\tpanic(\"cannot fork init: %d\\n\", error);\n\tinitproc->p_flag |= P_INMEM | P_SYSTEM;\n\tcpu_set_fork_handler(initproc, start_init, NULL);\n\tremrunqueue(initproc);\n\tsplx(s);\n}\nSYSINIT(init,SI_SUB_CREATE_INIT, SI_ORDER_FIRST, create_init, NULL)" ], "previous_source": "", "target": [ "<filename>sys/kern/init_main.c:</filename>\nstatic void\ncreate_init(const void *udata __unused)\n{\n\tint error;\n\tint s;\n\n\ts = splhigh();\n\terror = fork1(&proc0, RFFDG | RFPROC, &initproc);\n\tif (error)\n\t\tpanic(\"cannot fork init: %d\\n\", error);\n\tinitproc->p_flag |= P_INMEM | P_SYSTEM;\n\tcpu_set_fork_handler(initproc, start_init, NULL);\n\tremrunqueue(initproc);\n\tsplx(s);\n}\nSYSINIT(init,SI_SUB_CREATE_INIT, SI_ORDER_FIRST, create_init, NULL)" ], "id_hash": -2969740690441454277, "content_hash": -2969740690441454277, "location": "book.translate.xml:2598", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 296, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 44, "source_unit": "https://translate-dev.freebsd.org/api/units/102438/?format=api", "priority": 100, "id": 34249, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=56c95c938f36bd3b", "url": "https://translate-dev.freebsd.org/api/units/34249/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.223333Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The <function>create_init()</function> allocates a new process by calling <function>fork1()</function>, but does not mark it runnable. When this new process is scheduled for execution by the scheduler, the <function>start_init()</function> will be called. That function is defined in <filename>init_main.c</filename>. It tries to load and exec the <filename>init</filename> binary, probing <filename>/sbin/init</filename> first, then <filename>/sbin/oinit</filename>, <filename>/sbin/init.bak</filename>, and finally <filename>/stand/sysinstall</filename>:" ], "previous_source": "", "target": [ "" ], "id_hash": 4560443421461064464, "content_hash": 4560443421461064464, "location": "book.translate.xml:2616", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 297, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 55, "source_unit": "https://translate-dev.freebsd.org/api/units/102439/?format=api", "priority": 100, "id": 34251, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=bf49f3212a742b10", "url": "https://translate-dev.freebsd.org/api/units/34251/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.245747Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>sys/kern/init_main.c:</filename>\nstatic char init_path[MAXPATHLEN] =\n#ifdef\tINIT_PATH\n __XSTRING(INIT_PATH);\n#else\n \"/sbin/init:/sbin/oinit:/sbin/init.bak:/stand/sysinstall\";\n#endif" ], "previous_source": "", "target": [ "<filename>sys/kern/init_main.c:</filename>\nstatic char init_path[MAXPATHLEN] =\n#ifdef\tINIT_PATH\n __XSTRING(INIT_PATH);\n#else\n \"/sbin/init:/sbin/oinit:/sbin/init.bak:/stand/sysinstall\";\n#endif" ], "id_hash": 6933182083443056914, "content_hash": 6933182083443056914, "location": "book.translate.xml:2628", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 298, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 11, "source_unit": "https://translate-dev.freebsd.org/api/units/102440/?format=api", "priority": 100, "id": 34252, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=e0379c5f0eb9e112", "url": "https://translate-dev.freebsd.org/api/units/34252/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.261467Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Locking Notes" ], "previous_source": "", "target": [ "内核中的锁" ], "id_hash": -3202476029038334552, "content_hash": -3202476029038334552, "location": "book.translate.xml:2647", "context": "", "note": "(itstool) path: chapter/title", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 299, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/102441/?format=api", "priority": 100, "id": 34254, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=538e8504df776da8", "url": "https://translate-dev.freebsd.org/api/units/34254/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.271811Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<primary>SMP Next Generation Project</primary>" ], "previous_source": "", "target": [ "<primary>SMP Next Generation Project</primary>" ], "id_hash": -535079891998140646, "content_hash": -535079891998140646, "location": "book.translate.xml:2649", "context": "", "note": "(itstool) path: chapter/indexterm", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 300, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 4, "source_unit": "https://translate-dev.freebsd.org/api/units/102442/?format=api", "priority": 100, "id": 34255, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=789303ac56ff171a", "url": "https://translate-dev.freebsd.org/api/units/34255/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.281828Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<emphasis>This chapter is maintained by the FreeBSD SMP Next Generation Project.</emphasis>" ], "previous_source": "", "target": [ "<emphasis>这一章由 FreeBSD SMP Next Generation Project 维护</emphasis>" ], "id_hash": -5109440062307607557, "content_hash": -5109440062307607557, "location": "book.translate.xml:2653", "context": "", "note": "(itstool) path: chapter/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 301, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 11, "source_unit": "https://translate-dev.freebsd.org/api/units/102443/?format=api", "priority": 100, "id": 34257, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=39179f5595015bfb", "url": "https://translate-dev.freebsd.org/api/units/34257/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.296138Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<primary>locking</primary>" ], "previous_source": "", "target": [ "<primary>locking(锁)</primary>" ], "id_hash": 1256247067205333401, "content_hash": 1256247067205333401, "location": "book.translate.xml:2656", "context": "", "note": "(itstool) path: chapter/indexterm", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 302, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/102444/?format=api", "priority": 100, "id": 34259, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=916f160d3ee67199", "url": "https://translate-dev.freebsd.org/api/units/34259/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.315084Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<primary>multi-processing</primary>" ], "previous_source": "", "target": [ "<primary>multi-processing(多处理)</primary>" ], "id_hash": 4227147426002944294, "content_hash": 4227147426002944294, "location": "book.translate.xml:2657", "context": "", "note": "(itstool) path: chapter/indexterm", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 303, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/102445/?format=api", "priority": 100, "id": 34260, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=baa9d830041cc126", "url": "https://translate-dev.freebsd.org/api/units/34260/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.330086Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<primary>mutexes</primary>" ], "previous_source": "", "target": [ "<primary>mutexes(同时/独占, mutual exclusion)</primary>" ], "id_hash": -951265405194106796, "content_hash": -951265405194106796, "location": "book.translate.xml:2658", "context": "", "note": "(itstool) path: chapter/indexterm", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 304, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/102446/?format=api", "priority": 100, "id": 34262, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=72cc6d276c498854", "url": "https://translate-dev.freebsd.org/api/units/34262/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.345017Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<primary>lockmgr</primary>" ], "previous_source": "", "target": [ "<primary>lockmgr(锁管理器)</primary>" ], "id_hash": 4448246091254324215, "content_hash": 4448246091254324215, "location": "book.translate.xml:2659", "context": "", "note": "(itstool) path: chapter/indexterm", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 305, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/102447/?format=api", "priority": 100, "id": 34264, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=bdbb58408ebbdbf7", "url": "https://translate-dev.freebsd.org/api/units/34264/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.356157Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<primary>atomic operations</primary>" ], "previous_source": "", "target": [ "<primary>atomic operations(原子操作)</primary>" ], "id_hash": -5036393231039810287, "content_hash": -5036393231039810287, "location": "book.translate.xml:2660", "context": "", "note": "(itstool) path: chapter/indexterm", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 306, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/102448/?format=api", "priority": 100, "id": 34265, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=3a1b230a52b0b511", "url": "https://translate-dev.freebsd.org/api/units/34265/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.377332Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "This document outlines the locking used in the FreeBSD kernel to permit effective multi-processing within the kernel. Locking can be achieved via several means. Data structures can be protected by mutexes or <citerefentry><refentrytitle>lockmgr</refentrytitle><manvolnum>9</manvolnum></citerefentry> locks. A few variables are protected simply by always using atomic operations to access them." ], "previous_source": "", "target": [ "" ], "id_hash": -8364513089017833745, "content_hash": -8364513089017833745, "location": "book.translate.xml:2661", "context": "", "note": "(itstool) path: chapter/para", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 307, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 48, "source_unit": "https://translate-dev.freebsd.org/api/units/102449/?format=api", "priority": 100, "id": 34266, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=0beb47a9a1fc96ef", "url": "https://translate-dev.freebsd.org/api/units/34266/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.389191Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Mutexes" ], "previous_source": "", "target": [ "Mutex" ], "id_hash": -678047064680228839, "content_hash": -678047064680228839, "location": "book.translate.xml:2669", "context": "", "note": "(itstool) path: sect1/title", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 308, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/102450/?format=api", "priority": 100, "id": 34268, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=769717c980bd1819", "url": "https://translate-dev.freebsd.org/api/units/34268/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.406161Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "A mutex is simply a lock used to guarantee mutual exclusion. Specifically, a mutex may only be owned by one entity at a time. If another entity wishes to obtain a mutex that is already owned, it must wait until the mutex is released. In the FreeBSD kernel, mutexes are owned by processes." ], "previous_source": "", "target": [ "Mutex就是一种用来解决共享/排它矛盾的锁。 一个mutex在一个时刻只可以被一个实体拥有。如果另一个实体要获得已经被拥有的mutex, 就会进入等待,直到这个mutex被释放。在FreeBSD内核中,mutex被进程所拥有。" ], "id_hash": -8933787611897280946, "content_hash": -8933787611897280946, "location": "book.translate.xml:2671", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 309, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 53, "source_unit": "https://translate-dev.freebsd.org/api/units/102451/?format=api", "priority": 100, "id": 34269, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=0404cf800e13c64e", "url": "https://translate-dev.freebsd.org/api/units/34269/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.423794Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Mutexes may be recursively acquired, but they are intended to be held for a short period of time. Specifically, one may not sleep while holding a mutex. If you need to hold a lock across a sleep, use a <citerefentry><refentrytitle>lockmgr</refentrytitle><manvolnum>9</manvolnum></citerefentry> lock." ], "previous_source": "", "target": [ "Mutex 可以被递归的索要,但是 mutex 一般只被一个实体拥有较短的一段时间,因此一个实体不能在持有 mutex 时睡眠。如果你需要在持有 mutex 时睡眠,可使用一个<citerefentry><refentrytitle>lockmgr</refentrytitle><manvolnum>9</manvolnum></citerefentry>的锁。" ], "id_hash": -8837948160996561644, "content_hash": -8837948160996561644, "location": "book.translate.xml:2677", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 310, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 41, "source_unit": "https://translate-dev.freebsd.org/api/units/102452/?format=api", "priority": 100, "id": 34271, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=05594cf9187bad14", "url": "https://translate-dev.freebsd.org/api/units/34271/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.433629Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Each mutex has several properties of interest:" ], "previous_source": "", "target": [ "每个mutex有几个令人感兴趣的属性:" ], "id_hash": 2545352943953724533, "content_hash": 2545352943953724533, "location": "book.translate.xml:2682", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 311, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 7, "source_unit": "https://translate-dev.freebsd.org/api/units/102453/?format=api", "priority": 100, "id": 34272, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=a352e904445b4475", "url": "https://translate-dev.freebsd.org/api/units/34272/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:45.445755Z" } ] }{ "count": 2721, "next": "