Syllable Forum Index Syllable
Syllable Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Porting the Broadcom b44 network driver from Linux
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Syllable Forum Index -> Syllable Desktop
View previous topic :: View next topic  
Author Message
nute



Joined: 01 Aug 2009
Posts: 20

PostPosted: Sun Jan 04, 2015 10:55 pm    Post subject: Porting b44 driver from linux-3.18.1... Reply with quote

I want to port the broadcom driver, b44.c and b44.h, to syllable. I've noticed that there are a lot of #includes for linux/foo linux/bar... Guess I'll have to see what functionality is being pulled in and what the equivalent in syllable is. Any help porting this driver will be very much appreciated.
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Mon Jan 05, 2015 1:44 pm    Post subject: Reply with quote

That would be great! It's the most popular network driver that's missing in Syllable. It would fill the remaining gap in support for 100 Mb/s chips and would allow many more machines to go on the network.

I'm actually on a machine where I fitted an extra network card because this driver is missing. And we have laptops where this isn't possible.

If you look at the other ported drivers, there's a header in Syllable for Linux compatibility, that mostly collects definitions for Linux network drivers.
Back to top
View user's profile Send private message Visit poster's website
nute



Joined: 01 Aug 2009
Posts: 20

PostPosted: Tue Jan 13, 2015 2:50 pm    Post subject: Broadcom b44 driver... Reply with quote

If I can bring in the linux b44.c code unmodified, that will be great as the code will be supported by the linux community. Okay, looks at first glance like I need to translate which include files I ask for. Looks fairly simple. I am meaning to get to this before February. Help understanding Syllable's design so I do this port correctly very much appreciated.
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Tue Jan 13, 2015 6:47 pm    Post subject: Reply with quote

Unfortunately, all drivers ported to Syllable are quite heavily modified. Syllable's driver architecture is significantly different, which is how it achieves its superior performance and handling.

The biggest difference is the automatic hardware detection, based on the PCI bus driver. This is something that needs to be modified in all drivers for PCI devices. There also tend to be substantial parts in Linux drivers that are removed in the Syllable ports, because they're not needed or implement features that Syllable doesn't support.

Have you read Kristian's guide to porting a network driver?
Back to top
View user's profile Send private message Visit poster's website
nute



Joined: 01 Aug 2009
Posts: 20

PostPosted: Sat Jan 17, 2015 4:11 pm    Post subject: Ascertaining how to port broadcom drivers... Reply with quote

Sorry for the delay getting back to you.

A little background on me, I just graduated in computer science and am currently job hunting.

I haven't read relevant source materials on porting network drivers to Syllable as I haven't managed to find them yet.

I could use design docs on the Linux driver so I can understand the Linux code I'm trying to use as a reference for making a syllable driver.

I want to find out how long this is going to take to get a port done and I want to be upfront and say that I need to understand Syllable better which could take longer than anyone wants it to take.

I don't want to hang anyone out where I'd appreciate collaboration on this project.

If I can get a tutorial on an existing syllable network card driver, that might help.

-- Michael C. Robinson
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Sat Jan 17, 2015 5:06 pm    Post subject: Reply with quote

Please review the documentation section of our development site. The driver tutorial is here:

http://development.syllable.org/documentation/drivers/index.html

Work on Syllable is excellent to put on your CV. Wink

It's hard to say how long porting a driver takes. It mostly depends on you, but there are also drivers that are harder and more unwieldy than others.
Back to top
View user's profile Send private message Visit poster's website
nute



Joined: 01 Aug 2009
Posts: 20

PostPosted: Sat Jan 17, 2015 5:21 pm    Post subject: Getting the tools onto... Reply with quote

a Syllable desktop machine, Dell Inspiron 5100. Since the broadcom driver isn't written/ported yet to Syllable, how do I get the toolchain onto the machine? I also need to bring the Linux kernel code for the broadcom network card. The laptop has USB2 and a DVD writer. Does Syllable desktop read usb memory sticks? I'm assuming I need to have the development environment on Syllable desktop and that cross compiling for Syllable on Linux is a more advanced technique where porting a network card driver is challenge enough. I'll try to get to this soon, maybe I can get the toolchain installed very soon. This makes my old Dell laptops more valuable and giving a driver to the Syllable community doesn't hurt my career search either.
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Sat Jan 17, 2015 5:28 pm    Post subject: Reply with quote

You can copy all the installation packages via USB stick or CD/DVD.

