cheetosysst / os

Learning how to write a operating system kernel.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GDT init caused unpredictable behaviour.

cheetosysst opened this issue · comments

Description

kernel/segments.c gdt_entries_init() causes unpredictable behavior.
Sometimes it seems to work just fine, sometimes the serial output is fine but video is still stuck at BIOS or not updating properly. Sometimes nothing works and serial output stuck at GDT setup start

Expected Behavior

Setup segments and move on.

Additional Info

When it works

image

qemu-system-i386 -machine q35 -kernel build/kernel_bin -serial stdio
GDT setup start.
Flag.
GDT flushed
172 AC 254 hello $

When it doesn't work

Notice the serial output message doesn't always work.
image

qemu-system-i386 -machine q35 -kernel build/kernel_bin -serial stdio
GDT setup start.
Flag.
GDT flushed
172 AC 254 hello $