Skip to content

Commit ee1bee0

Browse files
Fixed cpu from working so hard because of fsh.
1 parent 536b889 commit ee1bee0

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

source/kernel/C/kernel.c

-2
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,6 @@ void main(void) {
410410
// ivec2 mousePos = GetMousePosition();
411411
// decode_targa_image(module_request.response->modules[3]->address, (uvec2){mousePos.x, mousePos.y}, framebuffer->width, framebuffer->height);
412412

413-
// pit_sleep((int32)16.6666); // 60 Hz approx.
414-
415413
if (failed_attempts >= 5){
416414
error("You tried 5 diffrent wrong attempts. You've been locked out.", __FILE__);
417415
hcf();

source/kernel/C/user-input/keyboard.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ char scancode_to_char(int scancode, bool uppercase) {
6060
return '\0';
6161
}
6262

63-
char c = '\0';
6463
bool shift = no;
6564
uint8_t modifiers = 0;
6665

@@ -71,10 +70,10 @@ uint8_t modifiers = 0;
7170
void process_keyboard(InterruptFrame* frame){
7271
if(!enable_keyboard) return;
7372

74-
int data = inb(0x60);
73+
// int data = inb(0x60);
74+
75+
asm("int $0x81");
7576

76-
exit_interrupt:
77-
c = '\0';
7877
outb(0x20, 0x20); // End PIC Master
7978
}
8079

@@ -128,9 +127,11 @@ uint8_t get_extended_keyboard_data() // only called if last data was the 0xE0 ex
128127

129128
uint8_t get_keyboard_data()
130129
{
131-
while (1)
130+
while (1) {
132131
if (inb(0x64) & 1)
133132
break;
133+
asm("hlt");
134+
}
134135

135136
uint8_t data = inb(0x60);
136137
if (data == 0xE0)

0 commit comments

Comments
 (0)