os-tutorial icon indicating copy to clipboard operation
os-tutorial copied to clipboard

how to boot on real hardware

Open thecoder08 opened this issue 4 years ago • 10 comments

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.

thecoder08 avatar Mar 16 '20 18:03 thecoder08

likely a triple fault

Menotdan avatar Mar 16 '20 20:03 Menotdan

probably because the code in this codebase is kinda broken but it works fine on normal qemu

Menotdan avatar Mar 16 '20 20:03 Menotdan

probably because the code in this codebase is kinda broken but it works fine on normal qemu

So how can I fix it?

thecoder08 avatar Mar 16 '20 23:03 thecoder08

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

thecoder08 avatar Mar 17 '20 22:03 thecoder08

Idk you'll have to figure out what instruction faults

Menotdan avatar Mar 18 '20 02:03 Menotdan

printf spam to the rescue!

jlagarespo avatar Mar 18 '20 12:03 jlagarespo

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.

jlagarespo avatar Mar 18 '20 12:03 jlagarespo

printf spam to the rescue!

printf in assembly you say... hmmm

Menotdan avatar Mar 21 '20 04:03 Menotdan

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 avatar Mar 22 '20 14:03 jlagarespo

@jlagarespo except the bootloader, yes

ajh123 avatar May 01 '20 10:05 ajh123