diff --git a/slrboot.bin b/slrboot.bin index 1110ee7..0e3a904 100644 Binary files a/slrboot.bin and b/slrboot.bin differ diff --git a/slrboot.nasm b/slrboot.nasm index 87e7ffe..53a2d0d 100644 --- a/slrboot.nasm +++ b/slrboot.nasm @@ -36,9 +36,6 @@ call print ; Call our string-printing routine xor bx, bx xor cx, cx mov ax, [partition_1.active_partition] -call dumpax -cli -hlt cmp ax, 0x80 jne check_p_2 mov bx, 0x01 ; Partion 1 active @@ -67,7 +64,7 @@ mov bx, 0x04 ; Partion 4 active eval_active_partion_number: cmp cx, 1 -je boot_partition: +je boot_partition ; here goes wait call, for the user to enter debug mode. ; Wating for 2 seconds: mov ah, 0x86 ; code for waiting interupt call @@ -79,34 +76,34 @@ xor ax, ax mov ah, 0x01 ; BIOS call to wait for key int 0x16 -mov bx, 1 boot_partition: ; IMPORTANT bx, has to hold the value 1-4 for the partiotion that wanted to be booted. +mov bx, 2 mov ax, partition_1 .loop: cmp bx, 1 je break add ax, 0x10 + ;call dumpax dec bx jmp .loop break: -add ax, 7 ; This is the offset to fetch the LBA start adress of the partition record - -mov bx, [ax] ; first part of LBA -mov WORD [DAPACK.lba_addr_dw_low], bx -inc ax ; next part -mov bx, [ax] -mov WORD [DAPACK.lba_addr_dw_low + 1], bx -inc ax ; next part -mov bx, [ax] -mov WORD [DAPACK.lba_addr_dw_low + 2], bx -inc ax ; next part -mov bx, [ax] -mov WORD [DAPACK.lba_addr_dw_low + 3], bx +add ax, 8 ; This is the offset to fetch the LBA start adress of the partition record +mov bx, ax +xor ax, ax +mov ax, [bx] ; first part of LBA +mov WORD [DAPACK.lba_addr_dw_low], ax +call dumpax +add bx, 2 ; next part +mov ax, [bx] +mov WORD [DAPACK.lba_addr_dw_low + 1], ax +call dumpax +cli +hlt mov WORD [DAPACK.blkcnt], 0x01 mov WORD [DAPACK.db_addr_segment], 0x0000 mov WORD [DAPACK.db_addr_offset], 0x7c00