os-tutorial
os-tutorial copied to clipboard
how to boot on real hardware
I compiled the code for 13-kernel-barebones
. I ran it with QEMU. It works fine. I flash os-image.bin to a USB drive with balenaEtcher. I plug it into my computer. I boot it from the flash drive and I see it say "Started in 16-bit Real Mode", "Loading kernel into memory", and "Landed in 32-bit protected mode" (in the top left) for a split second, and then the computer reboots. What gives? If possible, How can I fix it?
Computer: Dell Inspiron 1300 Architecture: i386
On the HDD it has Debian 10 w/ xfce4 desktop environment.
Edit
The same thing happens when I compile and run 24-el-capitan
(the last lesson), and my own OS.
likely a triple fault
probably because the code in this codebase is kinda broken but it works fine on normal qemu
probably because the code in this codebase is kinda broken but it works fine on normal qemu
So how can I fix it?
probably because the code in this codebase is kinda broken but it works fine on normal qemu
So how can I fix it?
Or at least handle the exception
Idk you'll have to figure out what instruction faults
printf
spam to the rescue!
I guess you could also use a hardware debugger, but I'd personally first try to run it on several computers and see if something changes. Maybe the BIOS of that computer has some weird quirk which crashes your program, i don't know.
printf
spam to the rescue!
printf in assembly you say... hmmm
I mean, it's just a name, you can call it whatever you like. Also afaik this whole thing is written in C right?
@jlagarespo except the bootloader, yes