Autor Thema: Mode 13h und Debugmodus  (Gelesen 2210 mal)

jeb

  • Beiträge: 341
    • Profil anzeigen
    • http://www.jebdev.net
Gespeichert
« am: 05. October 2005, 21:13 »
Hi!
Ich erstelle für jemand anderen und für mich als Übung ein "OS", welches bootet und dann einfach eine Grafik auf dem Bildschirm anzeigt. Nun gibt es hier ein paar Probleme.......
Als Bootloader verwende ich der Faulheit wegen einfach den vom Tut1. Den Code um alles anzuzeigen hab ich auf 512 Bytes aufgefüllt, damit ich dann die Grafik in die nächsten Sektoren laden kann. Die Grafik selber ist ein 256-Farben Bitmap (bmp) bei welchem ich den Header am Anfang wegeditiert hab. Die Farbpalette spielt vorläufig noch keine Rolle, da das Bild gar nicht richtig angezeigt wird. Hier mal mein Code. Er ist jetzt etwas überfüllt, weil ich die Schleifen durch den ganzen Code ersetzt habe.

;== Base Stuff
mov ax,1000h
mov ds,ax
mov es,ax

cli
mov ax,9000h
mov ss,ax
mov sp,0
sti

;== Changing into "Mode 13h"
xor ah,ah
mov al,13h
int 10h

;call check

;== Loading Bitmap 1
mov ah,02h
mov al,16
mov ch,0
mov cl,3
mov dh,0
mov dl,0
mov di,01200h
;mov di,0A000h
mov es,di
mov di,0
mov bx,di
int 13h

;== Check loaded
;mov ah,0Eh
;mov bl,7
;mov di,01200h
;mov es,di
;mov al,[es:1]
;int 10h

;call check

;== Loading Bitmap 2
mov ah,02h
mov al,18
mov cl,1;
mov dh,0
mov dl,0
;mov di,0A000h
mov di,01200h
mov es,di
mov word di,8192
mov bx,di
mov byte ch,1
int 13h

mov ah,02h
mov al,18
mov cl,1;
mov dh,0
mov dl,0
;mov di,0A000h
mov di,01200h
mov es,di
mov word di,17408
mov bx,di
mov byte ch,2
int 13h

mov ah,02h
mov al,18
mov cl,1;
mov dh,0
mov dl,0
;mov di,0A000h
mov di,01200h
mov es,di
mov word di,26624
mov bx,di
mov byte ch,3
int 13h

mov ah,02h
mov al,18
mov cl,1;
mov dh,0
mov dl,0
;mov di,0A000h
mov di,01200h
mov es,di
mov word di,35840
mov bx,di
mov byte ch,3
int 13h

mov ah,02h
mov al,18
mov cl,1;
mov dh,0
mov dl,0
;mov di,0A000h
mov di,01200h
mov es,di
mov word di,45056
mov bx,di
mov byte ch,4
int 13h

mov ah,02h
mov al,18
mov cl,1;
mov dh,0
mov dl,0
;mov di,0A000h
mov di,01200h
mov es,di
mov word di,54272
mov bx,di
mov byte ch,5
int 13h

;call check

;== Check loaded
;mov ah,0Eh
;mov bl,7
;mov di,01200h
;mov es,di
;mov al,[es:8193]
;int 10h

;call check

;== Loading Bitmap 3
mov ah,02h
mov al,1
mov ch,6
mov cl,0
mov dh,0
mov dl,0
;mov di,0A000h
mov di,01200h
mov es,di
mov di,63488
mov bx,di
int 13h

;call check

;== Copy Image to Screen
jmp start_copy
coff dw 0

start_copy:
mov di,01200h
mov es,di
mov word bx,[coff]
mov al,[es:bx]
mov di,0A000h
mov es,di
mov [es:bx],al

add word [coff],1

cmp word [coff],64000
jne start_copy

jmp stop

;==================
;==================
;==================

;== Check
check:
mov ah,0Eh
mov al,35
mov bl,7
int 10h
ret

;== Finish
stop:
jmp stop

;== Fill Sector
times 512-($-$$) db 0


Die Loading Bitmap 1-3 sind alle das gleiche Bild. Das erste sind die übrigen 16 Sektoren des 1. Tracks. 2 ist eigentlich eine Schleife, die weitere 6 Tracks einlist. 3. ist dann noch der letzte Sektor. Nur leider zeigt es mir das Bild komplett falsch an. Ich hab das Bild schon um 90, 180 und 270 ° gedreht, ohne erfolg. Es ist auch nur der halbe Bildschirm gefüllt  :( Nun wollte ich fragen, ob es eine Möglichkeit gibt, bei BOCHS sich den aktuellen Speicher anzusehen um zu überprüfen, wo Daten fehlen.
Bochs selber hat bei mir auch noch einen Fehler: No romimage to load
Wo befindet sich das zu verwendende Romimage unter Linux?
Nun noch eine letzte Frage. Weiss jemand gerade, wo im Header die Farbpalette des Bitmaps steht? Sonst schau ich in den Dokus nach.

Vielen Dank

jeb

 

Einloggen