Code: Select all
mov ax,0xb800
mov es,ax
mov word [es:0],0x5050
Code: Select all
mov ax,0xb800
mov es,ax
mov word [es:0],0x5050
Code: Select all
mov ebx,0xb8000
mov byte [ebx],'A'
mov byte [ebx+1], 1
True.tadada wrote:Sorry about that. If I use the code shown to print a "P" on a purple background it works in Real Monde only. When I try to use it in Protected Mode it doesn't work.
Code: Select all
mov ax,0xb800 mov es,ax mov word [es:0],0x5050
no, you cant -- to use the 64bit registers, requires removing existing instructions to turn them into prefixes -- which makes it incompatible with 16/32 bit software (the same is not true for 32bit registers, therefore those work in 16bit modes, but 64bit registers cannot work in 16/32bit modes)The question here is this: Can I use 64 bit registers even though I'm in 32 bit?
As long as its a valid descriptor offset in your GDT, then yes. If not, it will #GPF as soon as you use it.ES being "extra segment" I believe can be to where I chose though...
Wait... 0x500? What is loaded at 0x500? Your kernel?I think the second jump might be from the fact that it is loaded into 0x500 BUT is ORG [0x000].