1 / 19

Drivers para Mac OS X

Drivers para Mac OS X. Pedro Alós Bianchi & Tomás Grimm Programação de Periféricos - FACIN Pontifícia Universidade Católica do Rio Grande do Sul - Porto Alegre. Definição.

misty
Download Presentation

Drivers para Mac OS X

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Drivers para Mac OS X • Pedro Alós Bianchi & Tomás Grimm • Programação de Periféricos - FACIN • Pontifícia Universidade Católica do Rio Grande do Sul - Porto Alegre

  2. Definição • Drivers são arquivos carregados no kernel de um sistema para que os dispositivos ligados ao computador consigam fazer a comunicação dispositivo <=> computador com a maior eficiência possível, uma vez que os drivers são proprietários na maior parte dos casos. 2

  3. Arquitetura do Mac OS X 3

  4. Núcleo MAC OS X • Darwin é o núcleo do sistema operacional Mac OS X da Apple, e roda em um kernel Open Source chamado XNU. Trata-se de um kernel híbrido que integra código do kernel Mach e também do FreeBSD. 4

  5. Processos do kernel • São os processos criados e administrados em modo root, os quais fazem parte do gerenciamento dos recursos da máquina. • Exemplos: update, securityd, notifyd, hidd, kernel_task, coreaudiod, configd, 5

  6. Processos de usuário • Criados pelos usuários ou pela aplicações abertas. • Fazem parte deste grupo todos os aplicativos disponíveis para os usuários e também todos os processos criados por eles. 6

  7. I/O kit • É um framework open-source do kernel que ajuda no desenvolvimento de device drivers para o MAC OS X. 7

  8. Recursos disponibilizados no I/O Kit • Serial • Armazenamento • USB • Bonjour • Gráficos e Imagens • Hardware Apple • Segurança • Redes • Open Firmware • PCI e PC card • Desempenho • Impressoras • QuickTime • Scanners • SCSI • Acessibilidade • Airport / 802.11 • ATA • Audio • Bluetooth • Ethernet • Fibra Óptica • FireWire • Mac OS X Server 8

  9. Estrutura I/O kit 9

  10. Kernel Extension • O KEXT funciona como o carregador e linkador do kernel. Quando um dispositivo é ligado, o I/O Kit procura o driver certo pra ele e o KEXT carrega pro kernel que carrega todas as bibliotecas que o driver (ou a extensão) precisam. 10

  11. Kernel Extension • Kextload – Carrega uma kernel extension (driver). • Kextunload – Se possível, descarrega uma kernel extension. • Kextstat – informa as características dos drivers ou outras kernel extensions que estão carregados. 11

  12. Drivers e Nubs • A estrutura chamada NUB funciona como um host do barramento, seja ele PCI, USB, SCSI, ou qualquer outro, e ele faz a intermediação do hardware com o driver do dispositivo. 12

  13. Drivers e Nubs 13

  14. Drivers e Nubs • IONetworkStack (interface managing object) - Connects I/O Kit objects to the BSD networking facilities. • IOEthernetInterface (nub) - Manages device-independent data transmission and reception. • Controller Driver (driver) - Operates the Ethernet controller through the IOPCIDevice object. This object inherits from a networking family class called IOEthernetController. 14

  15. Drivers e Nubs • IOPCIDevice (nub) - Match point for the controller; provides basic PCI bus interaction to the controller. • IOPCIBridge (driver) - Manages the PCI bus. (Other objects provide services to the IOPCIBridge; their specific identities depend on the hardware configuration.) 15

  16. Drivers e Nubs (Exemplo) 16

  17. Drivers e Nubs (Exemplo) • 1. The PCI bus controller driver, a member of the PCI family, discovers a PCI device and announces its presence by creating a nub (IOPCIDevice). • 2. The nub identifies (matches) an appropriate device driver—in this case, a SCSI controller driver—and requests that it be loaded. Loading the SCSI controller driver causes the SCSI Parallel family, and all families that it depends on, to be loaded as well. The SCSI controller driver is given a reference to the IOPCIDevice nub. 17

  18. Drivers e Nubs (Exemplo) • 3. The SCSI controller driver, which is a client of the PCI family and a provider of SCSI Parallel family services, scans the SCSI bus for devices that might be clients of these services. Upon finding such a device (a disk), the driver announces the device’s presence by creating a nub (IOSCSIDevice). • 4. The nub, by going through the matching procedure, finds a device driver (a disk driver) that is appropriate for the device and requests that this driver be loaded. Loading the disk driver causes the Storage family, and all families that it depends on, to be loaded as well. The disk driver is now a client of the SCSI Parallel family and a member of the Storage family. The disk driver is given a reference to the IOSCSIDevice nub. 18

  19. Referências • Website da Apple Developers Connection: • http://developer.apple.com/referencelibrary/HardwareDrivers/ • http://developer.apple.com/documentation/DeviceDrivers • Biblioteca para desenvolvimento I/O kit 19

More Related