March 20th, 2012, 1:41
March 20th, 2012, 4:47
/* on Primary bus: ctrl->base =0x1F0, ctrl->dev_ctl =0x3F6. REG_CYL_LO=4, REG_CYL_HI=5, REG_DEVSEL=6 */
int detect_devtype (int slavebit, struct DEVICE *ctrl)
{
ata_soft_reset(ctrl->dev_ctl); /* waits until master drive is ready again */
outb(ctrl->base + REG_DEVSEL, 0xA0 | slavebit<<4);
inb(ctrl->dev_ctl); /* wait 400ns for drive select to work */
inb(ctrl->dev_ctl);
inb(ctrl->dev_ctl);
inb(ctrl->dev_ctl);
unsigned cl=inb(ctrl->base + REG_CYL_LO); /* get the "signature bytes" */
unsigned ch=inb(ctrl->base + REG_CYL_HI);
/* differentiate ATA, ATAPI, SATA and SATAPI */
if (cl==0x14 && ch==0xEB) return ATADEV_PATAPI;
if (cl==0x69 && ch==0x96) return ATADEV_SATAPI;
if (cl==0 && ch == 0) return ATADEV_PATA;
if (cl==0x3c && ch==0xc3) return ATADEV_SATA;
return ATADEV_UNKNOWN;
}March 20th, 2012, 6:38
March 20th, 2012, 13:16
March 20th, 2012, 21:17
JWCC wrote:Tried native? As in not a guest OS?
March 21st, 2012, 7:00
corner wrote:JWCC wrote:Tried native? As in not a guest OS?
The code was executed in a GUEST-OS, the error is Not a GUEST-OS BSOD. Looks like the Action broken the Virtualization of VMWare, then the VMWare was stop.
March 21st, 2012, 11:36
flykiller wrote:corner wrote:JWCC wrote:Tried native? As in not a guest OS?
The code was executed in a GUEST-OS, the error is Not a GUEST-OS BSOD. Looks like the Action broken the Virtualization of VMWare, then the VMWare was stop.
if you operate softest ,You port addr error!try 0x1fa
March 21st, 2012, 15:28
corner wrote:hi,all
with the code:
add dx, 0x7 //status
in al, dx
test al, (_STATUS_BSY_ | _STATUS_DRQ_)
I got the _STATUS_DRQ always is 0x1, never be cleared to ZERO..
What's wrong with my code ?(The port is correct! 1F0-1F7)
thx!
My SATA-Controller is oprating in PCI Compatibility Mode)
March 21st, 2012, 18:29
March 21st, 2012, 21:51
quasimodo wrote:1)Well 1F0-1F7 is correct for primary IDE.My SATA-Controller is oprating in PCI Compatibility Mode)
2)I would use IDE port and connect a IDE-SATA adapter.
3) I think trying to work with ASM in VMWare is asking for trouble, use a standalone system if you have the option.
corner wrote:hi,all
with the code:
add dx, 0x7 //status
in al, dx
test al, (_STATUS_BSY_ | _STATUS_DRQ_)
I got the _STATUS_DRQ always is 0x1, never be cleared to ZERO..
What's wrong with my code ?(The port is correct! 1F0-1F7)
thx!
March 21st, 2012, 23:16
guru wrote:use Victoria to check what port your SATA-Controller is mapped to
March 21st, 2012, 23:55
corner wrote:hi,all
with the code:
add dx, 0x7 //status
in al, dx
test al, (_STATUS_BSY_ | _STATUS_DRQ_)
I got the _STATUS_DRQ always is 0x1, never be cleared to ZERO..corner wrote:What's wrong with my code ?(The port is correct! 1F0-1F7)
thx!
The reason is there is no one IDE-hard-disk attached to ATA-Controller on my VMWare-Guest-OS. They are all SCSI-hard-disk.
THANKS ALL YOU ARE THE BEST!
in al, dx add dx, 0x7 //statusMarch 22nd, 2012, 1:45
quasimodo wrote:corner wrote:hi,all
with the code:
add dx, 0x7 //status
in al, dx
test al, (_STATUS_BSY_ | _STATUS_DRQ_)
I got the _STATUS_DRQ always is 0x1, never be cleared to ZERO..corner wrote:What's wrong with my code ?(The port is correct! 1F0-1F7)
thx!
The reason is there is no one IDE-hard-disk attached to ATA-Controller on my VMWare-Guest-OS. They are all SCSI-hard-disk.
THANKS ALL YOU ARE THE BEST!this should be the correct instruction, but I think you should be able to use ax as well, as long as your code continues to use the entire 16 bit register not just the lower half. but I am no expert on asm, so maybe someone else can confirm it for you.
- Code:
in al, dx
Also I would think you should use mov rather than add
- Code:
add dx, 0x7 //status
March 22nd, 2012, 2:01
March 22nd, 2012, 2:02
quasimodo wrote:this should be the correct instruction, but I think you should be able to use ax as well, as long as your code continues to use the entire 16 bit register not just the lower half. but I am no expert on asm, so maybe someone else can confirm it for you.
in ax, dxMarch 22nd, 2012, 2:06
March 22nd, 2012, 21:18
corner wrote:JWCC wrote:Tried native? As in not a guest OS?
The code was executed in a GUEST-OS, the error is Not a GUEST-OS BSOD. Looks like the Action broken the Virtualization of VMWare, then the VMWare was stop.
March 22nd, 2012, 21:59
JWCC wrote:This could be exploited for evil... hehe, pretty funny bug. Just execute these few bytes in a kernel module or something and WHAM, crash the debugging host as well as the virtualized guest in order to prevent white-hat reversing. Hopefully, there's a patch coming up that can prevent this malware trick.
JWCC wrote:Emulators are generally a poor substitute for real hardware when learning assembly or other low-level stuff. For an example, on the SNES there was a tool to add custom sounds/music to Super Mario World. It would cause the game to crash on a real system but worked fine in emulators! Lesson learned: Test this low-level stuff out on real hardware!
March 23rd, 2012, 3:25
March 23rd, 2012, 17:34
guru wrote:Victoria works with API or PIO or both?
Powered by phpBB © phpBB Group.