[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-04-18。"],[],[],null,["# Trusty OS (TOS) partitions\n\n[Trusty](/docs/security/features/trusty) is Google's implementation of a Trusted\nExecution Environment (TEE) OS that runs alongside Android. This is the\nspecification for devices using Arm Trustzone technology to provide a TEE. If\nyour ARM devices use Trusty as the secure OS solution, implement the bootloader\nas described in the following sections.\n\nInitialize TOS\n--------------\n\nTo load and initialize the Trusty OS (TOS), a bootloader should:\n\n- Set up and configure all available RAM.\n- Initialize at least one serial port.\n- Verify signature of TOS image.\n- Load TOS into RAM (execution from flash or TCM isn't supported).\n- Jump to the first instruction in the TOS image after setting up the state and registers as described below.\n\nCall in to the TOS image\n------------------------\n\nConfigure the following state at entry:\n\n- MMU turned off\n- Data cache flushed and turned off (instruction cache can be on or off)\n- All interrupts (IRQs and FIQs) disabled\n- CPU in SVC mode on ARMv7 and EL3 on ARMv8\n- Registers in the following state:\n - `r0/x0`: Size of memory allocated to TOS.\n - `r1/x1`: Physical address of a contiguous block of memory that contains platform-specific boot parameters. The layout of this block is platform-specific.\n - `r2/x2`: Size of the above block of memory.\n - `r14/x30`: Return address to jump to (in nonsecure mode) after TOS initializes.\n\n| **Note:** `r0-r3/x0-x3` also serve as scratch registers to TOS. Don't expect their values to be preserved upon return.\n\nOn a 64-bit platform:\n\n- Only `w0-w2` are used for parameters, so `x0-x2` should contain only 32-bit values.\n- `x30` can contain a 64-bit value.\n- The value in `x0` when added to the base address of TOS entry-point should result in a 32-bit value. The same applies to the size in register x2 when added to the address of boot parameter block in `x1`.\n\nReturn from TOS\n---------------\n\nAfter TOS completes initialization, it returns to the bootloader in nonsecure\nmode (SCR.NS set to `1`) so that the bootloader can continue loading the primary\noperating system (that is, Android)."]]