I see you are on Windows. Native GCC compilers will target Windows, and with it comes many nuances with the default linker script. But there are things that stand out:
Code:
objcopy -O binary -j .text kernel.tmp kernel.bin
The output file will only contain the `.text` and won't include the `.data` or `.rdata*` sections where `msg` likely reside. My guess is that `msg` doesn't appear in the kernel.bin file at all and thus why you are having problems.
Beyond that you appear to have another big issue. You appear to be using a GCC (MinGW? Cygwin?) compiler that by default is generating 64-bit code. In order for you to properly run 64-bit bit code you need to be in 64-bit mode (one of the submodes of long mode). Your bootloader appears to only put the processor in protected mode. Even if you were able to start executing the code, you would likely see certain anomalies right away - like screen output appearing wonky for inexplicable reasons.
I can't stress this enough. If you want to build a 64-bit kernel then you need to get into 64-bit long mode, and on WIndows I highly suggest that you consider a cross compiler so you don't have to deal with all the nuances of the native non-ELF compilers on that platform. If you intend to write a 32-bit OS then I recommend getting a 32-bit (i686-elf or i386-elf) cross compiler.
It is in fact possible to use the native compilers, but the linker script section names are slightly different, and the bit and structure packing rules are different unless you also add the GCC option -mno-ms-bitfields . These are two things that I remember off the top of my head. I've helped people on Stackoverflow build 32-bit OSes using Cygwin and they encounter similar issues.
You will really need to start considering using a linker script as well (you don't use one at all since you link with the -T NUL option).
When using Windows commands to add file together I recommend using COPY instead of type. You can ensure binary files are copied as is. You can do:
Code:
copy /b file+file2 outputfile
A somewhat related post of mine (they used GRUB and not a custom bootloader with Cygwin as a compiler) on SO:
https://stackoverflow.com/questions/492 ... on-mode-elAnd regarding 64-bit code running in 32-bit protected mode these are the type of things you could possibly see early on in OS development:
https://stackoverflow.com/questions/398 ... y/39815993