The translation is temporarily closed for contributions due to maintenance, please come back later.
English Chinese (Simplified) (zh_CN)
<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: boot2 定义了很重要的引导信息数据结构。此结构由 boot2 初始化,然后传递到加载程序,再传到内核。
<emphasis>mapp</emphasis> - pointer to the storage for the new map to be returned <emphasis>mapp</emphasis> - 指向返回的新映射的存储的指针。
<emphasis>arg</emphasis> - the same as callback_arg passed to <function>bus_dmamap_load()</function> <emphasis>arg</emphasis> - 与传递给<function>bus_dmamap_load()</function>的callback_arg相同。
<emphasis>error</emphasis> - indication of the segment number overflow: if it is set to <errorname>EFBIG</errorname> then the buffer did not fit into the maximal number of segments permitted by the tag. In this case only the permitted number of descriptors will be in the array. Handling of this situation is up to the driver: depending on the desired semantics it can either consider this an error or split the buffer in two and handle the second part separately <emphasis>error</emphasis> - 表示段数目溢出:如被设为<errorname>EFBIG</errorname>,则标签允许的最大数目的段无法容纳缓冲区。这种情况下数组中的描述符的数目只有标签许可的那么多。对这种情况的处理由驱动程序决定:根据希望的语义,驱动程序可以视其为错误,或将缓冲区分为两个并单独处理第二个。
unit - the controller unit number, for example for controller <quote>mps0</quote> this number will be 0 unit - 控制器单元号,例如对于控制器<quote>wds0</quote>的此数字将为0。
Do some action on request of the CAM subsystem. Sim describes the SIM for the request, CCB is the request itself. CCB stands for <quote>CAM Control Block</quote>. It is a union of many specific instances, each describing arguments for some type of transactions. All of these instances share the CCB header where the common part of arguments is stored. 响应CAM子系统的请求采取某些动作。Sim描述了请求的SIM,CCB为 请求本身。CCB代表<quote>CAM Control Block</quote>。它是很多特定 实例的联合,每个实例为某些类型的事务描述参量。所有这些实例共享 存储着参量公共部分的CCB头部。(译注:这一段不很准确,请自行参考原文)
<emphasis>flags</emphasis> - various bits of information about the request spriv_ptr0, spriv_ptr1 - fields reserved for private use by the SIM driver (such as linking to the SIM queues or SIM private control blocks); actually, they exist as unions: spriv_ptr0 and spriv_ptr1 have the type (void *), spriv_field0 and spriv_field1 have the type unsigned long, sim_priv.entries[0].bytes and sim_priv.entries[1].bytes are byte arrays of the size consistent with the other incarnations of the union and sim_priv.bytes is one array, twice bigger. <emphasis>flags</emphasis> - 有关请求的各个 信息位
<emphasis>sense_len</emphasis> - the length of that buffer (if it happens to be higher than size of sense_data the SIM driver must silently assume the smaller value) resid, sense_resid - if the transfer of data or SCSI sense returned an error these are the returned counters of the residual (not transferred) data. They do not seem to be especially meaningful, so in a case when they are difficult to compute (say, counting bytes in the SCSI controller's FIFO buffer) an approximate value will do as well. For a successfully completed transfer they must be set to zero. <emphasis>sense_len</emphasis> - 缓冲区的长度(如果碰巧大于sense_data的大小,SIM驱动程序必须 悄悄地采用较小值)(译注:一点改动,参考原文及代码)
After the values are re-negotiated the resulting values must be assigned to both current and goal parameters, so for future I/O transactions the current and goal parameters would be the same and <function>target_negotiated()</function> would return TRUE. When the card is initialized (in <function>xxx_attach()</function>) the current negotiation values must be initialized to narrow asynchronous mode, the goal and current values must be initialized to the maximal values supported by controller. 重新协商这些值后,结果值必须同时赋给当前和目的(goal)参数, 这样对于以后的I/O事务当前和目的参数将相同,且 <function>target_negotiated()</function>会返回TRUE。当初始化卡 (在<function>xxx_attach()</function>中)当前协商值必须被初始化为 最窄同步模式,目的和当前值必须被初始化为控制器所支持的最大值。 (译注:原文可能有误,此处未改)
<emphasis>XPT_PATH_INQ</emphasis> - path inquiry, in other words get the SIM driver and SCSI controller (also known as HBA - Host Bus Adapter) properties <emphasis>XPT_PATH_INQ</emphasis> - 路径问询, 换句话说,获得SIM驱动程序和SCSI控制器(也称为HBA - 主机总线适配器) 的特性。
Devices can suspend themselves and trigger resumes of the host system 设备可以挂起自身并触发host系统的重新投入运行。
Devices are intelligent and contain easily accessible information about themselves 设备智能化并包含很容易访问到的关于自身的信息。
A uniform software interface to hardware-specific audio interface modules. 一个统一的软件接口,与硬件特定的音频接口模块接口
As an alternative, or in addition to starting from a working example, you can find a commented driver template at <link xlink:href="https://people.FreeBSD.org/~cg/template.c"> https://people.FreeBSD.org/~cg/template.c</link> 作为另外的途径,或者说除了从一个可工作的范例开始的办法之外, 你可以从<link xlink:href="http://people.FreeBSD.org/~cg/template.c"> http://people.FreeBSD.org/~cg/template.c</link>找到一个注释过的 驱动程序模板。
All the relevant code lives in <filename>/usr/src/sys/dev/sound/</filename>, except for the public ioctl interface definitions, found in <filename>/usr/src/sys/sys/soundcard.h</filename> 除<filename>/usr/src/sys/sys/soundcard.h</filename>中的公共 ioctl接口定义外,所有的相关代码当前(FreeBSD 4.4)位于 <filename>/usr/src/sys/dev/sound/</filename>。
Probing, Attaching, etc. 探测,连接等
<function>xxxmixer_init()</function> initializes the hardware and tells <filename>pcm</filename> what mixer devices are available for playing and recording <function>xxxmixer_init()</function>初始化硬件,并告诉 <filename>pcm</filename>什么混音器设备可用来播放和录音。
The desired recording devices are specified as a bit field 期望的录音设备由一个位域指定.