21 June 2019, 01:01 | #1 |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 962
|
bsdsocket.library - how does it work?
Recently (yesterday) I managed to connect my real A1200 to the Internet using a pcmcia card, prism2v2 and roadshow (demo version).
From what I understand prism2v2 is the driver used to manage the pcmcia card and roadshow is the TCP/IP stack. Once I installed these I could browse to google.com. In WinUAE all I have to do is tick the checkbox bsdsocket.library to get the same result. So my question is; what does ticking the bsdsocket.library checkbox actually do? How does the browser still manage to connect to google.com without a TCP/IP stack installed? Last edited by Sim085; 21 June 2019 at 01:06. |
21 June 2019, 01:42 | #2 |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 882
|
Bsd socket is the interface to the tcp stack. In UAE that same interface is proxied directly to network calls on the host computer, so no need for a stack on the Amiga.
|
21 June 2019, 02:04 | #3 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,265
|
With WinUAE you can also disable "bsdsocket.library" and make a connection as you do on a Real Amiga, in this case you have to activate "uaenet. device" and configure a TCP/IP stack with Miami or other similar software.
|
21 June 2019, 08:57 | #4 | |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 962
|
Thanks for your answer. Your question made me realize I do not know how the browser hits the TCP/IP stack in the first place. I guess what is confusing me is how bsdsocket works without the need to install anything in Workbench.
Quote:
|
|
21 June 2019, 09:03 | #5 |
Puttymoon inhabitant
|
I also met bsdsocket.library requirement recently (yes, it was also for AmiModRadio ), but my question is: is this library a separate file, that can be downloaded and put into LIBS: in my real Amiga, and does it help to anything?
|
21 June 2019, 09:42 | #6 |
Registered User
Join Date: Jan 2005
Location: Umeå
Age: 44
Posts: 938
|
@Predaeda:
As already said, bsdsocket.library is the interface which applications use to talk to the TCP/IP stack - think connect, send, receive etc. The main executable of for example AmiTCP and Miami creates bsdsocket.library in memory, while in Roadshow it is a file in LIBS: which contains more or less the entire TCP/IP stack. So there is no separate download, the bsdsocket.library in your system, in whichever way it exists is tightly coupled with the TCP/IP stack you use. |
21 June 2019, 10:22 | #7 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,265
|
Yes, to be able to do so, however, you need to install on Windows, npcap or WinPcap, I enclose a video of mine that shows the connection Network to the NetSurf with UaeNet.device:
WinUAE + UaeNet.device |
21 June 2019, 10:34 | #8 | |
Puttymoon inhabitant
|
Quote:
Ah, thank you. I am asking because I tried this: I launched Miami and connected to the internet. Then I started snoopdos, RexxMast and launched AmiModRadio. And in SnoopDOS log there was something like "attempting to load bsdsocket.library: FAIL". So I though it is missing in my system, but in meanwhile it should be in RAM? |
|
21 June 2019, 13:12 | #9 |
Registered User
Join Date: Jan 2005
Location: Umeå
Age: 44
Posts: 938
|
With Miami it is in RAM. You can verify that it is available by “version bsdsocket.library” in a shell. Double check that the version reported in the shell is equal or greater than the version SnoopDos logs that AmiModRadio attempts to open.
|
28 June 2019, 16:18 | #10 |
Not a Rebel anymore
Join Date: Apr 2005
Location: UK
Age: 51
Posts: 505
|
bsdsocket.library is the primary way that all amiga applications interface with the network.
If you install a tcp/ip stack you will find that the stack creates a bsdsocket.library (in memory) and you can see it using the version command. WinUAE has the option to enable the bsdsocket.library which creates a compatible bsdsocket.library in memory which talks to the network on the PC side using the same api calls. |
28 June 2019, 21:50 | #11 |
Registered User
Join Date: Jan 2005
Location: Umeå
Age: 44
Posts: 938
|
@Phantasm:
Regarding the in-memory-creation of bsdsocket.library, Roadshow is an exception to that and most of the stack resides in the file LIBS:bsdsocket.library. |
29 June 2019, 00:30 | #12 |
Registered User
Join Date: Feb 2014
Location: Germany
Posts: 527
|
Any chance to dump a lib from ram to use it maybe later as a file?
|
29 June 2019, 02:46 | #13 |
Registered User
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,773
|
|
29 June 2019, 08:53 | #14 |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 962
|
Let me see if I understand, bsdsocket.library is the library used by other applications to access the TCP/IP stack.
In case of WinUAE (bsdsocket.library ticked), the bsdsocket.library is injected into the memory of the guest emulation, where other applications find this, and calls to this are mapped to the TCP/IP stack of the host operating system. (the following part I am not so sure about) In case of non-emulation there is still a bsdsocket.library but this time rounds any call to this is mapped to the TCP/IP stack installed (ex: Roadshow, or Miami). Is the above correct? |
29 June 2019, 09:44 | #15 |
Registered User
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,773
|
In the case of non-emulation, the bsdsocket.library is generally created in memory by the TCP/IP stack. They do not come with this library as a seperate file. WinUAE simply emulates the behaviour of the stack, creating it's own bsdsocket.library replacement.
|
29 June 2019, 10:45 | #16 | |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,035
|
Quote:
I would not call it mapping if you are on a real IP stack. The app calls a library function and this function is part of the IP stack. It does not need to map anything. The public part of a library, a.k.a. the library base is always created dynamically in memory. And this part is the only thing needed to open a library and call functions of it. If an app calls OpenLibrary("bsdsocket.library") the OS checks if the library base is already present. If it is it just returns its address to the app. If the base is not yet present, OpenLibrary tries to load a file called bsdsocket.library and call its init function. This init function then creates the base and adds it to the system's list of library bases. In case of the IP stack the stack is run as a program. The program creates a library base for bsdsocket.library and adds it to the system's list. This is the same as what the init function would do. The only difference is that it is not done in the context of OpenLibrary. |
|
30 June 2019, 05:29 | #17 |
Registered User
Join Date: Nov 2015
Location: Perth, Australia
Posts: 73
|
In the case of AmiTCP, you can find the source of version 3 on Aminet and see exactly how it constructs the bsdsocket.library in memory and adds it to the list of libraries maintained by Exec. For each task that opens the library, AmiTCP will construct a new instance of the library structure.
The file where you can see this happening is in src/amitcp/api/amiga_api.c. There is no separate library that could be used independently. Amiga libraries are a structure holding some data and a bunch of function pointers. For bsdsocket.library the functions pointed to are part of the AmiTCP executable. I'm not sure what Roadshow does but I expect most other Amiga TCP stacks work this way. |
30 June 2019, 19:17 | #18 | |
Registered User
Join Date: Aug 2010
Location: Germany
Posts: 537
|
Quote:
I understand why AmiTCP, Miami, etc. build the "bsdsocket.library" interface within a program which the user must start. It's much easier to test and debug this design since "all" you have to do is make the TCP/IP stack work and then add the library interfaces to what you built. Now try doing that with a standard disk-loaded library. It's much harder to pull off, and (I admit this here and now) I was stupid enough to try. Often there's a very fine line between being stupid and being clever, and at least in this case I succeeded at crossing over into "being clever" Don't try this at home kids! Pick the design that makes debugging and testing easier for you. |
|
14 November 2023, 08:52 | #19 | |
\m/
Join Date: Nov 2008
Location: Devon, U.K.
Posts: 573
|
Quote:
|
|
14 November 2023, 19:44 | #20 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,035
|
It depends on the reason why the software asks for a newer version.
Normally a request for a higher version means that the software requires new features which only exist on the new version. It would crash if an older version would be hacked to fulfill the request. Only in rare cases the developer was too lazy to determine the minimum version he needs and just requests the version he used himself. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UAE bsdsocket.library inconsistensy | patrik | support.WinUAE | 4 | 01 April 2017 13:43 |
Bsdsocket.Library | Emufr3ak | Coders. Asm / Hardware | 5 | 25 December 2016 11:20 |
Crosscompiling with bsdsocket.library | ciVic | Coders. General | 6 | 05 January 2016 11:56 |
winuae bsdsocket.library | clauddio | support.WinUAE | 5 | 21 July 2015 21:47 |
BSDSocket.library error with version 1.5+ | Icreadence | support.WinUAE | 7 | 28 August 2008 04:16 |
|
|