flat assembler
Message board for the users of flat assembler.

Index > OS Construction > linebreak in protected mode?

Author
Thread Post new topic Reply to topic
qyte



Joined: 13 Aug 2006
Posts: 6
qyte
Hi,

i got a little problem with my bootloader. After I set up the protected mode i can't use the BIOS to print messages (where the linebreak is no problem).
In protected mode the bytes 12 and 10 are shown as a circle and a not, or something. Here's the code for printing my text.

Code:
pr_str:
        mov   esi,loadKernelMsg
        mov   edi,0xB8000 + 4
        mov   ah,0x0F  
        cld
pr_str1: 
        lodsb  
        test al,al 
        jz pr_strd
        stosw  
        jmp pr_str1
pr_strd:
        ret

loadKernelMsg   db      "Loading Kernel ...",13,10,0
    


How can I obtain that the next String will be printed into a new line.

Thanks in advance


Last edited by qyte on 25 Dec 2006, 00:25; edited 1 time in total
Post 24 Dec 2006, 23:21
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
do you understand what your code does? (and how?)
Post 25 Dec 2006, 00:02
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
qyte



Joined: 13 Aug 2006
Posts: 6
qyte
uhm ... of course. do you? ;D
Post 25 Dec 2006, 00:17
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
Quote:
do you understand what your code does? (and how?)
uhm ... of course
you don't seem to be understanding....

to go to new line, you should write to 0xB0000 + 80*2 (if your screen is 80 characters wide)
Post 25 Dec 2006, 00:54
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
Quote:
In protected mode the bytes 12 and 10 are shown as a circle and a not, or something


12 or 13 ? Anyway, I do not think this fact is specific to PM. Razz

Quote:
"Loading Kernel ...",13,10,0


You can drop the "13,10" Razz and define EOL as 1 or whatever ...

Quote:
to go to new line, you should write to 0xB0000 + 80*2 (if your screen is 80 characters wide)


Right. You need to set up a variable with screen writing address or 2
variables keeping X and Y cursor position, and check the string for EOL value
yourself ...

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 25 Dec 2006, 01:18
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
You need to write your own functions, go here:
http://bos.asmhackers.net/downloads.php
And get the OS BOS by bubach, in BOS is a inc file called "text.inc" with some good examples.
Post 25 Dec 2006, 02:09
View user's profile Send private message Reply with quote
qyte



Joined: 13 Aug 2006
Posts: 6
qyte
Thx everybody.
Special thanks 2 Dex. That inc file is really educational especially in setting the cursorpos, scrolling the screen and stuff. Smile
Post 25 Dec 2006, 18:17
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
BOS seems to work in DOSBOX also (except for "fddtest" and "reboot").
Post 26 Dec 2006, 04:55
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.