gmarino2048 / 64bit-os-tutorial

This OS Tutorial expands on the fundamental concepts covered in cfenollosa/os-tutorial and covers entering long mode on the x86_64 architecture. It also uses clang rather than relying on an external crosscompiler. I plan on keeping it up to date, so feel free to submit an issue!
MIT License
172 stars 19 forks source link

Infinite loop in the last chapter #8

Closed ThunderDZNGITH closed 5 months ago

ThunderDZNGITH commented 1 year ago

Hi, I know this is an old repo but who knows I might have an answer.

I would like to say that I followed this repo because it offers very good explanation unlike others. It's a pity that you don't continue it.

So my problem is that I have a problem of infinite loading in chapter 3.1, I suppose a problem of sector loading certainly in the "boot.asm" at the line "mov cx, 0x000A", when I compile, the build.sh indicates me that it is necessary to load 10 sectors however I move well cx to the 10 th sectors It is even more surprising that when I compile and launch the code provided on the github, I have the same problem.

If the author of this repo or someone has an idea of why, an answer is welcome!

Thanks in advance, Thunder.

gmarino2048 commented 1 year ago

Hi Thunder,

I see the issue you're referring to, and have been able to reproduce it locally. I'll leave this issue open until I can figure out what went wrong and fix it. Thanks for bringing this to my attention.

ThunderDZNGITH commented 1 year ago

Hey ! any update here ?

frisby-ninja commented 1 year ago

Same error here, I'll try to fix it myself but would appreciate some advice on the situation!

EDIT: It's caused by the line 'asm volatile ("sti");' in isr.c. I think there's some kind of interrupt happening at some stage that we can't see.

gmarino2048 commented 5 months ago

@ThunderDZNGITH and @frisby-ninja , sorry it took me so long to fix this (literal years lmao), but the issue was caused by the _start address coming unpinned from the expected address for some reason. In the meantime, you should be able to set the KERNEL_START address with whatever value you get from gdb and it should work temporarily. I'll open an issue for a more permanent fix.