feat: gdt, attributes move, reorder
Added late gdt setup with initial tss Moved attributes to include root Reordered some imports
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
// Created by rick on 28-01-21.
|
||||
//
|
||||
|
||||
#include <string.h>
|
||||
#include <attributes.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <myke/util/stream.h>
|
||||
#include <myke/attributes.h>
|
||||
#include <myke/tasks/task.h>
|
||||
#include <myke/libk/kprint.h>
|
||||
#include <myke/tasks/task.h>
|
||||
#include <myke/util/stream.h>
|
||||
|
||||
#define MAX_HANDLERS 8
|
||||
#define STREAM_SIZE (32*1024)
|
||||
@@ -49,7 +49,7 @@ void kprint_init() {
|
||||
kprint_stream = stream_create(STREAM_SIZE);
|
||||
}
|
||||
|
||||
void noreturn kprint_task(void *_) {
|
||||
void att_noreturn kprint_task(void *_) {
|
||||
uint32_t last_read = 0;
|
||||
uint8_t data[PRINT_BUFFER_SIZE + 1] = {0};
|
||||
while (true) {
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
// Created by rick on 02-02-21.
|
||||
//
|
||||
|
||||
#include <attributes.h>
|
||||
|
||||
#include <myke/libk/kprint.h>
|
||||
#include <myke/attributes.h>
|
||||
#include <myke/libk/libk.h>
|
||||
|
||||
bool k_addr_in_kspace(void *addr) {
|
||||
@@ -14,13 +15,13 @@ void k_wait_for_interrupt() {
|
||||
__asm__ __volatile__("hlt;");
|
||||
}
|
||||
|
||||
void noreturn k_panics(const char *msg) {
|
||||
void att_noreturn k_panics(const char *msg) {
|
||||
// todo this is not printed
|
||||
kprint_sync(msg);
|
||||
k_panic();
|
||||
}
|
||||
|
||||
void noreturn k_panic() {
|
||||
void att_noreturn k_panic() {
|
||||
kprint_sync("PANIC!");
|
||||
while (1) {
|
||||
__asm__ __volatile__("cli;"
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Created by rick on 22-02-21.
|
||||
//
|
||||
|
||||
#include <attributes.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <myke/libk/syscall.h>
|
||||
#include <myke/attributes.h>
|
||||
|
||||
void syscall1(uint32_t arg1) {
|
||||
__asm__("int $0x80"
|
||||
@@ -19,7 +19,7 @@ void syscall2(uint32_t arg1, uint32_t arg2) {
|
||||
: "a"(arg1), "b"(arg2));
|
||||
}
|
||||
|
||||
void noreturn syscall_start_scheduler() {
|
||||
void att_noreturn syscall_start_scheduler() {
|
||||
syscall1(SYSCALL_START_SCHEDULER);
|
||||
while (1) { __asm__("hlt"); };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user