about summary refs log tree commit diff stats
path: root/README
Commit message (Expand)AuthorAgeFilesLines
* RANGER! RANGER! HIGH VOLTAGE! v1.6.1hut2013-05-241-1/+1
* manpage: renamed example/ to /usr/share/doc/ranger/hut2013-03-091-1/+1
* Fire in the Hole! v1.6.0hut2013-02-221-1/+1
* README: updated introductionhut2013-02-221-3/+5
* README: update dependencieshut2013-02-221-2/+2
* README: removed bash dependencyhut2013-02-181-1/+0
* README: added w3m as dependency for viewing imageshut2013-02-041-0/+1
* README: add bash as an optional dephut2013-02-031-0/+1
* Merge branch 'stable'hut2012-08-101-1/+1
|\
| * ceci n'est pas un nouveau version v1.5.5hut2012-08-101-1/+1
* | renamed ranger/defaults to ranger/confighut2012-08-021-3/+3
|/
* What kind of idiot invented bugs anyway? v1.5.4hut2012-05-031-1/+1
* Always remember to bring your towel. v1.5.3hut2012-03-051-1/+1
* Added "sudo" optional dependency to READMEhut2012-03-051-0/+1
* corrected READMEhut2011-11-091-4/+4
* The hard work of the electrons must be respected. v1.5.2hut2011-10-241-1/+1
* The hard work of the computer must be respected. v1.5.1hut2011-10-241-1/+1
* README: Added newlinehut2011-10-111-0/+1
* fixed some documentationhut2011-10-101-2/+3
* README: "file" really is optionalhut2011-10-101-1/+1
* README: Updated dependencieshut2011-10-081-4/+4
* README: Updatehut2011-10-081-21/+22
* general updateshut2011-10-081-5/+11
* README: polished, removed INSTALLhut2011-10-051-48/+44
* Changed version to 1.5.0hut2011-10-021-1/+1
* Merge branch 'stable'hut2011-10-021-1/+1
|\
| * One in five ranger users use it exclusively for browsing porn v1.4.4hut2011-10-021-1/+1
* | A little README updatehut2011-09-291-2/+3
* | shortened README, added early reference to the man pagehut2011-09-281-86/+19
|/
* Merge branch 'stable'hut2011-04-261-1/+1
|\
| * This gonna be cool once it's finished v1.4.3hut2011-04-051-1/+1
* | Use chardet in case of encoding detection problemshut2011-04-261-0/+1
|/
* Next version will run on pure Lisp Machines only v1.4.2hut2011-03-051-1/+1
* Added --choosedir, a more logical alternative to --fail-unless-cdhut2011-02-151-5/+4
* Moved vimscript to README next to the bash script :)hut2011-02-151-6/+26
* If ranger won't run, you still got peanut butter to live for. v1.4.1hut2011-01-041-1/+1
* We are not authorized to disclose the commit message v1.4.0hut2010-12-221-1/+1
* updated READMEhut2010-12-101-3/+6
* Merge branch 'cp+preview'hut2010-10-121-0/+6
|\
| * Merge branch 'master' into previewhut2010-10-081-1/+1
| |\
| * \ Merge branch 'stable' into previewhut2010-10-051-6/+35
| |\ \
| | * | core.actions: Fixed yy/pp bug when yanking multiple directories v1.2.1hut2010-09-161-1/+1
| * | | data/scope.sh: added lynxhut2010-06-221-0/+1
| * | | README: added dependencies for scope.shhut2010-06-221-0/+5
* | | | new version: 1.3.1, merge with cp+preview branchhut2010-10-121-1/+1
| |_|/ |/| |
* | | Incremented version number to 1.3 (testing)hut2010-09-131-1/+1
| |/ |/|
* | Beware of low-flying butterflies v1.2.0hut2010-09-131-1/+1
* | README: Usage Tips sectionhut2010-09-131-0/+6
* | README: added ranger starting function examplehut2010-09-111-0/+14
* | Tuned versioning scheme to be more intuitive, back to 1.1.2hut2010-08-281-2/+2
a4d12030c0c872d0bec3a542f16a554d386'>3d4fba4d ^
6030d7e2 ^
3d4fba4d ^
ee9a9237 ^
6030d7e2 ^


5f6edeea ^
ee9a9237 ^
6030d7e2 ^


5f6edeea ^

ee9a9237 ^
6030d7e2 ^

ee9a9237 ^
6030d7e2 ^






dd9ba09a ^
6030d7e2 ^



8b9dd2d1 ^
9d27e966 ^
dd9ba09a ^
9d27e966 ^
6030d7e2 ^
9d27e966 ^
6030d7e2 ^
9d27e966 ^
6030d7e2 ^

e59a74ab ^


