i have a big problem: i have written some code:
Code:
Code: Select all
[BITS 16]
[ORG 0x7C00]
KERNEL_SIZE equ 76
KERNEL_SEGMENT equ 0x1000
KERNEL_START equ 1
%define LOOPS_1 bp-2
%define CYLINDER bp-4
%define offs bp-6
%define SECTORZ bp-8
%define LOGICAL bp-10
%define seg bp-12
SUB sp, 12
CLI
XOR ax, ax
MOV ss, ax
MOV sp, 0x7C00
MOV ds, ax
STI
MOV ax, KERNEL_SEGMENT
MOV es, ax
MOV [seg], ax
MOV bx, 0
MOV [offs], bx
MOV cx, KERNEL_SIZE
MOV [LOOPS_1], cx
MOV ax, 2 ;start at sector2
MOV [LOGICAL], ax
MOV [SECTORZ], ax
MOV ax, 0
MOV [CYLINDER], ax
main_loop:
MOV [LOOPS_1], cx ;take the loopvar to the logical sector number
;MOV ax, [LOGICAL] ;Cylinder
;MOV bx, 36
;MOV dx, 0
;DIV bx
;MOV [CYLINDER], ax
MOV dx, 18 ;set TRACK 0 if TRACK is 18
CMP dx, [SECTORZ]
JE set_null
fail:
;read the sector
MOV ax, [seg]
MOV bx, [offs]
MOV ah, 2
MOV al, 1
MOV ch, [CYLINDER]
MOV cl, [SECTORZ]
MOV dx, 0
INT 0x13
JC fail
MOV cx, [LOOPS_1]
MOV al, 1
ADD [LOGICAL], al
ADD [SECTORZ], al
MOV al, 32
ADD [seg], al
MOV ax, 512
ADD [offs], al
LOOP main_loop;
JMP KERNEL_SEGMENT:0x0000
set_null
mov ah, 0x0e
mov al, '.'
mov bx, 0x0004
int 0x10
MOV dx, 1
MOV [SECTORZ], dx
ADD [CYLINDER], dx
JMP fail
but it didnt word i have used bochs for testing bochs didnt gave me an error message he puts the dots('.') and then he did nothing... please help me... THANK YOU!!!
ps: i have assembled it with nasm boot.asm -o boot -f bin
my prog what copies the bootloader on the floppy adds the boot signature!!