paging: remove page.asm
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# Define the object files
|
# 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
|
# Define the compiler and assembler
|
||||||
CC = gcc -D__is_katauos
|
CC = gcc -D__is_katauos
|
||||||
@@ -93,9 +93,6 @@ bin/keyboard.o: src/keyboard.c
|
|||||||
bin/paging.o: src/paging.c
|
bin/paging.o: src/paging.c
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
bin/page.o: src/page.asm
|
|
||||||
$(AS) $(ASFLAGS) $< -o $@
|
|
||||||
|
|
||||||
bin/fat.o: src/fat.c
|
bin/fat.o: src/fat.c
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
|
||||||
+4
-7
@@ -2,10 +2,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "../include/stdio.h"
|
#include "../include/stdio.h"
|
||||||
|
|
||||||
//extern void loadPageDirectory(unsigned int*);
|
void enablePaging() {
|
||||||
//extern void enablePaging();
|
|
||||||
|
|
||||||
void enablePaging1() {
|
|
||||||
asm volatile (
|
asm volatile (
|
||||||
"mov %%cr0, %%eax\n"
|
"mov %%cr0, %%eax\n"
|
||||||
"or $0x80000000, %%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 (
|
asm volatile (
|
||||||
"mov %0, %%cr3\n" // Загружаем физический адрес каталога страниц в CR3
|
"mov %0, %%cr3\n" // Загружаем физический адрес каталога страниц в CR3
|
||||||
: // Нет выходных операндов
|
: // Нет выходных операндов
|
||||||
@@ -132,8 +129,8 @@ void paging_init()
|
|||||||
printf("OSHIBKA ZAPISI BLYA\n");
|
printf("OSHIBKA ZAPISI BLYA\n");
|
||||||
while (1); // Ошибка записи
|
while (1); // Ошибка записи
|
||||||
}
|
}
|
||||||
loadPageDirectory1(kernel_page_directory);
|
loadPageDirectory(kernel_page_directory);
|
||||||
enablePaging1();
|
enablePaging();
|
||||||
}
|
}
|
||||||
|
|
||||||
void *get_physaddr(void *virtualaddr) {
|
void *get_physaddr(void *virtualaddr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user