/programs/system/shell/system/kolibri.c |
---|
215,15 → 215,14 |
void kol_board_puti(int n) |
{ |
char c; |
int i = 0; |
do |
{ |
if ( n > 1 ) |
kol_board_puti(n / 10); |
c = n % 10 + '0'; |
asm ("int $0x40"::"a"(63), "b"(1), "c"(c)); |
i++; |
} |
while ((n /= 10) > 0); |
} |
int kol_file_70(kol_struct70 *k) |
419,4 → 418,17 |
void kol_get_kernel_ver(char buff16b[]) |
{ |
asm ("int $0x40"::"a"(18), "b"(13), "c"(buff16b)); |
} |
} |
int kol_buffer_open(char name[], int mode, int size, char **buf) |
{ |
int error; |
asm ("movl %0, %%esi"::"r"(mode)); |
asm ("int $0x40":"=a"(*buf), "=d"(error):"a"(68), "b"(22), "c"(name), "d"(size)); |
return error; |
} |
void kol_buffer_close(char name[]) |
{ |
asm ("int $0x40"::"a"(68), "b"(23), "c"(name)); |
} |
/programs/system/shell/system/kolibri.h |
---|
1,6 → 1,18 |
#define NULL ((void*)0) |
#define SHM_OPEN 0 |
#define SHM_OPEN_ALWAYS 0x04 |
#define SHM_CREATE 0x08 |
#define SHM_READ 0x00 |
#define SHM_WRITE 0x01 |
#define E_NOTFOUND 5 |
#define E_ACCESS 10 |
#define E_NOMEM 30 |
#define E_PARAM 33 |
typedef struct |
{ |
unsigned p00 __attribute__((packed)); |
89,4 → 101,6 |
unsigned kol_process_info(unsigned slot, char buf1k[]); |
int kol_process_kill_pid(unsigned process); |
void kol_get_kernel_ver(char buff16b[]); |
int kol_kill_process(unsigned process); |
int kol_kill_process(unsigned process); |
int kol_buffer_open(char name[], int mode, int size, char **buf); |
void kol_buffer_close(char name[]); |
/programs/system/shell/system/string.c |
---|
122,3 → 122,19 |
return (char*)0; |
} |
void _itoa(int i, char *s) |
{ |
int a, b, c, d; |
a = (i - i%1000)/1000; |
b = (i - i%100)/100 - a*10; |
c = (i - i%10)/10 - a*100 - b*10; |
d = i%10; |
s[0] = a + '0'; |
s[1] = b + '0'; |
s[2] = c + '0'; |
s[3] = d + '0'; |
s[4] = 0; |
} |
/programs/system/shell/system/string.h |
---|
13,3 → 13,4 |
char* strncpy(char *strDest, const char *strSource, unsigned n); |
int strlen(const char* string); |
char *strchr(const char* string, int c); |
void _itoa(int i, char *s); |