ff167ad7 ^

ee9a9237 ^
6030d7e2 ^





ee9a9237 ^
6030d7e2 ^


5f6edeea ^
e59a74ab ^


3a044623 ^
e59a74ab ^










5f6edeea ^
9d27e966 ^

ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
6030d7e2 ^
9d27e966 ^
ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
6030d7e2 ^
9d27e966 ^
ee9a9237 ^
6030d7e2 ^

ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
6030d7e2 ^

ee9a9237 ^
6030d7e2 ^

ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
6030d7e2 ^
ddd2e989 ^
ee9a9237 ^
6030d7e2 ^
ddd2e989 ^

ee9a9237 ^
ddd2e989 ^
ee9a9237 ^
6030d7e2 ^
9d27e966 ^
6030d7e2 ^
5f6edeea ^

9d27e966 ^

ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
6030d7e2 ^
9d27e966 ^
ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
6030d7e2 ^
9d27e966 ^
ee9a9237 ^
6030d7e2 ^

ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
6030d7e2 ^
9d27e966 ^

ee9a9237 ^
6030d7e2 ^

ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
6030d7e2 ^
9d27e966 ^

ee9a9237 ^
6030d7e2 ^

ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
6030d7e2 ^
9d27e966 ^
ee9a9237 ^
6030d7e2 ^

ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
6030d7e2 ^
ddd2e989 ^
ee9a9237 ^
6030d7e2 ^
ddd2e989 ^

ee9a9237 ^
ddd2e989 ^
ee9a9237 ^
6030d7e2 ^
9d27e966 ^
6030d7e2 ^
5f6edeea ^



6030d7e2 ^
9b16f190 ^
6030d7e2 ^
9b16f190 ^


6030d7e2 ^
9b16f190 ^
5f6edeea ^
ee9a9237 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255


                                                                 


                                                                                                                                                 
 
                        



                                            



                                                                                                                                                                                         

                                                                           
              


                                                                                                                                                                       
                                                                                                                                                                        
                                                                  
                   

                                                                                                                                                                      
              
                                 
                      

                                                                                                                                                                  
                   
                                                   
                      


               
             
                                                                                                                                                                            
             
                                                                                                                                                                             
                                                                                                     
                                 

                                                                                                                                                                              
               
                                

                                                                                                                                                                              
               
                                  

                                                                                                                                                                              
               
                                 

                                                                                                                                                                              
               
              
                             
                      

                                                                                                                                                                  
                                                                                                                                                                       
                    
                                                                                                                                                                           
                         


                 
                  
              


                                                                                                                                                                       

                                                          
              

                                                                                                                                                                       
                      






               
                                                                                                                                                                             



                                                                                                                                                                            
                                                               
                  
                                                                                                                                                                            
                                        
                                                                                                                                                                              
                                         
                                                                                                                                                                             
                 

                                 


                                                     

                                                                                                                                                                           
                         





                 
              


                                                                                                                                                                       
 


                               
                                                             










                                                                                                                                                                  
                         

                                  
                   
                               
              
                                
                      
                                                                                                                                                                  
                                   
                   
                                
              
                                
                      
                                                                                                                                                                  
                                  
                   

                                
              
                         
                      

                                                                                                                                                                  
                   

                                
              
                                
                      
                                                                                                                                                                  
                                                 
                   
                                                 

                               
              
                                      
                      
                                                                                                                                                                  
           
             

                          

                                  
                   
                               
              
                                
                      
                                                                                                                                                                  
                                   
                   
                                
              
                                
                      
                                                                                                                                                                  
                                 
                   

                                
              
                         
                      
                                                                                                                                                                  

                                                 
                   

                                
              
                                
                      
                                                                                                                                                                  

                                 
                   

                                
              
                         
                      
                                                                                                                                                                  
                                                 
                   

                                
              
                                
                      
                                                                                                                                                                  
                                                 
                   
                                                  

                               
              
                                      
                      
                                                                                                                                                                  
           
             



              
                         
           
                        


            
          
                                              
 
                            
# write-stream: like write, but write streams rather than strings

== code
#   instruction                     effective address                                                   register    displacement    immediate
# . op          subop               mod             rm32          base        index         scale       r32
# . 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes

#? Entry:  # manual test
#?     # write-stream(stdout, _test-stream2)
#?     68/push  _test-stream2/imm32
#?     68/push  1/imm32/stdout
#?     e8/call write-stream/disp32
#?     # syscall(exit, Num-test-failures)
#?     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/EBX   Num-test-failures/disp32          # copy *Num-test-failures to EBX
#?     b8/copy-to-EAX  1/imm32/exit
#?     cd/syscall  0x80/imm8

