mirror of
https://github.com/SmallPond/MIT6.828_OS.git
synced 2026-04-28 21:01:11 +08:00
LAB 4 IS DONE.
This commit is contained in:
22
lab/kern/kclock.c
Normal file
22
lab/kern/kclock.c
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user