File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -80,9 +80,18 @@ check_int13h_extensions:
80
80
load_rest_of_bootloader_from_disk:
81
81
lea eax , _rest_of_bootloader_start_addr
82
82
83
- # start of memory buffer
83
+ # dap buffer segment
84
+ mov ebx , eax
85
+ shr ebx , 4 # divide by 16
86
+ mov [ dap_buffer_seg ], bx
87
+
88
+ # buffer offset
89
+ shl ebx , 4 # multiply by 16
90
+ sub eax , ebx
84
91
mov [ dap_buffer_addr ], ax
85
92
93
+ lea eax , _rest_of_bootloader_start_addr
94
+
86
95
# number of disk blocks to load
87
96
lea ebx , _rest_of_bootloader_end_addr
88
97
sub ebx , eax # end - start
@@ -99,6 +108,9 @@ load_rest_of_bootloader_from_disk:
99
108
mov ah , 0x42
100
109
int 0x13
101
110
jc rest_of_bootloader_load_failed
111
+
112
+ # reset segment to 0
113
+ mov word ptr [ dap_buffer_seg ], 0
102
114
103
115
jump_to_second_stage:
104
116
lea eax , [ stage_2 ]
You can’t perform that action at this time.
0 commit comments