Getting the latest source code from CVS would be a little harder: you'd have to check it out on another machine. But the older source packages are probably sufficient for your goals.

Cross-compiling from other systems is not supported - although we once established a setup for cross-compiling the kernel and kernel drivers from Linux. It's hard to set up, though, and we haven't maintained that configuration.
Back to top
View user's profile Send private message Visit poster's website
nute



Joined: 01 Aug 2009
Posts: 20

PostPosted: Thu Jan 22, 2015 2:07 am    Post subject: CD not reading... Reply with quote

I grabbed the necessary packages to develop on Syllable desktop and burned them to CD-R on a Fedora 21 system. The disc reads under Linux. Move over to the Dell Inspiron 5100, trying to mount the CD either causes a segfault in a terminal or a locked mount window.

Which USB flash drives work? I tried an 8G thumb drive and it didn't mount. Might try without attempting to mount the CD first.

One option is to shrink the Syllable partition by a gig or two and copy the contents of the CD to an ext3 file system that Syllable can read from. Are there tools available to shrink the Syllable partition or do I have to start over from scratch?

Are there any USB based network cards that Syllable supports? Might be a workaround to get needed packages onto the system until I have a working broadcom driver. How about one of those USB to serial converters?
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Thu Jan 22, 2015 10:53 am    Post subject: Reply with quote

It is very unlikely for a CD not to read on Syllable. Segfaults point to a deeper stability problem. To address only the CD (and HD), you could try to disable ATA DMA in the kernel boot options, but it is more likely that you need to disable SMP or ACPI. Does the Syllable live CD work?

Most USB sticks work with Syllable, but on some machines the USB driver in general is unreliable. Reading through USB is much more likely to be unreliable than reading CD's. It's the USB 2 driver that is buggy. In that case, you can disable it to fall back to the USB 1 drivers.

There are no tools to shrink an AFS partition. If you decide to reformat, it's best to use an extra FAT partition, because the ext2 driver is buggy.

There is no Syllable driver for network over USB.
Back to top
View user's profile Send private message Visit poster's website
nute



Joined: 01 Aug 2009
Posts: 20

PostPosted: Thu Jan 22, 2015 3:04 pm    Post subject: The memory stick read okay... Reply with quote

Was able to use my 8G memory stick okay. Installed the developer resource package.
The CD/DVD drive still has an issue, but I'm not sure if it is the particular disc or the drive itself. Next step is to make sure I have the Syllable source code.
Back to top
View user's profile Send private message
nute



Joined: 01 Aug 2009
Posts: 20

PostPosted: Thu Jan 22, 2015 6:40 pm    Post subject: Success ;-) Reply with quote

Thanks for providing the xz compression/decompression engine in Syllable. Currently unpacking the linux-3.18.1.tar.xz archive on my Syllable desktop system. I've figured I should add a broadcom directory to the Syllable source under /system/sys/kernel/drivers/net. This is where I plan on placing the new b44 driver. Now I'm ready for coding conventions and any tips anyone has on what features in the linux driver aren't supported in Syllable.
Back to top
View user's profile Send private message
nute



Joined: 01 Aug 2009
Posts: 20

PostPosted: Thu Jan 22, 2015 10:09 pm    Post subject: Standard Makefile????? Reply with quote

I nabbed a Makefile from the eepro100 directory in the Syllable sources.

Modified so that every instance of eepro100 changed to b44.

Trying to do a make, get the following:

b44.h:1:26: error: atheos/types.h: No such file or directory
b44.h:2:27: error: athoes/device.h: No such file or directory
b44.h:3:25: error: posix/errno.h: No such file or directory

and then there are two more errors about device_init and device_uninit...

I'm trying to follow the development documentation for writing drivers. Looks like I need to set my include path. Right now, the Makefile has C_INCLUDE_PATH=$(ATHEOS_INCLUDE_PATH)
which is just a variable that is evidently not set up yet.

Is there a more basic or different Makefile that I should be using?
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Thu Jan 22, 2015 10:29 pm    Post subject: Reply with quote

Did you install the development files pack specific to Syllable 0.6.7? Otherwise you don't have the headers.
Back to top
View user's profile Send private message Visit poster's website
nute



Joined: 01 Aug 2009
Posts: 20

PostPosted: Fri Jan 23, 2015 12:12 am    Post subject: Correct devlopment pack??? Reply with quote

I think I installed the development pack with the header files. I have the toolchain at least, but how do I find out if the headers are installed or not?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Syllable Forum Index -> Syllable Desktop All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group