Skip to content

Commit 3c01d24

Browse files
committed
Fixed some flaws
1 parent 0da1194 commit 3c01d24

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

boot.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ global _boot ; Defines entrypoint
66
; Code section
77
section .text:
88
_boot:
9-
xor ax, ax
9+
xor ax, ax ; Clear Data and Extra segments
1010
mov ds, ax
1111
mov es, ax
1212

@@ -108,8 +108,8 @@ GDT_start:
108108

109109
[bits 32]
110110
_enter_protected_mode:
111-
mov ax, DATA_SEG
112-
mov ds, ax
111+
mov ax, DATA_SEG ; Write data segment to ax
112+
mov ds, ax ; Distribute data segment to segments
113113
mov ss, ax
114114
mov es, ax
115115
mov fs, ax

build/kernel.o

-12 Bytes
Binary file not shown.

run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
nasm -f bin -o build/boot.bin boot.asm
44
nasm -f bin -o build/zeroes.bin bootloader/zeroes.asm
55
nasm -f elf -o build/kernel_entry.o bootloader/kernel_entry.asm
6-
i386-elf-gcc -ffreestanding -m32 -g -c kernel/kernel.cpp -o build/kernel.o
6+
i386-elf-gcc -ffreestanding -m32 -g -c kernel/kernel.c -o build/kernel.o
77

88
i386-elf-ld -o build/full_kernel.bin -Ttext 0x1000 build/kernel_entry.o build/kernel.o --oformat binary
99

0 commit comments

Comments
 (0)