-
Notifications
You must be signed in to change notification settings - Fork 698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a cross compiler for OS #122
Comments
I'm glad you enjoy the book! I'm happy to hear it. For cross compilers, indeed it is recommended that way. However, to reduce the complexity of already complex learning project, I decided to use a native compiler since code generated is x86 anyway. The code sections like |
I couldn't actually get it working with the linker script, the first issue was that I had to flip the order on PHDRS command (code comes first then headers), as it gave me an error that after that I had a problem that I couldn't get physical and virtual memory addresses and the offset to be correct (even when I used the recipe in the book), I just kep trying in other ways until I got things barely working (I got shifted debug symbols at the very end) I couldn't solve that problem, but in my opinion building a cross-compiler on Linux wasn't that complicated, to be honest, I was just scared of stepping into doing it just because it seemed complex, but using the steps ok OSDev made things easier, I just needed to modify the I also felt that linker scripts aren't documents and I couldn't really search about what's wrong when anything happened (I just kept randomly trying until things work), so that why I suggest that maybe using a cross compiler is a better option but surely I'm not saying that was annoying, I'm grateful that those problems got me into the cross compiler thing, thanks 🙏 |
Hello, I"m very grateful that I found your book, it has lots of information laid nicely, I followed it to the end (I hope it gets complete one day!) and completed the missing information online without much trouble.
I just want to note that I guess GCC won't be friendly with the OS binary as it inserts calls to some of its functions (I don't remember the exact name of the function) like .text.***_ax or something like that which get the OS code into an undefined state. (I followed the code with
gdb
)Guys on the osdev wiki mandated that we have a cross compiler build specifically for our target, when I did that and compiled the OS and retraced the code it worked as expected and contained to extra call.
Thank you so much for your efforts writing the book, I appreciate them
The text was updated successfully, but these errors were encountered: