collected-nots-gmail

 UEvent event test program

https://blog.csdn.net/u014135607/article/details/79966983


Uevent analysis, from kernel to framework

https://blog.csdn.net/wh_19910525/article/details/17306155


USB plug and unplug process

https://blog.csdn.net/piaozhiye/article/details/25098435


Android usb process

https://blog.csdn.net/pashanhu6402/article/details/53320444


was reading this blog

https://blog.csdn.net/shift_wwx/article/details/85633801

and for fstab

https://blog.csdn.net/u014770862/article/details/54583157


disk event handling article

https://lwn.net/Articles/412752/


search with this

 Android phone mounts the MicroSD blog.csdn


the function of card reader with SD card inserted is basically the same with that of USB flash drive.


Similar problem

https://superuser.com/questions/457497/how-do-i-detect-sd-card-insertion-just-the-sd-card-not-the-card-reader-in-lin

some thing about udisk daemon



motoroal device udavadm monitor on insertion and removal

remove@/devices/virtual/bdi/179:64 ACTION=remove DEVPATH=/devices/virtual/bdi/179:64 SUBSYSTEM=bdi SEQNUM=65859

remove@/devices/soc/7864900.sdhci/mmc_host/mmc1/mmc1:aaaa/block/mmcblk1 ACTION=remove DEVPATH=/devices/soc/7864900.sdhci/mmc_host/mmc1/mmc1:aaaa/block/mmcblk1 SUBSYSTEM=block MAJOR=179 MINOR=64 DEVNAME=mmcblk1 DEVTYPE=disk NPARTS=0 SEQNUM=65860

remove@/devices/soc/7864900.sdhci/mmc_host/mmc1/mmc1:aaaa ACTION=remove DEVPATH=/devices/soc/7864900.sdhci/mmc_host/mmc1/mmc1:aaaa SUBSYSTEM=mmc MMC_TYPE=SD MMC_NAME=SS16G MODALIAS=mmc:block SEQNUM=65861

change@/devices/virtual/xt_idletimer/timers ACTION=change DEVPATH=/devices/virtual/xt_idletimer/timers SUBSYSTEM=xt_idletimer INTERFACE=0 STATE=inactive TIME_NS=165573364341738 UID= SEQNUM=65862

change@/devices/soc/qpnp-smbcharger-17/power_supply/battery ACTION=change DEVPATH=/devices/soc/qpnp-smbcharger-17/power_supply/battery SUBSYSTEM=power_supply POWER_SUPPLY_NAME=battery POWER_SUPPLY_STATUS=Discharging POWER_SUPPLY_PRESENT=1 POWER_SUPPLY_CAPACITY=89 POWER_SUPPLY_HEALTH=Good POWER


DEVPATH=/devices/soc/7864900.sdhci/mmc_host/mmc1/mmc1:aaaa/block/mmcblk1 SUBSYSTEM=block MAJOR=179 MINOR=64 DEVNAME=mmcblk1 DEVTYPE=disk NPARTS=1 SEQNUM=65868

add@/devices/soc/7864900.sdhci/mmc_host/mmc1/mmc1:aaaa/block/mmcblk1/mmcblk1p1 ACTION=add DEVPATH=/devices/soc/7864900.sdhci/mmc_host/mmc1/mmc1:aaaa/block/mmcblk1/mmcblk1p1 SUBSYSTEM=block MAJOR=179 MINOR=65 DEVNAME=mmcblk1p1 DEVTYPE=partition PARTN=1 SEQNUM=65869

add@/devices/soc/7864900.sdhci/mmc_host/mmc1/mmc1 ACTION=add DEVPATH=/devices/soc/7864900.sdhci/mmc_host/mmc1/mmc1 SUBSYSTEM=devfreq SEQNUM=65870

change@/devices/virtual/xt_idletimer/timers ACTION=change DEVPATH=/devices/virtual/xt_idletimer/timers SUBSYSTEM=xt_idletimer INTERFACE=0 STATE=active TIME_NS=165749998473761 UID=10153 SEQNUM=65871


sg3_utils to detect scsi devices without rebooting

https://www.systutorials.com/docs/linux/man/8-rescan-scsi-bus.sh


SCSI specific notes:

from : http://fibrevillage.com/storage/279-hot-add-remove-rescan-of-scsi-devices-on-linux


