Hi Everybody,
Nope, my Kernel is Fine, it's something with the BootSector and Second Stage Loader, i can't seem to figure out what the heck is wrong?
I tried my Kernel with somebody else's BootSector, and it works fine. But with mine it doesn't.
I am going to post my BootSector & SSL Here, Sorry, but i just can't see what is wrong, i have been trying for a couple of hours and i just can't figure it out.
So Somebody Please help out if you can...
Code: Select all
[BITS 16]
[ORG 0x7C00]
;Jump over the Functions & Variables, and goto the BootCode!
jmp 0x0000:BootCode
BootDrive db 0 ;Stores the BootDrive Number
_ReadDisk:
push es
push bp
mov bp, sp
Reset_FloppyDisk_Drive:
mov ax, 0x00 ;Select Reset Function
int 0x13 ;Reset!
jc Reset_FloppyDisk_Drive ;If there is an Error, Try Again!
Read_FloppyDisk_Sectors:
mov ax, [bp + 16] ;Segment to load DiskData to
mov es, ax
mov bx, [bp + 14] ;Offset
mov ah, 0x02 ;Get the Segment:Offset from ES:BX
mov ch, [bp + 12] ;Cylinder
mov dh, [bp + 10] ;Head
mov al, [bp + 8] ;Sectors to Read
mov cl, [bp + 6] ;Sector to Start Reading at
int 0x13 ;Read!
jc Read_FloppyDisk_Sectors ;If there is an Error, Try Again!
pop bp
pop es
ret 12
BootCode:
;Set all the Segment Registers to 0
mov ax, 0
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
;Save the BootDrive number
mov [BootDrive], dl
;Setup a RM (Real Mode) Stack
cli ;Disable Interrupts
mov ax, 0x9000 ;Stack Segment
mov ss, ax
mov sp, 0xFFFF ;Use the whole segment
mov ax, cs
mov ds, ax ;Set DS == CS
sti ;Enable Interrupts
;Clear the Screen (Changing the Graphics Mode Clears the Screen!)
mov ah, 0x00 ;Select, Change Graphics Mode Function
mov al, 0x03 ;Select Text Mode 3 as a Graphics Mode
int 0x10 ;Call Video Interrupt
;Read in BootLoader
ReadIn_BootLoader:
mov dl, [BootDrive] ;FloppyDisk Drive to Read From
push 0x0000 ;Segment to load DiskData to
push 0x7E00 ;Offset
push 0 ;Cylinder
push 0 ;Head
push 4 ;Sectors to Load
push 2 ;Sector to Start Loading at
call _ReadDisk ;Read!
;Jump to the BootLoader
JumpTo_BootLoader:
mov dl, [BootDrive] ;Save the BootDrive for use in the BootLoader!
jmp 0x0000:0x7E00 ;Jump to the BootLoader
CodePadding times 510-($-$$) db 0 ;Makes sure the Code is 512 Bytes
BootSignature dw 0xAA55
That is my BootSector, My ssl is in the next post --|under this one ;D