User:Reuben: Difference between revisions
No edit summary |
m (Reverted edits by 79.76.108.206 (Talk) to last version by Reuben) |
||
Line 1: | Line 1: | ||
Reuben Caron. |
|||
{{OLPC}} |
|||
{{TOCright}} |
|||
<!--- '''Manufacturing Data Specification''' ---> |
|||
This document defines the method for storing manufacturing data on an OLPC laptop, as well as the interaction with the security system. |
|||
Manufacturing data is information about a specific OLPC laptop that is known at time of manufacture and stored in the unit's SPI FLASH. It includes basic manufacturing data such as the product model, part number, and motherboard model number; unique identifying information such as the serial number, unique user ID, and WLAN MAC address; and language localization information such as the keyboard version and language locale. There are also flag indicating the anti-theft "status" of the laptop (activated, developer). |
|||
==Goals== |
|||
* Security: When an OLPC machine leaves the factory, the SPI FLASH '''must''' be write protected, if the customer has requested that anti-theft be enabled. |
|||
* Manufacturability: The procedures should be fast, reliable, and convenient within the constraints of the manufacturing flow. |
|||
* Extensibility: The data formats should make it easy to revise or extend the manufacturing data set in the future. |
|||
* Sanity: The validity of the manufacturing data should be easy to verify. |
|||
* Robustness: Programs that read or write manufacturing data should continue to work when the data set is revised. |
|||
* Simplicity: The implementation programs should be small and easy to write and verify. |
|||
==Version History== |
|||
Version 3.0, 2009-06-18 (lots of other updates have happened) Added SKU 53 and 54 for Nicaragua |
|||
Version 2.9, 2007-11-20 us,ng -> ng |
|||
Version 2.8, 2007-11-14 Corrected a couple of keyboard table entries - us,ur -> us,pk, and ng -> us,ng |
|||
Version 2.7, 2007-11-14 Added SK tag for SKU number |
|||
Version 2.6, 2007-10-21 Revised SG tag per input from Quanta |
|||
Version 2.5, 2007-10-19 Added SG tag information |
|||
Version 2.4, 2007-10-17 Revised SD tag format |
|||
Version 2.3, 2007-10-11 Revised KA tag, fixed lengths and example values for other tags to match reality. |
|||
Version 2.2, 2007-10-09 Clarified LA and LO values, added dk and ak tags. |
|||
Version 2,1, 2007-10-07 add keyboard data |
|||
Version 2.0, 2007-05-24 manufacturing data now lives in Sector E, not Sector 0. |
|||
Version 1.0, 2006-11-16 added some example data values from Quanta. |
|||
Version 0.2, 2006-09-14 added approvals process, added wp/ww to tags list, specified tag registration process |
|||
Version 0.1, 2006-09-13 |
|||
==Specification== |
|||
===Location=== |
|||
The manufacturing data shall start at SPI FLASH offset 0xeffff and grow downwards. 2K of space is currently "reserved" for this purpose, although at that time of this writing (2007-05-24, ROM version Q2C14), there is nothing else in that 64K sector, so the 2K limit is not hard and fast. |
|||
''Historical note: Prior to the C-series firmware, i.e. up to and including Q2B87, the manufacturing data was located at the end of the first 64K sector of the SPI FLASH chip, growing down toward the "EC" code area. The VSA code was above the upper boundary of the manufacturing data.'' |
|||
====Rationale==== |
|||
''This rationale is obsolete now that the manufacturing data is no longer in the EC sector, but remains here for historical background.'' |
|||
* Placing the manufacturing data near the EC code results in a single boundary below which the data is effectively immutable. This simplifies and increases the reliability of the code for field updates to OFW. |
|||
* 64K is the size of an erase sector; the EC code plus the manufacturing data should "never need to be erased". |
|||
* The current size of the EC code is approximately 16K, so there should be plenty of space for manufacturing data within that 64K sector. |
|||
===Data Format=== |
|||
The manufacturing data shall be stored using the following extensible tagged representation: |
|||
# Each item shall consist of a tag header plus optional binary data. |
|||
# There are two tag formats - a 4-byte format that can have from 0 to 127 bytes of data, and a 5-byte format that can have from 0 to 16383 bytes of data (the practical limit is less because of the overall size limits on the manufacturing data area). |
|||
## The 4-byte tag shall consist of: |
|||
### Two name bytes, each containing a case-sensitive 7-bit ASCII character |
|||
### A length byte whose binary value is from 0 to 127, indicating the number of additional data bytes (not including the 4-byte tag). |
|||
### A check byte whose binary value is the one's complement of the length byte |
|||
## The 5-byte tag shall consist of: |
|||
### Two name bytes, each containing a case-sensitive 7-bit ASCII character |
|||
### A check byte whose binary value is from 128 to 255, computed as described below. |
|||
### A low length byte (0..127), containing the 7 least significant bits of the data length |
|||
### A high length byte (0..127), containing the 7 most significant bits of the data length. |
|||
### The data length is given by ((high_length << 7) + low_length). (If the most-significant bit of either low_length or high_length is set, the tag is invalid.) |
|||
### The check byte value is calculated as (low_length ^ high_length ^ 0xff). Note that this guarantees that the most-significant bit of the check byte will be 1, thus distinguishing the 5-byte tag from the 4-byte tag format. |
|||
# The list of manufacturing data is the concatenation of individual items. |
|||
# The list grows in the "downward" direction, reflecting the fact that the manufacturing data is stored at the end of a region. |
|||
# There is no padding for alignment purposes - each tagged item is immediately adjacent to (i.e. just below) its predecessor. |
|||
# The end of the list is denoted by the absence of a valid tag "after" (i.e. at the address just below) the last item. |
|||
# Within a tagged item, the order of bytes is: |
|||
## Highest address: second name character |
|||
## Highest address minus 1: first name character |
|||
## Highest address minus 2: length byte of 4-byte format (0-127) or check byte of 5-byte format (128-255) |
|||
## Highest address minus 3: check byte (~length) of 4-byte format or low length of 5-byte format |
|||
## Highest address minus 4: last data byte (if any) of 4-byte format or high length byte of 5-byte format |
|||
## Highest address minus 5: next-to-last data byte (if any) of 5-byte format or last data byte (if any) of 5-byte format |
|||
## ... (additional data bytes) |
|||
# The interpretation of the data bytes within an item varies from name to name; code that operates on such data must know the appropriate data interpretation for the names that it uses. (But see also [[#Data Value Encoding Conventions]] .) |
|||
====Rationale==== |
|||
* The list grows down because it has to start at a known location at the end of an erase sector |
|||
* The order of characters within tag names makes it easier to "visually parse" the data when looking at memory dumps, with no adverse effect on program code. |
|||
* Note that a valid check byte always has the most-significant bit set, and the other three tag bytes always have that bit clear. |
|||
* Erased FLASH storage (all bytes FF) does not constitute a valid tag, nor does all-zero storage. |
|||
* Software that inspects specific items of manufacturing data need not understand the details of all tags. It can just skip tags to find the one it's looking for. |
|||
* Appending a tag to the end of the list involves skipping to the end of the list and writing the new tag. |
|||
* Changing the value of an existing tag is difficult, except for the special case of changing some bits from 1 to 0 (which can be done without erasing the FLASH). |
|||
* It is possible to distinguish the 4-byte and 5-byte header formats from either direction. From the direction of the name bytes (going downward in memory), if the next byte is <128, it is the 4-byte format. Conversely, from the direction of the data bytes (going upward in memory), if the next byte is <128, it is the 5-byte format. |
|||
* The 5-byte format is not supported by any firmware version <= q2c28, and systems <= C1 do not have any 5-byte tags. It follows that systems that use 5-byte tags must have firmware > q2c29. |
|||
===Write Protect Behavior=== |
|||
# Prior to starting execution of the main operating system, the bootloader shall control the hardware write protection for the SPI FLASH as follows: |
|||
## If the location of the first tag (i.e. the bytes at SPI FLASH offset 0xfffc-0xffff) is erased (i.e. all four byte values are 0xff), the bootloader shall ''not'' enable the hardware write protection. |
|||
## If the location of the first tag contains a valid tag with the name 'ww' and zero data length (i.e. 'w' at 0xffff, 'w' at 0xfffe, 0x0 at 0xfffd , and 0xff at 0xfffc), the bootloader shall ''not'' enable the hardware write protection. |
|||
## Otherwise, the bootloader shall enable the hardware write protection. |
|||
====Rationale==== |
|||
* The "all erased" clause handles the "virgin FLASH" case, for initial manufacturing procedures. |
|||
* The "ww" clause enables the possibility of "incremental logging" during the manufacturing flow. The first manufacturing phase that adds an item to the manufacturing data area creates a "ww" tag at the beginning. Subsequent phases can extend the list with other tags as necessary. The final step in the manufacturing flow changes the "ww" to "wp", thus causing the bootloader to enable write protection. |
|||
* Note that changing "ww" to "wp" drives three bits from 1 to 0, which can be done without erasing. The only way to return to "ww" (or to 0xff) is to erase the entire sector. |
|||
* (Need a link to the document defining the auto-bootloader-update procedure). |
|||
===Data Value Encoding Conventions=== |
|||
# The following conventions should be observed when defining data formats for new tags: |
|||
## Store text strings with the first character at the lowest address, null terminated. |
|||
## Store variable length text strings using only the amount of space needed (including the null terminator). |
|||
## Consider storing numeric values as human-readable ASCII text when it is reasonable to do so. |
|||
## Store multi-byte binary numbers in little-endian form, i.e. with the least-significant byte at the lowest address. |
|||
====Rationale==== |
|||
* The order of characters within text strings makes it easier to "visually parse" the data when looking at memory dumps, while also being easier (or at least no harder) to operate on with program code. |
|||
* Null termination makes it easy to use C library routines. |
|||
* There's no need to pad out strings to a predefined maximum length, because the tag encapsulation can tell you the actual length. |
|||
* Note that there is no guarantee that multi-byte binary numbers will be naturally-aligned. |
|||
===Tag Registration=== |
|||
# The most recent version of this document at http://wiki.laptop.org/go/Manufacturing_Data contains the definitive list of tag names and values. |
|||
# The method for arbitrating changes to the list is as follows: Someone associated with the OLPC project will be designated as the gatekeeper of the list. The gatekeeper is currently Mitch Bradley, wmb@firmworks.com . Upon request, the gatekeeper will add tags to the list. Such requests should include complete definitions of the proposed new tags and their value encodings. |
|||
====Rationale==== |
|||
* The assumption is that new tags will be defined infrequently. |
|||
===Defined Tags=== |
|||
Use '.mfg-data' at the OK prompt to get the tag settings. <br> |
|||
(In the tag name DQ, the "first name character" is "D", the "second name character" is "Q") |
|||
<table border=1> |
|||
<tr><th>Tag Name</th><th>Data Length<br>(including null)</th><th>Req</th><th>Meaning</th><th>Encoding</th></tr> |
|||
<tr><td>ww</td><td>0</td><td></td><td>Write Allow</td><td>(No Data) Presence at beginning of tag list prevents bootloader from enabling hardware write protect of SPI FLASH. This can be used to allow incremental updates to the tag list during multiple manufacturing phases. See [[#Write Protect Behavior]].</td></tr> |
|||
<tr><td>wp</td><td>0</td><td></td><td>Write Protect</td><td>(No Data) Change 'ww' to 'wp' to enable hardware write protect. Note that if the first tag is not 'ww', write protect will be enabled, so if the entire tag list is written at once (no incremental tagging), it is not necessary to include the 'wp' tag.</td></tr> |
|||
<tr><td>ak</td><td>0</td><td>o</td><td>Activation Key</td><td>(No Data) Presence of this field indicates that this system is persistently activated, requiring no temporal lease to run the operating system. Open Firmware uses this as an input to its secure boot algorithm. For certain SKUs, this field might be set at the factory.</td></tr> |
|||
<tr><td>dk</td><td>0</td><td>o</td><td>Developer Key</td><td>(No Data) Presence of this field indicates that this system is persistently unlocked and can be used without going through the Open Firmware secure boot algorithm. Typically, this flag would not be set at the factory, but would instead be added to the manufacturing data by individuals who have acquired a developer key and wish to unlock the machine permanently.</td></tr> |
|||
<tr><td>SN</td><td>12</td><td>Y</td><td>Serial Number</td><td>Example: SHF7250024D</td></tr> |
|||
<tr><td>SG</td><td>1</td><td></td><td>Board Revision</td><td>Example: 0xC2. A single binary byte whose hexadecimal representation matches the "letter number" designation of the board revision. The value for an XO-1 B2 machines was 0xB2, for B3 was 0xB3, and for B4 was 0xB4. For XO-1 C1 machines, the value was 0xA9, due to an error of unknown origin. For XO-1 C2 versions (MP), this value was 0xC2. For XO-1.5, 0xD0 indicates A2, 0xD1 indicates B2, 0xD2 indicates B3, 0xD3 indicates C1, and 0xD4 indicates a C2 version (and MP).</td></tr> |
|||
<tr><td>B#</td><td>15</td><td></td><td>Motherboard Number</td><td>Example: QTFLCA72400085</td></tr> |
|||
<tr><td>U#</td><td>37</td><td>Y</td><td>UUID#</td><td>Example: DADD886B-C2F7-4B9C-89CB-43B9A81A388C (Random Generate)</td></tr> |
|||
<tr><td>P#</td><td>12</td><td>Y</td><td>Part Number</td><td>Example: 1CL11ZU0KD9</td></tr> |
|||
<tr><td>M#</td><td>4</td><td></td><td>Product Model Number</td><td>CL1</td></tr> |
|||
<tr><td>LA</td><td>varies</td><td>Y</td><td>Country Code</td><td>Three-letter ISO 3166-1-alpha-3 country code specifying the target country for this system. (See http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3). In prototype systems, the use of this tag was inconsistent, sometimes specifying the target country and sometimes specifying the target country's predominant language. The meaning for future systems is hereby clarified to be the country, not the language. In cases where the same SKU is to be used for multiple countries, this field should contain the name of an arbitrary one of those countries. The detailed use of this field is unspecified, but the OS might, for instance, use it as a "hint" in case other fields are missing (as with prototype systems) or insufficiently specific.</td></tr> |
|||
<tr><td>LO</td><td>varies</td><td>Y</td><td>Product Localization</td><td>Default value for the POSIX locale (LANG environment variable). The Linux startup code uses this to configure the language environment. If not present, the Linux startup code will chose a default according to some heuristic. Example value: en_US.UTF-8</td></tr> |
|||
<tr><td>KA</td><td>111</td><td>Y</td><td>Keyboard ASCII map</td><td>Specifies the keyboard key numbers for the US ASCII characters on this system's keyboard. This lets Open Firmware automatically adapt to different keyboard layouts. See [[#Keyboard ASCII Map]].</td></tr> |
|||
<tr><TD>KM</td><td>varies</td><td>Y</td><td>Keyboard Model</td><td>Always "olpc" on the XO-1; see below</td></tr> |
|||
<tr><TD>KL</td><td>varies</td><td>Y</td><td>Keyboard Layout</td><td>Layout of the keyboard: "es", "fi", "us,ar", "us,ru"; see table below for settings for OLPC Keyboards</td></tr> |
|||
<tr><TD>KV</td><td>varies</td><td>Y</td><td>Keyboard Variant</td><td>Keyboard variant for OLPC Keyboards; see below.</td></tr> |
|||
<tr><td>CC</td><td>11</td><td></td><td>Configuration Code</td><td>Example: 2222XXXXXX</td></tr> |
|||
<tr><td>F#</td><td>3</td><td></td><td>Factory Number</td><td>Example: F6</td></tr> |
|||
<tr><td>L#</td><td>2</td><td></td><td>Line Number</td><td>Example: H</td></tr> |
|||
<tr><td>S#</td><td>11</td><td></td><td>SWID #</td><td>OS Build that was loaded in the factory. Example: CL1XL00406</td></tr> |
|||
<tr><td>T#</td><td>13</td><td></td><td>TSWID#</td><td>Example: TSIMG_V3.0.2</td></tr> |
|||
<tr><td>WM</td><td>18</td><td>Y</td><td>Wireless MAC #</td><td>Example: 00-17-C4-03-56-8A</td></tr> |
|||
<tr><td>MN</td><td>5</td><td></td><td>Model Name</td><td>XO-1</td></tr> |
|||
<tr><td>BV</td><td>6</td><td></td><td>BIOS Version</td><td>Example: Q2C18</td></tr> |
|||
<tr><td>TS</td><td>3</td><td></td><td>Test Station</td><td>Example: DL for DOWNLOAD (SMT/ASSY/DL/RUNIN/FINAL/SHIP/FQA)</td></tr> |
|||
<tr><td>BD</td><td>3</td><td></td><td>Boot Device</td><td>Example: u:\boot\olpc.fth cifs:\\user:password@10.20.0.2\directory\olpc.fth<br>This is the value of the boot-device list to use in the manufacturing phase indicated by the TS tag.</td></tr> |
|||
<tr><td>MS</td><td>3</td><td></td><td>Manufacturing Server</td><td>Example: cifs:\\user:password@10.20.0.2\directory\<br>This is the server to use in the manufacturing phase indicated by the TS tag.</td></tr> |
|||
<tr><td>SS</td><td>3</td><td></td><td>SMT Status</td><td>Example: EN (for END), ST (for START)</td></tr> |
|||
<tr><td>FQ</td><td>3</td><td></td><td>FQA</td><td>Example: NA (START/END)</td></tr> |
|||
<tr><td>SD</td><td>7</td><td></td><td>SWDL Date</td><td>Example: 20071017 (for 17 November 2007)</td></tr> |
|||
<tr><td>MD</td><td>16</td><td></td><td>Manufacturing Date</td><td>Example: 20081014T200700Z (for 14 October 2008, 8:07:00 PM UTC)</td></tr> |
|||
<tr><td>SK</td><td>varies</td><td></td><td>Stock Keeping Unit number</td><td>The SKU number, expressed as a decimal number in ASCII, null terminated, without leading zeros. Examples: "1" (length is 2 including null), "13" (length 3 including null), "237" (length 4 including null).</td></tr> |
|||
</table> |
|||
The "Req" field indicates which tags are required for proper operation of the laptop. The KA tag is required unless the keyboard type is US, in which case OFW will default to the correct key map. The ak and dk flags may be viewed as required, if they were already set! |
|||
==Keyboards== |
|||
[[Category:Keyboard layouts]] |
|||
The scheme selected (using the KM, KL, and KV flags) maps directly to the X |
|||
Window System Xkb extension. |
|||
The AK field is used to designate pre-activated or not activated coming out of the factory. 'Yes' means the AK flag exists in the mfg-data; and the laptop is pre-activated. 'No' means there is no AK flag, and the laptop will have to be activated at the delivery site. |
|||
The KM field is the model of the keyboard: for the XO-1, it will always have the value of "olpc", unless some different keyboard is designed in subsequent production. We include it here for completeness and to allow for such a different keyboard model sometime in the future, or this manufacturing data scheme to be easily used on other systems. |
|||
The KL field specifies the layouts on the keyboard. Keyboards may have multiple layouts, which can be switched between at run time. The names for these layouts generally bear resemblance to ISO country codes, as a given keyboard is often (but not necessarily) in use in particular countries. One or more layouts can be present on a keyboard. If there are multiple layouts, the layout codes are separated by the "," character. |
|||
The KV field specifies one or more variants on a layout. Example variants include strings such as "olpc", "olpc2", "dvorak", "winkeys", ",bksl,". |
|||
The LO field is both language and region specific: The first two letters are the language code; the second two letters are the country code. Note that many langauge/region variants can share a common keyboard, e.g., Russian (ru_RU) and Ukrainian (uk_UA) both use the Cyrillic keyboard, but will need different SKUs to accommodate the different language settings on the laptop. |
|||
<table border=1> |
|||
<tr><th>Keyboard Layout</th><th>AK</th><th>KM</th><th>KL</th><th>KV</th><th>LO</th><th>SKU(s)</th><th>KA Reference†</th><th>Comment</th></tr> |
|||
<tr><td>[[OLPC_Keyboard_layouts|US International keyboard]]</td><td>yes</td><td>olpc</td><td>us</td><td>olpc</td><td>en_US.UTF-8</td><td>1,2,19 27, 33, 34, 39, 44, 45</td><td>us</td><td>Developers, other</td></tr> |
|||
<tr><td>[[OLPC_Keyboard_layouts|US International keyboard]]</td><td>yes</td><td>olpc</td><td>us</td><td>olpc</td><td>en_US.UTF-8</td><td>20,28,21</td><td>us</td><td>Alabama, Nigeria (temp), Rwanda (temp)</td></tr> |
|||
<tr><td>[[OLPC_Argentina_Keyboard|Spanish keyboard]]</td><td>no</td><td>olpc</td><td>es</td><td>olpc</td><td>es_UY.UTF-8</td><td>5,6,18,40</td><td>es</td><td>Uruguay, Paraguay</td></tr> |
|||
<tr><td>[[OLPC_Argentina_Keyboard|Spanish keyboard]]</td><td>no</td><td>olpc</td><td>es</td><td>olpc</td><td>es_MX.UTF-8</td><td>3,4,17</td><td>es</td><td>Mexico/Peru</td></tr> |
|||
<tr><td>[[OLPC_Argentina_Keyboard|Spanish keyboard]]</td><td>yes</td><td>olpc</td><td>es</td><td>olpc</td><td>es_UY.UTF-8</td><td>26</td><td>es</td><td>General Spanish laptops</td></tr> |
|||
<tr><td>[[OLPC_Brasil_Keyboard|Portuguese keyboard]]</td><td>yes</td><td>olpc</td><td>br</td><td>olpc</td><td>pt_BR.UTF-8</td><td>10,42</td><td>pt</td><td>Brasil</td></tr> |
|||
<tr><td>[[OLPC_Ethiopia_Keyboard|Amharic keyboard]]</td><td>'''no'''</td><td>olpc</td><td>us,et</td><td>olpc2,basic</td><td>am_ET.UTF-8</td><td>11</td><td>us</td><td>Ethiopia</td></tr> |
|||
<tr><td>[[OLPC_Libya_Keyboard|Arabic keyboard]]</td><td>yes</td><td>olpc</td><td>us,ara</td><td>olpc2,olpc</td><td>ar_EG.UTF-8</td><td>7,41</td><td>us</td><td></td></tr> |
|||
<tr><td>[[OLPC_Nigeria_Keyboard|Nigerian keyboard]]</td><td>yes</td><td>olpc</td><td>ng</td><td>olpc</td><td>en_US.UTF-8</td><td>9</td><td>us(?)</td><td>(US/International keyboard only) for Igbo, Yoruba, and Hausa</td></tr> |
|||
<tr><td>[[OLPC_Rwanda_Keyboard|French keyboard]]</td><td>yes</td><td>olpc</td><td>fr</td><td>olpc</td><td>fr_FR.UTF-8</td><td></td><td>fr</td><td>(not approved for MP)</td></tr> |
|||
<tr><td>[[OLPC_Thailand_Keyboard|Thai keyboard]]</td><td>yes</td><td>olpc</td><td>us,th</td><td>olpc2,olpc</td><td>th_TH.UTF-8</td><td>8</td><td>us</td><td>Thailand</td></tr> |
|||
<tr><td>[[Urdu Keyboard|Urdu keyboard]]</td><td>yes</td><td>olpc</td><td>us,pk</td><td>olpc2,olpc</td><td>ur_PK.UTF-8</td><td>12</td><td>us</td><td>Pakistan</td></tr> |
|||
<tr><td>[[Cyrillic_Keyboard|Cyrillic keyboard]]</td><td>yes</td><td>olpc</td><td>us,ru</td><td>olpc2,olpc</td><td>uk_UA.UTF-8</td><td>30</td><td>us</td><td>Russia</td></tr> |
|||
<tr><td>[[OLPC_Turkey_Keyboard|Turkish keyboard]]</td><td>yes</td><td>olpc</td><td>tr</td><td>olpc</td><td>tr_TR.UTF-8</td><td></td><td>us</td><td>Turkish-Q approved</td></tr> |
|||
<tr><td>[[OLPC_Nepal_Keyboard|Nepali keyboard]]</td><td>yes</td><td>olpc</td><td>us,np</td><td>olpc2,olpc</td><td>ne_NP.UTF-8</td><td>15, 46</td><td>us</td><td>Nepal</td></tr> |
|||
<tr><td>[[OLPC_Mongolian_Keyboard|Mongolian keyboard]]</td><td>yes</td><td>olpc</td><td>us,mn</td><td>olpc2,olpc</td><td>mn_MN.UTF-8</td><td>13,43</td><td>us</td><td>Mongolia</td></tr> |
|||
<tr><td>[[OLPC_Kazakh_Keyboard|Kazakh keyboard]]</td><td>yes</td><td>olpc</td><td>us,kz</td><td>olpc2,olpc</td><td>kk_KZ.UTF-8</td><td></td><td>us</td><td>(not approved for MP)</td></tr> |
|||
<tr><td>[[Devanagari_Keyboard|Devanagari keyboard]]</td><td>yes</td><td>olpc</td><td>us,in</td><td>olpc2,olpc</td><td>hi_IN.UTF-8</td><td>14</td><td>us</td><td>India</td></tr> |
|||
<tr><td>[[Dari_Keyboard|Dari keyboard]]</td><td>yes</td><td>olpc</td><td>us,af</td><td>olpc2,fa-olpc</td><td>fa_AF.UTF-8</td><td>22</td><td>us</td><td>Afghanistan</td></tr> |
|||
<tr><td>[[Uzbek_Keyboard|Uzbec keyboard]]</td><td>yes</td><td>olpc</td><td>us,af</td><td>olpc2,uz-olpc</td><td>uz_AF.UTF-8</td><td></td><td>us</td><td></td></tr> |
|||
<tr><td>[[Pashto_Keyboard|Pashto keyboard]]</td><td>yes</td><td>olpc</td><td>us,af</td><td>olpc2,pa-olpc</td><td>ps_AF.UTF-8</td><td></td><td>us</td><td></td></tr> |
|||
<tr><td>[[Khmer_Keyboard|Khmer keyboard]]</td><td>yes</td><td>olpc</td><td>us,kh</td><td>olpc2,olpc</td><td>km_KH.UTF-8</td><td>25</td><td>us</td><td>Cambodia</td></tr> |
|||
<tr><td>[[Pulaar_Keyboard|Pulaar keyboard]]</td><td>yes</td><td>olpc</td><td>ff</td><td>olpc</td><td>ff_SN.UTF-8</td><td></td><td> </td><td>(not approved for MP)</td></tr> |
|||
<tr><td>[[Armenian_Keyboard|Armenian keyboard]]</td><td>yes</td><td>olpc</td><td>us,am</td><td>olpc2,olpc</td><td>hy_AM.UTF-8</td><td></td><td>us</td><td>(not approved for MP)</td></tr> |
|||
<tr><td>[[Italian_Keyboard|Italian keyboard]]</td><td>yes</td><td>olpc</td><td>it</td><td>olpc</td><td>it_IT.UTF-8</td><td>23</td><td>it</td><td>Italy</td></tr> |
|||
<tr><td>[[French Canadian|French Canadian keyboard]]</td><td>yes</td><td>olpc</td><td>ca</td><td>olpc</td><td>ht_HT.UTF-8</td><td>24</td><td>ht</td><td>Kreyòl for Haiti</td></tr> |
|||
</table> |
|||
:†KA Reference is a hint as to which Keyboard ASCII Map to load for both OFW and the Console. It is ''not'' the actual KA string, which is described [[#Keyboard ASCII Map|below]], but it can be used with the 'loadkeys' command on the console (It should match the value of the KEYTABLE field in /etc/sysconfig/keyboard). |
|||
===Keyboard ASCII Map=== |
|||
The KA tag specifies the locations of US ASCII characters on the keyboard. It is primarily intended for use by Open Firmware, whose command character set is US ASCII. This tag makes it unnecessary to revise the firmware for new keyboard layouts. |
|||
The tag value is a compact encoding specifying the keyboard scanset-1 scan codes that generate US ASCII characters. The encoding takes advantage of these facts and assumptions to save space: |
|||
* Scanset-1 values are less than 0x60 for keys in the alpha/numeric/punctuation region. |
|||
* The lower case letters a-z are always on unshifted keys and the upper case equivalents are generated with the Shift key. |
|||
* The numbers and punctuation characters can be unshifted, shifted, or in the AltGr map. |
|||
* If a particular key combination results in a printable ASCII character, holding down the Ctrl key will result in the corresponding control character. |
|||
* The dedicated keys that generate the ASCII characters Esc, Tab, Enter, Erase, and Space and the non-ASCII function and arrow keys are the same for all keyboard layouts. |
|||
Given those assumptions, 68 scancodes must be specified: |
|||
* 26 unshifted scancodes for a-z |
|||
* 42 possibly-modified scancodes for numbers and punctuation |
|||
The KA tag value consists of 110 data bytes plus an extra null terminator byte. Bytes 0-25 are the scancodes for a-z. Bytes 26-109 are 42 pairs of bytes, each pair consisting of a scancode and a keymap number, for numbers and punctuation. Byte 110 is an extra null terminator byte to protect the data from any software that might strip a trailing null from tag values. |
|||
Bytes 26-109 specify characters in this order: |
|||
<pre> |
|||
0123456789!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ |
|||
</pre> |
|||
The first byte of pair is the scancode number, the second is the keymap number, as follows: |
|||
<table border=1> |
|||
<tr><th>Number</th><th>Keymap</th></tr> |
|||
<tr><td>0</td><td>Unshifted</td></tr> |
|||
<tr><td>1</td><td>Shifted</td></tr> |
|||
<tr><td>2</td><td>AltGr</td></tr> |
|||
</table> |
|||
The firmware keyboard driver currently has only these three maps; it does not distinguish between shifted and unshifted AltGr variants, nor does it have a special keymap for the Function key. |
|||
For ASCII codes with no corresponding key, the scancode and keymap numbers should be 0, but it is best not to leave such "holes" in the ASCII character set. |
|||
==SKU(s)== |
|||
===XO-1=== |
|||
The SKU tables have been migrated and can be found here: |
|||
http://bit.ly/mfg-data |
|||
===XO-1.5=== |
|||
http://bit.ly/mfg-data |
|||
==Useful links== |
|||
:[http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm ISO Country Codes] |
|||
:[https://www.cia.gov/library/publications/the-world-factbook/appendix/appendix-d.html CIA World Factbook Table of ISO 3166 Codes (includes three-letter codes not given in the ISO document above)] |
|||
:[http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes ISO Language Codes] |
|||
:[http://www.iana.org/assignments/language-subtag-registry IANA Language Tag Registry] |
|||
:[[wikipedia:Language code]] |
|||
:[[wikipedia:Country code]] |
|||
[[Category:XO localization]] |
|||
[[Category:Developers]] |
|||
[[Category:Firmware]] |
|||
[[Category:Hardware]] |
Revision as of 21:38, 11 March 2010
Reuben Caron.
This document defines the method for storing manufacturing data on an OLPC laptop, as well as the interaction with the security system.
Manufacturing data is information about a specific OLPC laptop that is known at time of manufacture and stored in the unit's SPI FLASH. It includes basic manufacturing data such as the product model, part number, and motherboard model number; unique identifying information such as the serial number, unique user ID, and WLAN MAC address; and language localization information such as the keyboard version and language locale. There are also flag indicating the anti-theft "status" of the laptop (activated, developer).
Goals
- Security: When an OLPC machine leaves the factory, the SPI FLASH must be write protected, if the customer has requested that anti-theft be enabled.
- Manufacturability: The procedures should be fast, reliable, and convenient within the constraints of the manufacturing flow.
- Extensibility: The data formats should make it easy to revise or extend the manufacturing data set in the future.
- Sanity: The validity of the manufacturing data should be easy to verify.
- Robustness: Programs that read or write manufacturing data should continue to work when the data set is revised.
- Simplicity: The implementation programs should be small and easy to write and verify.
Version History
Version 3.0, 2009-06-18 (lots of other updates have happened) Added SKU 53 and 54 for Nicaragua
Version 2.9, 2007-11-20 us,ng -> ng
Version 2.8, 2007-11-14 Corrected a couple of keyboard table entries - us,ur -> us,pk, and ng -> us,ng
Version 2.7, 2007-11-14 Added SK tag for SKU number
Version 2.6, 2007-10-21 Revised SG tag per input from Quanta
Version 2.5, 2007-10-19 Added SG tag information
Version 2.4, 2007-10-17 Revised SD tag format
Version 2.3, 2007-10-11 Revised KA tag, fixed lengths and example values for other tags to match reality.
Version 2.2, 2007-10-09 Clarified LA and LO values, added dk and ak tags.
Version 2,1, 2007-10-07 add keyboard data
Version 2.0, 2007-05-24 manufacturing data now lives in Sector E, not Sector 0.
Version 1.0, 2006-11-16 added some example data values from Quanta.
Version 0.2, 2006-09-14 added approvals process, added wp/ww to tags list, specified tag registration process
Version 0.1, 2006-09-13
Specification
Location
The manufacturing data shall start at SPI FLASH offset 0xeffff and grow downwards. 2K of space is currently "reserved" for this purpose, although at that time of this writing (2007-05-24, ROM version Q2C14), there is nothing else in that 64K sector, so the 2K limit is not hard and fast.
Historical note: Prior to the C-series firmware, i.e. up to and including Q2B87, the manufacturing data was located at the end of the first 64K sector of the SPI FLASH chip, growing down toward the "EC" code area. The VSA code was above the upper boundary of the manufacturing data.
Rationale
This rationale is obsolete now that the manufacturing data is no longer in the EC sector, but remains here for historical background.
- Placing the manufacturing data near the EC code results in a single boundary below which the data is effectively immutable. This simplifies and increases the reliability of the code for field updates to OFW.
- 64K is the size of an erase sector; the EC code plus the manufacturing data should "never need to be erased".
- The current size of the EC code is approximately 16K, so there should be plenty of space for manufacturing data within that 64K sector.
Data Format
The manufacturing data shall be stored using the following extensible tagged representation:
- Each item shall consist of a tag header plus optional binary data.
- There are two tag formats - a 4-byte format that can have from 0 to 127 bytes of data, and a 5-byte format that can have from 0 to 16383 bytes of data (the practical limit is less because of the overall size limits on the manufacturing data area).
- The 4-byte tag shall consist of:
- Two name bytes, each containing a case-sensitive 7-bit ASCII character
- A length byte whose binary value is from 0 to 127, indicating the number of additional data bytes (not including the 4-byte tag).
- A check byte whose binary value is the one's complement of the length byte
- The 5-byte tag shall consist of:
- Two name bytes, each containing a case-sensitive 7-bit ASCII character
- A check byte whose binary value is from 128 to 255, computed as described below.
- A low length byte (0..127), containing the 7 least significant bits of the data length
- A high length byte (0..127), containing the 7 most significant bits of the data length.
- The data length is given by ((high_length << 7) + low_length). (If the most-significant bit of either low_length or high_length is set, the tag is invalid.)
- The check byte value is calculated as (low_length ^ high_length ^ 0xff). Note that this guarantees that the most-significant bit of the check byte will be 1, thus distinguishing the 5-byte tag from the 4-byte tag format.
- The 4-byte tag shall consist of:
- The list of manufacturing data is the concatenation of individual items.
- The list grows in the "downward" direction, reflecting the fact that the manufacturing data is stored at the end of a region.
- There is no padding for alignment purposes - each tagged item is immediately adjacent to (i.e. just below) its predecessor.
- The end of the list is denoted by the absence of a valid tag "after" (i.e. at the address just below) the last item.
- Within a tagged item, the order of bytes is:
- Highest address: second name character
- Highest address minus 1: first name character
- Highest address minus 2: length byte of 4-byte format (0-127) or check byte of 5-byte format (128-255)
- Highest address minus 3: check byte (~length) of 4-byte format or low length of 5-byte format
- Highest address minus 4: last data byte (if any) of 4-byte format or high length byte of 5-byte format
- Highest address minus 5: next-to-last data byte (if any) of 5-byte format or last data byte (if any) of 5-byte format
- ... (additional data bytes)
- The interpretation of the data bytes within an item varies from name to name; code that operates on such data must know the appropriate data interpretation for the names that it uses. (But see also #Data Value Encoding Conventions .)
Rationale
- The list grows down because it has to start at a known location at the end of an erase sector
- The order of characters within tag names makes it easier to "visually parse" the data when looking at memory dumps, with no adverse effect on program code.
- Note that a valid check byte always has the most-significant bit set, and the other three tag bytes always have that bit clear.
- Erased FLASH storage (all bytes FF) does not constitute a valid tag, nor does all-zero storage.
- Software that inspects specific items of manufacturing data need not understand the details of all tags. It can just skip tags to find the one it's looking for.
- Appending a tag to the end of the list involves skipping to the end of the list and writing the new tag.
- Changing the value of an existing tag is difficult, except for the special case of changing some bits from 1 to 0 (which can be done without erasing the FLASH).
- It is possible to distinguish the 4-byte and 5-byte header formats from either direction. From the direction of the name bytes (going downward in memory), if the next byte is <128, it is the 4-byte format. Conversely, from the direction of the data bytes (going upward in memory), if the next byte is <128, it is the 5-byte format.
- The 5-byte format is not supported by any firmware version <= q2c28, and systems <= C1 do not have any 5-byte tags. It follows that systems that use 5-byte tags must have firmware > q2c29.
Write Protect Behavior
- Prior to starting execution of the main operating system, the bootloader shall control the hardware write protection for the SPI FLASH as follows:
- If the location of the first tag (i.e. the bytes at SPI FLASH offset 0xfffc-0xffff) is erased (i.e. all four byte values are 0xff), the bootloader shall not enable the hardware write protection.
- If the location of the first tag contains a valid tag with the name 'ww' and zero data length (i.e. 'w' at 0xffff, 'w' at 0xfffe, 0x0 at 0xfffd , and 0xff at 0xfffc), the bootloader shall not enable the hardware write protection.
- Otherwise, the bootloader shall enable the hardware write protection.
Rationale
- The "all erased" clause handles the "virgin FLASH" case, for initial manufacturing procedures.
- The "ww" clause enables the possibility of "incremental logging" during the manufacturing flow. The first manufacturing phase that adds an item to the manufacturing data area creates a "ww" tag at the beginning. Subsequent phases can extend the list with other tags as necessary. The final step in the manufacturing flow changes the "ww" to "wp", thus causing the bootloader to enable write protection.
- Note that changing "ww" to "wp" drives three bits from 1 to 0, which can be done without erasing. The only way to return to "ww" (or to 0xff) is to erase the entire sector.
- (Need a link to the document defining the auto-bootloader-update procedure).
Data Value Encoding Conventions
- The following conventions should be observed when defining data formats for new tags:
- Store text strings with the first character at the lowest address, null terminated.
- Store variable length text strings using only the amount of space needed (including the null terminator).
- Consider storing numeric values as human-readable ASCII text when it is reasonable to do so.
- Store multi-byte binary numbers in little-endian form, i.e. with the least-significant byte at the lowest address.
Rationale
- The order of characters within text strings makes it easier to "visually parse" the data when looking at memory dumps, while also being easier (or at least no harder) to operate on with program code.
- Null termination makes it easy to use C library routines.
- There's no need to pad out strings to a predefined maximum length, because the tag encapsulation can tell you the actual length.
- Note that there is no guarantee that multi-byte binary numbers will be naturally-aligned.
Tag Registration
- The most recent version of this document at http://wiki.laptop.org/go/Manufacturing_Data contains the definitive list of tag names and values.
- The method for arbitrating changes to the list is as follows: Someone associated with the OLPC project will be designated as the gatekeeper of the list. The gatekeeper is currently Mitch Bradley, wmb@firmworks.com . Upon request, the gatekeeper will add tags to the list. Such requests should include complete definitions of the proposed new tags and their value encodings.
Rationale
- The assumption is that new tags will be defined infrequently.
Defined Tags
Use '.mfg-data' at the OK prompt to get the tag settings.
(In the tag name DQ, the "first name character" is "D", the "second name character" is "Q")
Tag Name | Data Length (including null) | Req | Meaning | Encoding |
---|---|---|---|---|
ww | 0 | Write Allow | (No Data) Presence at beginning of tag list prevents bootloader from enabling hardware write protect of SPI FLASH. This can be used to allow incremental updates to the tag list during multiple manufacturing phases. See #Write Protect Behavior. | |
wp | 0 | Write Protect | (No Data) Change 'ww' to 'wp' to enable hardware write protect. Note that if the first tag is not 'ww', write protect will be enabled, so if the entire tag list is written at once (no incremental tagging), it is not necessary to include the 'wp' tag. | |
ak | 0 | o | Activation Key | (No Data) Presence of this field indicates that this system is persistently activated, requiring no temporal lease to run the operating system. Open Firmware uses this as an input to its secure boot algorithm. For certain SKUs, this field might be set at the factory. |
dk | 0 | o | Developer Key | (No Data) Presence of this field indicates that this system is persistently unlocked and can be used without going through the Open Firmware secure boot algorithm. Typically, this flag would not be set at the factory, but would instead be added to the manufacturing data by individuals who have acquired a developer key and wish to unlock the machine permanently. |
SN | 12 | Y | Serial Number | Example: SHF7250024D |
SG | 1 | Board Revision | Example: 0xC2. A single binary byte whose hexadecimal representation matches the "letter number" designation of the board revision. The value for an XO-1 B2 machines was 0xB2, for B3 was 0xB3, and for B4 was 0xB4. For XO-1 C1 machines, the value was 0xA9, due to an error of unknown origin. For XO-1 C2 versions (MP), this value was 0xC2. For XO-1.5, 0xD0 indicates A2, 0xD1 indicates B2, 0xD2 indicates B3, 0xD3 indicates C1, and 0xD4 indicates a C2 version (and MP). | |
B# | 15 | Motherboard Number | Example: QTFLCA72400085 | |
U# | 37 | Y | UUID# | Example: DADD886B-C2F7-4B9C-89CB-43B9A81A388C (Random Generate) |
P# | 12 | Y | Part Number | Example: 1CL11ZU0KD9 |
M# | 4 | Product Model Number | CL1 | |
LA | varies | Y | Country Code | Three-letter ISO 3166-1-alpha-3 country code specifying the target country for this system. (See http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3). In prototype systems, the use of this tag was inconsistent, sometimes specifying the target country and sometimes specifying the target country's predominant language. The meaning for future systems is hereby clarified to be the country, not the language. In cases where the same SKU is to be used for multiple countries, this field should contain the name of an arbitrary one of those countries. The detailed use of this field is unspecified, but the OS might, for instance, use it as a "hint" in case other fields are missing (as with prototype systems) or insufficiently specific. |
LO | varies | Y | Product Localization | Default value for the POSIX locale (LANG environment variable). The Linux startup code uses this to configure the language environment. If not present, the Linux startup code will chose a default according to some heuristic. Example value: en_US.UTF-8 |
KA | 111 | Y | Keyboard ASCII map | Specifies the keyboard key numbers for the US ASCII characters on this system's keyboard. This lets Open Firmware automatically adapt to different keyboard layouts. See #Keyboard ASCII Map. |
KM | varies | Y | Keyboard Model | Always "olpc" on the XO-1; see below |
KL | varies | Y | Keyboard Layout | Layout of the keyboard: "es", "fi", "us,ar", "us,ru"; see table below for settings for OLPC Keyboards |
KV | varies | Y | Keyboard Variant | Keyboard variant for OLPC Keyboards; see below. |
CC | 11 | Configuration Code | Example: 2222XXXXXX | |
F# | 3 | Factory Number | Example: F6 | |
L# | 2 | Line Number | Example: H | |
S# | 11 | SWID # | OS Build that was loaded in the factory. Example: CL1XL00406 | |
T# | 13 | TSWID# | Example: TSIMG_V3.0.2 | |
WM | 18 | Y | Wireless MAC # | Example: 00-17-C4-03-56-8A |
MN | 5 | Model Name | XO-1 | |
BV | 6 | BIOS Version | Example: Q2C18 | |
TS | 3 | Test Station | Example: DL for DOWNLOAD (SMT/ASSY/DL/RUNIN/FINAL/SHIP/FQA) | |
BD | 3 | Boot Device | Example: u:\boot\olpc.fth cifs:\\user:password@10.20.0.2\directory\olpc.fth This is the value of the boot-device list to use in the manufacturing phase indicated by the TS tag. | |
MS | 3 | Manufacturing Server | Example: cifs:\\user:password@10.20.0.2\directory\ This is the server to use in the manufacturing phase indicated by the TS tag. | |
SS | 3 | SMT Status | Example: EN (for END), ST (for START) | |
FQ | 3 | FQA | Example: NA (START/END) | |
SD | 7 | SWDL Date | Example: 20071017 (for 17 November 2007) | |
MD | 16 | Manufacturing Date | Example: 20081014T200700Z (for 14 October 2008, 8:07:00 PM UTC) | |
SK | varies | Stock Keeping Unit number | The SKU number, expressed as a decimal number in ASCII, null terminated, without leading zeros. Examples: "1" (length is 2 including null), "13" (length 3 including null), "237" (length 4 including null). |
The "Req" field indicates which tags are required for proper operation of the laptop. The KA tag is required unless the keyboard type is US, in which case OFW will default to the correct key map. The ak and dk flags may be viewed as required, if they were already set!
Keyboards
The scheme selected (using the KM, KL, and KV flags) maps directly to the X Window System Xkb extension.
The AK field is used to designate pre-activated or not activated coming out of the factory. 'Yes' means the AK flag exists in the mfg-data; and the laptop is pre-activated. 'No' means there is no AK flag, and the laptop will have to be activated at the delivery site.
The KM field is the model of the keyboard: for the XO-1, it will always have the value of "olpc", unless some different keyboard is designed in subsequent production. We include it here for completeness and to allow for such a different keyboard model sometime in the future, or this manufacturing data scheme to be easily used on other systems.
The KL field specifies the layouts on the keyboard. Keyboards may have multiple layouts, which can be switched between at run time. The names for these layouts generally bear resemblance to ISO country codes, as a given keyboard is often (but not necessarily) in use in particular countries. One or more layouts can be present on a keyboard. If there are multiple layouts, the layout codes are separated by the "," character.
The KV field specifies one or more variants on a layout. Example variants include strings such as "olpc", "olpc2", "dvorak", "winkeys", ",bksl,".
The LO field is both language and region specific: The first two letters are the language code; the second two letters are the country code. Note that many langauge/region variants can share a common keyboard, e.g., Russian (ru_RU) and Ukrainian (uk_UA) both use the Cyrillic keyboard, but will need different SKUs to accommodate the different language settings on the laptop.
Keyboard Layout | AK | KM | KL | KV | LO | SKU(s) | KA Reference† | Comment |
---|---|---|---|---|---|---|---|---|
US International keyboard | yes | olpc | us | olpc | en_US.UTF-8 | 1,2,19 27, 33, 34, 39, 44, 45 | us | Developers, other |
US International keyboard | yes | olpc | us | olpc | en_US.UTF-8 | 20,28,21 | us | Alabama, Nigeria (temp), Rwanda (temp) |
Spanish keyboard | no | olpc | es | olpc | es_UY.UTF-8 | 5,6,18,40 | es | Uruguay, Paraguay |
Spanish keyboard | no | olpc | es | olpc | es_MX.UTF-8 | 3,4,17 | es | Mexico/Peru |
Spanish keyboard | yes | olpc | es | olpc | es_UY.UTF-8 | 26 | es | General Spanish laptops |
Portuguese keyboard | yes | olpc | br | olpc | pt_BR.UTF-8 | 10,42 | pt | Brasil |
Amharic keyboard | no | olpc | us,et | olpc2,basic | am_ET.UTF-8 | 11 | us | Ethiopia |
Arabic keyboard | yes | olpc | us,ara | olpc2,olpc | ar_EG.UTF-8 | 7,41 | us | |
Nigerian keyboard | yes | olpc | ng | olpc | en_US.UTF-8 | 9 | us(?) | (US/International keyboard only) for Igbo, Yoruba, and Hausa |
French keyboard | yes | olpc | fr | olpc | fr_FR.UTF-8 | fr | (not approved for MP) | |
Thai keyboard | yes | olpc | us,th | olpc2,olpc | th_TH.UTF-8 | 8 | us | Thailand |
Urdu keyboard | yes | olpc | us,pk | olpc2,olpc | ur_PK.UTF-8 | 12 | us | Pakistan |
Cyrillic keyboard | yes | olpc | us,ru | olpc2,olpc | uk_UA.UTF-8 | 30 | us | Russia |
Turkish keyboard | yes | olpc | tr | olpc | tr_TR.UTF-8 | us | Turkish-Q approved | |
Nepali keyboard | yes | olpc | us,np | olpc2,olpc | ne_NP.UTF-8 | 15, 46 | us | Nepal |
Mongolian keyboard | yes | olpc | us,mn | olpc2,olpc | mn_MN.UTF-8 | 13,43 | us | Mongolia |
Kazakh keyboard | yes | olpc | us,kz | olpc2,olpc | kk_KZ.UTF-8 | us | (not approved for MP) | |
Devanagari keyboard | yes | olpc | us,in | olpc2,olpc | hi_IN.UTF-8 | 14 | us | India |
Dari keyboard | yes | olpc | us,af | olpc2,fa-olpc | fa_AF.UTF-8 | 22 | us | Afghanistan |
Uzbec keyboard | yes | olpc | us,af | olpc2,uz-olpc | uz_AF.UTF-8 | us | ||
Pashto keyboard | yes | olpc | us,af | olpc2,pa-olpc | ps_AF.UTF-8 | us | ||
Khmer keyboard | yes | olpc | us,kh | olpc2,olpc | km_KH.UTF-8 | 25 | us | Cambodia |
Pulaar keyboard | yes | olpc | ff | olpc | ff_SN.UTF-8 | (not approved for MP) | ||
Armenian keyboard | yes | olpc | us,am | olpc2,olpc | hy_AM.UTF-8 | us | (not approved for MP) | |
Italian keyboard | yes | olpc | it | olpc | it_IT.UTF-8 | 23 | it | Italy |
French Canadian keyboard | yes | olpc | ca | olpc | ht_HT.UTF-8 | 24 | ht | Kreyòl for Haiti |
- †KA Reference is a hint as to which Keyboard ASCII Map to load for both OFW and the Console. It is not the actual KA string, which is described below, but it can be used with the 'loadkeys' command on the console (It should match the value of the KEYTABLE field in /etc/sysconfig/keyboard).
Keyboard ASCII Map
The KA tag specifies the locations of US ASCII characters on the keyboard. It is primarily intended for use by Open Firmware, whose command character set is US ASCII. This tag makes it unnecessary to revise the firmware for new keyboard layouts.
The tag value is a compact encoding specifying the keyboard scanset-1 scan codes that generate US ASCII characters. The encoding takes advantage of these facts and assumptions to save space:
- Scanset-1 values are less than 0x60 for keys in the alpha/numeric/punctuation region.
- The lower case letters a-z are always on unshifted keys and the upper case equivalents are generated with the Shift key.
- The numbers and punctuation characters can be unshifted, shifted, or in the AltGr map.
- If a particular key combination results in a printable ASCII character, holding down the Ctrl key will result in the corresponding control character.
- The dedicated keys that generate the ASCII characters Esc, Tab, Enter, Erase, and Space and the non-ASCII function and arrow keys are the same for all keyboard layouts.
Given those assumptions, 68 scancodes must be specified:
- 26 unshifted scancodes for a-z
- 42 possibly-modified scancodes for numbers and punctuation
The KA tag value consists of 110 data bytes plus an extra null terminator byte. Bytes 0-25 are the scancodes for a-z. Bytes 26-109 are 42 pairs of bytes, each pair consisting of a scancode and a keymap number, for numbers and punctuation. Byte 110 is an extra null terminator byte to protect the data from any software that might strip a trailing null from tag values.
Bytes 26-109 specify characters in this order:
0123456789!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
The first byte of pair is the scancode number, the second is the keymap number, as follows:
Number | Keymap |
---|---|
0 | Unshifted |
1 | Shifted |
2 | AltGr |
The firmware keyboard driver currently has only these three maps; it does not distinguish between shifted and unshifted AltGr variants, nor does it have a special keymap for the Function key.
For ASCII codes with no corresponding key, the scancode and keymap numbers should be 0, but it is best not to leave such "holes" in the ASCII character set.
SKU(s)
XO-1
The SKU tables have been migrated and can be found here: