Don't write x86 ASM, there is a reason why a compiler generates plain x86 ASM, because a human is not capable of understanding it. Write MIPS ASM instead, it is much cleaner and human readable.
Name:
Anonymous2008-09-20 23:39
>>2
More like because YOU aren't capable of understanding it amirite?
Name:
Anonymous2008-09-21 0:13
>>2
The reason it generates assembly is because the compiler author couldn't be bothered with doing manual label-to-address translation when there were perfectly good assemblers for doing this. Also, to create a human readable description of what it's actually telling the computer to do.
I'll write it in something else when you show me how to go from real to long mode in that language. Until then, why the fuck does my qemu decide to stop working when hitting that far jump? It's taken more or less straight from the amd64 documents.
>>1
Do you know where things are blowing up? That would be helpful.
1. You are not updating ds and ss after jumping into protected mode.
2. I presume your 'puts' takes a string pointer in 'esi'. Why are you using only half of the register and not the full 32 bits?
>>5
qemu is dicks for debugging these sorts of problems
1: As it fucks up on the jump, it never reaches puts.
2: Only half is needed.
What would you recommend in place of qemu?
Also, I just tried turning on the A20 line, didn't work.
Name:
Anonymous2008-09-21 3:17
>>8
Does your pGDT32 structure have the correct linear address for the GDT? Your address origin might be throwing it off (I presume it's at 0, if this is loaded off the boot sector you might want to fix that).
Are you positive the upper half of si isn't garbage? It probably is.
A20 line shouldn't make a difference at this point since you're not accessing memory above the 1MB mark.
bochs is OK for debugging CPU setup stuff like this. Unfortunately its emulation is more forgiving than it should be. Maybe qemu has gotten better, but I recall it hanging a lot when the state blows up when transitioning between modes.
Name:
Anonymous2008-09-21 3:42
>>9
cs is 0, the bootloader puts the kernel at 1600h. In other examples I've seen this doesn't matter.
The file shown is included after showing some nice "Welcome to Failix! =D" messages.
But thanks thanks for the tip, I'm installing bochs now.
/prog/ was having a nice programming related conversation and you come in with your memes. gb2not this thread.
Name:
Anonymous2008-09-21 9:00
Bochs really helped.
The descriptor table wasn't in the correct format. However, I had set the code descriptor to point to a data descriptor in a wild goose chase, and later forgot about it, so I didn't find it until after I RAGE'd and wrote them in pure binary.