Step by step...
For first here is stack problem for me, cose:
1. Extended Bootloader
fClrScr function is working
2. Bootloader jumping correctly to
0x7E00
3. Jump to another address returning Bochs error message "Not allocated memory".
Secod:
1. 'SI' points to incorrect address (Data Segment, Offset or both).
2. If Data Segment 'DS' is eq
0x7E00 or
0x0000 than still not works in Extanded Bootloader.
3. Something wrong with
Data Segment
Third:
1. Why you counting
StackAddress *
0x10 ?
2. Push and Pop with no result.
Fourth:
1. Primary MBR Bootloader source code [boot.asm]:
Code: Select all
[BITS 16]
[ORG 0x00007C00]
BOOT_MAIN:
cli
xor bx,bx ;BX = 0
mov ss,bx ;Stack Segment = 0
mov sp,0x7C00 ;Stack Pointer = 0x7C00
sti ;Enable Interrupts
call fClrScr
mov si, [ DB_MSG_BOOTSTART ]
call fPrint
call fReadFloppy
call fExecExtendBoot
jmp $
fPrint:
mov ah,0x0E
mov bh,0x00
mov bl,0x07 ; Normal text attribute
.fPrintChar:
lodsb
or al,al
jz .fPrintReturn
int 0x10
jmp .fPrintChar
.fPrintReturn:
ret
fClrScr:
mov ax, 3
int 10h
ret
fReadFloppy:
mov ah,0x02 ;Read disk sectors
mov al,0x01 ;Read ONE sector
mov ch,0x00 ;Track 0
mov cl,0x02 ;Sector 2
mov dh,0x00 ;Head 0
mov dl,0x00 ;Drive 0
mov bx,0x7E00 ;Set BX offset to our desired load location
mov es,bx ;Set Head Offset to 0, Set Drive Number to 0
mov bx,0x0000;
int 0x13 ;Execute BIOS Interrupt:
mov ax, 0x7E00;
mov ds, ax;
ret
fExecExtendBoot:
jmp 0x7E00:0x0000
ret
DB_MSG_BOOTSTART db 13, 10, ' Booting MBR... ', 0
DB_MSG_OK db '[OK]', 13, 10, 0
DB_MSG_FAILURE db '[FAILURE]', 13, 10, 0
DB_MSG_ERROR db 13, 10, ' **** [ERROR]: ', 0
times 510-($-$$) db 0 ; Fill the rest with zeros
dw 0xAA55 ; Boot loader signature
2. Extanded Bootloader source code [boot-ext.asm]:
Code: Select all
[BITS 16]
[ORG 0x7E00]
EBOOT_MAIN:
cli
xor bx,bx ;BX = 0
mov ss,bx ;Stack Segment = 0
mov sp,0x7E00 ;Stack Pointer = 0x7C00
mov ax,0x0000
mov ds,ax
mov ax,0x0000
mov es,ax
sti
;call fClrScr
;mov si, [ DB_Message_Starting ]
mov si, 0x0010
call fPrint
jmp $
fPrint:
mov ah,0x0E ; The function to display a chacter (teletype)
mov bh,0x00 ; Page number
mov bl,0x07 ; Normal text attribute
.fPrintChar:
lodsb
or al,al
jz .fPrintReturn
int 0x10
jmp .fPrintChar
.fPrintReturn:
ret
fClrScr:
mov ax, 3
int 10h
ret
DB_Message_Starting db 'OK',13,10,0
I have no idea.
By the way - Thanks for your time
Really Thanks a Lot
~ Marcel