LAB 4 IS DONE.

This commit is contained in:
winPond
2019-07-06 10:39:40 +08:00
parent 21dd0e1a51
commit e78b336ba8
113 changed files with 11622 additions and 0 deletions

22
lab/kern/kclock.c Normal file
View File

@@ -0,0 +1,22 @@
/* See COPYRIGHT for copyright information. */
/* Support for reading the NVRAM from the real-time clock. */
#include <inc/x86.h>
#include <kern/kclock.h>
unsigned
mc146818_read(unsigned reg)
{
outb(IO_RTC, reg);
return inb(IO_RTC+1);
}
void
mc146818_write(unsigned reg, unsigned datum)
{
outb(IO_RTC, reg);
outb(IO_RTC+1, datum);
}