Your commit message here
This commit is contained in:
parent
11d0f9d492
commit
23228162c4
BIN
src/impl/kernel/kernel.bin
Normal file
BIN
src/impl/kernel/kernel.bin
Normal file
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
#include "print.h"
|
||||
#include "../../../../../../"
|
||||
|
||||
void kernel_main()
|
||||
{
|
||||
|
@ -17,8 +17,8 @@ uint8_t color = PRINT_COLOR_WHITE | PRINT_COLOR_BLACK << 4;
|
||||
void clear_row(size_t row)
|
||||
{
|
||||
struct Char empty = (struct Char){
|
||||
character : '',
|
||||
color : color,
|
||||
0,
|
||||
color,
|
||||
};
|
||||
|
||||
for (size_t col = 0; col < NUM_COLS; col++)
|
||||
@ -62,7 +62,7 @@ void print_char(char character)
|
||||
if (character == '\n')
|
||||
{
|
||||
print_newline();
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
if (col > NUM_COLS)
|
||||
@ -71,8 +71,8 @@ void print_char(char character)
|
||||
}
|
||||
|
||||
buffer[col + NUM_COLS * row] = (struct Char){
|
||||
character : (uint8_t)character,
|
||||
color : color,
|
||||
(uint8_t)character,
|
||||
color,
|
||||
};
|
||||
|
||||
col++;
|
||||
@ -89,7 +89,7 @@ void print_str(char *str)
|
||||
return;
|
||||
}
|
||||
|
||||
print_char(character)''
|
||||
print_char(character);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
global start
|
||||
global _start
|
||||
extern long_mode_start
|
||||
|
||||
section .text
|
||||
bits 32
|
||||
start:
|
||||
_start:
|
||||
mov esp, stack_top
|
||||
|
||||
call check_multiboot
|
||||
@ -134,4 +134,4 @@ gdt64:
|
||||
dq (1 << 43) | (1 << 44) | (1 << 47) | (1 << 53) ; code segment
|
||||
.pointer:
|
||||
dw $ - gdt64 - 1 ; length
|
||||
dq gdt64 ; address
|
||||
dq gdt64 ; address
|
||||
|
@ -12,5 +12,5 @@ long_mode_start:
|
||||
mov fs, ax
|
||||
mov gs, ax
|
||||
|
||||
call kernel_main
|
||||
call kernel_main
|
||||
hlt
|
||||
|
@ -19,9 +19,8 @@ enum {
|
||||
PRINT_COLOR_LIGHT_RED = 12,
|
||||
PRINT_COLOR_PINK = 13,
|
||||
PRINT_COLOR_YELLOW = 14,
|
||||
PRINT_COLOR_WHITE = 15,
|
||||
|
||||
}
|
||||
PRINT_COLOR_WHITE = 15
|
||||
};
|
||||
|
||||
void print_clear();
|
||||
void print_char(char character);
|
||||
|
Loading…
Reference in New Issue
Block a user