From 23228162c497833da4f6ca77bbe4b6cfdb3def2a Mon Sep 17 00:00:00 2001 From: Greg Bowne Date: Mon, 8 Apr 2024 23:25:11 -0700 Subject: [PATCH] Your commit message here --- src/impl/kernel/kernel.bin | Bin 0 -> 8201 bytes src/impl/kernel/main.c | 2 +- src/impl/print.c | 12 ++++++------ src/impl/x86_64/boot/main.asm | 6 +++--- src/impl/x86_64/boot/main64.asm | 2 +- src/intf/print.h | 5 ++--- 6 files changed, 13 insertions(+), 14 deletions(-) create mode 100644 src/impl/kernel/kernel.bin diff --git a/src/impl/kernel/kernel.bin b/src/impl/kernel/kernel.bin new file mode 100644 index 0000000000000000000000000000000000000000..295bcc71d505f081100f03e99c1d6598eb5d6dd0 GIT binary patch literal 8201 zcmeHMO=whC6h3#Fr!h^uV==U)KRzRrZlXn0NU3xrJh+R7i77z~7X0Z_HB&)|g<>c!B3O8FqD)J0o-+9S&b(wCaoa@~_rlzJ z-ub?B?m6FCUFH&@8dU-p@+c(&x=nR_?x*OgQp;lVn?HskkAy^}qqQ9!+m4xk)<2|2Y};1~|)_>fc80=y=ZJ}7^hqy7llr5Apr zNCfnQD<5#qfW-++s^0FfVLL6?8Q=5yLkba%-6`fcMt03hbHOf|vTI=`L6n!B<>*uUZdCP8(Bi5+$vw znzcNREO)DvF#+GjetaqChLY#{T$LL1l(?qEA4(MD1?xfF2`St1M6S;2vAp3@W;M6H z6mDeOpi-8{mrwY5S)=_2E&$rr8MZ4_s;&r%q5{lD z5wGyTR~15k7%0ZVDR}mY@hXkJBrjW46mP8#s(f>0JkBGhk{qlhEl*Bc-j#(GrvRfS z=8{GXcVp~4HNCU~S^=$qRzNGD70?Q31+)TM0j_m zn!Q7ZMn;YviGFDA+R=UZ=%{%-HvCy^Xmg#-Z#!Q6wB)rhI7plxAaN=zUTa_5n!!U7 z@0t4V=Zf!dW6qxS;fYXh$C_gxtYGiq`~~=dW<0d7PT+Xm;D4t8{s8ACp8(oykr)5~ literal 0 HcmV?d00001 diff --git a/src/impl/kernel/main.c b/src/impl/kernel/main.c index 143be57..4fdb2d6 100644 --- a/src/impl/kernel/main.c +++ b/src/impl/kernel/main.c @@ -1,4 +1,4 @@ -#include "print.h" +#include "../../../../../../" void kernel_main() { diff --git a/src/impl/print.c b/src/impl/print.c index 20eca8a..de60a67 100644 --- a/src/impl/print.c +++ b/src/impl/print.c @@ -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); } } diff --git a/src/impl/x86_64/boot/main.asm b/src/impl/x86_64/boot/main.asm index ddf5793..57063c2 100644 --- a/src/impl/x86_64/boot/main.asm +++ b/src/impl/x86_64/boot/main.asm @@ -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 \ No newline at end of file + dq gdt64 ; address diff --git a/src/impl/x86_64/boot/main64.asm b/src/impl/x86_64/boot/main64.asm index 13d783c..a5954a3 100644 --- a/src/impl/x86_64/boot/main64.asm +++ b/src/impl/x86_64/boot/main64.asm @@ -12,5 +12,5 @@ long_mode_start: mov fs, ax mov gs, ax - call kernel_main + call kernel_main hlt diff --git a/src/intf/print.h b/src/intf/print.h index bb4fff8..ce7c43e 100644 --- a/src/intf/print.h +++ b/src/intf/print.h @@ -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);