WKern
Loading...
Searching...
No Matches
irq0.c
Go to the documentation of this file.
1/*
2WKern - A Bare Metal OS / Kernel I am maKing (For Fun)
3Copyright (C) 2025 Wdboyes13
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 3 of the License, or
8any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <https://www.gnu.org/licenses/>.
17*/
18
19#include <idt/idtirq.h>
20#include <io/kio.h>
21#include <types/nums.h>
22volatile u32 ticK_count = 0;
23
25 ticK_count++;
26 SendEOI; // Send PIC EOI
27}
28
29void MsSleep(unsigned int milliseconds) {
30 unsigned int start = ticK_count;
31 while ((ticK_count - start) < milliseconds) {
32 __asm__ volatile("hlt");
33 }
34}
#define SendEOI
Definition idtirq.h:108
void Irq0HandlerC()
Definition irq0.c:24
void MsSleep(unsigned int milliseconds)
Definition irq0.c:29
volatile u32 ticK_count
Definition irq0.c:22
unsigned int u32
32-Bit Unsigned Int
Definition nums.h:30