more here : https://blog.csdn.net/zs12344444/article/details/8203321


From 

https://www.spinics.net/lists/linux-usb/msg168951.html

On Tue, 15 May 2018, Tushar Nimkar wrote:


> Everyone,

> Please help me in understanding sd_probe| storage_probe/1/2 and 

> uas_probe | scsi_scan_host :)

> Basically want to know the correct sequence for them? How 

> sd_probe_async() is called (ASYNC_DOMAIN(scsi_sd_probe_domain))?


Very briefly:


The probe routine for usb-storage is storage_probe(), which calls

usb_stor_probe1() and usb_stor_probe2().  Similarly, the probe routine 

for uas is uas_probe().  Each driver's probe routine is called by the 

driver core (drivers/base/dd.c) when a new device of the appropriate 

type is detected.


usb_stor_probe2() starts a workqueue routine, usb_stor_scan_dwork(), 

which calls scsi_scan_host(), whereas uas_probe() calls 

scsi_scan_host() directly.  Either way, scsi_scan_host() usually sets 

up an async worker to carry out the actual scanning.  The scanning is 

started by scsi_scan_target() and the various routines it calls.


When the scanning procedure registers a SCSI device that is a 

disk-drive-like device, the sd driver's sd_probe() routine is called by 

the driver core.  sd_probe() does some of the initial work needed to 

probe the device, and it defers the rest of the work to the async 

worker routine sd_probe_async().


> Is there any document which say it in detail ?


No.  UTSL.  You might concentrate on include/linux/async.h and

kernel/async.c (and you should be able to figure that much out for

yourself without asking the mailing list).


Alan Stern

> major name-unit name-partition num

/dev/sda1

sd is the major name(driver name), unit is 'a', and partition number is '1'.


https://electronics.stackexchange.com/questions/380091/what-is-the-difference-between-usb-root-hub-and-usb-host-controller


> https://www.linuxidc.com/Linux/2012-12/76197p14.htm

drivers/usb/storage/usb.c

get_transport()

case USB_PR_BULK:

us->transport_name = "Bulk";

us->transport = usb_stor_Bulk_transport;

us->transport_reset = usb_stor_Bulk_reset;

break;


get_protocol()

case USB_SC_SCSI:

us->protocol_name = "Transparent SCSI";

us->proto_handler = usb_stor_transparent_scsi_command;

break;

> Very important 

https://github.com/linux-kernel-labs/linux


device driver study

https://linux-kernel-labs.github.io/master/labs/block_device_drivers.html



============================================================================================================================================================

system calls and malloc tutorial interrupts GIC vs INTC device tree


https://0xax.gitbooks.io/linux-insides/SysCall/linux-syscall-2.html

https://danluu.com/malloc-tutorial/

https://www.kernel.org/doc/Documentation/devicetree/bindings/interrupt-controller/arm,gic.txt

https://www.nxp.com/docs/en/application-note/AN5125.pdf


spurious interrupts

https://lwn.net/Articles/392136/

https://stackoverflow.com/questions/42764945/spurious-interrupt-handling

============================================================================================================================================================

qnx vm and hypervisor


>https://developer.blackberry.com/playbook/native/documentation/com.qnx.doc.neutrino.sys_arch/topic/intro_microkernelarch.html


>http://qnxauto.blogspot.com/2015/03/hypervisors-virtualization-and-taking.html


>https://automotive-operating-systems.blogspot.com/2017/06/qnx-automotive.html


" A hypervisor is a process that separates a computer’s operating system and applications from the underlying physical hardware."


“Hypervisor” is simply a variant of “supervisor,” a traditional name for the software that controls task scheduling and other fundamental operations in a computer system"


"Type 1 “bare metal” hypervisors, which run directly on the host hardware,

Type 2 hypervisors, which run on top of an OS.

Both types have their benefits, but Type 1 offers the better choice for any embedded system that requires fast, predictable response times — most safety-critical systems arguably fall within this category"


Understanding from qemu and kvm

>https://serverfault.com/questions/208693/difference-between-kvm-and-qemu

>https://wiki.archlinux.org/index.php/KVM

"When working together, KVM arbitrates access to the CPU and memory, and QEMU emulates the hardware resources (hard disk, video, USB, etc.). When working alone, QEMU emulates both CPU and hardware."


Virtio

>https://developer.ibm.com/articles/l-virtio/

