moment ich such mal den source vn meinem alten bootloader raus:
org 0x7c00
%define STACK_SEGMENT 0x9000
%define STACK_OFFSET 0xffff
%define FAT_SEGMENT 0x0100
%define FAT_OFFSET 0x0000
%define RD_SEGMENT 0x0220
%define RD_OFFSET 0x0000
%define KERNEL_SEGMENT 0x1000
jmp End_FatSB
OSName db "MSDOS "
BytesPerSec dw 512
SecPerClus db 1
ResvdSecCnt 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 1
VolumeLavel db "ChaOS", 0, 0
FileSysType db "FAT12 "
End_FatSB:
CreateStack:
cli
cld
mov ax, STACK_SEGMENT
mov ss, ax
mov sp, STACK_OFFSET
mov ax, cs
mov ds, ax
mov es, ax
sti
mov [DrvNum], dl
mov si, start_msg
call Print
ReadFAT:
mov ax, [ResvdSecCnt]
mov cx, [FATSize]
mov bx, FAT_SEGMENT
mov es, bx
mov bx, FAT_OFFSET
ReadFAT_loop:
call ReadSector
inc ax
add bx, 512
loop ReadFAT_loop
ReadRD:
mov ax, [RootEntCnt]
mov bx, 32
mul bx
mov bx, 512
xor dx, dx
div bx
mov cx, ax
push cx
sektoren
xor ax, ax
mov al, [NumFATs]
mul word [FATSize]
add ax, [ResvdSecCnt]
push ax
mov bx, RD_SEGMENT
mov es, bx
mov bx, RD_OFFSET
ReadRD_loop:
call ReadSector
inc ax
add bx, 512
loop ReadRD_loop
FindKernel:
mov cx, [RootEntCnt]
mov di, RD_OFFSET
FindKernel_loop:
push cx
mov cx, 11
mov si, kernel_name
repe cmpsb
pop cx
je FoundKernel
add di, 21
loop FindKernel_loop
jmp KernelNotFound
FoundKernel:
pop dx
pop bx
add dx, bx
add di, 15
mov ax, [es:di]
mov bx, KERNEL_SEGMENT
mov es, bx
xor bx, bx
LoadKernel_loop:
pusha
mov ah, 0x0e
mov al, '.'
mov bx, 0x0007
int 0x10
popa
push ax
add ax, dx
dec ax
dec ax
call ReadSector
pop ax
push dx
push es
mov cx, ax
mov bx, 3
mul bx
mov bx, 2
xor dx, dx
div bx
mov bx, FAT_SEGMENT
mov es, bx
mov bx, ax
mov ax, [es:bx]
test cx, 1
jz IsEven
shr ax, 4
jmp LoadKernel_loopTail
IsEven:
and ax, 0xfff
LoadKernel_loopTail:
pop es
pop dx
mov bx, es
add bx, 0x20
mov es, bx
xor bx, bx
cmp ax, 0xfff
jne LoadKernel_loop
mov dl, [DrvNum]
jmp KERNEL_SEGMENT:0
KernelNotFound:
mov si, no_kernel
call Print
Hang:
xor ax, ax
int 0x16
jmp 0xffff:0x0000
ReadSector:
pusha
mov bp, 4
ReadSector_loop:
xor dx, dx
div word [SecPerTrack]
inc dl
mov cl, dl
xor dx, dx
div word [NumHeads]
mov dh, dl
mov ch, al
mov dl, [DrvNum]
mov al, 1
mov ah, 2
int 0x13
jnc ReadOk
dec bp
jz ReadError
jmp ReadSector_loop
ReadOk:
popa
ret
ReadError:
mov si, read_err
call Print
mov si, reboot
call Print
call Hang
Print:
Print_loop:
lodsb
or al, al
jz EndPrint
mov ah, 0x0e
mov bx, 0x0007
int 0x10
jmp Print_loop
EndPrint:
ret
start_msg db 'ChaOS-Booty 0.0.0.1', 0
no_kernel db 13, 10, 'kernel not found', 13, 10
reboot db ' press any key to reboot', 0
read_err db 13, 10, 'read error', 13, 10
kernel_name db 'KERNEL SYS'
times 510-($-$$) db 0
dw 0xaa55