Renaming/Moving stuff into a different file structure
This commit is contained in:
@ -21,10 +21,10 @@ stack_bottom:
|
||||
stack_top:
|
||||
|
||||
.section .text
|
||||
.include "./src/kernel/arch/i386/irs_table.s"
|
||||
.include "./src/kernel/arch/i386/irq_table.s"
|
||||
.include "./src/kernel/arch/i386/idt/idt.s"
|
||||
.include "./src/kernel/arch/i386/paging.s"
|
||||
.include "./src/kernel/irs_table.s"
|
||||
.include "./src/kernel/irq_table.s"
|
||||
.include "./src/kernel/idt/idt.s"
|
||||
.include "./src/kernel/paging.s"
|
||||
|
||||
|
||||
.global _start
|
||||
@ -46,44 +46,7 @@ _start:
|
||||
|
||||
call early_main
|
||||
cli
|
||||
.global load_gdt
|
||||
load_gdt:
|
||||
lgdt gdt
|
||||
|
||||
# set the segment selecters
|
||||
|
||||
movw $0x10, %ax
|
||||
movw %ax, %ds
|
||||
movw %ax, %es
|
||||
movw %ax, %fs
|
||||
movw %ax, %gs
|
||||
movw %ax, %ss
|
||||
ljmp $0x08, $flush
|
||||
|
||||
flush:
|
||||
|
||||
|
||||
#load idt
|
||||
call init_idt
|
||||
sti
|
||||
|
||||
# Try enable A20
|
||||
# mov $0x2401, %ax
|
||||
# int $0x15
|
||||
|
||||
|
||||
# enable protected mode
|
||||
mov %cr0, %eax
|
||||
or $1, %eax
|
||||
mov %eax, %cr0
|
||||
|
||||
|
||||
call kernel_main
|
||||
|
||||
|
||||
cli
|
||||
1: hlt
|
||||
jmp 1b
|
||||
|
||||
|
||||
|
||||
.include "./src/kernel/arch/i386/gdt/gdt.s"
|
||||
.include "./src/kernel/gdt/gdt.s"
|
@ -2,7 +2,7 @@
|
||||
#include "bootloader/multiboot.h"
|
||||
#define CHECK_FLAG(flags, bit) ((flags) & (1 <<(bit)))
|
||||
|
||||
#include "arch/i386/tty/kterm.h"
|
||||
#include "tty/kterm.h"
|
||||
|
||||
|
||||
|
||||
|
@ -6,10 +6,48 @@ gdt:
|
||||
|
||||
.att_syntax
|
||||
|
||||
.global load_gdt
|
||||
load_gdt:
|
||||
lgdt gdt
|
||||
|
||||
# set the segment selecters
|
||||
|
||||
movw $0x10, %ax
|
||||
movw %ax, %ds
|
||||
movw %ax, %es
|
||||
movw %ax, %fs
|
||||
movw %ax, %gs
|
||||
movw %ax, %ss
|
||||
ljmp $0x08, $flush
|
||||
|
||||
flush:
|
||||
|
||||
|
||||
#load idt
|
||||
call init_idt
|
||||
sti
|
||||
|
||||
# Try enable A20
|
||||
# mov $0x2401, %ax
|
||||
# int $0x15
|
||||
|
||||
|
||||
# enable protected mode
|
||||
mov %cr0, %eax
|
||||
or $1, %eax
|
||||
mov %eax, %cr0
|
||||
|
||||
|
||||
call kernel_main
|
||||
|
||||
|
||||
cli
|
||||
1: hlt
|
||||
jmp 1b
|
||||
|
||||
|
||||
.size _start, . - _start
|
||||
|
||||
|
||||
/*
|
||||
* Create the GDT
|
||||
*/
|
@ -43,6 +43,9 @@
|
||||
printf( "UTC time: %02d-%02d-%02d %02d:%02d:%02d [ Formatted as YY-MM-DD h:mm:ss]\r" ,year, month, day, hour, minute, second);
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,15 +2,15 @@
|
||||
extern "C"{
|
||||
#include "../libc/include/string.h"
|
||||
}
|
||||
#include "arch/i386/vga/VBE.h"
|
||||
#include "arch/i386/tty/kterm.h"
|
||||
#include "vga/VBE.h"
|
||||
#include "tty/kterm.h"
|
||||
|
||||
#include "./bootloader/multiboot.h"
|
||||
#include "bootcheck.h"
|
||||
#include "memory/PhysicalMemoryManager.h"
|
||||
|
||||
#include "arch/i386/gdt/gdtc.h"
|
||||
#include "arch/i386/idt/idt.h"
|
||||
#include "gdt/gdtc.h"
|
||||
#include "idt/idt.h"
|
||||
|
||||
#include "io.h"
|
||||
#include "time.h"
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
void PageDirectory::enable(){
|
||||
|
||||
// https://wiki.osdev.org/Setting_Up_Paging
|
||||
//set each entry to not present
|
||||
int i;
|
||||
for(i = 0; i < 1024; i++)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "../../../io.h"
|
||||
#include "../io.h"
|
||||
|
||||
#define PIC1 0x20 /* IO base address for master PIC */
|
||||
#define PIC2 0xA0 /* IO base address for slave PIC */
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "arch/i386/tty/kterm.h"
|
||||
#include "tty/kterm.h"
|
||||
#include "io.h"
|
||||
#define PORT 0x3f8
|
||||
static int init_serial() {
|
||||
|
@ -5,10 +5,10 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "../vga/colors.h"
|
||||
#include "../../../io.h"
|
||||
#include "../io.h"
|
||||
|
||||
extern "C"{
|
||||
#include "./../../../../libc/include/string.h"
|
||||
#include "./../../libc/include/string.h"
|
||||
}
|
||||
|
||||
void kterm_init();
|
Reference in New Issue
Block a user