XenOS wrote:requimrar wrote:I think I just did… I don't know what defines '64-bit code', but I can execute code in a 64-bit elf by jumping directly to it. Probably a bad idea though.
When you're in long mode with a 64-bit code segment, you can execute code compiled with a 64 bit compiler or assembled with some 64 bit assembler, maybe using the .code64 directive if you had some .code32 stub before.
Yes, I'm using QEMU. Is that some kind of anomaly?
Actually I never encountered such a delay in QEMU, so I don't think it's a general thing about QEMU. But it's hard to tell where this may come from.
I see, thanks for clarifying. Anyway, now that I've gotten a call-able function pointer to my kernel, I'm just going to work on my PMM for now.
Just a question: Say the kernel wants to be loaded at 0x002F0000. However, that space is either
a. Reserved (Type 2) or
b. Non-existant.
Should I
a. Screw what it wants, and just shove it in whatever nook and cranny I have for free memory, or
b. Figure out relocations and stuff?
I'm thinking A… but of course it doesn't seem right.
One last question: GRUB says my kernel is about 2MB+. That doesn't seem right, given that
a. My ASM file is just 1 BITS directive, one extern and one global directive, a section marker, a label, a cli, a hlt and a call instruction, and
b. My C file is a void main(), setting an int pointer to 0xB8000, writing A to 0xB8000 and 0x0F to 0xB8001…
Why?