Skip to content

Repository files navigation

osmo-bsc for macOS ARM64

osmo-bsc port to macOS ARM64 (Apple Silicon), Darwin 26+. Osmocom Base Station Controller, the daemon between the BTS units (Abis interface) and the MSC (A interface over SCCP).

Upstream version: 1.15.0. Four patches applied, one in the daemon and three in the test tree. Testsuite on macOS 26.6.2, Apple M5 Pro: 7 pass, 2 skipped, 0 fail; the skipped groups are the ones that need the GNU ld --wrap option.

Upstream README preserved as README.upstream.md.

Prerequisites

Ports from this series, built into the same prefix:

osmo-bsc does not need libosmo-gsup-client, libsmpp34 or SQLite. The optional measurement tools that need SQLite (--enable-meas-udp2db, --enable-meas-pcap2db) and the curses viewer (--enable-meas-vis) are off by default and were not built.

libosmocore v0.2.2 is a hard requirement: v0.2.1 emulates timerfd, which the stats and rate counter timers need, and v0.2.2 fixes osmo_sock_local_ip().

Build

git clone https://github.com/AndreiGosman/osmo-bsc-macos-arm64.git
cd osmo-bsc-macos-arm64
autoreconf -fi
mkdir -p build && cd build
../configure --prefix=$HOME/sdr-lab/local
make -j$(sysctl -n hw.ncpu)
make check
make install

Every dependency is found through pkg-config, so no extra CFLAGS or LDFLAGS are needed as long as the prefix is on PKG_CONFIG_PATH. --disable-doxygen and --disable-iu are not osmo-bsc options; this release has no Iu interface at all.

Besides osmo-bsc the build installs the ip.access utilities abisip-find, ipaccess-config and ipaccess-proxy, plus bs11_config, meas_json and isdnsync. isdnsync compiles because mISDNif.h has a non-Linux fallback, but it opens a PF_ISDN socket that only the Linux mISDN driver provides, so it is of no use on macOS.

Testsuite

make check runs 9 autotest groups. On macOS 7 run and pass: abis, acc, bsc, codec_pref, gsm0408, nanobts_omlattr, subscr. The other two, handover_tests and paging, are skipped. They replace functions at link time with the GNU ld option -Wl,--wrap=symbol and call the originals through the __real_ prefix. Apple ld has no such option:

ld: unknown options: --wrap=abis_rsl_sendmsg

Patch 004 probes for --wrap in configure, builds the two test directories only when it is available, and makes their autotest groups exit 77 otherwise. On GNU/Linux nothing changes. The handover group is 58 VTY transcripts that cover the handover decision and the lchan selection logic, so a Linux run of make check remains the reference for any change to that code.

Running

The example configuration expects an STP on port 2905 (M3UA over SCTP) and a media gateway on 127.0.0.1:2427 (MGCP), and an MSC reachable through the STP at point code 0.23.1. All three exist in this port series. The VTY listens on 127.0.0.1:4242, CTRL on 4249.

osmo-bsc -c doc/examples/osmo-bsc/osmo-bsc.cfg

When osmo-stp runs on the same Mac, each SCTP daemon needs its own encapsulation port. libsctp-compat tunnels SCTP over UDP (RFC 6951) and one process holds one local port, so the port from env.sh is taken by the STP and the next daemon fails with a misleading "Unable to create socket: Protocol not supported". In this series the STP has 9899, the MSC 9898 and the BSC 9897:

LIBSCTP_COMPAT_UDP_ENCAPS_PORT=9897 LIBSCTP_COMPAT_UDP_ENCAPS_REMOTE_PORT=9899 \
    osmo-bsc -c doc/examples/osmo-bsc/osmo-bsc.cfg

