kclock.c

来自「jos lab3代码」· C语言 代码 · 共 29 行

C
29
字号
/* See COPYRIGHT for copyright information. *//* Support for two time-related hardware gadgets: 1) the run time * clock with its NVRAM access functions; 2) the 8253 timer, which * generates interrupts on IRQ 0. */#include <inc/x86.h>#include <kern/kclock.h>unsignedmc146818_read(unsigned reg){	outb(IO_RTC, reg);	return inb(IO_RTC+1);}voidmc146818_write(unsigned reg, unsigned datum){	outb(IO_RTC, reg);	outb(IO_RTC+1, datum);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?