flat assembler
Message board for the users of flat assembler.

Index > OS Construction > scasi, pata, sata, pci, floppy, 1394...?

Thread Post new topic Reply to topic

Joined: 21 May 2010
Posts: 287
Im trying to understand now the relation between all devices (interfaces) used to connect hardware.

I know that cdroms are scsi, and signal is transported using pata or sata or scsi interfaces (calbe + controlers). Are hard drives simmilar?

Is there something like 'native' pata/sata?
Is pata/sata/floppy just a physical layer (no specyfied protocol of sending data, just data pins), and logical layer is scsi?

Are there any other protocols diffrent than scsi, or its just it, and can be used over any type of medium (sata/...)?

Is the floppy interface any diffrent, or its just a medium carrying scsi protocol?

Is the pci also only a physical medium, and devices are scsi? What is the relation between pci and usb?

i really need to know that, if i understand it correctly just say yes to all question, if no please give me a short explanation.
Post 19 Jan 2011, 08:42
View user's profile Send private message Reply with quote

Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
The short answer to all your questions is no.

SCSI (Small Computer Systems Interface) is just one of many peripheral interfaces, mainly used for CD's but there are also some SCSI hard drives about.

Older harddrives were IDE, then PATA and SATA.

Floppies are different again.

The PCI bus is different again, as is the older ISA it replaced, and the newer PCIe and AGP etc.

Most USB Host Controllers are devices mapped into the PCI configuration space. The USB HC's then communicate with the USB devices using a number of USB-defined protocols.

That's a quick overview but its a very big subject that will take a lot of reading on your part to get on top of it. Best to download some articles on SCSI etc and start reading, and if you want to really get into it you will have to start reading the technical specs, which run to 1000's of pages.

FAMOS - the first memory operating system
Post 19 Jan 2011, 10:01
View user's profile Send private message Visit poster's website Reply with quote

Joined: 20 Feb 2006
Posts: 4240
Location: 2018
there is a serious need of unification, at least at the documentation point of view.

i will work on it this week for the book. and post an english version of this doc here.
but it anounce to be hard because i first need to filter what is important, and what is not, in theses thousands of "world company style" documentations.
Post 19 Jan 2011, 12:05
View user's profile Send private message Visit poster's website Reply with quote

Joined: 21 May 2010
Posts: 287
Is that correct:

Every single device communicate using signal modulation. For example, ide device expose some control registers. Contents of each of those registers is constantly reported to controller via for example PATA cable. Controller takes care of mapping those registers (device must comply with maximum requirements of PATA) into address space, or io.

When i want to read or write port/mmio, its just simple transferring memory between al/eax and controller internal memory, simmilar (or exactly) to whats happening when accessing ram.

Controller and device constantly send thousands pulses per second depending on contents of a 'pin'. When i update devices register by means of out instruction, controller change pulse to match new contents of registers. Device detect this change, and invoke onwrite() respectivly. When device wants to write data, it do exactly the same, but its the controller that must update itself.

Thats my understanding of parallel bus. Correct?
What about serial bus? Here i cant just update signal modulation, because many registers must coresspond to 2 lines, so in order to update register i have to send its id before data, right?

What about irqls?
What about DMA?
I cant find dma/irql lines in fr example floppy interface. Is that mean that device itself doesnt generate interrupts and doesnt access memory directly? When it comes to serial bus, i can imagine that irql/dma signals are just 2 values passed before actual request, but what about parallel bus, when there is 1:1 mapping between bits and pins?

The PCI bus is different again,

i belive i read somewere about detecting pata devices, and i bet that its exactly same as pci ones, i get resources from pci enum and rest how its implemented doesnt matter, for now.
Post 19 Jan 2011, 17:46
View user's profile Send private message Reply with quote

Joined: 25 Aug 2004
Posts: 619
Floppy and hard/CD PATA drives are all connected to the ISA bus. On this bus there is a DMA controller that can be programmed to do a DMA transfer (interrupt driven) or you can simply do a Programmed IO (poll driven) transfer directly with the disk controller. Floppy has its own way of communicating, hard/CD can both use the same ATA interface but CD can also use ATAPI which has a different way of writing values.

In addition, you have the PCI bus which has a bridge controller to the ISA bus as well as an AHCI controller for hard/CD SATA/SCSI drives. This allows you to enumerate most hardware controllers with just the PCI bus using a simple probe routine. All USB controllers (OHCI/UHCI/XHCI) are present on the PCI bus as well.

When you probe these controllers, it will give you model, IO port and memory region information needed to interact with it; you can then use device specific (driver) code for more details about any connected devices and use them.

Hope that helps
Post 20 Jan 2011, 23:20
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.