NetcanOS
Netcan OS is an operation system for x86 PCs, for learning how os works.
宏定义 | 类型定义 | 函数
io.h 文件参考
#include <stddef.h>
#include <stdio.h>

浏览源代码.

宏定义

#define ASSERT(cond, msg)   if(!(cond)) { printf("%s at %s:%d\n", msg, __FILE__, __LINE__); while(1); }
 

类型定义

typedef unsigned int u32
 
typedef signed int s32
 
typedef unsigned short u16
 
typedef signed short s16
 
typedef unsigned char u8
 
typedef signed char s8
 

函数

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

宏定义说明

◆ ASSERT

#define ASSERT (   cond,
  msg 
)    if(!(cond)) { printf("%s at %s:%d\n", msg, __FILE__, __LINE__); while(1); }

类型定义说明

◆ s16

typedef signed short s16

◆ s32

typedef signed int s32

◆ s8

typedef signed char s8

◆ u16

typedef unsigned short u16

◆ u32

typedef unsigned int u32

◆ u8

typedef unsigned char u8

函数说明

◆ 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需要写的数据