Ich hab ein Problem mit meinem Bootloader. Wenn ich ihn auf meine Diskette schreibe, kann Windows auf die Diskette zugreifen. Sobald ich aber von der Diskette boote passiert etwas Seltsames 
Der Cursor hüpft zuerst eine Weile lang sinlos am Bildschirm herum, dann wird ein Smiley ausgegeben und per Tastendruck bootet er neu (soll er ja).
Meine Vermutung liegt an einem Fehler in der Funktion func_printMsg, ich finde den Fehler aber nicht
Hier der Code:
Weiß jemand Rat?

Der Cursor hüpft zuerst eine Weile lang sinlos am Bildschirm herum, dann wird ein Smiley ausgegeben und per Tastendruck bootet er neu (soll er ja).
Meine Vermutung liegt an einem Fehler in der Funktion func_printMsg, ich finde den Fehler aber nicht

Hier der Code:
Code: [Auswählen]
jmp FAT_INFORMATION_BLOCK_END
OSName db "MSWIN4.1"
BytesPerSec dw 512
SecPerClus db 1
RsvdSecCnt dw 1
NumFATs db 2
RootEntCnt dw 224
TotSec dw 2880
MediaType db 0xF0
FATSize dw 9
SecPerTrack dw 18
NumHeads dw 2
HiddenSec dd 0
TotSec32 dd 0
DrvNum db 0x00
Reserved db 0
BootSig db 0x29
VolumeID dd 0xFAFA
VolumeLabel db "MINOS 0.0.1"
FileSysType db "FAT12 "
FAT_INFORMATION_BLOCK_END:
org 0x7C00
cli ; clear interrupt flag (no interrupts)
mov ax, 0x9000
mov ss, ax ; set stackpointer to ax (0x9000)
xor sp, sp ; set stackpointer to zero
sti ; allow interrupts again
mov [bootdrv], dl ; save bootdrive from dl into bootdrv
; this function searches for the kernel and loads it
; into the memory at adress 0x1000
LOAD_KERNEL:
mov si, loadingMsg
call func_printMsg
; code follows
; this function jumps to address 0x1000 and executes
; the kernel
EXECUTE_KERNEL:
; code follows
; this function is executed if no kernel.bin file was
; found. it writes some text and then reboots the system
KERNEL_NOT_FOUND:
mov si, failureMsg
call func_printMsg
mov ah, 0 ; Wait until a key is pressed
int 0x16
; this function reboots the personal computer
REBOOT:
db 0xEA ; reboot
dw 0x0000
dw 0xFFFF
; variables
loadingMsg db "Loading kernel.bin into memory. Please wait.",13,10,0
failureMsg db "Couldn't find kernel.bin on disk.",13,10,"Press any key to reboot.",13,10,0
bootdrv db 0
; this function prints a zero terminated string on the
; screen, whos adress is saved in si
func_printMsg:
lodsb ; load byte
or al,al ; is al zero?
jz short .end ; al is zero -> end
mov ah,0x0E ; function 0x0E (write char)
mov bx,0x0007 ; attribut byte (is not necessary)
int 0x10 ; write character
jmp func_printMsg ; next byte
.end:
retn ; return to code
; Fill up with zeros until file is 512 bytes long
times 510-($-$$) db 0
dw 0xAA55
Weiß jemand Rat?

Übersicht
Wiki
Hilfe
Suche
Einloggen
Registrieren
Drucken
Gespeichert






)