NetcanOS
Netcan OS is an operation system for x86 PCs, for learning how os works.
函数
io.c 文件参考
#include <io.h>

函数

u8 port_byte_in (u16 port)
 从IO端口读取8位数据。 更多...
 
void port_byte_out (u16 port, u8 data)
 从IO端口写入8位数据。 更多...
 
u16 port_word_in (u16 port)
 从IO端口读取16位数据。 更多...
 
void port_word_out (u16 port, u16 data)
 从IO端口写入16位数据。 更多...
 

函数说明

◆ port_byte_in()

u8 port_byte_in ( u16  port)

从IO端口读取8位数据。

参数
port端口
返回
读取的数据。

__asm__是ansi标准自带的 asm [volatile] ( AssemblerTemplate : OutputOperands // 输出寄存器的值到变量 [ : InputOperands // 输入变量的值到寄存器 [ : Clobbers ] ])

◆ port_byte_out()

void port_byte_out ( u16  port,
u8  data 
)

从IO端口写入8位数据。

参数
port端口
data需要写的数据

◆ port_word_in()

u16 port_word_in ( u16  port)

从IO端口读取16位数据。

参数
port端口
返回
读取的数据。

◆ port_word_out()

void port_word_out ( u16  port,
u16  data 
)

从IO端口写入16位数据。

参数
port端口
data需要写的数据