Rev 4874 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4349 | Serge | 1 | |
2 | |||
3 | |||
6536 | serge | 4 | |
4349 | Serge | 5 | |
6 | #tls:4 tid reserved for thread slot |
||
7 | #tls:8 thread's stack low limit |
||
8 | #tls:12 thread's stack high limit |
||
9 | #tls:16 reseved for libc |
||
10 | |||
11 | |||
12 | __crt_start: |
||
6536 | serge | 13 | movl $68, %eax |
4349 | Serge | 14 | movl $12, %ebx |
15 | lea __size_of_stack_reserve__, %ecx |
||
16 | addl $4095, %ecx #load stack size |
||
17 | andl $-4096, %ecx #align to page granularity |
||
18 | int $0x40 #and allocate |
||
19 | testl %eax, %eax |
||
20 | jz 1f |
||
21 | |||
22 | |||
23 | movl %eax, %fs:8 |
||
24 | movl %ecx, %fs:12 #save stack base - low limit |
||
25 | #save stack top - high limit |
||
26 | movl %ecx, %esp #reload stack |
||
27 | |||
28 | |||
29 | |||
30 | |||
31 | movl %esp, %ebx |
||
32 | movl $-1, %ecx |
||
33 | int $0x40 |
||
34 | |||
35 | |||
36 | movl %eax, %fs:0 #save pid |
||
37 | |||
38 | |||
39 | |||
40 | |||
6536 | serge | 41 | 1: |
4349 | Serge | 42 | int3 #trap to debugger |
43 | |||
44 | |||
45 |