Linux OS


questions and curiosity


36 developerworks


http://www.ibm.com/developerworks/cn/linux/



34 branch prefect



32: copy from user


http://wdqfirst.blog.163.com/blog/static/11334741120118240421956/


http://blog.csdn.net/sunnybeike/article/details/7027867


MOVS


Moves the byte, word, or doubleword specified with the second operand (source operand) to the location specified 
with the first operand (destination operand). Both the source and destination operands are located in memory. The 
address of the source operand is read from the DS:ESI or the DS:SI registers (depending on the address-size 
attribute of the instruction, 32 or 16, respectively). The address of the destination operand is read from the ES:EDI 
or the ES:DI registers (again depending on the address-size attribute of the instruction). The DS segment may be 
overridden with a segment override prefix, but the ES segment cannot be overridden.
At the assembly-code level, two forms of this instruction are allowed: the “explicit-operands” form and the “no-
operands” form. The explicit-operands form (specified with the MOVS mnemonic) allows the source and destination 
operands to be specified explicitly. Here, the source and destination operands should be symbols that indicate the 
size and location of the source value and the destination, respectively. This explicit-operands form is provided to 
allow documentation; however, note that the documentation provided by this form can be misleading. That is, the 
source and destination operand symbols must specify the correct type (size) of the operands (bytes, words, or 
doublewords), but they do not have to specify the correct location. The locations of the source and destination 
operands are always specified by the DS:(E)SI and ES:(E)DI registers, which must be loaded correctly before the 
move string instruction is executed. 
The no-operands form provides “short forms” of the byte, word, and doubleword versions of the MOVS instruc-
tions. Here also DS:(E)SI and ES:(E)DI are assumed to be the source and destination operands, respectively. The 
size of the source and destination operands is selected with the mnemonic: MOVSB (byte move), MOVSW (word 
move), or MOVSD (doubleword move).
After the move operation, the (E)SI and (E)DI registers are incremented or decremented automatically according 
to the setting of the DF flag in the EFLAGS register. (If the DF flag is 0, the (E)SI and (E)DI register are incre-mented; 

if the DF flag is 1, the (E)SI and (E)DI registers are decremented.) The registers are incremented or 

decremented by 1 for byte operations, by 2 for word operations, or by 4 for doubleword operations.



Operation
DEST ← SRC;
Non-64-bit Mode:
IF (Byte move)
THEN IF DF = 0
THEN 
(E)SI ← (E)SI + 1; 
(E)DI ← (E)DI + 1; 
ELSE 
(E)SI ← (E)SI – 1; 
(E)DI ← (E)DI – 1; 
FI;
ELSE IF (Word move)
THEN IF DF = 0
(E)SI ← (E)SI + 2; 
(E)DI ← (E)DI + 2; 
FI;
ELSE 
(E)SI ← (E)SI – 2; 
(E)DI ← (E)DI – 2; 
FI;
ELSE IF (Doubleword move)
THEN IF DF = 0
(E)SI ← (E)SI + 4; 
(E)DI ← (E)DI + 4; 
FI;
ELSE 
(E)SI ← (E)SI – 4; 
(E)DI ← (E)DI – 4; 
FI;
FI;

rep instruction

Operation
IF AddressSize = 16
    THEN
        Use CX for CountReg;
        Implicit Source/Dest operand for memory use of SI/DI;
    ELSE IF AddressSize = 64
        THEN Use RCX for CountReg; 
        Implicit Source/Dest operand for memory use of RSI/RDI;
    ELSE
        Use ECX for CountReg;
        Implicit Source/Dest operand for memory use of ESI/EDI;
FI;
WHILE CountReg ≠ 0
DO
Service pending interrupts (if any);
Execute associated string instruction;
CountReg ← (CountReg – 1);
IF CountReg = 0
THEN exit WHILE loop; FI;
IF (Repeat prefix is REPZ or REPE) and (ZF = 0)
or (Repeat prefix is REPNZ or REPNE) and (ZF = 1)
THEN exit WHILE loop; FI;
OD;


