Colored Boot Message 
Author Message
 Colored Boot Message

I'm in the process of writing my own boot sector that simply
displays a message.  I can write the message, but now I want to
write that message in color.  I've used AH=09h with BH=01h and
BL=010xd, but all attempts have failed.  Could anyone point out
to me what I'm doing wrong?

        org   0h                ; <--- boot sequence
alpha:
start:  db    0ebh,045h       ; JMP to boot sector code
        db    090h            ; NOP (standard)
        db    '  iG!   '      ; OEM ID
        dw    0200h           ; bytes per sector
        db    01h             ; sectors per cluster
        dw    0001h           ; reserved sectors at beginning
        db    02h             ; number of FAT copies
        db    0e0h            ; number of root directory entries
        db    0h              ; (?)
        dw    0b40h           ; number of sectors on disk
        db    0f0h            ; media descriptor byte
        db    09h             ; sectors per FAT
        dw    01200h          ; sectors per track
        dw    0200h           ; number of sides
        dw    0000h           ; special hidden sectors
        db    09xd dup (0h)   ; (?)
        db    029h            ; extended boot record signature
        db    'GnaI'          ; volume serial number
        db    '.o=isaac=o.'   ; volume label
        db    'FAT12   '      ; file system ID
        db    09xd dup (0h)   ; (?)
boot:       cli                     ; <--- boot sequence
            xor   ax, ax            ; <--- boot sequence
            mov   ss, ax            ; <--- boot sequence
            mov   sp, 7BF0h         ; <--- boot sequence
            sti                     ; <--- boot sequence
            mov   ax, 7C0h          ; <--- boot sequence
            mov   ds, ax            ; <--- boot sequence
            cld                     ; <--- boot sequence
            mov   si, offset(msg)
disp:       lodsb
            or    al,al
            jz    cont
            push  si
            mov   ah,0eh
            mov   bx,07xd
            mov   bl,010xd    ; first attempt at color
          ; mov   ah,09h      ; second attempt at color
          ; mov   bh,00h      ; second attempt at color
          ; mov   bl,013xd    ; second attempt at color
          ; mov   cx,01h      ; second attempt at color
          ; mov   ah,09h      ; third attempt at color
          ; mov   bh,01h      ; third attempt at color
          ; mov   bl,013xd    ; third attempt at color
          ; mov   cx,01h      ; third attempt at color
            int   010h
            pop   si
            jmp   disp
cont:       xor   ah, ah
            int   16h
            int   19h

msg         db    0dh,0ah,'This is supposed to be colored text.'
            db    0dh,0ah,0dh,0ah
            db    0h
omega:
amt         equ   0509xd-(omega-alpha)

            db    amt dup (01h)

            db    0h,055h,0aah

Until I type again...
---




Fri, 06 Aug 1999 03:00:00 GMT  
 Colored Boot Message

have you tried:

mov ah, 0Eh
mov al, (character code)
mov bh, o
mov bl, (color)
int 10

It's the TTY Character Output BIOS routine, and though I haven't used it with color, does work well for boot messages...



Sat, 07 Aug 1999 03:00:00 GMT  
 Colored Boot Message

Quote:

> I'm in the process of writing my own boot sector that simply
> displays a message.  I can write the message, but now I want to
> write that message in color.  I've used AH=09h with BH=01h and
> BL=010xd, but all attempts have failed.  Could anyone point out
> to me what I'm doing wrong?

>         org   0h                ; <--- boot sequence
> alpha:
> start:  db    0ebh,045h       ; JMP to boot sector code
>         db    090h            ; NOP (standard)
>         db    '  iG!   '      ; OEM ID
>         dw    0200h           ; bytes per sector
>         db    01h             ; sectors per cluster
>         dw    0001h           ; reserved sectors at beginning
>         db    02h             ; number of FAT copies
>         db    0e0h            ; number of root directory entries
>         db    0h              ; (?)
>         dw    0b40h           ; number of sectors on disk
>         db    0f0h            ; media descriptor byte
>         db    09h             ; sectors per FAT
>         dw    01200h          ; sectors per track
>         dw    0200h           ; number of sides
>         dw    0000h           ; special hidden sectors
>         db    09xd dup (0h)   ; (?)
>         db    029h            ; extended boot record signature
>         db    'GnaI'          ; volume serial number
>         db    '.o=isaac=o.'   ; volume label
>         db    'FAT12   '      ; file system ID
>         db    09xd dup (0h)   ; (?)
> boot:       cli                     ; <--- boot sequence
>             xor   ax, ax            ; <--- boot sequence
>             mov   ss, ax            ; <--- boot sequence
>             mov   sp, 7BF0h         ; <--- boot sequence
>             sti                     ; <--- boot sequence
>             mov   ax, 7C0h          ; <--- boot sequence
>             mov   ds, ax            ; <--- boot sequence
>             cld                     ; <--- boot sequence
>             mov   si, offset(msg)
> disp:       lodsb
>             or    al,al
>             jz    cont
>             push  si
>             mov   ah,0eh
>             mov   bx,07xd
>             mov   bl,010xd    ; first attempt at color
>           ; mov   ah,09h      ; second attempt at color
>           ; mov   bh,00h      ; second attempt at color
>           ; mov   bl,013xd    ; second attempt at color
>           ; mov   cx,01h      ; second attempt at color
>           ; mov   ah,09h      ; third attempt at color
>           ; mov   bh,01h      ; third attempt at color
>           ; mov   bl,013xd    ; third attempt at color
>           ; mov   cx,01h      ; third attempt at color
>             int   010h
>             pop   si
>             jmp   disp
> cont:       xor   ah, ah
>             int   16h
>             int   19h

> msg         db    0dh,0ah,'This is supposed to be colored text.'
>             db    0dh,0ah,0dh,0ah
>             db    0h
> omega:
> amt         equ   0509xd-(omega-alpha)

>             db    amt dup (01h)

>             db    0h,055h,0aah

Why don't you slam you text right into your display card's ascii-memory.
You can insert the attributes and never touch the BIOS.

Quote:
> Until I type again...
> ---



Dries van Oosten

Eat any good books lately.



Mon, 09 Aug 1999 03:00:00 GMT  
 Colored Boot Message



:I'm in the process of writing my own boot sector that simply displays a
:message.  I can write the message, but now I want to write that message
:in color.  I've used AH=09h with BH=01h and BL=010xd, but all attempts
:have failed.  Could anyone point out to me what I'm doing wrong?

:            mov   ah,0eh
:            mov   bx,07xd
:            mov   bl,010xd    ; first attempt at color

In this function, the use of bl for color is only supported in graphics
mode.

:          ; mov   ah,09h      ; second attempt at color
:          ; mov   bh,00h      ; second attempt at color
:          ; mov   bl,013xd    ; second attempt at color
:          ; mov   cx,01h      ; second attempt at color

This function should print in color, but all characters will overtype
because the cursor position is not automatically advanced.

Best,
        -- Chuck Crayne
-----------------------------------------------------------

-----------------------------------------------------------



Mon, 09 Aug 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. output color message (text) to a message box (string)

2. output color message (text) to a message box (string)

3. Boot Message

4. Change error message/s background color?

5. Display a Message with color text

6. Pc Boot Direct:Boot Apps on PC Processor

7. MS-DOS Boot Sector & Boot Programs

8. Virus Boot - Boot virus - help

9. PP-80 R4--Using color messages on B&W screens

10. Setting a web hex color as background color for a canvas

11. conflicts between button colors and background color

12. RGB color to HTML color

 

 
Powered by phpBB® Forum Software