The 539kernel Book: A journey in creating an operating system kernel
539kernel.com
539kernel.com
Comparable other "guides" that I have stumbled across is osdev101 [1] and "Writing an operating system from scratch" [2].
[1] https://github.com/tuhdo/os01/blob/master/Operating_Systems_...
[2] https://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures...
> The angel number 539 is suggesting you focus on your success. It will be the opportunity to interchange your ideas with others who will assist you in sailing through challenges.
https://www.sunsigns.org/angel-number-539-meaning/
> stick with your plan. It is a good plan that can guarantee great results.
> Get the job done and let your creative ideas flow. When people start offering their help and assistance, don’t say no!
If you do want to do x86_64, off the top of my head by rough order where you will encounter things:
0. bootstrapping the kernel either gets more complicated or easier based on whether you start in 32 bit mode or 64 bit mode with UEFI. Just start from UEFI and save yourself the headache.
1. The gdt (segmentation table) format changes
2. The tss (another segmentation table) format changes
3. The idt (interrupt table) format changes
4. The ABI (application binary interface, calling convention mostly) changes, leading to a ton of subtle changes to the asm, much deeper than just the register width
5. The page table format changes.
6. Modern processors kick off sibling cores slightly differently. That's not really a 32->64 bit thing but is good to keep in mind.
7. I didn't look to see how they implement their syscall path, but you want to have your kernel ABI be the sysenter instruction, and not say int 0x80. It will simplify your life