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

Improve File Sizing and Loading #13

Closed gmarino2048 closed 5 months ago

gmarino2048 commented 5 months ago

Right now, we rely on the flat number of sectors to figure out how much of our image needs to be loaded. This has the potential to cause some data corruption since the load will fail if the image does not perfectly align with the sector size. One simple fix is using dd to pad the file by one sector so that the truncated portion is only zeroes, but I feel that there is a more elegant way to do this.