>http://player.slideplayer.com/5/1509596/


hypervisor vs container

>https://www.net.in.tum.de/fileadmin/TUM/NET/NET-2016-07-1/NET-2016-07-1_01.pdf


"Container-based virtualization utilizes kernel features to create an isolated environment for processes. In contrast to hypervisor-based virtualization, containers do not get their own virtualized hardware but use the hardware of the host system."


============================================================================================================================================================

path partner notes


https://www.tecmint.com/how-to-setup-nfs-server-in-linux/amp/


compile against desired kernel verisonget the sourcegive path to that source

obj-m += main.o


all:

make -C /home/mrigendra.chaubey/github/Linux-Device-Driver/linux-4.9.30 M=$(PWD) modules


clean:

make -C /home/mrigendra.chaubey/github/Linux-Device-Driver/linux-4.9.30 M=$(PWD) clean


emulatorhttps://confluence.navico.com/pages/resumedraft.action?draftId=20212854&draftShareId=2eb9908d-612d-4375-88f6-a7cf313024c6

cd my_directory/ && tar -zcvf ../my_dir.tgz . && cd -

Emulator commands to useemulator -verbose -debug all -show-kernel -screen touchEmulator -show-kernel -no-snapshot -wipe-data -logcat *:e -accel auto -selinux permissive -no-boot-anim -force-32bitSDK source code

https://android.googlesource.com/platform/sdk

https://android.googlesource.com/platform/external/qemu/+/master/docs/DEVELOPMENT.TXT

git clone https://android.googlesource.com/platform/sdkhttps://android.googlesource.com/platform/external/qemu/+/master/docs

old tutorialhttps://www.youtube.com/watch?v=1_H4AlQaNa0


for mac

https://www.youtube.com/watch?v=qD-B3NXycg4https://www.youtube.com/watch?v=p2s9NT60UIQ&t=2s

emulator and aosphttps://forum.xda-developers.com/general/general/building-aosp-emulator-t3853627

git branch colourshttps://www.leaseweb.com/labs/2013/08/git-tip-show-your-branch-name-on-the-linux-prompt/

With Warm Regards,


To run DDMSin macInstall jdk and jre8go to /Users/vinay.p/Library/Android/sdk/toolsrun monitoryou can get this errorNo Java runtime present, requesting install

go to https://www.oracle.com/technetwork/java/javase/downloads/jdk12-downloads-5295953.html

accept the license agreement and click on Macosx java download. (sometimes accept and decline check box does not appear. these check boxes are just left to the text. do a trial and error and it should get checked.)

Installing and uninstalling java and jre,https://docs.oracle.com/javase/9/install/installation-jdk-and-jre-macos.htm#JSJIG-GUID-0071963E-D247-4D15-BF49-AD19C7260740


