2

I am trying to find the source code for SIM cards, or at least know the location. I found an interesting site and then got the source code for a Samsung Android system (https://android.googlesource.com/kernel/samsung/+/android-samsung-3.0-jb-mr0/drivers/). I was hoping the SIM cards would be under ./drivers/sim/ or something of that nature.

Any ideas on where the SIM card source code can be found? This is not for development. I am wanting to know how the Android system manages SIM cards.

I asked this question on the Android Exchange site, but Izzy told me to ask here.

Kara
  • 6,115
  • 16
  • 50
  • 57
Devyn Collier Johnson
  • 4,124
  • 3
  • 18
  • 39

1 Answers1

1

SIM card usually considered as modem related part of the system, and because of it many chipset manuf.(qualcomm,samsung,mtk,broadcom...) have the code handling it in the baseband processor.

Baseband processors have proprietary code, they run usually on arm9 arch RT OS, and the ways android access the sim data is unique to different devices/chipsets. Most of them however use XDR/RPC calls from android processor to baseband processor.

Most of the android stuff is explained pretty good here

Broadcom does it by implementing interface in kernel driver which is exposed to /dev/bcrm_kril and lets userspace send direct commands to sim. And then XDR it to baseband

Qualcomm like to keep it more proprietary, they only implement the RPC interface in kernel, they call it ONCRPC and its exposed by hard coded driver entry point.

Ex. /dev/oncrpc/30000016:d6bb93e6

Then userspace native libraries are sending encoded commands, just that in this case they dont have direct access to the simcard. I.E android sends RIL_REQUEST_GET_IMSI, and get the exact response containing the IMSI.

Community
  • 1
  • 1
skoperst
  • 2,259
  • 1
  • 23
  • 35
  • I haven't seen that /dev driver entry (above) on any modern Qualcomm phone, so far. So where did you get that info from? Also, it doesn't say how to access other EF files on the SIM. – not2qubit Oct 29 '14 at 18:29