From 10eb4687f03583ede19b059013b1c55703a95d48 Mon Sep 17 00:00:00 2001 From: Ruslan Isaev Date: Sun, 30 Mar 2025 13:12:43 +0300 Subject: [PATCH] paging: remove page.asm --- Makefile | 5 +---- src/page.asm | 24 ------------------------ src/paging.c | 11 ++++------- 3 files changed, 5 insertions(+), 35 deletions(-) delete mode 100644 src/page.asm diff --git a/Makefile b/Makefile index 091b454..86e4b68 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Define the object files -OBJS = bin/boot.o bin/kernel.o bin/idt.o bin/isr.o bin/screen.o bin/utils.o bin/string.o bin/stdio.o bin/disk.o bin/pic.o bin/pit.o bin/keyboard.o bin/paging.o bin/page.o bin/fat.o +OBJS = bin/boot.o bin/kernel.o bin/idt.o bin/isr.o bin/screen.o bin/utils.o bin/string.o bin/stdio.o bin/disk.o bin/pic.o bin/pit.o bin/keyboard.o bin/paging.o bin/fat.o # Define the compiler and assembler CC = gcc -D__is_katauos @@ -93,9 +93,6 @@ bin/keyboard.o: src/keyboard.c bin/paging.o: src/paging.c $(CC) $(CFLAGS) -c $< -o $@ -bin/page.o: src/page.asm - $(AS) $(ASFLAGS) $< -o $@ - bin/fat.o: src/fat.c $(CC) $(CFLAGS) -c $< -o $@ diff --git a/src/page.asm b/src/page.asm deleted file mode 100644 index 6ca81b9..0000000 --- a/src/page.asm +++ /dev/null @@ -1,24 +0,0 @@ - - -global loadPageDirectory -loadPageDirectory: - push ebp - mov ebp, esp - mov eax, [esp+8] - mov cr3, eax - mov esp, ebp - pop ebp - ret - -global enablePaging -enablePaging: - push ebp - mov ebp, esp - - mov eax, cr0 - or eax, 0x80000000 - mov cr0, eax - - mov esp, ebp - pop ebp - ret diff --git a/src/paging.c b/src/paging.c index cad77a6..e6f37d5 100644 --- a/src/paging.c +++ b/src/paging.c @@ -2,10 +2,7 @@ #include #include "../include/stdio.h" -//extern void loadPageDirectory(unsigned int*); -//extern void enablePaging(); - -void enablePaging1() { +void enablePaging() { asm volatile ( "mov %%cr0, %%eax\n" "or $0x80000000, %%eax\n" @@ -21,7 +18,7 @@ void enablePaging1() { ); } -void loadPageDirectory1(uint32_t* page_directory) { +void loadPageDirectory(uint32_t* page_directory) { asm volatile ( "mov %0, %%cr3\n" // Загружаем физический адрес каталога страниц в CR3 : // Нет выходных операндов @@ -132,8 +129,8 @@ void paging_init() printf("OSHIBKA ZAPISI BLYA\n"); while (1); // Ошибка записи } - loadPageDirectory1(kernel_page_directory); - enablePaging1(); + loadPageDirectory(kernel_page_directory); + enablePaging(); } void *get_physaddr(void *virtualaddr) {