uninstallsudo rm -rf /Library/Java/*


Only one jdk worked for mejdk-8u151-macosx-x64.dmg


Download from here (You need to have an account with Oracle to be able to download archived downloads.)https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html

Building for windows:Follow this dochttps://android.googlesource.com/platform/sdk/+/master/docs/howto_build_SDK.txt

sudo apt-get install mingw-w64

sudo apt-get install tofrodos

$ . build/envsetup.sh$ lunch sdk-eng$ make win_sdk


One more thing to try is to run emulator from android studio

out/host/linux-x86/bin/emulator -sysdir out/target/product/generic/ -system out/target/product/generic/system.img -ramdisk out/target/product/generic/ramdisk.img -data out/target/product/generic/userdata.img -kernel prebuilt/android-arm/kernel/kernel-qemu -sdcard sdcard.img -skindir sdk/emulator/skins -skin WVGA800 -scale 0.7 -memory 512 -partition-size 1024


check this link for abovehttps://stackoverflow.com/questions/9022750/running-emulator-after-building-android-from-source


https://www.androidcookbook.info/android-system/working-with-emulator-disk-images.html

---------------------------

in mac,

Install jdk8 and jre8

go to /Users/vinay.p/Library/Android/sdk/tools

run monitor

you can get this errorNo Java runtime present, requesting install

go to https://www.oracle.com/technetwork/java/javase/downloads/jdk12-downloads-5295953.html

accept the license agreement and click on Macosx java download. (sometimes accept and decline check box does not appear. these check boxes are just left to the text. do a trial and error and it should get checked.)

Installing and uninstalling java and jre,https://docs.oracle.com/javase/9/install/installation-jdk-and-jre-macos.htm#JSJIG-GUID-0071963E-D247-4D15-BF49-AD19C7260740


uninstallsudo rm -rf /Library/Java/*


Only one jdk worked for mejdk-8u151-macosx-x64.dmg


Download from here (You need to have an account with Oracle to be able to download archived downloads.)https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html---------------------------


USB SDhttps://askubuntu.com/questions/118961/how-can-a-usb-be-detected-but-not-show-up-anywhere

https://blog.csdn.net/outofmemo/article/details/53348552


very good usb introhttps://blog.csdn.net/mao0514/article/details/24996553

https://blog.csdn.net/HellDevil/article/details/5604421

https://askubuntu.com/questions/18374/how-to-understand-the-flow-of-usb-detection


https://source.android.com/devices/storage/config


https://osmocom.org/projects/quectel-modems/wiki/Android_USB_Gadget


important link https://blog.csdn.net/encourage2011/article/details/76407232


https://developer.toradex.com/knowledge-base/usb-device-mode-(linux)


https://community.nxp.com/thread/309507


https://www.digi.com/resources/documentation/digidocs/90001945-13/reference/bsp/cc6/r_usb_device.htm


https://blog.csdn.net/q1183345443/article/details/81911699


https://community.nxp.com/docs/DOC-335495


https://blog.csdn.net/fudan_abc/article/details/1954261



https://askubuntu.com/questions/65363/udev-not-running-remove-events


https://www.linuxquestions.org/questions/linux-desktop-74/udev-not-doing-remove-rules-841733/

https://blog.csdn.net/kongbaidepao/article/details/78970819


https://blog.csdn.net/ly890700/article/details/54907509



usb sda path/sys/devices/soc0/soc/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb2/2-1/2-1:1.0/host0/target0:0:0/0:0:0:0



emmc booting: 

one port gets enumerated dnamiccall

Kworkerhttps://unix.stackexchange.com/questions/406305/linux-keep-forking-kworker




Ramoops:

https://stackoverflow.com/questions/9682306/android-how-to-get-kernel-logs-after-kernel-panic


WiFi work:https://community.nxp.com/docs/DOC-1477http://androidxref.com/8.0.0_r4/xref/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiStateMachine.java


Capsense controller:https://www.cypress.com/file/46236/download


Buzzer:example,https://www.codingdemos.com/android-vibrate-programmatically/

for understandinghttp://pyeh.github.io/blog/2014/12/22/android-vibrator-on-msm8909-platform/

aosphttps://source.android.com/reference/hal/structvibrator__device

buzzer have three parameterschmod 777 /sys/class/buzzer/pwm-buzzer.0/duty_nschmod 777 /sys/class/buzzer/pwm-buzzer.0/freqchmod 777 /sys/class/buzzer/pwm-buzzer.0/volume

freq=1000volume=1000sound comes

below is a good tutorialhttps://blog.csdn.net/alifrank/article/details/81739144


code for vibator HAL is here

/home/mrigendra.chaubey/PROJECT_neon/hardware/libhardware/modules/vibrator

/home/mrigendra.chaubey/PROJECT_neon/hardware/interfaces/vibrator


jni/home/nikhil/cmap/android_build/frameworks/base/services/core/jni/com_android_server_VibratorService.cpp


java/home/nikhil/cmap/android_build/frameworks/base/services/core/java/com/android/server/VibratorService.java


IVibrator  service is here/home/nikhil/cmap/android_build/frameworks/base/core/java/android/os/IVibratorService.aidl



 VibratorService(VibratorService.java) implements all the interfaces defined by IVibratorService and calls them to the native layer via JNI. Lower level implementation


this guy makes it a systemservice

/home/nikhil/cmap/android_build/frameworks/base/services/java/com/android/server/SystemServer.java

 vibrator = new VibratorService(context);


understand hwservicmanager> hidl service management center, which is responsible for managing all hidl services in the system, which are started by the init process.


Vibrator app attached.

Sd slot issue:disk polling configuration and enabling the same, dynamic detection and working of SD Card Slot is possible [/sys/module/block/events_dfl_poll_msecs]


============================================================================================================================================================


Comments

Popular posts from this blog

dev_get_platdata understanding

Getting started with pinctrl subsystem linux

How to take systrace in android