Wednesday, 15 November 2017

USB Bootable Stick - For Linux User

For Linux user, sorry its not necessary to explain you guys, as you might have aware of this..
but, tolerate I'm explaining for the people started..


Download Ubuntu ISO from the link below, preferred with LTS version which would be stable.

Ubuntu ISO download link


There are many ways to do this, which everyone might have not aware of...

1. Through UI, You can make use of "Startup Disk Creator" you can find searching it in the search box.



Press Make startup disk will create your USB stick easily.

2. Through terminal command

$ sudo dd if=/path/of/ISOfile/ubuntu-14.04.5-desktop-amd64.iso of=/dev/sdb1 bs=1M && sync
Which will take ~10 min to get your disk ready.

For windows users don't worry I could help you.. Follow the hyperlink USB Bootable Stick - For Windows User

Thanks.........:-)

https://www.amazon.in/gp/product/B0756Z43QS/ref=as_li_tl?ie=UTF8&camp=3638&creative=24630&creativeASIN=B0756Z43QS&linkCode=as2&tag=myblog08b4-21&linkId=edfba1abe25aeb011b8e38cc53147000




USB Bootable Stick - For Windows User

To create a Live USB stick

Common download of the Ubuntu from the link below, preferred with LTS version which would be tested as stable.

Ubuntu ISO download link


1. Download The Power ISO software which is good.
Power ISO download link

2. Extract and Install the application.


3. Run this as an Administrator and if it prompts for product key, just go with Unregistered.


4. Use a pendrive with minimum of 4GB space.


5. In Menubar > Tools > Create bootable USB drive

Through the bootable Usb drive option, you could see the administrator privilege, enter continue.



6. You can show the path of the Source image and destination to be written.

7. To burn the ISO file to the USB stick it might take ~20mins.


8. Once done, click OK to get your bootable USB stick.


For Linux users, You can help yourself by Following the hyperlink USB Bootable Stick - For Linux User

Thanks..........:-)

Password reset for Windows

Stuck with your computer to get opened!! I'm here............

Here, I could help you to recover your windows operating system without damaging your data..




If you forgot your password or if you need to peek into your neighbours, you can use this trick

( Be aware you can't find the password through this, just an hack....:-) )

1. Prepare your Ubuntu live USB stick ready..

if not, follow my other post which will help you to make use of getting ready with live USB stick.
a) USB Bootable Stick - For Windows User
b) USB Bootable Stick - For Linux User

2. Insert the live stick into the system and give a reboot/ restart


3. You could see the live image of Ubuntu popup. if not go to bios setting before bootup and change the boot option as USB to first priority.


4. This time I hope you could see the Ubuntu screen.


5. Enter "Try Ubuntu"  option.


6. You could see a GUI (Graphical User Interface) Desktop of Ubuntu.


7. Go to file manager "FILES" in the left end taskbar icon or you could search for the "Files" by pressing windows key.


8.You could see the volume of disk with some "Alphabets" like CBSCAFASFASF, You can verify by seeing the folders of C drive in it like system, system32, etc..


9. Enter to the directory and search for "sethc.exe"


and rename it as sethc-temp.exe


10. Search and rename cmd.exe to sethc.exe


11. Now again change sethc-temp.exe to cmd.exe. Its just swapping the two executable.


12. Its just simple, now you can restart the system by unplugging the Live stick, which will lead you to the windows screen


13. Just press the "shift" button for 5 times and You will see a command prompt


14. enter "net user"

which will list the users in the system, note the user details, which you need to crack

15. enter "net user test *"

where test is the user name in my case

16. This will prompt you for new password, enter the new password and confirm and enjoy the peeking.


Thanks.................................:-)


Tuesday, 14 November 2017

Emulating the ARM Versatile Express in Linux(Ubuntu) Machine using Qemu Emulator with minimal RFS from scratch



Emulating an ARM versatile express in Linux system using Qemu with minimal file system1. Requirements

a) Qemu

b) toolchain – cross compiling

c) Linux Kernel source code

d) Busybox – file system

a) Steps for installing Qemu

1. Create a directory
$ mkdir Source_Code

2. enter into the directory
$ cd Source_Code

3. clone the souce code of qemu from github
$ git clone git://git.qemu-project.org/qemu.git

4. enter in to the cloned directory
$ cd qemu

5. checkout the stable version from git
$ git checkout remotes/origin/stable-2.5 -b stable-2.5

6. create a path to compile the ./config file from qemu
$ cd ../../
$ mkdir -p Binary_images/Qemu_Bin

7. enter into the source directory qemu again
$ cd Source_Code/qemu

8.change the target location to the preferred directory
$ ./configure --target-list=arm-softmmu --prefix= ../../Binary_images/Qemu_Bin

9. This will create a Makefile in the directory and Build it
$ make

10. Now make it install by using the cmd
$ make install

b) Steps for downloading Toolchain
1.Enter to the link
http://sourcery.mentor.com/public/gnu_toolchain/arm-none-linux-gnueabi/

2.Download the latest version from the list
arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

3. Enter to the Binary_images directory and create a directory
$ cd Binary_images
$ mkdir -p ARM_Cross_Tools

4. Enter to the ARM_Cross_Tools and download the toolchain into ithe folder
$ cp ~/Downloads/arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 ~/Desktop/Source_Code/Binary_images/ARM_Cross_Tools

5. Enter into the ARM_Cross_Tools directory
$ cd ARM_Cross_Tools

6. Extract the toolchain with tar cmd into the same directory
$ tar xvf arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

b.1) Exporting the path to make it fixed for all time purpose
1. open the bashrc file
$ vi ~/.bashrc

