Saturday, 4 March 2017

Links I want to maintain

Nice Motivational Video

link to article on how to print string using assembly :
https://baptiste-wicht.com/posts/2011/11/print-strings-integers-intel-assembly.html 

Friday, 17 February 2017

Creating loop device on fedora


We can create a loop device in Linux which we can use as a virtual device for experiment. Following steps will show how to create loop device and use it for creation of file system. 

  • Add new device
 # losetup -f
/dev/loop0


  • Create a file which will serve as virtual device.


# dd if=/dev/urandom of=/bhushan bs=1M count=128
128+0 records in
128+0 records out
134217728 bytes (134 MB, 128 MiB) copied, 12.9207 s, 10.4 MB/s


  • Setup up the mapping between loop device and new file 

# losetup /dev/loop0 /bhushan



  • Use new virtual device for file system creation

# mkfs -t ext4 /dev/loop0
mke2fs 1.43.3 (04-Sep-2016)
Discarding device blocks: done                          
Creating filesystem with 131072 1k blocks and 32768 inodes
Filesystem UUID: 7be2cbaf-a2a5-4319-a7e9-51b749c69184
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729

Allocating group tables: done                          
Writing inode tables: done                          
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

# mount -t ext4 /dev/loop0 /mnt

# df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/loop0               120M  1.6M  110M   2% /mnt1

# umount /mnt1


  • Detach a file from loop device

# losetup -d /dev/loop0



Tuesday, 31 January 2017

.config changes for KGDB

Change following parameter for custom kernel development during KGDB setup :

CONFIG_STRICT_DEVMEM = n
CONFIG_KGDB_KDB = y
CONFIG_KGDB_KDB = y
CONFIG_KDB_DEFAULT_ENABLE=0x1
CONFIG_DEBUG_RODATA=n => kernel hacking => write protect kernel read only data strucuture

Reference :

https://www.kernel.org/pub/linux/kernel/people/jwessel/kdb/quickKDBkeyboard.html

http://landley.net/kdocs/Documentation/DocBook/xhtml-nochunks/kgdb.html#CompilingAKernel

https://www.kernel.org/pub/linux/kernel/people/jwessel/kdb/

Convert Fedora 25 login from command line to GUI

#dnf install @gnome-desktop
#dnf distro-sync
#dnf groupinstall gnome
#dnf groupinstall x-base
#systemctl start gdm
#systemctl set-default graphical.target