How to read the first sector of master drive via ATA PIO?
Posted: Wed Jun 11, 2014 2:21 pm
I want to read the first sector of master drive via ATA PIO.
What is wrong with this code? This is my stage2 boot loader, I have full 64-bit environment before running this code.
What is wrong with this code? This is my stage2 boot loader, I have full 64-bit environment before running this code.
Code: Select all
section .text
use64
org 0x0000000000100000 ; Load address.
start:
mov al, 'A'
mov [0xB8000], al
mov edi, 0x200000
mov al, 0x40
out 0x1F6, al
mov al, 0x00
out 0x1F2, al
out 0x1F3, al
out 0x1F4, al
out 0x1F5, al
mov al, 0x01
out 0x1F2, al
mov al, 0x00
out 0x1F3, al
out 0x1F4, al
out 0x1F5, al
mov al, 0x24
out 0x1f7, al
rep insw
cli
hlt