From 2ada7fd5df08e43ce55de9db7a639c80e28ea54f Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 5 Aug 2003 22:00:00 -0400 Subject: [PATCH] Import backup from 2003-08-05 --- bootsect.asm | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/bootsect.asm b/bootsect.asm index 2cb6333..dd72fa6 100644 --- a/bootsect.asm +++ b/bootsect.asm @@ -141,11 +141,12 @@ found_file: ;ds:si points to root dir entry of kernel file mov bx, FAT_SEG mov ds, bx ;ds points to beginning of FAT xor bx, bx + xor di, di readkernel_loop: cmp ax, 0xff7 jg readkernel_done - ;inc word [k_count] + inc di push ax push bx call getCHSfromCluster @@ -183,20 +184,24 @@ got_cluster: jmp readkernel_loop readkernel_done: ;now copy kernel to final location in KERNEL_ADD! + xor ecx, ecx + mov cx, di ;cx=# of 512byte sectors loaded + shl ecx, 9 ;ecx=ecx*512 -; mov ax, KERNEL_SEG -; mov ds, ax -; xor esi, esi -; xor ax, ax -; mov es, ax -; mov edi, KERNEL_ADD -; xor ecx, ecx -; mov cx, [k_count] ;cx=# of 512byte sectors loaded -; shl ecx, 9 ;ecx=ecx*512 -;movekernel_loop: -; o32 lodsb ;mov al, [ds:esi] -; o32 stosb ;mov [es:edi], al -; o32 loop movekernel_loop + mov ax, KERNEL_SEG + mov ds, ax + xor esi, esi + xor ax, ax + mov es, ax + mov edi, KERNEL_ADD +movekernel_loop: + mov al, [ds:esi] + inc esi + mov [es:edi], al + inc edi + dec ecx + cmp ecx, 0 + jne movekernel_loop jmp $