PrettyOS-questions



  • Hi,

    I speak only little german.
    I am implementing USB in my OS by the USB-book (Lunt) and PrettyOS.
    1. In PrettyOS (EHCI), the USBStatus register gets cleared by writing zero to it in ehci_startHC, but the relevant bits are write-clear (WC) in the Status register.
    Is this a bug or I have overlooked something 🙂 ?

    2. The other thing I don't understand is that in ehci_checkPortLineStatus() the code checks bit0 of PortSC register (Current Connect Status) but without Powering he port on first it will always be zero. The port gets Powered on only later in the code.
    Can anybody explain it to me?

    Regards,
    Rob


  • Mod

    1. you are right! "Software sets a bit to 0 in this register by
      writing a 1 to it." This is valid only for the bits 5:0. Moreover, bits 11:6 and bits 31:16 are reserved, and bits 15:12 are read-only. bit 12 shoud be set to 1 (HALTED) at start.

    Therefore, our e->OpRegs->USBSTS = 0x00000000; is not useful!
    Hence, we set it to: 0000 0000 0000 0000 0001 0000 0011 1111 = 0x0000103F

    1. ehci_checkPortLineStatus is a general function that really works, if portstatus is connected. We use it in ehci_portCheck, only if the portstatus is connected. We use it in ehci_enablePorts. Here it might be useless.

Anmelden zum Antworten