Real mode print function not working!

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
Jubbens

Real mode print function not working!

Post by Jubbens »

I'm trying to print simple progress messages from my boot loader. But when I run the attatched bootloader, all it prints is

????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????
????????????????????????????????

Very strange indeed. Any insights?
Ushma

Re:Real mode print function not working!

Post by Ushma »

Whilst I don't know that this is causing your problem, you seem to be making assumptions about the status of the segment registers. Get them into a known state before you do anything else. Also, you don't seem to be setting up a stack. You should do so.
Jubbens

Re:Real mode print function not working!

Post by Jubbens »

Set regs and moved the setting up of the stack to the bootstrap. No change.

???
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:Real mode print function not working!

Post by Brendan »

Hi,

It could be because of this:

Code: Select all

   mov si,[msg1]
I'd assume you'd want this instead:

Code: Select all

   mov si,msg1
While it's probably not a problem, I'd also use a "CLD" instruction somewhere - you never know when someone's gone and reversed the direction.

I've also heard of BIOSs that refuse to boot when the first instruction of the boot image isn't a "jmp" (a Compaq IIRC).


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.
Jubbens

Re:Real mode print function not working!

Post by Jubbens »

Thanks Brendan, the square brackets were the problem.

You're awesome.
Post Reply