31  64 Bit memory

64 Bit memory

others 


http://en.wikipedia.org/wiki/X86-64


30 size of PIPE


29 Physical address map


28 IOremap


IO shared memory ==> IOremap ==> vmalloc



27: Per CPU


26: 各种锁


25: smp中


processor A 访问共享数据Data, A对Data加锁,此时processor B 也必须要用到Data,怎么办?


23: initrd and vmlinux compiling ?


the procedure of buidling initrd and vmlinx 

and the script 

are they compiled with the same source files ?


22: linux kernel startup


http://blog.chinaunix.net/uid/1701789.html


grub and linux,  how does it work ? why it need grub ? 



4: float


http://www.ruanyifeng.com/blog/2010/06/ieee_floating-point_representation.html


http://zhidao.baidu.com/question/97733490.html


最大值就是:0 11111110 11111111111111111111111

0 1111 1110 1.111 1111 1111 1111 1111 1111 -- 有效正max
1 1111 1110 1.111 1111 1111 1111 1111 1111 -- 有效负max


V = (-1)^0 * 2^(254-127) * 1.111 1111 1111 1111 1111 1111
  = 2^(127-23) * 1111 1111 1111 1111 1111 1111.
  = 2^104 * 16777215
  = 3.4028234663852885981170418348452e+38


0 0000 0000 0.000 0000 0000 0000 0000 0001 -- 正min (+0)
1 0000 0000 0.000 0000 0000 0000 0000 0001 -- 负min (-0)


+V =  (-1)^0 * 2^(-126) ^ 0.000 0000 0000 0000 0000 0001
     =  + 2^(-149)
     =  + 1.4012984643248170709237295832899e-45
-V =  - 2^(-149)

0 1111 1111 0000 0000 0000 0000 0000 000 -- 正无穷
1 1111 1111 0000 0000 0000 0000 0000 000 -- 负无穷

+V = 正无穷 = 2^(128) =     3.4028236692093846346337460743177e+38
-V = 负无穷 = -2^(128) =  -3.4028236692093846346337460743177e+38

0 1111 1111 xxxx .... -- NaN (not a number)
1 1111 1111 xxxx .... -- NaN


5: pragma

http://gcc.gnu.org/onlinedocs/cpp/

http://gcc.gnu.org/onlinedocs/cpp/Pragmas.html#Pragmas

http://gcc.gnu.org/onlinedocs/cpp/Line-Control.html#Line-Control

http://gcc.gnu.org/onlinedocs/cpp/Stringification.html#Stringification


6:  preprocessor output


http://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html#Preprocessor-Output


8: fork exit wait4

task_struct

thread_info


9: spin lock and semaphore


 10: msi


http://blog.sina.com.cn/s/blog_538eef960100l6lv.html 


11: stack


http://blog.csdn.net/zsy2020314/article/details/9429707


12: 时钟中断处理函数process


13: driver

开始学习linux驱动,该看drivers目录下的什么驱动程序


drivers/misc/*.c
简单明了...
loopback.c

14: 理解linux OS 实现中的抽象层次机制

接口层次,oop编程方式


Linux 时钟处理机制


http://www.ibm.com/developerworks/cn/linux/l-cn-clocks/index.html


15: CFS


http://blog.csdn.net/zhoudaxia/article/details/7375780


http://blog.chinaunix.net/uid-20940095-id-3084063.html


16: interview 


http://www.newsmth.net/nForum/#!article/WorkLife/459252?p=1


17:  OS course

http://www.cse421.net/lecture/ 


18: kernel ring buffer and printk


http://unix.stackexchange.com/questions/35851/whats-the-difference-of-dmesg-output-and-var-log-messages


http://stackoverflow.com/questions/11412950/difference-between-dmesg-and-var-log-kern-log


http://www.ibm.com/developerworks/linux/library/l-kernel-logging-apis/index.html


19: B树、B-树、B+树、B*树 radix tree






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值