Created
October 17, 2017 13:24
-
-
Save anonymous/d29a80b0b05840f8f34fd88bd7a1fa4e 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
Read_Sectors: | |
push ds | |
pop es | |
mov cx, 1 ; 1 Sector to read | |
mov ax, 0 | |
mov bx, bufor | |
call ReadSectors | |
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 | |
mov cx, 16 | |
call ReadLoop | |
hlt | |
ReadLoop: | |
mov bx, [bufor+1] | |
call Console_Write_Hex | |
loop ReadLoop | |
ret | |
second_stage_msg db 'Second stage of boot loader running', 0 | |
boot_device db 0 | |
ask_sector_num_msg db 'Enter the sector number to read:', 0 | |
bufor resb 512 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment