Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Can you tell me what i am doing wrong here and how to correct it. what i was doing is print 1 string message and load the next sector. In my next sector will be the kernel which i will give what the users want in my Patricknet BETA 0.2 version which i want to turns some heads. I am not using LBA just standard CHS. I spent 2 days working on this fixing the print message error and creating the load sector part.
;Book Disk Designed For Patricknet Systems
;Built By PatrickV(Project Manager)
;Free to use this bootsector with no limits and is Opensource
[bits 16]
[org 0x7c00]
jmp Start
; Data Strap
msg db 'Patricknet Bootstrap - Version: 0.0.1 (BETA) (20/7/2008)',13,10,0
Start:
xor ax, ax
mov ds, ax
mov si, msg
mov bx,512 ;Buffer
mov ah,02h
mov al,1 ; Number of Sectors to read
mov ch,0 ; Track Number
mov cl,2 ; Sector Number
mov dh,0 ; Head Number
mov dl,0 ; Drive Number
int 0x13
ch_loop:lodsb
or al, al
jz hang
mov ah, 0x0E
int 0x10
jmp ch_loop
hang:
jmp hang
padding TIMEs 510-($-$$) db 0
;Flag Point Form Bios To Notice That This A Patricknet Boot Sector Is Vaild By Signature
Dw 0AA55h
1. The text will never be printed as you have not called the print string bios function.
2. The value of bx should be the address of the data buffer not the size.
From Ralf Brown's Interrupt List for Int 13/AH=0x02 the buffer to be filled is at DS:BX
Guys, i guess he is calling the character printing bios function mov ah,0x0e int 10h. So this should work... but the problem is i guess the 'si' should be loaded before the ch_loop... int 13h might be changing it...
Yous should also change bh to 0 and bl to your character attribute (not supported by all bioses)
And also your not loading anything into AL, you need to load the next character using something like lodsb, which even increments SI for you...
Jules
Start:
xor ax, ax
mov ds, ax
mov bx,512 ;Buffer
mov ah,02h
mov al,1 ; Number of Sectors to read
mov ch,0 ; Track Number
mov cl,1 ; Sector Number
mov dh,0 ; Head Number
mov dl,0 ; Drive Number
int 0x13
mov si, msg
mov ah, 0Eh
ch_loop:
lodsb
cmp al, 0 ; end of string
je hang
int 0x10
jmp ch_loop
hang:
jmp hang
@rutix: isn't es:bx the segment and offset for the destination buffer address? In my code I fill es:bx with the destination for where the loaded sectors will go, not the size of the buffer.