TPM芯片SSX35的BIOS模块化开发(2)

来源:网络(转载) 作者:林聪发 发表于:2011-08-17 14:31  点击:
【关健词】TPM; SSX35;模块化
;call TPM MP driver function 4 for startup ST_CLEAR cmd mov ax, 0104h mov word ptr cs:[Transmit_TO_32bitCall], ax call TPM_PM32_Handler mov al, byte ptr cs:[TPMMP_Call_Return] cmp al, 0 mov ax, 0A1h

  ;call TPM MP driver function 4 for startup ST_CLEAR cmd
  mov ax, 0104h
  mov word ptr cs:[Transmit_TO_32bitCall], ax
  call TPM_PM32_Handler
  mov al, byte ptr cs:[TPMMP_Call_Return]
  cmp al, 0
  mov ax, 0A1h
  jne Sinosun_TPM_MP_Fail
  ;get return codes
  out 0ebh,al ;io delay
  mov edx,TPM_ORD_Startup.pbOutBuf
  add edx,6
  mov eax,ds:[edx]
  cmp eax,00000000h ;TPM initiates pass
  je tpm_test_continue
  cmp eax,26000000h ;TPM has been initiated
  je tpm_test_continue
  cmp eax,02080000h ;??? retry??
  je startup_begin
  ;//todo error in here
  ;出错处理
  ③ 向SSX35 MP Driver下continue test命令,进行SSX35的继续测试,代码如下:
  tpm_test_continue:
  ;call TPM MP driver function 4 for continue test cmd
  mov eax, 0204h
  mov word ptr cs:[Transmit_TO_32bitCall], ax
  call TPM_PM32_Handler
  mov al, byte ptr cs:[TPMMP_Call_Return]
  cmp al, 0
  mov ax, 0A1h
  jne Sinosun_TPM_MP_Fail
  out 0ebh,al
  mov edx,TPM_ORD_Startup.pbOutBuf
  add edx,6
  mov eax,ds:[edx]
  cmp eax,00000000h
  je TPM_contest_OK
  ; cmp eax,02080000h
  ; je tpm_test_continue
  ; mov ah, 0FEh
  ; jmp Sinosun_TPM_MP_Fail
  TPM_contest_OK:
  ④ 向SSX35 MP Driver下PhysicalPresence_CommandEnable命令,进行SSX35的物理状态使能,代码如下:
  WaitingForContinueTestOK:
  ;call TPM MP driver function 4 for TSC_PhysicalPresence with PhysicalPresence_CommandEnable
  mov eax, 0304h
  mov word ptr cs:[Transmit_TO_32bitCall], ax
  call TPM_PM32_Handler
  mov al, byte ptr cs:[TPMMP_Call_Return]
  cmp al, 0
  mov ax, 0A1h
  jne Sinosun_TPM_MP_Fail
  out 0ebh,al
  mov edx,TPM_ORD_Startup.pbOutBuf
  add edx,6
  mov eax,ds:[edx]
  cmp eax, 02080000h ;detect continue test return code in here for tpm new firmware 1.2.0.9, it is fault in this firmware
  je WaitingForContinueTestOK
  cmp eax,00000000h
  mov ax, 0A1h
  jne Sinosun_TPM_MP_Fail
  ⑤ 向SSX35 MP Driver下PhysicalPresence_Presence命令,进行SSX35的物理状态设置,代码如下:
  ;call TPM MP driver function 4 for TSC_PhysicalPresence with PhysicalPresence_Presence
  mov eax, 0404h
  mov word ptr cs:[Transmit_TO_32bitCall], ax
  call TPM_PM32_Handler
  mov al, byte ptr cs:[TPMMP_Call_Return]
  cmp al, 0
  mov ax, 0A1h
  jne Sinosun_TPM_MP_Fail
out 0ebh,al
  mov edx,TPM_ORD_Startup.pbOutBuf
  add edx,6
  mov eax,ds:[edx]
  cmp eax,00000000h
  mov ax, 0A1h
  jne Sinosun_TPM_MP_Fail
  3) STATUS阶段的主要工作是,报告设备接收数据或者发送数据的状态。
  3.3 读取SSX35状态
  通过SSX35 MP Driver Function 4读取SSX35的'disable'、'deactived'、 'owner'这3个状态,并保存到BIOS CMOS中,具体代码如下:
  ;call TPM MP driver function 4 for TPM_GetCapability
  ;Get the 'disable','deactived' flag (permanent)
  mov eax, 0504h
  mov word ptr cs:[Transmit_TO_32bitCall], ax
  call TPM_PM32_Handler
  mov al, byte ptr cs:[TPMMP_Call_Return]
  cmp al, 0
  mov ax, 0A2h
  jne Sinosun_TPM_MP_Fail
  out 0ebh,al
  mov edx,TPM_ORD_Startup.pbOutBuf
  add edx,6
  mov eax,ds:[edx]
  cmp eax,00000000h
  mov ax, 0A2h
  jne Sinosun_TPM_MP_Fail
  add edx, 10 ;get return byte 19
  xor ax, ax
  mov al, byte ptr ds:[edx]
  WRITENV cmosTPMActiveStatus
  add edx, 2 ;get return byte 17
  xor ax, ax
  mov al, byte ptr ds:[edx]
  WRITENV cmosTPMCtrlStatus
  ;Get the 'owner' flag
  mov eax, 0604h
  mov word ptr cs:[Transmit_TO_32bitCall], ax
  call TPM_PM32_Handler
  mov al, byte ptr cs:[TPMMP_Call_Return]
  cmp al, 0
  mov ax, 0A2h
  jne Sinosun_TPM_MP_Fail
  out 0ebh,al
  mov edx,TPM_ORD_Startup.pbOutBuf
  add edx, 6
  mov eax,ds:[edx]
  cmp eax,00000000h
  mov ax, 0A2h
  jne Sinosun_TPM_MP_Fail
  add edx, 8
  xor ax, ax
  mov al, byte ptr ds:[edx]
  WRITENV cmosTPMOwnerStatus
  3.4 SSX35 BIOS Setup的信息显示及人机交互处理
  在BIOS Setup中,总共需要以下条目显示或设置SSX35,如表1所示。
  其中序号1条目负责显示SSX35硬件是否存在的状态,并且决定后续的序号条目是否显示:如果SSX35硬件不存在,则所有相关SSX35的BIOS选项全部消失。
  关于SSX35的用户设置,有2个开关设置项,分别是序号2和序号5。并且,因为TPM是可信技术的基础,关于这两个选项的设置,必须加以保护。通常,序号2(TPM禁用/启用)由BIOS Setup中‘User Password’保护,序号5(TPM清除所有者)通常由‘Supervisor Password’保护,如果这个两个BIOS Setup的密码没有设置,则TPM的这两个设置项无法选择(灰色显示),需要设置过BIOS Setup的User和Supervisor密码方可使用。并且,在BIOS法相CMOS掉电或其他情况导致需要重新载入BIOS Setup默认值时,关于TPM的状态和设置不会发生变化。 (责任编辑:南粤论文中心)转贴于南粤论文中心: http://www.nylw.net(南粤论文中心__代写代发论文_毕业论文带写_广州职称论文代发_广州论文网)
顶一下
(0)
0%
踩一下
(0)
0%


版权声明:因本文均来自于网络,如果有版权方面侵犯,请及时联系本站删除.