If you're going to port it to a different architecture, do arm64 or risc-v. Don't waste your time learning about the quirks of a processor lineage which has compatibility with features meant to solve problems from the 70s, like segmentation for example.
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
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