Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change 1st stage int 13h addressing #123

Merged
merged 1 commit into from
Jul 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/stage_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,18 @@ check_int13h_extensions:
load_rest_of_bootloader_from_disk:
lea eax, _rest_of_bootloader_start_addr

# start of memory buffer
# dap buffer segment
mov ebx, eax
shr ebx, 4 # divide by 16
mov [dap_buffer_seg], bx

# buffer offset
shl ebx, 4 # multiply by 16
sub eax, ebx
mov [dap_buffer_addr], ax

lea eax, _rest_of_bootloader_start_addr

# number of disk blocks to load
lea ebx, _rest_of_bootloader_end_addr
sub ebx, eax # end - start
Expand All @@ -99,6 +108,9 @@ load_rest_of_bootloader_from_disk:
mov ah, 0x42
int 0x13
jc rest_of_bootloader_load_failed

# reset segment to 0
mov word ptr [dap_buffer_seg], 0

jump_to_second_stage:
lea eax, [stage_2]
Expand Down