Good work solving this; you're at the point where you can load a second stage, which is crucial for later work.
However, you now have a few choices to make:
- Do you want to try and load the kernel as the second stage directly, or do you want to have an intermediate second stage which can be larger and more elaborate than the 510-byte boot loader?
- Do you want to keep the code to switch to long mode in the boot loader, or do you want to have it in the second stage, which would give you greater flexibility in the boot loader and more room for things like error checking and interacting with the file system?
- What file system do you want to use? Are you planning on using an existing file system such as FAT32 or ext3fs, or were you going to roll your own (not generally advisable)? Do you have tools to partition the disk image file, format it, etc to the file system you want to use? Does the file system of your choice restrict how you can set up the boot loader and second stage?
- What object format are you planning on using? In your previous thread, you found that your C compiler was generating ELF executables, which is the most commonly used object format in the Linux world (and in Unix in general, today); do you mean to stick to that, or do you want to use some other format (GCC can generate several different ones depending on how you configure it)?
I'm not trying to intimidate you with this list; on the contrary, I'm just giving you some idea of the road ahead.
Of these decisions, I would say that choice of where to set up the protected/long mode switch is the first priority, because having that in the boot loader really gives up too much flexibility in the form of code space that could be used for other purposes. I specifically would recommend having a sort of rump file system in the boot loader instead, just enough to read the location of a second stage loader file. By having a second stage loader, and making it a regular file in the filesystem rather than a fixed location on the disk partition, you make it much easier to fix things like changes in the size of the second stage later on.
You can load the second stage as a 16-bit real mode raw binary, and have the switch to long mode there. This also gives you more room for testing, gathering hardware information from the BIOS, and for setting up the GDTs, IDT, etc. properly when you do the mode switch. Finally, it gives you enough room for a slightly more elaborate version of your mini-filesystem reader, one which can load the actual kernel in whichever object format you choose to support.