OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Jun 24, 2022 11:41 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Writing Ethernet Adapter Driver
PostPosted: Fri May 27, 2022 5:22 pm 
Offline

Joined: Mon Feb 28, 2022 5:52 am
Posts: 3
I'm looking to write a basic OS to do some simple tasks and run on bare-metal (Macbook Pro 2010).

It turns out I have a Broadcom NetXtreme 57XX Gigabit adapter, but I cannot find any information about how to program it anywhere, only a user manual that doesn't tell me what I need to know.

Is there some general architecture for network adapters so that I can handle multiple of them the same way, which is why I can't find specific information about this card? If so, how should it be handled?

Thanks!


Top
 Profile  
 
 Post subject: Re: Writing Ethernet Adapter Driver
PostPosted: Fri May 27, 2022 5:28 pm 
Offline
Member
Member

Joined: Sun Jun 23, 2019 5:36 pm
Posts: 590
Location: North Dakota, United States
I will be extremely surprised if you can find anything. Broadcom is one of those notorious companies who majorly dislikes open-source of any kind. You'd have to purchase the developer documentation from them -- and that's assuming they'd even sell it to you at all. Even their Linux drivers are closed-source (at least last time I checked) and (in some cases) highly unreliable. If you can, replace your NIC with an Intel one -- I'm pretty sure Intel provides developer documentation for NICs even now, though I might be wrong about that.


Top
 Profile  
 
 Post subject: Re: Writing Ethernet Adapter Driver
PostPosted: Sat May 28, 2022 2:14 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4365
Location: Chichester, UK
I'm not convinced that a MacBook is the best hardware to target, unless you are very experienced. Information about the hardware is rather harder to find than for a conventional PC.

Have you written drivers for the screen, the keyboard, and the storage devices yet? I'd have thought that networking came pretty far down the list of things to implement.

But that's just my opinion - it's your OS so you are free to implement it on whatever hardware you choose and in whichever order you choose; just be sure you aren't making things too difficult for yourself. Developing on bare metal is hard enough when you have all the relevant documentation.


Top
 Profile  
 
 Post subject: Re: Writing Ethernet Adapter Driver
PostPosted: Sat May 28, 2022 9:26 am 
Offline

Joined: Mon Feb 28, 2022 5:52 am
Posts: 3
Ethin wrote:
I will be extremely surprised if you can find anything. Broadcom is one of those notorious companies who majorly dislikes open-source of any kind. You'd have to purchase the developer documentation from them -- and that's assuming they'd even sell it to you at all. Even their Linux drivers are closed-source (at least last time I checked) and (in some cases) highly unreliable. If you can, replace your NIC with an Intel one -- I'm pretty sure Intel provides developer documentation for NICs even now, though I might be wrong about that.


iansjack wrote:
I'm not convinced that a MacBook is the best hardware to target, unless you are very experienced. Information about the hardware is rather harder to find than for a conventional PC.

Have you written drivers for the screen, the keyboard, and the storage devices yet? I'd have thought that networking came pretty far down the list of things to implement.

But that's just my opinion - it's your OS so you are free to implement it on whatever hardware you choose and in whichever order you choose; just be sure you aren't making things too difficult for yourself. Developing on bare metal is hard enough when you have all the relevant documentation.

It does seem going with a MacBook is not the way to go, it was just the only laptop I had on hand.

I will see what kind of hardware that I am actually able to buy I can also emulate through QEMU and such.

Thanks to both of you for the reply, hard to know as a beginner if I'm not searching in the right place or the information is just not out there.


Top
 Profile  
 
 Post subject: Re: Writing Ethernet Adapter Driver
PostPosted: Sat May 28, 2022 9:49 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4365
Location: Chichester, UK
Emulating through qemu is definitely the way to go. Not only can it tell you which exceptions have occurred but also you can use gdb with it to set breakpoints in your code, single-step code, examine memory, and all the other debugger facilities. This makes OS development so much easier. Also, it means you can go with a simple, well documented NIC - such as the E1000 - if you want to play with networking. Writing a driver for this is fairly straightforward, as is implementing IP and UDP. TCP is rather more challenging.


Top
 Profile  
 
 Post subject: Re: Writing Ethernet Adapter Driver
PostPosted: Sat May 28, 2022 12:13 pm 
Offline
Member
Member

Joined: Sat Mar 10, 2018 10:16 am
Posts: 251
I’ve found two specs for broadcom ethernet cards: https://docs.broadcom.com/doc/1211168564335 https://docs.broadcom.com/doc/5718-PG108-R
However, I do not have working driver. It is one thing on my osdev wishlist.

_________________
https://github.com/Klaykap/BleskOS


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Neevabot [Bot], PetalBot [Bot] and 7 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group