ATA_IDENTIFY

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
ahmedfme
Posts: 9
Joined: Wed Mar 30, 2016 7:02 am
Libera.chat IRC: ahmedfme

Re: ATA_IDENTIFY

Post by ahmedfme »

alexg wrote:You said you are not running your OS on Bochs, what are you running it on?

I've just ran my OS on a real machine and the ATA registers are not exposed by the IDE controller at the standard locations and I have to read the values from the PCI IDE Controller bars (see http://wiki.osdev.org/PCI_IDE_Controller).

Edit: also make sure from your BIOS that the SATA configuration mode is set to IDE and not ACHI.
I am using virtual box or VMware .
Values in PCI BARS is zeros and this mean the controller is using the default ports.
ahmedfme
Posts: 9
Joined: Wed Mar 30, 2016 7:02 am
Libera.chat IRC: ahmedfme

Re: ATA_IDENTIFY

Post by ahmedfme »

omarrx024 wrote:Well, writing 0xA0 and 0xB0 for the master and slave respectively works on Bochs, QEMU, VMware, VirtualBox, one real ATA hard drive and a SATA hard drive with IDE emulation.
Well, I have developed a small port operations shell which I am using to input and output to and from ports step by step to understand what is going on .
setting the drive is working file . But as soon as sending identify command the system freeze.
Tomorrow I will write here the results I get from status ports after each operation.

Even I tried to reset the controller before selecting the drive and still freeze after sending identify command.
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: ATA_IDENTIFY

Post by BrightLight »

neon responded to you about the boot loader problem. Fix it and run it in Bochs.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: ATA_IDENTIFY

Post by neon »

Hello,

We can just release a copy of the new boot loader which doesn't use it. It'll just take a day or so if you really want to try it. We use it fine with Bochs and Virtual Box so it should work. Since your kernel is multi-boot compatible, you shouldn't need to change anything. My concern is that we have to recommend updating once the actual beta is out. Let us know what you want to do.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
ahmedfme
Posts: 9
Joined: Wed Mar 30, 2016 7:02 am
Libera.chat IRC: ahmedfme

Re: ATA_IDENTIFY

Post by ahmedfme »

this is screenshot of my ports manual examination shows the values of 0x1f1,0x1f7,0x3f6 before and after selecting the drive and freeze after sending 0xec to 0x1f7.

Image
Attachments
ide-ports.jpg
ahmedfme
Posts: 9
Joined: Wed Mar 30, 2016 7:02 am
Libera.chat IRC: ahmedfme

Re: ATA_IDENTIFY

Post by ahmedfme »

neon wrote:Hello,
I have tried but unfortunately Bochs can't loade my bootloader "Neptune" because it doesn't support int 15h Function AX=0088
It should be noted that this was a copy of our old boot loader, which used int 15h function 88h to calculate the mem_lower and mem_upper fields of the multiboot information structure. The boot loader uses int 15h function e820h for the memory map fields which is what you really want. So, if you want to suppress the error, clear bit 0 of the multiboot header flags field. This will tell the boot loader to ignore the mem_* fields. In any case though, the software should still continue to run despite the error.
i tried this just now and still the same crash ..
the flags value was
#define MULTIBOOT_HEADER_FLAGS 0x00010003
so i changed to
#define MULTIBOOT_HEADER_FLAGS 0x00010002
ahmedfme
Posts: 9
Joined: Wed Mar 30, 2016 7:02 am
Libera.chat IRC: ahmedfme

Re: ATA_IDENTIFY

Post by ahmedfme »

[quote="alexg"]You said you are not running your OS on Bochs, what are you running it on?

I've just ran my OS on a real machine and the ATA registers are not exposed by the IDE controller at the standard locations and I have to read the values from the PCI IDE Controller bars (see http://wiki.osdev.org/PCI_IDE_Controller).

Edit: also make sure from your BIOS that the SATA configuration mode is set to IDE and not ACHI.[/quot

as i told you PCI BARS is zeros as below:
Image
Attachments
PCI.jpg
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: ATA_IDENTIFY

Post by BrightLight »

You have to set the LBA and sector count registers to zero before sending IDENTIFY.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
Post Reply