Переглянути джерело

More logic added to check for more active partitions

master
Rhodez-x 5 роки тому
джерело
коміт
33197f1dac
2 змінених файлів з 15 додано та 18 видалено
  1. BIN
      slrboot.bin
  2. +15
    -18
      slrboot.nasm

+ 15
- 18
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

Завантаження…
Відмінити
Зберегти