UEFI CPU IO & MSR

本文介绍了在UEFI环境下如何进行CPU输入输出(IO)操作,重点关注如何找到相应的IO地址。同时,提到了MSR(Model Specific Register)的相关处理,特别是通过.nasm文件进行的操作。内容涵盖了.nasm、.inf和.c文件的使用,以及MSR的处理方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

CPU IO 的读取主要要找到对应的IO地址

.nasm 文件



    SECTION .text

;------------------------------------------------------------------------------
; UINT8
; EFIAPI
; CMOSRead (
;    IN UINT Address
; );
;------------------------------------------------------------------------------
global ASM_PFX(CMOSRead)
ASM_PFX(CMOSRead):
    mov     rdx,[rcx]
    mov     al,dl
    out     70h,al
    in      al,71h
    xor     rdx,rdx
    mov     [rcx],rdx
    mov     [rcx],al
    ret
    

.inf 文件

## @file
#  Sample UEFI Application Reference EDKII Module.
#
#  This is a sample shell application that will print "UEFI Hello World!" to the
#  UEFI Console based on PCD setting.
#
#  It demos how to use EDKII PCD mechanism to make code more flexible.
#
#  Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
#
#  This program and the accompanying materials
#  are licensed and made available under the terms and conditions o
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值