Hi all!
I've bumped into a weird problem yesterday. I wanted to write some stuff to the last sector of the hard disk using ATA PIO, so I located the max addressable sectors from the output from the IDENTIFY command (got 0x40000), so I tried write to there. But bochs trowed me the error
Code: Select all
00039372670e[HD ] logical address out of bounds (1031438/262144) - aborting command
Code: Select all
[...]
Next at t=39372658
(0) [0x0000000081de] 0008:00000000000081de (unk. ctxt): out dx, al ; ee
<bochs:36> calc dx
0x1f3 499
<bochs:37> calc al
0xff 255
[...]
Next at t=39372662
(0) [0x0000000081e7] 0008:00000000000081e7 (unk. ctxt): out dx, al ; ee
<bochs:42> calc dx
0x1f4 500
<bochs:43> calc al
0xff 255
[...]
(0) [0x0000000081f0] 0008:00000000000081f0 (unk. ctxt): out dx, al ; ee
<bochs:48> calc dx
0x1f5 501
<bochs:49> calc al
0x3 3
[...]
Next at t=39372670
(0) [0x0000000081fb] 0008:00000000000081fb (unk. ctxt): out dx, al ; ee
<bochs:54> calc dx
0x1f7 503
<bochs:55> calc al
0x30 48
<bochs:56> s
Next at t=39372671
(0) [0x0000000081fc] 0008:00000000000081fc (unk. ctxt): mov edx, esi ; 89f2
<bochs:57> 00039372670e[HD ] logical address out of bounds (1031438/262144) - aborting command
Here is my code:
https://github.com/cheyao/AchieveOS/blo ... ain.c#L239