Rev 2933 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2933 | Rev 2952 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | */ |
32 | */ |
33 | /** |
33 | /** |
34 | * @file |
34 | * @file |
35 | */ |
35 | */ |
36 | 36 | ||
- | 37 | #include <stdio.h> |
|
- | 38 | ||
37 | static void kputint(unsigned i) |
39 | static void kputint(unsigned i) |
38 | { |
40 | { |
39 | unsigned dummy; |
41 | unsigned dummy; |
40 | asm volatile ( |
42 | asm volatile ( |
41 | "movl $30, %%eax;" |
43 | "movl $30, %%eax;" |
Line 44... | Line 46... | ||
44 | : "d" (i) /* input */ |
46 | : "d" (i) /* input */ |
45 | : "%eax","%ecx" /* all scratch registers clobbered */ |
47 | : "%eax","%ecx" /* all scratch registers clobbered */ |
46 | ); |
48 | ); |
47 | } |
49 | } |
48 | 50 | ||
- | 51 | int z = 42; |
|
- | 52 | ||
49 | void test_func(void); |
53 | void test_func(void); |
50 | void test_func(void) |
54 | void test_func(void) |
51 | { |
55 | { |
- | 56 | kputint(-1); |
|
- | 57 | kputint(z); |
|
- | 58 | printf("Hello, world! (from rtld)\n"); |
|
- | 59 | getchar(); |
|
- | 60 | printf("x\n"); |
|
- | 61 | while(1); |
|
- | 62 | ||
52 | asm ( |
63 | asm ( |
53 | "movl $253, %%eax;" |
64 | "movl $253, %%eax;" |
54 | "int $0x30" |
65 | "int $0x30" |
55 | : /* output */ |
66 | : /* output */ |
56 | : /* input */ |
67 | : /* input */ |