write-stream:  # f : fd or (address stream), s : (address stream) -> <void>
    # . prolog
    55/push-EBP
    89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
    # if (f < 0x08000000) _write-stream(f, s), return  # f can't be a user-mode address, so treat it as a kernel file descriptor
    81          7/subop/compare     1/mod/*+disp8   5/rm32/EBP    .           .             .           .           8/disp8         0x08000000/imm32  # compare *(EBP+8)
    73/jump-if-greater-unsigned-or-equal  $write-stream:fake/disp8
    # . . push args
    ff          6/subop/push        1/mod/*+disp8   5/rm32/EBP    .           .             .           .           0xc/disp8       .                 # push *(EBP+12)
    ff          6/subop/push        1/mod/*+disp8   5/rm32/EBP    .           .             .           .           8/disp8         .                 # push *(EBP+8)
    # . . call
    e8/call  _write-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
    eb/jump  $write-stream:end/disp8
$write-stream:fake:
    # otherwise, treat 'f' as a stream to append to
    # . save registers
    50/push-EAX
    56/push-ESI
    57/push-EDI
    # EDI = f
    8b/copy                         1/mod/*+disp8   5/rm32/EBP    .           .                         7/r32/EDI   8/disp8         .                 # copy *(EBP+8) to EDI
    # ESI = s
    8b/copy                         1/mod/*+disp8   5/rm32/EBP    .           .                         6/r32/ESI   0xc/disp8       .                 # copy *(EBP+12) to ESI
    # EAX = _append-4(&f->data[f->write], &f->data[f->length], &s->data[s->read], &s->data[s->write])
    # . . push &s->data[s->write]
    8b/copy                         0/mod/indirect  6/rm32/ESI    .           .             .           0/r32/EAX   .               .                 # copy *ESI to EAX
    8d/copy-address                 1/mod/*+disp8   4/rm32/sib    6/base/ESI  0/index/EAX   .           0/r32/EAX   0xc/disp8       .                 # copy ESI+EAX+12 to EAX
    50/push-EAX
    # . . push &s->data[s->read]
    8b/copy                         1/mod/*+disp8   6/rm32/ESI    .           .             .           0/r32/EAX   4/disp8         .                 # copy *(ESI+4) to EAX
    8d/copy-address                 1/mod/*+disp8   4/rm32/sib    6/base/ESI  0/index/EAX   .           0/r32/EAX   0xc/disp8       .                 # copy ESI+EAX+12 to EAX
    50/push-EAX
    # . . push &f->data[f->length]
    8b/copy                         1/mod/*+disp8   7/rm32/EDI    .           .             .           0/r32/EAX   8/disp8         .                 # copy *(EDI+8) to EAX
    8d/copy-address                 1/mod/*+disp8   4/rm32/sib    7/base/EDI  0/index/EAX   .           0/r32/EAX   0xc/disp8       .                 # copy EDI+EAX+12 to EAX
    50/push-EAX
    # . . push &f->data[f->write]
    8b/copy                         0/mod/indirect  7/rm32/EDI    .           .             .           0/r32/EAX   .               .                 # copy *EDI to EAX
    8d/copy-address                 1/mod/*+disp8   4/rm32/sib    7/base/EDI  0/index/EAX   .           0/r32/EAX   0xc/disp8       .                 # copy EDI+EAX+12 to EAX
    50/push-EAX
    # . . call
    e8/call  _append-4/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0x10/imm32        # add to ESP
    # f->write += EAX
    01/add                          0/mod/indirect  7/rm32/EDI    .           .             .           0/r32/EAX   .               .                 # add EAX to *EDI
    # s->read += EAX
    01/add                          1/mod/*+disp8   6/rm32/ESI    .           .             .           0/r32/EAX   4/disp8         .                 # add EAX to *(ESI+4)
    # . restore registers
    5f/pop-to-EDI
    5e/pop-to-ESI
    58/pop-to-EAX
$write-stream:end:
    # . epilog
    89/copy                         3/mod/direct    4/rm32/ESP    .           .             .           5/r32/EBP   .               .                 # copy EBP to ESP
    5d/pop-to-EBP
    c3/return

_write-stream:  # fd : int, s : (address stream) -> <void>
    # . prolog
    55/push-EBP
    89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
    # . save registers
    50/push-EAX
    51/push-ECX
    52/push-EDX
    53/push-EBX
    56/push-ESI
    57/push-EDI
    # ESI = s
    8b/copy                         1/mod/*+disp8   5/rm32/EBP    .           .             .           6/r32/ESI   0xc/disp8       .                 # copy *(EBP+12) to ESI
    # EDI = s->read
    8b/copy                         1/mod/*+disp8   6/rm32/ESI    .           .             .           7/r32/EDI   4/disp8         .                 # copy *(ESI+4) to EDI
    # EDX = s->write
    8b/copy                         0/mod/indirect  6/rm32/ESI    .           .             .           2/r32/EDX   .               .                 # copy *ESI to EDX
    # syscall(write, fd, &s->data[s->read], s->write - s->read)
    # . . fd : EBX
    8b/copy                         1/mod/*+disp8   5/rm32/EBP    .           .             .           3/r32/EBX   8/disp8         .                 # copy *(EBP+8) to EBX
    # . . data : ECX = &s->data[s->read]
    8d/copy-address                 1/mod/*+disp8   4/rm32/sib    6/base/ESI  7/index/EDI   .           1/r32/ECX   0xc/disp8       .                 # copy ESI+EDI+12 to ECX
    # . . size : EDX = s->write - s->read
    29/subtract                     3/mod/direct    2/rm32/EDX    .           .             .           7/r32/EDI   .               .                 # subtract EDI from EDX
    # . . syscall
    b8/copy-to-EAX  4/imm32/write
    cd/syscall  0x80/imm8
    # if (EAX < 0) abort
    3d/compare-EAX-with  0/imm32
    0f 8c/jump-if-lesser  $_write-stream:abort/disp32
    # s->read += EAX
    01/add                          1/mod/*+disp8   6/rm32/ESI    .           .             .           0/r32/EAX   4/disp8         .                 # add EAX to *(ESI+4)
    # . restore registers
    5f/pop-to-EDI
    5e/pop-to-ESI
    5b/pop-to-EBX
    5a/pop-to-EDX
    59/pop-to-ECX
    58/pop-to-EAX
    # . epilog
    89/copy                         3/mod/direct    4/rm32/ESP    .           .             .           5/r32/EBP   .               .                 # copy EBP to ESP
    5d/pop-to-EBP
    c3/return

$_write-stream:abort:
    # . _write(2/stderr, error)
    # . . push args
    68/push  "_write-stream: failed to write to file\n"/imm32
    68/push  2/imm32/stderr
    # . . call
    e8/call  _write/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
    # . syscall(exit, 1)
    bb/copy-to-EBX  1/imm32
    b8/copy-to-EAX  1/imm32/exit
    cd/syscall  0x80/imm8
    # never gets here

test-write-stream-single:
    # setup
    # . clear-stream(_test-stream)
    # . . push args
    68/push  _test-stream/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
    # . clear-stream(_test-stream2)
    # . . push args
    68/push  _test-stream2/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
    # . write(_test-stream2, "Ab")
    # . . push args
    68/push  "Ab"/imm32
    68/push  _test-stream2/imm32
    # . . call
    e8/call  write/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
    # write-stream(_test-stream, _test-stream2)
    # . . push args
    68/push  _test-stream2/imm32
    68/push  _test-stream/imm32
    # . . call
    e8/call  write-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
    # check-stream-equal(_test-stream, "Ab", msg)
    # . . push args
    68/push  "F - test-write-stream-single"/imm32
    68/push  "Ab"/imm32
    68/push  _test-stream/imm32
    # . . call
    e8/call  check-stream-equal/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0xc/imm32         # add to ESP
    # . end
    c3/return

test-write-stream-appends:
    # setup
    # . clear-stream(_test-stream)
    # . . push args
    68/push  _test-stream/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
    # . clear-stream(_test-stream2)
    # . . push args
    68/push  _test-stream2/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
    # . write(_test-stream2, "C")
    # . . push args
    68/push  "C"/imm32
    68/push  _test-stream2/imm32
    # . . call
    e8/call  write/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
    # first write
    # . write-stream(_test-stream, _test-stream2)
    # . . push args
    68/push  _test-stream2/imm32
    68/push  _test-stream/imm32
    # . . call
    e8/call  write-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
    # second write
    # . write(_test-stream2, "D")
    # . . push args
    68/push  "D"/imm32
    68/push  _test-stream2/imm32
    # . . call
    e8/call  write/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
    # . write-stream(_test-stream, _test-stream2)
    # . . push args
    68/push  _test-stream2/imm32
    68/push  _test-stream/imm32
    # . . call
    e8/call  write-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
    # check-stream-equal(_test-stream, "CD", msg)
    # . . push args
    68/push  "F - test-write-stream-appends"/imm32
    68/push  "CD"/imm32
    68/push  _test-stream/imm32
    # . . call
    e8/call  check-stream-equal/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0xc/imm32         # add to ESP
    # . end
    c3/return

== data

_test-stream2:
    # current write index
    4/imm32
    # current read index
    1/imm32
    # length
    8/imm32
    # data
    41/A 42/B 43/C 44/D 00 00 00 00  # 8 bytes

# . . vim:nowrap:textwidth=0