- Offline the Physical Disk 0 and clear the read-only flag
- run diskpart.exe
- run "SELECT DISK 0" -- 0 is the physical disk I would like to use.
- run "OFFLINE DISK"
- run "ATTRIBUTES DISK CLEAR READONLY"
- run "ATTRIBUTES DISK" to check the readonly flag has been cleared.
- Create the raw disk in the Virtualbox Host - Ubuntu-Local
- Open up a command prompt.
- cd C:\Program Files\Oracle\VirtualBox
- VBoxManage internalcommands createrawvmdk -filename "G:\Ubuntu.vmdk" -rawdisk "\\.\PhysicalDrive0"
- VBoxManage storageattach "Ubuntu-Local" --storagectl "IDE" --port 0 --device 0 --type hdd --medium G:\Ubuntu.vmdk
(Noted: You are able to create this by VirtualBox GUI, but be sure to run as an administrator when launching VirtualBox GUI) - Run VirtualBox as an administrator
2014年4月13日 星期日
Using VirtualBox raw disk on Win7
2014年3月25日 星期二
Linux - data transfer between kernel/user space
put_user(x, ptr)
- Write a simple value into user spacex - Value to copy to user spaceptr - Destination address in user spaceget_user(x, ptr)
- Get a simple variable from user spacex - Variable to store resultptr - Source address in user spacecopy_to_user(void __user *to, const void *from, unsigned long n);
- Copy a block of data into user space- copy_from_user(void *to, const void __user *from, unsigned long n);
- Copy a block of data from user space
2014年3月18日 星期二
Android build instruction
- build
- m - build all modules from the top of the tree
- mm - build all of the modules in current directory
- mmm - build all of the modules in the supplied directory
- make
- make systemimage - system.img
- make ramdisk - ramdisk.img
- make userdataimage - userdata.img
- make snod - build system.img quickly without checking the dependency
- misc
- croot - change directory to the top of the tree
- cgrep - grep on all local c/c++ files
- jgrep - grep on all local java files
- resgrep - grep on all local res/*.xml files
- godir - go to directory containing a file.
- printconfig - print the current build configuraiton
2014年3月17日 星期一
Linux init.rc (android)
Trigger sequence
"early-init" -> "init" -> "early-fs" -> "fs" -> "post-fs" -> "early-boot" -> "boot"
At the end of "boot" trigger, start corresponding services
class_start core
class_start main
Android Zygote
- Linux kernel start the 1st process - init
- init fork a child process - ServiceManager
- init fork a child process - Zygote
- Zygote
- Fork an child process for SystemServer (register to ServiceManager)
- Main process is waiting to fork child processes of user applications from ActivityManagerService via socket
- Linux - fork() function
- return child pid in parent process
- return 0 in child process
2014年3月16日 星期日
Process/Thread in each OS
- MS DOS
- Single-Process
- Single-Thread
- Java VM
- Single Process
- Multi-Thread
- Unix - traditional
- Multi-Process
- Single-Thread
- Linux, Windows, Solaris, ...
- Multi-Process
- Multi-Thread
2014年3月10日 星期一
Android App components
4 types of Android application components.
- Activities - foreground UI handler
- Services - background service routine
- Content Providers - share app data, such as SQLite or data in filesystem.
- Broadcast Receivers - response to system-wide broadcast
訂閱:
文章 (Atom)