Page 1 of 1

Bochs dosnt get it!

Posted: Thu Apr 25, 2002 4:22 pm
by smurphy
Hia :P

I am working on an (very) small operating system that suports 32 bit protected mode. It all works perfectly, and boots off the floppydisk perfectly. In fact, everything works just fine.

But bochs dosnt get it. When i write text to the video-memory bochs isnt showing it. It does, alas works fine when i, before the jump in to pmode, print anything with use of the BIOS.

for example, in protected mode:

mov byte [es:0xb809E], "U"

dosnt show anything in bochs, but it works fine on my 386.

The code below works just fine.

   mov si, some_text
   call write

   (...)

write:
   lodsb         ; al = ds:si
   or al,al
   jz klar         ; om al = 0 (slut p? str?ng) s? avsluta
   mov ah, 0x0e      ; 0x0e = put char
   mov bx, 0x000F      ; vit f?rg
   int 0x10      ; anropa BIOS
   jmp write      ; loop'a
klar:   ret

(Yeah, i know. Ive stolen it.. who cares?)

What's wrong? Should i use some other configuration for bochs? In that case, wich one?

I would apriciate any help at all!!


// SMURPHY - the guy in your head

Re:Bochs dosnt get it!

Posted: Thu Apr 25, 2002 4:29 pm
by Dave_Hunt
When you write text directly to video memory, you also have to write an attribute byte. It is possible that the attribute bytes are all set to black on black, so when you write your character, you can't see it.

Try this:

mov byte [es:0xb809E],"U"
mov byte [es:0xb809F],0x07

That should get you a white (grey) 'U'.

If that doesn't work, I have no idea what the problem might be. Bochs works just fine for me.