<div dir="ltr"><div>Dear Ragu,</div><div><br></div><div>I am tring to add HID, wireless LAN code from freeBSD 9.2 original code.</div><div>Also, my work is manual without freebsd-to-rtems.py.</div><div><br></div><div>I want to share my working code for all.</div><div>also, I would like to receive a advice from helper.</div><div><br></div><div>After I added HID(mouse, keyboard) and WirelessLAN(interface files), I modifed usb-sysinit.h in testsute/usb01 and rtems-bsd-sysinit.h in rtemsbsd/include/machine for building usb testesuite for HID only.</div><div><br></div><div>< rtems-bsd-sysinit.h ></div><div>#define SYSINIT_NEED_USB_MOUSE \<br> SYSINIT_DRIVER_REFERENCE(ums, uhub)</div><div>#define SYSINIT_NEED_USB_KEYEBOARD \<br> SYSINIT_DRIVER_REFERENCE(ukbd, uhub)</div><div><br></div><div>< usb-sysinit.h ></div><div>SYSINIT_NEED_USB_MOUSE;<br>SYSINIT_NEED_USB_KEYEBOARD;</div><div><br></div><div>At this time, there are undefined reference errors in linking phase about below functions.</div><div>1. ukbd.c : kern_yeild</div><div>2. ums.c : usb_fifo_detach, usb_fifo_softc, usb_fifo_free_buffer, usb_fifo_put_data_linear, usb_fifo_put_bytes_max, usb_fifo_attach, usb_fifo_reset</div><div>3. kbd.c : _bsd__start_set_kbddriver_set, _bsd__stop_set_kbddriver_set</div><div><br></div><div>My review until now is below;</div><div>1. ukbd.c</div><div> - kern_yeild : It should be implemented for rtems.</div><div>2. ums.c </div><div> - usb_dev.c sour include usb_fifo_detach, usb_fifo_softc, usb_fifo_free_buffer, usb_fifo_put_data_linear, usb_fifo_put_bytes_max, usb_fifo_attach, usb_fifo_reset function. also, libbsd.a library include usb_dev.c.</div><div> - I don't know why these functions in usb_dev.c are not linked in my case.</div><div>3. kdb.c</div><div> - I think that _bsd__start_set_kbddriver_set, _bsd__stop_set_kbddriver_set functions are made when SYSINIT_DRIVER_REFERENCE(ukbd, uhub) is processed.</div><div> - but, I don't know why these functions is not linked.</div><div><br></div><div>Please could you advise me ?</div><div><br></div><div>Best Regards,</div><div>Thomas<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-08-27 1:05 GMT+09:00 ragu nath <span dir="ltr"><<a href="mailto:ragunath3252@gmail.com" target="_blank">ragunath3252@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Thomas,<br>
<br>
There is no need to manually edit the makefile. You can add whatever<br>
files you need from freebsd to libbsd.py file.<br>
I can see, there is already a dev_usb_input module. It is currently<br>
disabled. You can just enable it & add additional files to it if you<br>
need.<br>
<br>
Then you run the freebsd-to-rtems.py which will make makefile &<br>
wscript modifications. I was advised to use this method instead of<br>
manually modifying the makefile.<br>
<br>
"python freebsd-to-rtems.py -m" command will make the changes.<br>
<br>
I am not sure how to get source files from freebsd using the scripts.<br>
What I did was, I copied the necessary files to rtems-libbsd/freebsd<br>
directory. Then I added those files to libbsd.py & ran<br>
freebsd-to-rtems.py. Now you have the source files & makefile changes.<br>
Now you can compile & start your porting work. As mentioned by yurii,<br>
you can see my blog post on<br>
<a href="http://ragustechblog.blogspot.in/2015/06/porting-driver-from-freebsd-to-rtems.html" target="_blank" rel="noreferrer">http://ragustechblog.blogspot.in/2015/06/porting-driver-from-freebsd-to-rtems.html</a><br>
which has some useful details<br>
<br>
Note: If I run the freebsd-to-rtems.py script it is copying all the<br>
files from freebsd to rtems. I could not import specific file/files.<br>
<br>
<br>
Thanks,<br>
Ragunath<br>
<br>
<br>
><br>
> Message: 1<br>
> Date: Wed, 26 Aug 2015 15:55:29 +0900<br>
> From: Thomas Kim <<a href="mailto:thomas73.kim@gmail.com">thomas73.kim@gmail.com</a>><br>
> To: Yurii Shevtsov <<a href="mailto:ungetch@gmail.com">ungetch@gmail.com</a>><br>
> Cc: "<a href="mailto:devel@rtems.org">devel@rtems.org</a>" <<a href="mailto:devel@rtems.org">devel@rtems.org</a>><br>
> Subject: Re: libbsd - USB Host Stack for HID, WirelessLAN<br>
> Message-ID:<br>
> <<a href="mailto:CADY8aTBTD-ZrquRCUfH_7uk9wyZxWcJhEqigHPMdD69-5UGzRA@mail.gmail.com">CADY8aTBTD-ZrquRCUfH_7uk9wyZxWcJhEqigHPMdD69-5UGzRA@mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="utf-8"<br>
><br>
> Dear Yurii,<br>
><br>
> Thank you for your kindly reply.<br>
><br>
> At this time, I built lastest libbsd successfully.<br>
> Also, I am tring to add USB input files in freebsd\sys\dev\usb\input.<br>
><br>
> Question 1)<br>
> As I guess, I think that I should modify Makefile, wscript file. also, I<br>
> should modify USB input files(atp.c, uep.c, uhid.c, uknd.c, ums.c, etc)<br>
> according to "Rules for Modifing FreeBSD source".<br>
> Is it correct ?<br>
><br>
> Question 2)<br>
> As I test freebsd-to-rtems.py, it just move the ported FreeBSD code only<br>
> from FreeBSD 9.2 original code to libbsd Freebsd. that is,<br>
> freebsd-to-rtems.py is not used for changing additional new files from<br>
> FreeBSD 9.2 original code automatically.<br>
> Is it correct ?<br>
><br>
> Question 3)<br>
> As I check libbsd.py file, there is below definitions.<br>
> - def dev_usb_input(mm):<br>
> - def dev_usb_mouse(mm):<br>
><br>
> Is there how to use libbsd.py for adding new files(source, header files)<br>
> easily ?<br>
> Or, I want to know that libbsd.py file is used for which purpose.<br>
><br>
> Best Regards,<br>
> Thomas<br>
><br>
> 2015-08-25 19:19 GMT+09:00 Yurii Shevtsov <<a href="mailto:ungetch@gmail.com">ungetch@gmail.com</a>>:<br>
><br>
>><br>
>><br>
>> 2015-08-25 12:10 GMT+03:00 Thomas Kim <<a href="mailto:thomas73.kim@gmail.com">thomas73.kim@gmail.com</a>>:<br>
>><br>
>>> Dear Yurii,<br>
>>><br>
>>> Thank you very much.<br>
>>><br>
>>> I want to review freeBSD source code.<br>
>>><br>
>>> Please let me know where is libbsd's README file. there is not README<br>
>>> file in current tree (<a href="https://git.rtems.org/rtems-libbsd/tree/" target="_blank" rel="noreferrer">https://git.rtems.org/rtems-libbsd/tree/</a>).<br>
>>> I want to check "Rules for Modiying FreeBSD source" in REAME file.<br>
>>><br>
>> <a href="https://github.com/RTEMS/rtems-libbsd/blob/master/libbsd.txt" target="_blank" rel="noreferrer">https://github.com/RTEMS/rtems-libbsd/blob/master/libbsd.txt</a><br>
>><br>
>>><br>
>>> Also, I want to compare FreeBSD original code and the modified FreeBSD<br>
>>> code.<br>
>>> I guess that FreeBSD original code version is 8.x.<br>
>>><br>
>> it's actually 9.2 (from the readme)<br>
>><br>
>>><br>
>>> Please let me know how to get FreeBSD original code version which was<br>
>>> used for libbsd porting work.<br>
>>><br>
>> <a href="https://svnweb.freebsd.org/base/release/9.2.0/" target="_blank" rel="noreferrer">https://svnweb.freebsd.org/base/release/9.2.0/</a> It's Subversion<br>
>> <a href="https://www.freebsd.org/doc/handbook/svn.html" target="_blank" rel="noreferrer">https://www.freebsd.org/doc/handbook/svn.html</a><br>
>><br>
>>><br>
>>> Best Regards,<br>
>>> Thomas.<br>
>>><br>
>>> 2015-08-21 23:57 GMT+09:00 Yurii Shevtsov <<a href="mailto:ungetch@gmail.com">ungetch@gmail.com</a>>:<br>
>>><br>
>>>> Hi)<br>
>>>><br>
>>>> For porting guide check this blogpost<br>
>>>><br>
>>>> <a href="http://ragustechblog.blogspot.in/2015/06/porting-driver-from-freebsd-to-rtems.html" target="_blank" rel="noreferrer">http://ragustechblog.blogspot.in/2015/06/porting-driver-from-freebsd-to-rtems.html</a><br>
>>>> Also read libbsd's README, especially "Rules for Modifying FreeBSD<br>
>>>> Source"<br>
>>>><br>
>>>> Can't say anything specific about USB HID and WLAN. Definitely WLAN will<br>
>>>> require porting libraries with auth protocols (WPA\WEP). About HID, you can<br>
>>>> try searching how input works in RTEMS. Maybe you can implement API in your<br>
>>>> future HID driver<br>
>>>><br>
>>>><br>
>>>><br>
>>><br>
>><br>
</blockquote></div><br></div>