原创 c volatile keyword and memory cache
The 'volatile' keyword is used to tells the compiler to fetch a variable each time from memory rather then use a "compi
原创 fork() printf()
#include <stdio.h> #include <sys/types.h> #include <unistd.h> int main(void) { int i; for(i=0; i<2; i++){
原创 find variale value in ELF file
copied from stackoverflow. First, you would use readelf to determine the virtual address of the variable (where it live
原创 add a new system call for x86
#define T_SYSCALL 64 // system call #define SYS_fork 1 #define SYS_sleep 2 #define SYSCALL(name) \
原创 vscode regex replace
question: replace following line in left to its right part. [SYS_write] sys_write, -> [SYS_write] "write", solut
原创 network byte order
copied from wiki. Many IETF RFCs use the term network order, meaning the order of transmission for bits and bytes over
原创 C function implementation: memcpy and strcpy and others
1. memcpy. An often being asked interview question. The key is to handle address overlap. void *memcpy(void *dest, con
原创 cut with tr
question: delete docker images with none tag. sample output: hfyin@hfyin-VirtualBox:~/projects$ docker image ls | grep
原创 git command
1. check a commit before a specified commit Use git show HEAD^1. You can replace HEAD with your commit-hash refer: http
原创 register sram dram nor flash nand flash
refer: https://zhuanlan.zhihu.com/p/70273183 https://www.zhihu.com/question/20075426 上面的兩個文章總結的挺好的,補償一點: 1. sram, dram都
原创 c data type size
copied from wiki: The actual size of the integer types varies by implementation. The standard requires only size relati
原创 c list sample code
c list sample code. The list interface may varies depends on use case. It seems the last one is more popular. However,
原创 c variable-length argument lists
a simple program demostrate c variable-length argument lists, and how to refer variable-length argument in c macro. #i
原创 give IAM user billing permission
1. config policy,attach policy to IAM user or group. 2. root user login, and go to account page, then find 'IAM User an
原创 stabs: c語言如何使用stabs存放debug信息,以及如何使用stabs查找函數, stacktrace 如何實現
stabs 已經被 DWARF 替代...... stabs是什麼 Stabs (Symbol Table String) refers to a format for information that describes a progr