Created
October 16, 2017 21:12
-
-
Save anonymous/40eb8a70cbf6acd310bc61f9fc170a47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Start of the second stage of the boot loader | |
Read_Sectors: | |
push cx | |
push ax | |
mov cx, 1 ; 1 Sector to read | |
mov ax, 0 | |
mov bx, 0D000h ; Set starting point for sector data | |
call ReadSectors | |
pop ax | |
pop cx | |
ret | |
Second_Stage: | |
mov [boot_device], dl ; Boot device number is passed in from first stage in DL. Save it to pass to kernel later. | |
mov si, second_stage_msg ; Output our greeting message | |
call Console_WriteLine_16 | |
call Read_Sectors | |
call Read | |
hlt | |
Read: | |
call Console_Write_Hex | |
mov bx, [0D000h+1] | |
call Console_Write_Hex | |
mov bx, [0D000h+2] | |
call Console_Write_Hex | |
mov bx, [0D000h+3] | |
call Console_Write_Hex |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment