Page 1 of 1
hard disk in Bochs
Posted: Fri May 20, 2011 7:07 am
by nicola
is the hard disk type emulated by Bochs ATA (IDE) or SATA?
or they are just the same in the sense of accessing it from assembly?
and is it possible to access SATA using AHCI in Bochs?
Re: hard disk in Bochs
Posted: Fri May 20, 2011 7:42 am
by nicola
i found in bochs config file for image:
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=disk, mode=flat, translation=auto, path=......
this means bochs emulating ATA (IDE).
but any example in assembly of accessing ATA (without using interrupts)?
Re: hard disk in Bochs
Posted: Fri May 20, 2011 8:22 am
by thepowersgang
Please, search the wiki before posting on the forums. All your questions are answered on the wiki
Look up the ATA PIO article.
Re: hard disk in Bochs
Posted: Fri May 20, 2011 8:33 am
by nicola
i typed "ata pio" into the search box of osdev wiki but none found,
luckily searching that phrase by google gives me the link to that "ATA PIO Mode"
tks thepowersgang
Re: hard disk in Bochs
Posted: Fri May 20, 2011 2:16 pm
by Brendan
Hi,
nicola wrote:is the hard disk type emulated by Bochs ATA (IDE) or SATA?
or they are just the same in the sense of accessing it from assembly?
and is it possible to access SATA using AHCI in Bochs?
The
"features" section of the Bochs user manual says exactly what Bochs supports.
However, you wouldn't need to know unless you're ready to start writing a driver for the disk controller; and if you're ready to start writing a driver for the disk controller then you must've already done code to scan PCI buses and detect which PCI devices are present, which means your own software can tell you what sort of PCI device the disk controller is.
Note: If a computer (including Bochs if configured without the i440FX PCI chipset) doesn't support PCI at all, then you'd have to probe for old ISA devices during your "hardware auto-detection" phase. PCI was introduced a long time before SATA existed, so all SATA controllers use some sort of PCI bus, and you can assume that if there's no PCI there's no SATA.
Basically, if you need to ask what sort of disk controller is present, then you don't need to ask what sort of disk controller is present yet, and you've overlooked a fundamental piece of the OS (hardware auto-detection).
nicola wrote:or they are just the same in the sense of accessing it from assembly?
SATA controllers can have 2 different modes - "legacy mode" where they emulate PATA, and "AHCI" where they don't emulate PATA. If the SATA controller doesn't support legacy mode then you have to support AHCI, and if the SATA controller does support "legacy mode" then it'd be better to switch it to "AHCI".
Cheers,
Brendan