Skip to content

Commit 915ca27

Browse files
committed
fix paging finally
1 parent 623dfed commit 915ca27

File tree

15 files changed

+378
-398
lines changed

15 files changed

+378
-398
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
commit 623dfed03e195ce3de99dda013399f497e936a5f
2+
Author: Alexeev Bronislav <[email protected]>
3+
Date: Mon Aug 25 01:27:39 2025 +0700
4+
5+
fix paging
6+
17
commit 46ebda58fa94ac4712cb208ef8ca8c77e076b48d
28
Author: Alexeev Bronislav <[email protected]>
39
Date: Sun Aug 24 23:00:29 2025 +0700

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ LDFLAGS = -Ttext 0x1000 --oformat binary
1717

1818
KERNEL_ENTRY = $(BIN_DIR)/bootloader/kernel_entry.o
1919
INTERRUPT_OBJ = $(BIN_DIR)/kernel/cpu/interrupt.o
20-
PAGING_OBJ = $(BIN_DIR)/kernel/paging_asm.o
2120

2221
C_SOURCES = $(shell find $(SRC_DIR) -name '*.c')
2322
C_OBJS = $(C_SOURCES:$(SRC_DIR)/%.c=$(BIN_DIR)/%.o)
2423

25-
OBJS = $(KERNEL_ENTRY) $(INTERRUPT_OBJ) $(PAGING_OBJ) $(C_OBJS)
24+
OBJS = $(KERNEL_ENTRY) $(INTERRUPT_OBJ) $(C_OBJS)
2625

2726
RED=\033[0;31m
2827
GREEN=\033[0;32m

src/kernel/cpu/isr.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,19 @@ char *exception_messages[] = {
118118
};
119119

120120
void isr_handler(registers_t r) {
121-
kprint("received interrupt: ");
121+
kprint("Received interrupt: ");
122122
char s[3];
123123
int_to_ascii(r.int_no, s);
124124

125125
kprint(s);
126126
kprint("\n");
127127
kprint(exception_messages[r.int_no]);
128128
kprint("\n");
129+
130+
if (interrupt_handlers[r.int_no]) {
131+
interrupt_handlers[r.int_no](r);
132+
}
133+
129134
asm volatile("hlt");
130135
}
131136

src/kernel/cpu/paging.c

Lines changed: 0 additions & 147 deletions
This file was deleted.

src/kernel/cpu/paging.h

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/kernel/kernel/kernel.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "../drivers/screen.h"
1111
#include "kernel.h"
1212
#include "utils.h"
13-
#include "../cpu/paging.h"
13+
#include "../kklibc/paging.h"
1414
#include "../kklibc/kklibc.h"
1515

1616
int shell_cursor_offset = 0;
@@ -25,9 +25,7 @@ void kmain() {
2525
irq_install();
2626
kprint("IRQ Installed\n");
2727

28-
// register_interrupt_handler(14, page_fault_handler);
29-
paging_init();
30-
28+
initialise_paging();
3129
heap_init();
3230

3331
// Приглашение

src/kernel/kernel/utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void kmalloc_command(char** args) {
145145
}
146146

147147
int size = strtoint(args[0]);
148-
void* ptr = kmalloc_a(size);
148+
void* ptr = (void*)kmalloc(size);
149149

150150
char buf1[32] = "";
151151
hex_to_ascii((int)ptr, buf1);

0 commit comments

Comments
 (0)