2. add the line to the end of the file
export PATH= ~/Desktop/Source_Code/Binary_images/ARM_Cross_Tools/arm-2014.05/bin:$PATH

3. save the file with :wq! Or with ZZ.

c) Steps for Downloading Linux Kernel source code
1. Enter into the source_code directory again
$ cd Source_Code

2. clone the souce code of Likux kernel from github
$ git clone https://github.com/torvalds/linux
3. enter in to the cloned directory
$ cd linux

4. Checkout the stable version from git by Switching to version v4.4, Where linux kernel get updated daily
$ git checkout v4.4

This kernel source doesn't have any file system so we can take Busybox which gives us Rfs.

d) Steps for Downloading Busybox for Root file Sytem.
1.Enter to the link
https://busybox.net/downloads/

2.Download the latest version from the list
busybox-1.26.1.tar.bz2

3. Enter to the Binary_images directory
$ cd Binary_images

4. Enter to the Binary_images and download the Busybox into the folder
$ cp ~/Downloads/busybox-1.26.1.tar.bz2 ~/Desktop/Source_Code/Binary_images/

5. Enter into the Binary_images directory
$ cd ~/Desktop/Source_Code/Binary_images/

6. Extract the busybox source code with tar cmd into the same directory
$ tar xvf busybox-1.26.1.tar.bz2

Emulating steps
Step 1 – Selecting the Kernel config file:

1. Enter into the Linux source code
$ cd ~/Desktop/Source_Code/linux

2. Load default config for target board from ~/Documents/qemu-test/source_code/linux/arch/arm/ configs

Here we can find different defconfig files for different boards now we are doing for ARM versatile express board i.e vexpress_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- vexpress_defconfig

3. To enable some features for the device menuconfig can be used or save it as default settings
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- menuconfig

step 2 – Compiling the kernel
1. After configuring the menu it will create a Makefile
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- all

2. Run qemu with kernel image and check wheteher it is running successfully
$ ~/Binary_images/Qemu_Bin/qemu-system-arm -M vexpress-a9 -m 512M -dtb ./arch/arm/boot/ dts/vexpress-v2p-ca9.dtb -kernel ./arch/arm/boot/zImage -append “console=ttyAMA0” -serial stdio

Explanation in the previous command
qemu-system-arm:- ARM architecture emulation

-M vexpress-a9 :- simulation vexpress-a9 veneer, for different target u can find by command qemu-system-arm -M ? which list supported target.

-dtb file :- Use file as a device tree binary (dtb) image and pass it to the kernel on boot.
-kernel :- to provide the Linux kernel image zImage
-append “console=ttyAMA0” :- kernel boot parameters, here to tell the kernel vexpress board runs, serial device which tty.

After this comiplation terminal will end in kernel panic mode. Because it doesn't have the rfs to load.

Step 3 – Busybox compilation

1. Enter into the Binary_images directory where Busybox is extracted previously
$ cd ~/Desktop/Source_Code/Binary_images/ busybox-1.26.1

2. Create a default defconfig file
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- defconfig

3. To enable Busybox as static library
$make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- menuconfig

4. In menuconfig GUI
Enter the Busybox Settings and in Build option enable the Busybox as static library.

5. Exit the menuconfig by saving

6. Now compile the Busybox
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- install

Step 4 – Folder for VFS

1. The above build of Busybox will creates a directory called _install containing the root filesystem tree.
2. Enter into the _install directory
$ cd ~/Desktop/Source_Code/Binary_images/ busybox-1.26.1/_install

3. Add some more direcotires which make a minimal file system
$ mkdir -p proc sys tmp root var mnt dev Home etc/init.d

step 5 – Download embedded linux files from git

1.Enter into the Binar_images directory
$ cd ~/Desktop/Source_Code/Binary_images/

2. Clone the files from git
$ git clone https://github.com/mahadevvinay/Embedded_Linux_Files.git

3. enter in to the cloned directory
$ cd Embedded_Linux_Files

4. Copy the file to the respective directories in _install directory.
$ cp fstab ~/Desktop/Source_Code/Binary_images/ busybox-1.26.1/_install/etc/
$ cp inittab ~/Desktop/Source_Code/Binary_images/ busybox-1.26.1/_install/etc/
$ cp rcS ~/Desktop/Source_Code/Binary_images/ busybox-1.26.1/_install/etc/init.d/

Step 6 – File in the rcs should be given permission
$ chmod 777 ~/Desktop/Source_Code/Binary_images/ busybox-1.26.1/_install/etc/init.d/rcS

step 7 - Creating ext3 image file and Copy all the files in our _install folder to image:

$ dd if=/dev/zero of=RootFS.ext3 bs=1M count=$((32))
$ sudo mkfs.ext3 RootFS.ext3
$ mkdir tmpfs
$ sudo mount -t ext3 RootFS.ext3 tmpfs/ -o loop
$ sudo cp -r _install/* tmpfs/.
$ sudo umount tmpfs

Step 8 – Emulating the Qemu

~/Desktop/Source_Code/Binary_images/Qemu_Bin/bin/qemu-system-arm -M vexpress-a9 -dtb ~/Desktop/Source_Code/linux/arch/arm/boot/dts/vexpress-v2p-ca9.dtb -kernel ~/Desktop/Source_ Code/linux/arch/arm/boot/zImage -append "root=/dev/mmcblk0 console=ttyAMA0" -sd ~/Desktop/ Source_Code/Binary_images/busybox-1.26.1/RootFS.ext3 -serial stdio

Done. This will emulate the system terminal with Root file System.
You have learnt a new thing now.............All the best:-)