diff options
author | Freya Murphy <freya@freyacat.org> | 2025-04-20 20:54:19 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-20 23:44:39 -0400 |
commit | 102a0aafc87ad894e7aba479df62ec4961bb6985 (patch) | |
tree | a6f59e352209e8de42f015733314a681a8e0d947 /kernel/drivers/pit.c | |
parent | add ata_init to main and fix some compilation problems (diff) | |
download | comus-102a0aafc87ad894e7aba479df62ec4961bb6985.tar.gz comus-102a0aafc87ad894e7aba479df62ec4961bb6985.tar.bz2 comus-102a0aafc87ad894e7aba479df62ec4961bb6985.zip |
move kspin to use ms, add ata_report
Diffstat (limited to '')
-rw-r--r-- | kernel/drivers/pit.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/drivers/pit.c b/kernel/drivers/pit.c index cb3c091..fd42084 100644 --- a/kernel/drivers/pit.c +++ b/kernel/drivers/pit.c @@ -8,16 +8,18 @@ uint64_t ticks = 0; -uint16_t pit_read_divider(void) { +uint16_t pit_read_divider(void) +{ uint16_t count = 0; cli(); outb(CMD, 0); // clear bits count = inb(CHAN_0); // low byte - count |= inb(CHAN_0)<<8; // highbyte + count |= inb(CHAN_0) << 8; // highbyte return count; } -void pit_set_divider(uint16_t count) { +void pit_set_divider(uint16_t count) +{ outb(CHAN_0, count & 0xFF); // low byte outb(CHAN_0, (count & 0xFF00) >> 8); // high byte } |