Comparing binder with socket socket binder internal status associated to FD associated to PID (FD can be shared among threads in the same process) read & write operation as a stream done at once by ”ioctl” network transparency Yes No expects local only
Transaction of Binder (2) Process A Process B Binder Process A Binder Process B Copy memory by copy_from _user Copy memory by copy_to_user Then, wake up process B Process A and B have different memory space. They can not see each other. Kernel Kernel
” ctl.start” / ”ctl.stop” is command to start/stop the service.
property_set("ctl.stop", "bootanim"); stops boot animation service
Starts from ”init.svc.” shows the state of the service.
Reading System Property Kernel init Other processes /dev/__properties__ (on tmpfs) mmap (read/write) mmap (read only) Just read the property in each process.
Writing System Property Kernel init Other processes /dev/__properties__ (on tmpfs) mmap (read/write) mmap (read only) Send write request to init through socket
Actual code of initialize System Properties fd = open ("/dev/__properties__", O_RDWR | O_CREAT, 0600); if (fd < 0) return -1; if ( ftruncate (fd, size) < 0) goto out; data = mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if(data == MAP_FAILED) goto out; close (fd); fd = open ("/dev/__properties__", O_RDONLY); if (fd < 0) return -1; unlink ("/dev/__properties__"); $(ANDROID_TOP)/system/core/init/property_service.c Give this fd to other processes. No longer access by file name. /dev is a tmpfs