More work on the bootloader
This commit is contained in:
1 parent
b45ac1b6ca
commit
987dbcf24d
2 files changed
+6
-4
No files matched your search
BIN
Binary file not shown.
+6
-4
@@ -81,6 +81,7 @@ int 0x16
|
|||||||
boot_partition:
|
boot_partition:
|
||||||
; IMPORTANT bx, has to hold the value 1-4 for the partiotion that wanted to be booted.
|
; IMPORTANT bx, has to hold the value 1-4 for the partiotion that wanted to be booted.
|
||||||
|
|
||||||
|
mov bx, 1
|
||||||
mov ax, partition_1
|
mov ax, partition_1
|
||||||
.loop:
|
.loop:
|
||||||
cmp bx, 1
|
cmp bx, 1
|
||||||
@@ -90,6 +91,7 @@ mov ax, partition_1
|
|||||||
jmp .loop
|
jmp .loop
|
||||||
break:
|
break:
|
||||||
|
|
||||||
|
|
||||||
add ax, 8 ; This is the offset to fetch the LBA start adress of the partition record
|
add ax, 8 ; This is the offset to fetch the LBA start adress of the partition record
|
||||||
mov bx, ax
|
mov bx, ax
|
||||||
xor ax, ax
|
xor ax, ax
|
||||||
@@ -108,7 +110,7 @@ xor ax, ax
|
|||||||
mov ah, 0x42 ; READ
|
mov ah, 0x42 ; READ
|
||||||
mov dl, [disk_identifier]
|
mov dl, [disk_identifier]
|
||||||
int 0x13
|
int 0x13
|
||||||
|
;call dumpax
|
||||||
jc endcarrycheck ; An error ocurred when reading from disk.
|
jc endcarrycheck ; An error ocurred when reading from disk.
|
||||||
|
|
||||||
; If no error then jump to volume boot record
|
; If no error then jump to volume boot record
|
||||||
@@ -182,7 +184,6 @@ error_str db 'Error', 0
|
|||||||
boot_this_partition: dw 0
|
boot_this_partition: dw 0
|
||||||
disk_identifier db 0
|
disk_identifier db 0
|
||||||
|
|
||||||
|
|
||||||
DAPACK:
|
DAPACK:
|
||||||
.dap_Size: db 0x10 ; This is always 16 bytes (0x10)
|
.dap_Size: db 0x10 ; This is always 16 bytes (0x10)
|
||||||
.rev_byte: db 0x0 ; reserved byte, should always be zero
|
.rev_byte: db 0x0 ; reserved byte, should always be zero
|
||||||
@@ -203,12 +204,13 @@ partition_1:
|
|||||||
.start_LBA db 0x10, 0x00, 0x00, 0x00
|
.start_LBA db 0x10, 0x00, 0x00, 0x00
|
||||||
.size db 0x00, 0xC8, 0x03, 0x00
|
.size db 0x00, 0xC8, 0x03, 0x00
|
||||||
|
|
||||||
|
; sector number for 2.nd SingOS -> 16480
|
||||||
partition_2:
|
partition_2:
|
||||||
.active_partition db 0x00
|
.active_partition db 0x80
|
||||||
.start_CHS db 0x8C, 0x3E, 0x0F
|
.start_CHS db 0x8C, 0x3E, 0x0F
|
||||||
.disk_type db 0x83
|
.disk_type db 0x83
|
||||||
.end_CHS db 0xFF, 0xFF, 0xFF
|
.end_CHS db 0xFF, 0xFF, 0xFF
|
||||||
.start_LBA db 0x00, 0xD0, 0x03, 0x00
|
.start_LBA db 0x61, 0x40, 0x00, 0x00 ;0x00, 0xD0, 0x03, 0x00
|
||||||
.size db 0x00, 0x28, 0x1C, 0x03
|
.size db 0x00, 0x28, 0x1C, 0x03
|
||||||
|
|
||||||
partition_3:
|
partition_3:
|
||||||
|
|||||||
Reference in new issue
Block a user