Sourcecode Fortschritt


  • Mod

    Rev. 390:

    ehci.h/c u. usb.c: Umbenennungen und ein Ausgabefehler (Rev. 389: ein Statusbyte ausgewiesen, dass es gar nicht gibt) beseitigt

    Jetzt sieht das alles gut aus.


  • Mod

    Rev. 391:

    nur geringe Veränderungen in ehci/usb.c


  • Mod

    Rev. 392:

    ehci.c, usb.h/c: testweise Stringausgabe bei USB-Transfer
    ckernel.c: deskriptoren zuerst (Dank an +gjm+ für diesen Hinweis)

    http://www.lowlevel.eu/wiki/USB#Stringdescriptor

    Beispiele für Stringausgaben:

    Chico QEye (web cam)

    PrettyOS [Version 0.0.0.392]                               Console 6: EHCI Ports
    --------------------------------------------------------------------------------
    lang: 0409h                                                                     
    
    SETUP:  qTD Status: 00h                                                         
    
    IO   :  qTD Status: 00h                                                         
    
    USB status: 00000000h                                                           
    >>> Press key to go on with USB-Test. <<<                                       
    
    USB2: GET_DESCRIPTOR string, dev: 1 endpoint: 0 stringIndex: 1#                 
    1Ch 03h 43h 00h 68h 00h 69h 00h 63h 00h 6Fh 00h 00h 00h 00h 00h 00h 00h 00h 00h 
    00h 00h 00h 00h 00h 00h 00h 00h 00h 00h                                         
    length:            28           descriptor type:   3                            
    string: Chico                                                                   
    
    SETUP:  qTD Status: 00h                                                         
    
    IO   :  qTD Status: 50h                                                         
    qTD Status: Halted - serious error at the device/endpoint                       
    qTD Status: Babble (fatal error leads to Halted)                                
    USB status: 00000000h                                                           
    >>> Press key to go on with USB-Test. <<<                                       
    
    USB2: GET_DESCRIPTOR string, dev: 1 endpoint: 0 stringIndex: 2#                 
    20h 03h 51h 00h 45h 00h 79h 00h 65h 00h 20h 00h 00h 00h 00h 00h 00h 00h 00h 00h 
    00h 00h 00h 00h 00h 00h 00h 00h 00h 00h                                         
    length:            32           descriptor type:   3                            
    string: QEye                                                                    
    
    SETUP:  qTD Status: 00h                                                         
    
    IO   :  qTD Status: 50h                                                         
    qTD Status: Halted - serious error at the device/endpoint                       
    qTD Status: Babble (fatal error leads to Halted)                                
    USB status: 00000000h                                                           
    >>> Press key to go on with USB-Test. <<<                                       
    
    USB2: GET_DESCRIPTOR string, dev: 1 endpoint: 0 stringIndex: 3#                 
    00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 
    00h 00h 00h 00h 00h 00h 00h 00h 00h 00h                                         
    SETUP:  qTD Status: 00h
    

    Memor USB2. 110 (USB Memory Stick)

    PrettyOS [Version 0.0.0.392]                               Console 1: EHCI Ports
    --------------------------------------------------------------------------------
    
    IO   :  qTD Status: 00h                                                         
    
    USB status: 00000000h                                                           
    >>> Press key to go on with USB-Test. <<<                                       
    
    USB2: GET_DESCRIPTOR string, dev: 1 endpoint: 0 stringIndex: 1                  
    0Eh 03h 6Dh 00h 65h 00h 6Dh 00h 6Fh 00h 72h 00h 00h 00h 00h 00h 00h 00h 00h 00h 
    00h 00h 00h 00h 00h 00h 00h 00h 00h 00h                                         
    length:            14           descriptor type:   3                            
    string: memor                                                                   
    
    SETUP:  qTD Status: 00h                                                         
    
    IO   :  qTD Status: 50h                                                         
    qTD Status: Halted - serious error at the device/endpoint                       
    qTD Status: Babble (fatal error leads to Halted)                                
    USB status: 00000000h                                                           
    >>> Press key to go on with USB-Test. <<<                                       
    
    USB2: GET_DESCRIPTOR string, dev: 1 endpoint: 0 stringIndex: 2                  
    0Eh 03h 55h 00h 53h 00h 42h 00h 32h 00h 2Eh 00h 00h 00h 00h 00h 00h 00h 00h 00h 
    00h 00h 00h 00h 00h 00h 00h 00h 00h 00h                                         
    length:            14           descriptor type:   3                            
    string: USB2.                                                                   
    
    SETUP:  qTD Status: 00h                                                         
    
    IO   :  qTD Status: 50h                                                         
    qTD Status: Halted - serious error at the device/endpoint                       
    qTD Status: Babble (fatal error leads to Halted)                                
    USB status: 00000000h                                                           
    >>> Press key to go on with USB-Test. <<<                                       
    
    USB2: GET_DESCRIPTOR string, dev: 1 endpoint: 0 stringIndex: 3                  
    08h 03h 31h 00h 31h 00h 30h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 
    00h 00h 00h 00h 00h 00h 00h 00h 00h 00h                                         
    length:            8            descriptor type:   3                            
    string: 110                                                                     
    
    SETUP:  qTD Status: 00h                                                         
    
    Port: 1, device attached
    

    EDIT: Strings werden noch abgeschnitten!


  • Mod

    Rev. 393:

    - #define _SOUND_ (nur dann ertönt beep)
    - usbDevices als Array zum Festhalten der abgefragten Infos



  • Revision 394:

    - shell verbessert (Intern)
    - VC++-Projektfile repariert und Dateien etwas umsortiert
    - Sound per Default aktiviert
    - cdi-Header: Ein paar Kommentare umformatiert/übersetzt
    - Ein Zeichen am Bootscreen geändert für schönere Zentrierung
    - Verbesserungen im Userspace
    -- C und C++ Dummieprogramme vereinheitlicht
    -- neues Usermakefile: Erster Schritt analog zum Hauptmakefile
    -- userlib.hpp und userlib.h "synchronisiert"


  • Mod

    Rev. 395:

    USB-Device-Strings wurden noch abgeschnitten, jetzt werden 64 Byte transferiert, damit können Strings (64-2)/2 = 31 Zeichen lang sein.

    USB2: GET_DESCRIPTOR string, dev: 1 endpoint: 0 stringIndex: 1#
    12h 03h 4Ah 00h 65h 00h 74h 00h 46h 00h 6Ch 00h 61h 00h 73h 00h 68h 00h 00h 00h
    00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h
    00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h
    00h 00h 00h 00h
    length: 18 descriptor type: 3
    string: JetFlash

    SETUP: qTD Status: 00h

    IO : qTD Status: 00h

    USB status: 00000000h

    > Press key to go on with USB-Test. <<<

    USB2: GET_DESCRIPTOR string, dev: 1 endpoint: 0 stringIndex: 2#
    28h 03h 4Dh 00h 61h 00h 73h 00h 73h 00h 20h 00h 53h 00h 74h 00h 6Fh 00h 72h 00h
    61h 00h 67h 00h 65h 00h 20h 00h 44h 00h 65h 00h 76h 00h 69h 00h 63h 00h 65h 00h
    00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h
    00h 00h 00h 00h
    length: 40 descriptor type: 3
    string: Mass Storage Device

    SETUP: qTD Status: 00h

    IO : qTD Status: 00h

    USB status: 00000000h

    > Press key to go on with USB-Test. <<<

    USB2: GET_DESCRIPTOR string, dev: 1 endpoint: 0 stringIndex: 3#
    12h 03h 4Eh 00h 30h 00h 31h 00h 34h 00h 49h 00h 4Dh 00h 37h 00h 35h 00h 00h 00h
    00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h
    00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h
    00h 00h 00h 00h
    length: 18 descriptor type: 3
    string: N014IM75

    Jetzt kommt auch kein Babbling mehr.

    Babbling: When a device transmits more data on the USB than the host controller is expecting for this transaction, it is defined to be babbling. In general, this is called a Packet Babble. When a device sends more data than the Maximum Length number of bytes, the host controller sets the Babble Detected bit to a one and halts the endpoint if it is using a queue head


  • Mod

    Rev. 396:

    _USB_DIAGNOSIS_ eingeführt, um die Übersichtlichkeit zu erhöhren

    Allerdings inzwischen wieder USB-Transfer-Probleme auf real hardware, aber keine error. Dürfte an der beschleunigten Ausführung liegen.

    In VMWare ist noch alles ok:

    PrettyOS [Version 0.0.0.396]                               Console 1: EHCI Ports
    --------------------------------------------------------------------------------
    
    >>> >>> function: resetPort 1                                                   
    
    >>> Status of USB Ports <<<                                                     
    port 1: 00001005h, line: 00h  SE0,power on, enabled, EHCI owned                 
    USB specification: 2.0          USB class:         0000h                        
    USB subclass:      0000h        USB protocol       0000h                        
    max packet size:   64           vendor:            1516h                        
    product:           8628h        release number:    2.0                          
    manufacturer:      0001h        product:           0002h                        
    serial number:     0003h        number of config.: 1                            
    
    total length:         32        number of interfaces: 1                         
    ID of config:         0001h     ID of config name     0000h                     
    remote wakeup:        no        self-powered:         no                        
    max power (mA):       100                                                       
    interface number:     0         alternate Setting:    0                         
    number of endpoints:  2         interface class:      8                         
    interface subclass:   6         interface protocol:   80                        
    interface:            0000h                                                     
    endpoint in/out:   in           endpoint number:   1                            
    attributes:        02h          max packet size:   512                          
    interval:          0                                                            
    endpoint in/out:   out          endpoint number:   2                            
    attributes:        02h          max packet size:   512                          
    interval:          0                                                            
    
    language code: 0409h                                                            
    
    memory                                                                          
    
    USB2.0                                                                          
    
    110
    

  • Mod

    Rev. 397:

    - Optische Darstellung von device, config, interface, endpoint besser strukturiert
    - Warteschleife am Ende eines USB-Transfers eingefügt für real Hardware


  • Mod

    Rev. 398:

    - config descriptor wird nun komplett durchkämmt, teilweise sind noch unbekannte
    Descriptoren enthalten


  • Mod

    Rev. 399:

    ehci_install geschaffen (aus pci.c ausgelagert nach ehci.c)



  • Revision 400:

    - shared_pages.h gelöscht (überflüssig)
    - userlib.c: kleine Umsortierung
    - Code von pci.c nach rtl8139.c verlegt
    - weitere Kleinigkeiten


  • Mod

    Rev. 401:

    modul usb_hc.h/c geschaffen, um pci.c weiter zu "verschlanken".


  • Mod

    Rev. 402:

    - Rechtschreibfehler beseitigt (thx to +gjm+)
    - auskommentierten Code in pci.c gestrichen


  • Mod

    Rev. 403:

    - void usbTransferSetConfiguration(uint32_t device, uint32_t configuration);
    - uint8_t usbTransferGetConfiguration(uint32_t device);
    - endpoint aus der Parameterliste der usb-Funktionen genommen, wenn sinnlos (z.B. wenn endpoint=0)

    Test bezüglich Konfigurationen (code auszugsweise):
    abfragen, auf 2 setzen, abfragen, auf 1 setzen, abfragen

    if (USBtransferFlag && enabledPortFlag && (pOpRegs->PORTSC[j] & (PSTS_POWERON | PSTS_ENABLED | PSTS_CONNECTED)))
    {
        uint8_t devAddr = usbTransferEnumerate(j);
        usbTransferDevice(devAddr); // device address, endpoint=0
        usbTransferConfig(devAddr); // device address, endpoint 0
        usbTransferString(devAddr); // device address, endpoint 0
    
        for(int k=1; k<4;k++) // fetch 3 strings
        {
            usbTransferStringUnicode(devAddr,k);
        }
    
        printf("\nconfig: %d",usbTransferGetConfiguration(devAddr));
    
        usbTransferSetConfiguration(devAddr, 2);
    
        printf("\nconfig: %d",usbTransferGetConfiguration(devAddr));
    
        usbTransferSetConfiguration(devAddr, 1);
    
        printf("\nconfig: %d",usbTransferGetConfiguration(devAddr));
    }
    

    Anmerkung: Dieses printf("\n\n\n") ist leider notwendig weil die Konsole auch in den Info-Bereich schreibt.


  • Mod

    Rev. 404:

    - Kleine Korrektur: Konsolenbereich und Info area gegen einander geschützt (thx to MrX)



  • Revision 405:

    - Infobereich ausgebaut: Fkt. writeInfo zum beschreiben, showInfo um festzulegen, ob der Infobereich in der Konsole angezeigt werden soll


  • Mod

    Rev. 406

    Bulk-Only Mass Storage Reset eingefügt
    (siehe: Universal Serial Bus Mass Storage Class Bulk-Only Transport, rev. 1.0, 1999)

    PrettyOS [Version 0.0.0.406]                               Console 1: EHCI Ports
    --------------------------------------------------------------------------------
    numInterfaceMSD:   0                                                            
    
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''          
    total length:         32        number of interfaces: 1                         
    ID of config:         0001h     ID of config name     0000h                     
    remote wakeup:        no        self-powered:         no                        
    max power (mA):       100                                                       
    
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''          
    interface number:     0         alternate Setting:    0                         
    number of endpoints:  2         interface class:      8                         
    interface subclass:   6         interface protocol:   80                        
    interface:            0000h                                                     
    
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''          
    endpoint in/out:   in           endpoint number:   1                            
    attributes:        02h          max packet size:   512                          
    interval:          0                                                            
    
    >>> Press key to go on with data analysis from config descriptor. <<<           
    
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''          
    endpoint in/out:   out          endpoint number:   2                            
    attributes:        02h          max packet size:   512                          
    interval:          0                                                            
    
    length: 0 type: 0 unknown                                                       
    
    >>> Press key to go on with data analysis from config descriptor. <<<           
    
    language: German                                                                
    memory                                                                          
    USB2.0                                                                          
    110                                                                             
    
    USB2: SET_CONFIGURATION 1                                                       
    USB2: GET_CONFIGURATION                                                         
    config: 1                                                                       
    dev: 1 MSDinterface: 0 ==> BulkOnlyMassStorageReset                             
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''          
    USB status: 00000000h                                                           
    >>> Press key to close this console. <<<                                        
    --------------------------------------------------------------------------------
    Port: 1, device attached
    

  • Mod

    Rev. 407:

    - uint8_t usbTransferBulkOnlyGetMaxLUN(uint32_t device, uint8_t numInterface)


  • Mod

    Rev. 408:

    Fehler korrigiert in usb2.c

    3 getestete USB-Sticks haben LUN = 0, während mein card reader LUN = 3 zeigt.


  • Mod

    Rev. 409:

    Zwischenschritt
    ehci/usb: SCSI Command: "test unit ready" (0x00) und Antwort im Statusword

    realPC:

    PrettyOS [Version 0.0.0.409]                               Console 1: EHCI Ports
    --------------------------------------------------------------------------------
    
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''          
    endpoint in/out:   out          endpoint number:   2                            
    attributes:        02h          max packet size:   512                          
    interval:          0                                                            
    
    length: 0 type: 0 unknown                                                       
    
    >>> Press key to go on with data analysis from config descriptor. <<<           
    
    language: German                                                                
    memory                                                                          
    USB2.0                                                                          
    110                                                                             
    
    USB2: SET_CONFIGURATION 1                                                       
    USB2: GET_CONFIGURATION 1                                                       
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''          
    Max. Logical Unit Numbers: 0                                                    
    USB status: 00000000h                                                           
    dev: 1 MSDinterface: 0 ==> BulkOnlyMassStorageReset                             
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''          
    USB status: 00000000h                                                           
    55h 53h 42h 43h 42h 42h 42h 42h 00h 00h 00h 00h 00h 00h 06h 00h 00h 00h 00h 00h 
    00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h                                     
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''          
    IO:     qTD Status: 01h                                                         
    qTD Status: Do Ping                                                             
    USB status: 00002000h                                                           
    Reclamation                                                                     
    >>> Press key to go on with USB-Test. <<<                                       
    
    timeout - no STS_USBINT set!                                                    
    55h 53h 42h 53h 00h 00h 00h 00h 00h 00h 00h 00h 00h                             
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''          
    IO:     qTD Status: 80h                                                         
    qTD Status: Active - HC transactions enabled                                    
    USB status: 00002000h                                                           
    Reclamation                                                                     
    >>> Press key to go on with USB-Test. <<<                                       
    
    >>> Press key to close this console. <<<                                        
    --------------------------------------------------------------------------------
    Port: 1, device attached
    

    Do Ping <--- TODO

    Auch bei VMWare noch "timeout - no STS_USBINT set!"
    Erfolg wird sichtbar, wenn das von uns im Kommando gewählte Tag "42424242h" im Statusword an gleicher Stelle wiederholt wird. 😉


Anmelden zum Antworten