With osmo-hlr, osmo-stp, osmo-mgw and osmo-msc from this series running, the daemon was checked as follows. show cs7 instance 0 asp on the BSC VTY reports ASP_ACTIVE and show cs7 instance 0 as all reports AS_ACTIVE with routing context 2; the STP VTY shows both the MSC and the BSC as active ASPs with dynamically allocated routing keys. show msc on the BSC reports BSSMAP state: CONNECTED, and show bsc on the MSC reports the BSC at point code 0.23.3 as READY, so the BSSMAP RESET and RESET ACK went through the STP in both directions. show rate-counters lists the ASP, AS, SS7 and BSC groups with the ASP packet counters at the number of M3UA messages exchanged. The startup log carries no stats.c error line, and the process has the two timerfd worker threads next to the usrsctp threads.

One log line at startup is normal and not a Darwin issue: the first BSSMAP RESET goes out before the AS is active and is reported as MTP-TRANSFER.req ... no route!; the retry after N-PCSTATE ind ... ACCESSIBLE succeeds.

Patches applied

Patch Upstream file Issue Fix
001 include/osmocom/bsc/lchan.h struct gsm_lchan has two struct timespec members but the header does not include <time.h>; glibc supplies the type transitively, Darwin does not, and lchan.c and data_rate_pref.c fail to compile Include <time.h> in the header
002 tests/bsc/Makefile.am, tests/codec_pref/Makefile.am -lrt in LDADD; Darwin has no librt and nothing in the tree calls a librt symbol directly Drop the flag
003 tests/handover/handover_test.c DEFUN(wait, ...) defines a static function named wait; Darwin <stdlib.h> includes <sys/wait.h> so wait(2) is already declared and clang rejects the redefinition Rename the function to do_wait; the VTY command and wait_cmd are unchanged
004 configure.ac, tests/Makefile.am, tests/atlocal.in, tests/testsuite.at tests/handover and tests/paging need the GNU ld -Wl,--wrap option, which Apple ld does not have; make check fails at the first link Probe for --wrap in configure; build those directories and run their autotest groups only when it is present, skip (exit 77) otherwise

A fifth commit tracks .tarball-version with the upstream version so that configure sees 1.15.0 rather than the fork's tag.

Patches 001 to 003 are portability fixes with no effect on GNU/Linux and are worth sending upstream. Patch 004 is the same mechanism used in the osmo-msc port of this series.

Not covered

No BTS was attached: osmo-bts and osmo-trx come later in the series, so the Abis side (OML, RSL, the PCU socket) was not exercised beyond startup. What was exercised is every interface the daemon opens at startup: M3UA/SCCP to the STP and through it BSSMAP to the MSC, the MGCP client, the Abis IPA listener on port 3002/3003, VTY and CTRL. E1 line drivers (mISDN, DAHDI) are Linux only and are not available through the libosmo-abis port.

Dependency cascade

Ports enabled by this repository:

  • osmo-bts and osmo-bts-trx, which connect to osmo-bsc over Abis/IP

Prior ports in this series

  1. libosmocore-macos-arm64 v0.2.2
  2. libsctp-compat-macos-arm64 v0.3.1
  3. srsRAN-4G-macos-arm64 v0.1.0
  4. kraken-macos-arm64
  5. libosmo-netif-macos-arm64 v0.1.2
  6. libosmo-abis-macos-arm64 v0.1.1
  7. libosmo-sigtran-macos-arm64 v0.1.0
  8. osmo-hlr-macos-arm64 v0.1.0
  9. osmo-mgw-macos-arm64 v0.1.0
  10. libsmpp34-macos-arm64 v0.1.0
  11. osmo-msc-macos-arm64 v0.1.0
  12. This repository

License

As upstream, per debian/copyright: AGPL-3.0-or-later for osmo-bsc, GPL-3.0-or-later for osmoappdesc.py and tests/vty_test_runner.py, LGPL-2.1 for include/mISDNif.h. The patches in this repository carry the license of the files they modify.

Credits

Port developed by Andrei Gosman (@agoarchitecture) in collaboration with Claude Code CLI (Anthropic). All commits authored by Andrei; Claude assisted with pattern analysis, debugging, and iteration.

About

osmo-bsc native port for macOS ARM64 (Apple Silicon), Osmocom Base Station Controller

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages