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? |
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.
|
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.
|
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:
Quote:
|
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?
|
@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. |
Quote:
WinUAE + UaeNet.device |
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? |
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.
|
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. |
@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. |
Any chance to dump a lib from ram to use it maybe later as a file?
|
Quote:
|
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? Quote:
|
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.
|
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. |
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. |
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. |
Quote:
|
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. |
All times are GMT +2. The time now is 14:46. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.