Rev 1665 | Rev 1673 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1665 | Rev 1668 | ||
---|---|---|---|
1 | #include "kolibri.h" |
1 | #include "kolibri.h" |
2 | #include "string.h" |
2 | #include "string.h" |
3 | 3 | ||
4 | 4 | ||
5 | extern char KOL_PATH[256]; |
5 | extern char KOL_PATH[256]; |
6 | extern char KOL_PARAM[256]; |
6 | extern char KOL_PARAM[256]; |
7 | extern char KOL_DIR[256]; |
7 | extern char KOL_DIR[256]; |
8 | 8 | ||
9 | 9 | ||
10 | void kol_exit() |
10 | void kol_exit() |
11 | { |
11 | { |
12 | asm ("int $0x40"::"a"(-1)); |
12 | asm ("int $0x40"::"a"(-1)); |
13 | } |
13 | } |
14 | 14 | ||
15 | 15 | ||
16 | void kol_sleep(unsigned d) |
16 | void kol_sleep(unsigned d) |
17 | { |
17 | { |
18 | asm ("int $0x40"::"a"(5), "b"(d)); |
18 | asm ("int $0x40"::"a"(5), "b"(d)); |
19 | } |
19 | } |
20 | 20 | ||
21 | 21 | ||
22 | void kol_wnd_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c) |
22 | void kol_wnd_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c) |
23 | { |
23 | { |
24 | asm ("nop"::"a"(0), "b"(x*65536+w), "c"(y*65536+h), "d"(c)); |
24 | asm ("nop"::"a"(0), "b"(x*65536+w), "c"(y*65536+h), "d"(c)); |
25 | asm ("movl $0xffffff, %esi \n int $0x40"); |
25 | asm ("movl $0xffffff, %esi \n int $0x40"); |
26 | } |
26 | } |
27 | 27 | ||
28 | 28 | ||
29 | void kol_wnd_move(unsigned x, unsigned y) |
29 | void kol_wnd_move(unsigned x, unsigned y) |
30 | { |
30 | { |
31 | asm ("nop"::"a"(67), "b"(x), "c"(y)); |
31 | asm ("nop"::"a"(67), "b"(x), "c"(y)); |
32 | asm ("movl $-1, %edx \n movl $-1, %esi \n int $0x40"); |
32 | asm ("movl $-1, %edx \n movl $-1, %esi \n int $0x40"); |
33 | } |
33 | } |
34 | 34 | ||
35 | 35 | ||
36 | void kol_event_mask(unsigned e) |
36 | void kol_event_mask(unsigned e) |
37 | { |
37 | { |
38 | asm ("int $0x40"::"a"(40), "b"(e)); |
38 | asm ("int $0x40"::"a"(40), "b"(e)); |
39 | } |
39 | } |
40 | 40 | ||
41 | 41 | ||
42 | unsigned kol_event_wait() |
42 | unsigned kol_event_wait() |
43 | { |
43 | { |
44 | asm ("int $0x40"::"a"(10)); |
44 | asm ("int $0x40"::"a"(10)); |
45 | } |
45 | } |
46 | 46 | ||
47 | 47 | ||
48 | unsigned kol_event_wait_time(unsigned time) |
48 | unsigned kol_event_wait_time(unsigned time) |
49 | { |
49 | { |
50 | asm ("int $0x40"::"a"(23), "b"(time)); |
50 | asm ("int $0x40"::"a"(23), "b"(time)); |
51 | } |
51 | } |
52 | 52 | ||
53 | 53 | ||
54 | unsigned kol_event_check() |
54 | unsigned kol_event_check() |
55 | { |
55 | { |
56 | asm ("int $0x40"::"a"(11)); |
56 | asm ("int $0x40"::"a"(11)); |
57 | } |
57 | } |
58 | 58 | ||
59 | 59 | ||
60 | void kol_paint_start() |
60 | void kol_paint_start() |
61 | { |
61 | { |
62 | asm ("int $0x40"::"a"(12), "b"(1)); |
62 | asm ("int $0x40"::"a"(12), "b"(1)); |
63 | } |
63 | } |
64 | 64 | ||
65 | 65 | ||
66 | void kol_paint_end() |
66 | void kol_paint_end() |
67 | { |
67 | { |
68 | asm ("int $0x40"::"a"(12), "b"(2)); |
68 | asm ("int $0x40"::"a"(12), "b"(2)); |
69 | } |
69 | } |
70 | 70 | ||
71 | 71 | ||
72 | void kol_paint_pixel(unsigned x, unsigned y, unsigned c) |
72 | void kol_paint_pixel(unsigned x, unsigned y, unsigned c) |
73 | { |
73 | { |
74 | asm ("int $0x40"::"a"(1), "b"(x), "c"(y), "d"(c)); |
74 | asm ("int $0x40"::"a"(1), "b"(x), "c"(y), "d"(c)); |
75 | } |
75 | } |
76 | 76 | ||
77 | 77 | ||
78 | void kol_paint_bar(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c) |
78 | void kol_paint_bar(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c) |
79 | { |
79 | { |
80 | asm ("int $0x40"::"a"(13), "b"(x*65536+w), "c"(y*65536+h), "d"(c)); |
80 | asm ("int $0x40"::"a"(13), "b"(x*65536+w), "c"(y*65536+h), "d"(c)); |
81 | } |
81 | } |
82 | 82 | ||
83 | 83 | ||
84 | void kol_paint_line(unsigned x1, unsigned y1, unsigned x2, unsigned y2, unsigned c) |
84 | void kol_paint_line(unsigned x1, unsigned y1, unsigned x2, unsigned y2, unsigned c) |
85 | { |
85 | { |
86 | asm ("int $0x40"::"a"(38), "b"(x1*65536+x2), "c"(y1*65536+y2), "d"(c)); |
86 | asm ("int $0x40"::"a"(38), "b"(x1*65536+x2), "c"(y1*65536+y2), "d"(c)); |
87 | } |
87 | } |
88 | 88 | ||
89 | 89 | ||
90 | void kol_paint_string(unsigned x, unsigned y, char *s, unsigned c) |
90 | void kol_paint_string(unsigned x, unsigned y, char *s, unsigned c) |
91 | { |
91 | { |
92 | asm ("int $0x40"::"a"(4), "b"(x*65536+y), "c"(c), "d"(s)); |
92 | asm ("int $0x40"::"a"(4), "b"(x*65536+y), "c"(c), "d"(s)); |
93 | } |
93 | } |
94 | 94 | ||
95 | 95 | ||
96 | void kol_paint_image(unsigned x, unsigned y, unsigned w, unsigned h, char *d) |
96 | void kol_paint_image(unsigned x, unsigned y, unsigned w, unsigned h, char *d) |
97 | { |
97 | { |
98 | asm ("int $0x40"::"a"(7), "c"(w*65536+h), "d"(x*65536+y), "b"(d)); |
98 | asm ("int $0x40"::"a"(7), "c"(w*65536+h), "d"(x*65536+y), "b"(d)); |
99 | } |
99 | } |
100 | 100 | ||
101 | 101 | ||
102 | void kol_paint_image_pal(unsigned x, unsigned y, unsigned w, unsigned h, char *d, unsigned *palette) |
102 | void kol_paint_image_pal(unsigned x, unsigned y, unsigned w, unsigned h, char *d, unsigned *palette) |
103 | { |
103 | { |
104 | asm ("nop"::"c"(w*65536+h), "d"(x*65536+y), "b"(d)); |
104 | asm ("nop"::"c"(w*65536+h), "d"(x*65536+y), "b"(d)); |
105 | asm ("nop"::"a"(palette)); |
105 | asm ("nop"::"a"(palette)); |
106 | asm ("movl %eax, %edi"); |
106 | asm ("movl %eax, %edi"); |
107 | asm ("xor %eax, %eax"); |
107 | asm ("xor %eax, %eax"); |
108 | asm ("movl %eax, %ebp"); |
108 | asm ("movl %eax, %ebp"); |
109 | asm ("pushl $8"); |
109 | asm ("pushl $8"); |
110 | asm ("popl %esi"); |
110 | asm ("popl %esi"); |
111 | asm ("int $0x40"::"a"(65)); |
111 | asm ("int $0x40"::"a"(65)); |
112 | } |
112 | } |
113 | 113 | ||
114 | 114 | ||
115 | unsigned kol_key_get() |
115 | unsigned kol_key_get() |
116 | { |
116 | { |
117 | asm ("int $0x40"::"a"(2)); |
117 | asm ("int $0x40"::"a"(2)); |
118 | } |
118 | } |
119 | 119 | ||
120 | 120 | ||
121 | unsigned kol_key_control() |
121 | unsigned kol_key_control() |
122 | { |
122 | { |
123 | asm ("int $0x40"::"a"(66), "b"(3)); |
123 | asm ("int $0x40"::"a"(66), "b"(3)); |
124 | } |
124 | } |
125 | 125 | ||
126 | 126 | ||
127 | void kol_key_lang_set(unsigned lang) |
127 | void kol_key_lang_set(unsigned lang) |
128 | { |
128 | { |
129 | asm ("int $0x40"::"a"(21), "b"(2), "c"(9), "d"(lang)); |
129 | asm ("int $0x40"::"a"(21), "b"(2), "c"(9), "d"(lang)); |
130 | } |
130 | } |
131 | 131 | ||
132 | 132 | ||
133 | unsigned kol_key_lang_get() |
133 | unsigned kol_key_lang_get() |
134 | { |
134 | { |
135 | asm ("int $0x40"::"a"(26), "b"(2), "c"(9)); |
135 | asm ("int $0x40"::"a"(26), "b"(2), "c"(9)); |
136 | } |
136 | } |
137 | 137 | ||
138 | 138 | ||
139 | void kol_key_mode_set(unsigned mode) |
139 | void kol_key_mode_set(unsigned mode) |
140 | { |
140 | { |
141 | asm ("int $0x40"::"a"(66), "b"(1), "c"(mode)); |
141 | asm ("int $0x40"::"a"(66), "b"(1), "c"(mode)); |
142 | } |
142 | } |
143 | 143 | ||
144 | 144 | ||
145 | unsigned kol_key_mode_get() |
145 | unsigned kol_key_mode_get() |
146 | { |
146 | { |
147 | asm ("int $0x40"::"a"(66), "b"(2)); |
147 | asm ("int $0x40"::"a"(66), "b"(2)); |
148 | } |
148 | } |
149 | 149 | ||
150 | 150 | ||
151 | unsigned kol_btn_get() |
151 | unsigned kol_btn_get() |
152 | { |
152 | { |
153 | asm ("int $0x40"::"a"(17)); |
153 | asm ("int $0x40"::"a"(17)); |
154 | } |
154 | } |
155 | 155 | ||
156 | 156 | ||
157 | void kol_btn_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned d, unsigned c) |
157 | void kol_btn_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned d, unsigned c) |
158 | { |
158 | { |
159 | asm ("nop"::"b"(x*65536+w), "c"(y*65536+h), "d"(d)); |
159 | asm ("nop"::"b"(x*65536+w), "c"(y*65536+h), "d"(d)); |
160 | asm ("nop"::"a"(c)); |
160 | asm ("nop"::"a"(c)); |
161 | asm ("movl %eax, %esi"); |
161 | asm ("movl %eax, %esi"); |
162 | asm ("int $0x40"::"a"(8)); |
162 | asm ("int $0x40"::"a"(8)); |
163 | } |
163 | } |
164 | 164 | ||
165 | 165 | ||
166 | void kol_btn_type(unsigned t) |
166 | void kol_btn_type(unsigned t) |
167 | { |
167 | { |
168 | asm ("int $0x40"::"a"(48), "b"(1), "c"(t)); |
168 | asm ("int $0x40"::"a"(48), "b"(1), "c"(t)); |
169 | } |
169 | } |
170 | 170 | ||
171 | 171 | ||
172 | void kol_wnd_caption(char *s) |
172 | void kol_wnd_caption(char *s) |
173 | { |
173 | { |
174 | asm ("int $0x40"::"a"(71), "b"(1), "c"(s)); |
174 | asm ("int $0x40"::"a"(71), "b"(1), "c"(s)); |
175 | } |
175 | } |
176 | 176 | ||
177 | 177 | ||
178 | unsigned kol_mouse_pos() |
178 | unsigned kol_mouse_pos() |
179 | { |
179 | { |
180 | asm ("int $0x40"::"a"(37), "b"(0)); |
180 | asm ("int $0x40"::"a"(37), "b"(0)); |
181 | } |
181 | } |
182 | 182 | ||
183 | 183 | ||
184 | unsigned kol_mouse_posw() |
184 | unsigned kol_mouse_posw() |
185 | { |
185 | { |
186 | asm ("int $0x40"::"a"(37), "b"(1)); |
186 | asm ("int $0x40"::"a"(37), "b"(1)); |
187 | } |
187 | } |
188 | 188 | ||
189 | 189 | ||
190 | unsigned kol_mouse_btn() |
190 | unsigned kol_mouse_btn() |
191 | { |
191 | { |
192 | asm ("int $0x40"::"a"(37), "b"(2)); |
192 | asm ("int $0x40"::"a"(37), "b"(2)); |
193 | } |
193 | } |
194 | 194 | ||
195 | 195 | ||
196 | void kol_board_putc(char c) |
196 | void kol_board_putc(char c) |
197 | { |
197 | { |
198 | asm ("int $0x40"::"a"(63), "b"(1), "c"(c)); |
198 | asm ("int $0x40"::"a"(63), "b"(1), "c"(c)); |
199 | } |
199 | } |
200 | 200 | ||
201 | 201 | ||
202 | void kol_board_puts(char *s) |
202 | void kol_board_puts(char *s) |
203 | { |
203 | { |
204 | unsigned i; |
204 | unsigned i; |
205 | i = 0; |
205 | i = 0; |
206 | while (*(s+i)) |
206 | while (*(s+i)) |
207 | { |
207 | { |
208 | asm ("int $0x40"::"a"(63), "b"(1), "c"(*(s+i))); |
208 | asm ("int $0x40"::"a"(63), "b"(1), "c"(*(s+i))); |
209 | i++; |
209 | i++; |
210 | } |
210 | } |
211 | } |
211 | } |
212 | 212 | ||
213 | 213 | ||
214 | void kol_board_puti(int n) |
214 | void kol_board_puti(int n) |
215 | { |
215 | { |
216 | char c; |
216 | char c; |
217 | int i = 0; |
217 | int i = 0; |
218 | do |
218 | do |
219 | { |
219 | { |
220 | c = n % 10 + '0'; |
220 | c = n % 10 + '0'; |
221 | asm ("int $0x40"::"a"(63), "b"(1), "c"(c)); |
221 | asm ("int $0x40"::"a"(63), "b"(1), "c"(c)); |
222 | i++; |
222 | i++; |
223 | } |
223 | } |
224 | while ((n /= 10) > 0); |
224 | while ((n /= 10) > 0); |
225 | } |
225 | } |
226 | 226 | ||
227 | 227 | ||
228 | int kol_file_70(kol_struct70 *k) |
228 | int kol_file_70(kol_struct70 *k) |
229 | { |
229 | { |
230 | asm ("int $0x40"::"a"(70), "b"(k)); |
230 | asm ("int $0x40"::"a"(70), "b"(k)); |
231 | } |
231 | } |
232 | 232 | ||
233 | 233 | ||
234 | kol_struct_import* kol_cofflib_load(char *name) |
234 | kol_struct_import* kol_cofflib_load(char *name) |
235 | { |
235 | { |
236 | asm ("int $0x40"::"a"(68), "b"(19), "c"(name)); |
236 | asm ("int $0x40"::"a"(68), "b"(19), "c"(name)); |
237 | } |
237 | } |
238 | 238 | ||
239 | 239 | ||
240 | void* kol_cofflib_procload (kol_struct_import *imp, char *name) |
240 | void* kol_cofflib_procload (kol_struct_import *imp, char *name) |
241 | { |
241 | { |
242 | int i; |
242 | int i; |
243 | for (i=0;;i++) |
243 | for (i=0;;i++) |
244 | if ( NULL == ((imp+i) -> name)) |
244 | if ( NULL == ((imp+i) -> name)) |
245 | break; |
245 | break; |
246 | else |
246 | else |
247 | if ( 0 == strcmp(name, (imp+i)->name) ) |
247 | if ( 0 == strcmp(name, (imp+i)->name) ) |
248 | return (imp+i)->data; |
248 | return (imp+i)->data; |
249 | return NULL; |
249 | return NULL; |
250 | } |
250 | } |
251 | 251 | ||
252 | 252 | ||
253 | unsigned kol_cofflib_procnum (kol_struct_import *imp) |
253 | unsigned kol_cofflib_procnum (kol_struct_import *imp) |
254 | { |
254 | { |
255 | unsigned i, n; |
255 | unsigned i, n; |
256 | 256 | ||
257 | for (i=n=0;;i++) |
257 | for (i=n=0;;i++) |
258 | if ( NULL == ((imp+i) -> name)) |
258 | if ( NULL == ((imp+i) -> name)) |
259 | break; |
259 | break; |
260 | else |
260 | else |
261 | n++; |
261 | n++; |
262 | 262 | ||
263 | return n; |
263 | return n; |
264 | } |
264 | } |
265 | 265 | ||
266 | 266 | ||
267 | void kol_cofflib_procname (kol_struct_import *imp, char *name, unsigned n) |
267 | void kol_cofflib_procname (kol_struct_import *imp, char *name, unsigned n) |
268 | { |
268 | { |
269 | unsigned i; |
269 | unsigned i; |
270 | *name = 0; |
270 | *name = 0; |
271 | 271 | ||
272 | for (i=0;;i++) |
272 | for (i=0;;i++) |
273 | if ( NULL == ((imp+i) -> name)) |
273 | if ( NULL == ((imp+i) -> name)) |
274 | break; |
274 | break; |
275 | else |
275 | else |
276 | if ( i == n ) |
276 | if ( i == n ) |
277 | { |
277 | { |
278 | strcpy(name, ((imp+i)->name)); |
278 | strcpy(name, ((imp+i)->name)); |
279 | break; |
279 | break; |
280 | } |
280 | } |
281 | 281 | ||
282 | } |
282 | } |
283 | 283 | ||
284 | 284 | ||
285 | unsigned kol_system_cpufreq() |
285 | unsigned kol_system_cpufreq() |
286 | { |
286 | { |
287 | asm ("int $0x40"::"a"(18), "b"(5)); |
287 | asm ("int $0x40"::"a"(18), "b"(5)); |
288 | } |
288 | } |
289 | 289 | ||
290 | 290 | ||
291 | unsigned kol_system_mem() |
291 | unsigned kol_system_mem() |
292 | { |
292 | { |
293 | asm ("int $0x40"::"a"(18), "b"(17)); |
293 | asm ("int $0x40"::"a"(18), "b"(17)); |
294 | } |
294 | } |
295 | 295 | ||
296 | 296 | ||
297 | unsigned kol_system_memfree() |
297 | unsigned kol_system_memfree() |
298 | { |
298 | { |
299 | asm ("int $0x40"::"a"(18), "b"(16)); |
299 | asm ("int $0x40"::"a"(18), "b"(16)); |
300 | } |
300 | } |
301 | 301 | ||
302 | 302 | ||
303 | unsigned kol_system_time_get() |
303 | unsigned kol_system_time_get() |
304 | { |
304 | { |
305 | asm ("int $0x40"::"a"(3)); |
305 | asm ("int $0x40"::"a"(3)); |
306 | } |
306 | } |
307 | 307 | ||
308 | 308 | ||
309 | unsigned kol_system_date_get() |
309 | unsigned kol_system_date_get() |
310 | { |
310 | { |
311 | asm ("int $0x40"::"a"(29)); |
311 | asm ("int $0x40"::"a"(29)); |
312 | } |
312 | } |
313 | 313 | ||
314 | 314 | ||
315 | unsigned kol_system_end(unsigned param) |
315 | unsigned kol_system_end(unsigned param) |
316 | { |
316 | { |
317 | asm ("int $0x40"::"a"(18), "b"(9), "c"(param)); |
317 | asm ("int $0x40"::"a"(18), "b"(9), "c"(param)); |
318 | } |
318 | } |
319 | 319 | ||
320 | 320 | ||
321 | void kol_path_file2dir(char *dir, char *fname) |
321 | void kol_path_file2dir(char *dir, char *fname) |
322 | { |
322 | { |
323 | unsigned i; |
323 | unsigned i; |
324 | strcpy (dir, fname); |
324 | strcpy (dir, fname); |
325 | for ( i = strlen(dir);; --i) |
325 | for ( i = strlen(dir);; --i) |
326 | if ( '/' == dir[i]) |
326 | if ( '/' == dir[i]) |
327 | { |
327 | { |
328 | dir[i] = '\0'; |
328 | dir[i] = '\0'; |
329 | return; |
329 | return; |
330 | } |
330 | } |
331 | } |
331 | } |
332 | 332 | ||
333 | 333 | ||
334 | void kol_path_full(char *full, char *fname) |
334 | void kol_path_full(char *full, char *fname) |
335 | { |
335 | { |
336 | char temp[256]; |
336 | char temp[256]; |
337 | 337 | ||
338 | switch (*fname) |
338 | switch (*fname) |
339 | { |
339 | { |
340 | 340 | ||
341 | case '/': |
341 | case '/': |
342 | strncpy(temp, fname+1, 2); |
342 | strncpy(temp, fname+1, 2); |
343 | temp[2]=0; |
343 | temp[2]=0; |
344 | if ( (!strcmp("rd", temp)) || (!strcmp("hd", temp)) || (!strcmp("cd", temp)) ) |
344 | if ( (!strcmp("rd", temp)) || (!strcmp("hd", temp)) || (!strcmp("cd", temp)) ) |
345 | strcpy (full, fname); |
345 | strcpy (full, fname); |
346 | break; |
346 | break; |
347 | 347 | ||
348 | case '.': |
348 | case '.': |
349 | break; |
349 | break; |
350 | 350 | ||
351 | default: |
351 | default: |
352 | break; |
352 | break; |
353 | 353 | ||
354 | }; |
354 | }; |
355 | 355 | ||
356 | } |
356 | } |
357 | 357 | ||
358 | 358 | ||
359 | 359 | ||
360 | void kol_screen_wait_rr() |
360 | void kol_screen_wait_rr() |
361 | { |
361 | { |
362 | asm ("int $0x40"::"a"(18), "b"(14)); |
362 | asm ("int $0x40"::"a"(18), "b"(14)); |
363 | } |
363 | } |
364 | 364 | ||
365 | 365 | ||
366 | 366 | ||
367 | void kol_screen_get_size(unsigned *w, unsigned *h) |
367 | void kol_screen_get_size(unsigned *w, unsigned *h) |
368 | { |
368 | { |
369 | unsigned size; |
369 | unsigned size; |
370 | asm ("int $0x40":"=a"(size):"a"(14)); |
370 | asm ("int $0x40":"=a"(size):"a"(14)); |
371 | *w = size / 65536; |
371 | *w = size / 65536; |
372 | *h = size % 65536; |
372 | *h = size % 65536; |
373 | } |
373 | } |
374 | 374 | ||
375 | 375 | ||
376 | 376 | ||
377 | unsigned kol_skin_height() |
377 | unsigned kol_skin_height() |
378 | { |
378 | { |
379 | asm ("int $0x40"::"a"(48), "b"(4)); |
379 | asm ("int $0x40"::"a"(48), "b"(4)); |
380 | } |
380 | } |
381 | 381 | ||
382 | 382 | ||
383 | unsigned kol_thread_start(unsigned start, unsigned stack) |
383 | unsigned kol_thread_start(unsigned start, unsigned stack) |
384 | { |
384 | { |
385 | asm ("int $0x40"::"a"(51), "b"(1), "c"(start), "d"(stack)); |
385 | asm ("int $0x40"::"a"(51), "b"(1), "c"(start), "d"(stack)); |
386 | } |
386 | } |
387 | 387 | ||
388 | 388 | ||
389 | unsigned kol_time_tick() |
389 | unsigned kol_time_tick() |
390 | { |
390 | { |
391 | asm ("int $0x40"::"a"(26), "b"(9)); |
391 | asm ("int $0x40"::"a"(26), "b"(9)); |
392 | } |
392 | } |
393 | 393 | ||
394 | 394 | ||
395 | unsigned kol_sound_speaker(char data[]) |
395 | unsigned kol_sound_speaker(char data[]) |
396 | { |
396 | { |
397 | asm ("movl %0, %%esi"::"a"(data)); |
397 | asm ("movl %0, %%esi"::"a"(data)); |
398 | asm ("int $0x40"::"a"(55), "b"(55)); |
398 | asm ("int $0x40"::"a"(55), "b"(55)); |
399 | } |
399 | } |
400 | 400 | ||
401 | 401 | ||
402 | unsigned kol_process_info(unsigned slot, char buf1k[]) |
402 | unsigned kol_process_info(unsigned slot, char buf1k[]) |
403 | { |
403 | { |
404 | asm ("int $0x40"::"a"(9), "b"(buf1k), "c"(slot)); |
404 | asm ("int $0x40"::"a"(9), "b"(buf1k), "c"(slot)); |
405 | } |
405 | } |
406 | 406 | ||
407 | 407 | ||
408 | int kol_process_kill_pid(unsigned process) |
408 | int kol_process_kill_pid(unsigned process) |
409 | { |
409 | { |
410 | asm ("int $0x40"::"a"(18), "b"(18), "c"(process)); |
410 | asm ("int $0x40"::"a"(18), "b"(18), "c"(process)); |
411 | } |
411 | } |
412 | 412 | ||
- | 413 | void kol_get_kernel_ver(char buff16b[]) |
|
- | 414 | { |
|
- | 415 | asm ("int $0x40"::"a"(18), "b"(13), "c"(buff16b)); |
|
- | 416 | } |
|
- | 417 | ||
413 | 418 |