Memory

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Pulser

Memory

Post by Pulser »

Ok, I've got my bootloader to load a kernel off a floppy, and it succesfully jumps to the kernel :) But I tried doing:

mov ax, 65
mov [0xb8000], ax

to print the letter A in the top left hand corner, but it doesn't seem to work. Do I have to access memory differently in protected mode? Thanks. :)
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:Memory

Post by Brendan »

Hi,
Pulser wrote: Ok, I've got my bootloader to load a kernel off a floppy, and it succesfully jumps to the kernel :) But I tried doing:

mov ax, 65
mov [0xb8000], ax

to print the letter A in the top left hand corner, but it doesn't seem to work. Do I have to access memory differently in protected mode? Thanks. :)
There are major differences for memory access in protected mode (it's protected!). See Intels manuals for details...

Despite this your code may actually be working. It puts an 'A' in the top left corner of the screen with a black foreground and a black background. Because both colours are black it will all look black :)

Perhaps "mov ax,0x0F41" might work (it'd do the same but the foreground colour will be white). If it doesn't work then there's something wrong (or unexpected) with the way DS is configured..


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Memory

Post by Pype.Clicker »

you of course turned on protected mode before trying this ? ...
Post Reply