Compare commits
2 Commits
dba3b4163e
...
d4e6dd4da8
Author | SHA1 | Date | |
---|---|---|---|
d4e6dd4da8 | |||
93729c40b5 |
|
@ -1,17 +0,0 @@
|
|||
; This file is written with Intel ASM Syntax.
|
||||
|
||||
[GLOBAL load_gdt] ; Allows the C code to call gdt_flush().
|
||||
[EXTERN gp]
|
||||
load_gdt:
|
||||
; Get the pointer to the GDT, passed as a parameter.
|
||||
lgdt [gp] ; Load the new GDT pointer
|
||||
|
||||
mov ax, 0x10 ; 0x10 is the offset in the GDT to our data segment
|
||||
mov ds, ax ; Load all data segment selectors
|
||||
mov es, ax
|
||||
mov fs, ax
|
||||
mov gs, ax
|
||||
mov ss, ax
|
||||
jmp 0x08:flush ; 0x08 is the offset to our code segment: Far jump!
|
||||
flush:
|
||||
ret
|
135
arch/i386/isr.s
135
arch/i386/isr.s
|
@ -1,135 +0,0 @@
|
|||
%macro ISR 1
|
||||
global isr%1
|
||||
isr%1:
|
||||
cli
|
||||
push byte 0
|
||||
push byte %1
|
||||
jmp isr_common
|
||||
%endmacro
|
||||
|
||||
%macro ISR_ERR 1
|
||||
global isr%1
|
||||
isr%1:
|
||||
cli
|
||||
push byte %1
|
||||
jmp isr_common
|
||||
%endmacro
|
||||
|
||||
%macro IRQ 2
|
||||
global irq%1
|
||||
irq%1:
|
||||
cli
|
||||
push byte 0
|
||||
push byte %2
|
||||
jmp irq_common
|
||||
%endmacro
|
||||
|
||||
ISR 0
|
||||
ISR 1
|
||||
ISR 2
|
||||
ISR 3
|
||||
ISR 4
|
||||
ISR 5
|
||||
ISR 6
|
||||
ISR 7
|
||||
ISR_ERR 8
|
||||
ISR 9
|
||||
ISR_ERR 10
|
||||
ISR_ERR 11
|
||||
ISR_ERR 12
|
||||
ISR_ERR 13
|
||||
ISR_ERR 14
|
||||
ISR 15
|
||||
ISR 16
|
||||
ISR_ERR 17
|
||||
ISR 18
|
||||
ISR 19
|
||||
ISR 20
|
||||
ISR 21
|
||||
ISR 22
|
||||
ISR 23
|
||||
ISR 24
|
||||
ISR 25
|
||||
ISR 26
|
||||
ISR 27
|
||||
ISR 28
|
||||
ISR 29
|
||||
ISR_ERR 30
|
||||
ISR 31
|
||||
|
||||
IRQ 0, 32
|
||||
IRQ 1, 33
|
||||
IRQ 2, 34
|
||||
IRQ 3, 35
|
||||
IRQ 4, 36
|
||||
IRQ 5, 37
|
||||
IRQ 6, 38
|
||||
IRQ 7, 39
|
||||
IRQ 8, 40
|
||||
IRQ 9, 41
|
||||
IRQ 10, 42
|
||||
IRQ 11, 43
|
||||
IRQ 12, 44
|
||||
IRQ 13, 45
|
||||
IRQ 14, 46
|
||||
IRQ 15, 47
|
||||
|
||||
extern fault_handler
|
||||
|
||||
isr_common:
|
||||
pusha
|
||||
push ds
|
||||
push es
|
||||
push fs
|
||||
push gs
|
||||
mov ax, 0x10
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov fs, ax
|
||||
mov gs, ax
|
||||
mov eax, esp
|
||||
push eax
|
||||
|
||||
mov eax, fault_handler
|
||||
call eax
|
||||
|
||||
pop eax
|
||||
pop gs
|
||||
pop fs
|
||||
pop es
|
||||
pop ds
|
||||
popa
|
||||
add esp, 8
|
||||
iret
|
||||
|
||||
extern irq_handler
|
||||
|
||||
irq_common:
|
||||
pusha
|
||||
push ds
|
||||
push es
|
||||
push fs
|
||||
push gs
|
||||
mov ax, 0x10
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov fs, ax
|
||||
mov gs, ax
|
||||
mov eax, esp
|
||||
push eax
|
||||
mov eax, irq_handler
|
||||
call eax
|
||||
pop eax
|
||||
pop gs
|
||||
pop fs
|
||||
pop es
|
||||
pop ds
|
||||
popa
|
||||
add esp, 8
|
||||
iret
|
||||
|
||||
global idt_load
|
||||
extern idtp
|
||||
idt_load:
|
||||
lidt [idtp]
|
||||
ret
|
|
@ -1,3 +1,12 @@
|
|||
/************************
|
||||
*** Team Kitty, 2019 ***
|
||||
*** Sync ***
|
||||
***********************/
|
||||
|
||||
/* This file provides an interface to
|
||||
* the hardware timer / RTC. Not much
|
||||
* more to be said about it. */
|
||||
|
||||
#include <kernel/utils.h>
|
||||
#include <kernel.h>
|
||||
#include <kernel/serial.h>
|
||||
|
|
|
@ -1,3 +1,18 @@
|
|||
/************************
|
||||
*** Team Kitty, 2019 ***
|
||||
*** Sync ***
|
||||
***********************/
|
||||
|
||||
/* This file provides all of the functionality
|
||||
* needed to interact with the Text-Mode VGA
|
||||
* buffer, which will soon be defunct due to
|
||||
* EFI and graphics.
|
||||
*
|
||||
* This file will be left for the forseeable
|
||||
* future, because it allows for easy debugging.
|
||||
* 17/07/19 Curle
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/************************
|
||||
*** Team Kitty, 2019 ***
|
||||
*** ProjectRED ***
|
||||
*** Sync ***
|
||||
***********************/
|
||||
|
||||
/* This file combines the implementation
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/************************
|
||||
*** Team Kitty, 2019 ***
|
||||
*******ProjectRED*******
|
||||
*** Sync ***
|
||||
***********************/
|
||||
|
||||
/* This file contains all of the ISR and IRQ
|
||||
|
|
|
@ -1,8 +1,16 @@
|
|||
/************************
|
||||
*** Team Kitty, 2019 ***
|
||||
*** ProjectRED ***
|
||||
*** Sync ***
|
||||
***********************/
|
||||
|
||||
/* This file contains the entry point
|
||||
* to the kernel. This section consists
|
||||
* mainly of bootloading functions.
|
||||
*
|
||||
* Graphics and memory will be setup
|
||||
* at later stages.
|
||||
*/
|
||||
|
||||
//#include <stdio.h>
|
||||
#include <kernel.h>
|
||||
#include <kernel/tty.h>
|
||||
|
@ -60,11 +68,10 @@ int kernel_main(void) {
|
|||
serial_print(0x3F8, "[INFO] All subsystems ready. Printing message.\r\n");
|
||||
|
||||
/* Everything is ready; print a pretty message. */
|
||||
term_setcolor(RED);
|
||||
term_writes("\n(c)");
|
||||
term_setcolor(GREEN);
|
||||
term_writes(" Project");
|
||||
term_setcolor(RED);
|
||||
term_writes("RED");
|
||||
term_writes(" Sync");
|
||||
term_setcolor(WHITE);
|
||||
term_writes(", 2019\n");
|
||||
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
/************************
|
||||
*** Team Kitty, 2019 ***
|
||||
*** Sync ***
|
||||
***********************/
|
||||
|
||||
/* This file provides an interface to the serial port.
|
||||
* Most emulators allow the serial port to be saved into
|
||||
* a text buffer, or a file, but this code should work on
|
||||
* hardware with an actual serial port and monitor. */
|
||||
|
||||
#include <kernel/utils.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
/************************
|
||||
*** Team Kitty, 2019 ***
|
||||
*** ProjectRED ***
|
||||
*** Sync ***
|
||||
***********************/
|
||||
|
||||
/* This file contains utility functions
|
||||
* for the kernel and OS to use. They
|
||||
* will be naturally optimized through
|
||||
* the run of development, and thus are
|
||||
* to be used scarcely until a more
|
||||
* permanent solution can be found.
|
||||
*/
|
||||
|
||||
#include <kernel/utils.h>
|
||||
#include <kernel/tty.h>
|
||||
|
|
Loading…
Reference in New Issue
Block a user