[OpenBIOS] OpenBIOS documentation
Programmingkid
programmingkidx at gmail.com
Mon Oct 17 15:24:56 CEST 2016
On Oct 17, 2016, at 6:28 AM, BALATON Zoltan wrote:
> On Sun, 16 Oct 2016, Programmingkid wrote:
>> make USB work. This patch is an attempt to make USB work. It looks like changes were made to the original code to make it compile in OpenBIOS.
>
> Apart from integrating in OpenBIOS changes were needed to make it work on a big endian CPU as well.
>
>> These changes may have disabled the OHCI code.
>
> Not likely but I don't know what are you trying to do.
I'm trying to make the USB keyboard work. Using a simple command-line like this "qemu-system-ppc -usb -usb-kbd" does not appear to work. Nothing typed appears on the screen.
I noticed many of these kind of changes:
Original coreboot version:
ed_t *const periodic_ed = dma_memalign(sizeof(ed_t), sizeof(ed_t));
OpenBIOS version:
ed_t *const periodic_ed;
All of the dma_memalign() calls were removed. How did this code work with so many uninitialized pointers?
>> https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/ecec80e062f7efe32a9a17479dcf8cb678a4a98b/payloads/libpayload/drivers/usb/ohci.c
>> This page has very similar code to usbohci.c has.
>
> The usb driver in OpenBIOS was ported from the libpayload library of the coreboot project. Your link says third_party so this is not the official repo. Maybe a better source would be the upstream repository at coreboot.org rather than Google's copy of it although that seems to be a bit hard to browse without cloning because it's behind a patch management system. I've found this link now (not sure if it has any relevant differences to the above but this should be the upstream source):
>
> https://review.coreboot.org/cgit/coreboot.git
Thank you for this link.
>
>> Using this page I filled in what I thought were the missing function calls. My changes no longer allow OpenBIOS to boot, so consider this a work in progress for now.
>
> If this breaks it then it's likely not the correct fix. What was the problem in the first place this is trying to correct?
When compiling OpenBIOS with gcc 4.2.3, a lot of warnings were issued by the compiler:
CC target/drivers/usbohci.o
cc1: warnings being treated as errors
/Users/john/desktop/openbios/drivers/usbohci.c: In function ‘ohci_init’:
/Users/john/desktop/openbios/drivers/usbohci.c:230: warning: dereferencing type-punned pointer will break strict-aliasing rules
/Users/john/desktop/openbios/drivers/usbohci.c:237: warning: dereferencing type-punned pointer will break strict-aliasing rules
/Users/john/desktop/openbios/drivers/usbohci.c: In function ‘ohci_control’:
/Users/john/desktop/openbios/drivers/usbohci.c:382: warning: dereferencing type-punned pointer will break strict-aliasing rules
/Users/john/desktop/openbios/drivers/usbohci.c:397: warning: dereferencing type-punned pointer will break strict-aliasing rules
/Users/john/desktop/openbios/drivers/usbohci.c:432: warning: dereferencing type-punned pointer will break strict-aliasing rules
/Users/john/desktop/openbios/drivers/usbohci.c:448: warning: dereferencing type-punned pointer will break strict-aliasing rules
/Users/john/desktop/openbios/drivers/usbohci.c:455: warning: dereferencing type-punned pointer will break strict-aliasing rules
/Users/john/desktop/openbios/drivers/usbohci.c: In function ‘ohci_bulk’:
/Users/john/desktop/openbios/drivers/usbohci.c:511: warning: dereferencing type-punned pointer will break strict-aliasing rules
/Users/john/desktop/openbios/drivers/usbohci.c:549: warning: dereferencing type-punned pointer will break strict-aliasing rules
/Users/john/desktop/openbios/drivers/usbohci.c:562: warning: dereferencing type-punned pointer will break strict-aliasing rules
/Users/john/desktop/openbios/drivers/usbohci.c: In function ‘ohci_create_intr_queue’:
/Users/john/desktop/openbios/drivers/usbohci.c:656: warning: dereferencing type-punned pointer will break strict-aliasing rules
/Users/john/desktop/openbios/drivers/usbohci.c:666: warning: dereferencing type-punned pointer will break strict-aliasing rules
/Users/john/desktop/openbios/drivers/usbohci.c:679: warning: dereferencing type-punned pointer will break strict-aliasing rules
make[1]: *** [target/drivers/usbohci.o] Error 1
make: *** [subdir-ppc] Error 2
More information about the OpenBIOS
mailing list