Hello everybody
I've a problem with my kernel. My bootloader loads kernel it from FAT12 at address 0x80000, sets protected mode and all segment registers. Here's my (very simple) kernel :
[BITS 32]
[ORG 0x80000]
VideoMemory dw 0xB8000
_start:
MOV [0xB8000], byte 'A'
MOV [0xB8001], byte 0x07
MOV [VideoMemory+2], byte 'B'
MOV [VideoMemory+3], byte 0x07
kernel_end:
JMP kernel_end
The 'A' is displayed, but not the 'B'... why ???
Kernel problem...
RE:Kernel problem...
may be, because of bad linkage.
Disassemble and check it out.(with ndisasm)
Disassemble and check it out.(with ndisasm)
RE:Kernel problem...
VideoMemory isn't a constant (immediate), its stored in memory. You have to move VideoMemory to a register first. At the moment it is moving 'B' to the address of VideoMemory (not 0xB8000, but 0x80000) + 2.
try:
MOV eax, [VideoMemory]
MOV [eax+2], byte 'B'
try:
MOV eax, [VideoMemory]
MOV [eax+2], byte 'B'
RE:Kernel problem...
I think the problem is to do withn the fact that you are using
16bit dw for vid mem
16bit dw for vid mem
RE:Kernel problem...
First, thanks everybody 4 help !
Yes sure, it's work now, but...
I can't access other variables. When I put something like
MOV AL, 'A'
MOV [0xB8000], byte AL
MOV [0xB8001], 0x07
It doesn't print what I want... Very strange...Any idea ?
Yes sure, it's work now, but...
I can't access other variables. When I put something like
MOV AL, 'A'
MOV [0xB8000], byte AL
MOV [0xB8001], 0x07
It doesn't print what I want... Very strange...Any idea ?