/contrib/other/8086tiny/8086tiny.c |
---|
276,7 → 276,7 |
} |
#endif |
#include <sys/kos_LoadConsole.h> |
#include <conio.h> |
#define kbhit con_kbhit |
#define getch con_getch |
283,9 → 283,7 |
// Emulator entry point |
int main(int argc, char **argv) |
{ |
load_console(); |
con_set_title("8086tiny"); |
//freopen("OUT", "w" ,stdout); |
#ifndef NO_GRAPHICS |
// Initialise SDL |
/contrib/other/uarm/main_pc.c |
---|
11,8 → 11,9 |
//#include <sys/select.h> |
#include <signal.h> |
//#include <termios.h> |
#include <sys/kos_LoadConsole.h> |
#include <conio.h> |
#define getch2 con_getch |
#define cprintf printf |
95,8 → 96,6 |
if (ret==0xD) {ret=0xA;} |
} |
return ret; |
} |
165,8 → 164,8 |
SoC soc; |
int main(int argc, char** argv){ |
load_console(); |
con_set_title("uARM"); |
//CONSOLE_INIT("CONSOLE"); |
/* |
/contrib/other/udcli/udcli.c |
---|
6,7 → 6,6 |
* See (LICENSE) |
* ----------------------------------------------------------------------------- |
*/ |
#include <sys/kos_LoadConsole.h> |
#include <stdlib.h> |
#include <stdio.h> |
#include <string.h> |
14,6 → 13,8 |
#include "udis86.h" |
#include "config.h" |
#include <conio.h> |
#if defined(__amd64__) || defined(__x86_64__) |
# define FMT "l" |
#else |
71,8 → 72,8 |
int main(int argc, char **argv) |
{ |
load_console(); |
con_set_title("udi disassembler"); |
FILE *stream; |
stream = fopen( "disasm.out", "w" ); |
/contrib/sdk/sources/newlib/libc/Makefile.ebox |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/libc.orig.def |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/libc.def |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/dirent/closedir.c |
---|
File deleted |
\ No newline at end of file |
/contrib/sdk/sources/newlib/libc/dirent/seekdir.c |
---|
File deleted |
\ No newline at end of file |
/contrib/sdk/sources/newlib/libc/dirent/ksys_fs.h |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/dirent/rewinddir.c |
---|
File deleted |
\ No newline at end of file |
/contrib/sdk/sources/newlib/libc/dirent/readdir.c |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/dirent/alphasort.c |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/dirent/dir.c |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/dirent/telldir.c |
---|
File deleted |
\ No newline at end of file |
/contrib/sdk/sources/newlib/libc/dirent/opendir.c |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/dirent/scandir.c |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/Makefile |
---|
116,10 → 116,9 |
sys/clock_gettime.c \ |
sys/close.c \ |
sys/conio.c \ |
sys/create.c \ |
sys/chdir.c \ |
sys/getcwd.c \ |
sys/errno.c \ |
sys/finfo.c \ |
sys/fsize.c \ |
sys/fstat.c \ |
sys/gettod.c \ |
sys/io.c \ |
473,16 → 472,6 |
wscanf.c \ |
wsetup.c |
DIRENT_SRCS= dir.c \ |
closedir.c \ |
opendir.c \ |
readdir.c \ |
rewinddir.c \ |
seekdir.c \ |
telldir.c \ |
scandir.c \ |
alphasort.c |
MATH_SRCS = e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c e_exp.c e_fmod.c \ |
e_hypot.c e_j0.c e_j1.c e_jn.c e_log.c e_log10.c e_pow.c e_rem_pio2.c \ |
e_remainder.c e_scalb.c e_sinh.c e_sqrt.c ef_acos.c ef_acosh.c ef_asin.c \ |
539,9 → 528,6 |
STDLIB_OBJS = $(patsubst %.S, stdlib/%.o, $(patsubst %.asm, stdlib/%.o,\ |
$(patsubst %.c, stdlib/%.o, $(STDLIB_SRCS)))) |
DIRENT_OBJS = $(patsubst %.S, dirent/%.o, $(patsubst %.asm, dirent/%.o,\ |
$(patsubst %.c, dirent/%.o, $(DIRENT_SRCS)))) |
MATH_OBJS = $(patsubst %.S, math/%.o, $(patsubst %.asm, math/%.o,\ |
$(patsubst %.c, math/%.o, $(MATH_SRCS)))) |
/contrib/sdk/sources/newlib/libc/Tupfile.lua |
---|
99,10 → 99,9 |
"sys/clock_gettime.c", |
"sys/close.c", |
"sys/conio.c", |
"sys/create.c", |
"sys/chdir.c", |
"sys/getcwd.c", |
"sys/errno.c", |
"sys/finfo.c", |
"sys/fsize.c", |
"sys/fstat.c", |
"sys/gettod.c", |
"sys/io.c", |
455,18 → 454,6 |
"wsetup.c" |
} |
DIRENT_SRCS = { |
"dir.c", |
"closedir.c", |
"opendir.c", |
"readdir.c", |
"rewinddir.c", |
"seekdir.c", |
"telldir.c", |
"scandir.c", |
"alphasort.c", |
} |
MATH_SRCS = { |
"e_acos.c", "e_acosh.c", "e_asin.c", "e_atan2.c", "e_atanh.c", "e_cosh.c", "e_exp.c", "e_fmod.c", |
"e_hypot.c", "e_j0.c", "e_j1.c", "e_jn.c", "e_log.c", "e_log10.c", "e_pow.c", "e_rem_pio2.c", |
518,7 → 505,6 |
LIB_SRCS += prepend("stdio/", STDIO_SRCS) |
LIB_SRCS += prepend("string/", STRING_SRCS) |
LIB_SRCS += prepend("stdlib/", STDLIB_SRCS) |
LIB_SRCS += prepend("dirent/", DIRENT_SRCS) |
LIB_SRCS += prepend("math/", MATH_SRCS) |
ALL_OBJS = {} |
/contrib/sdk/sources/newlib/libc/crt/console.asm |
---|
200,6 → 200,7 |
public_jmp con_cls, 0 |
public_jmp con_getch2, 0 |
public_jmp con_getch, 0 |
public_jmp con_kbhit, 0 |
public_jmp con_set_cursor_pos, 8 |
public_jmp con_get_cursor_pos, 8 |
public_jmp con_write_string, 8 |
257,6 → 258,7 |
con_cls, 'con_cls', \ |
con_getch2, 'con_getch2', \ |
con_getch, 'con_getch', \ |
con_kbhit, 'con_kbhit', \ |
con_set_cursor_pos, 'con_set_cursor_pos',\ |
con_get_cursor_pos, 'con_get_cursor_pos', \ |
con_write_string, 'con_write_string',\ |
/contrib/sdk/sources/newlib/libc/crt/crtdll.c |
---|
17,7 → 17,6 |
#include <stdio.h> |
#include <unistd.h> |
#include <setjmp.h> |
#include <sys/kos_io.h> |
struct app_hdr |
{ |
/contrib/sdk/sources/newlib/libc/include/dirent.h |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/include/kos32sys.h |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/include/sys/kos_LoadConsole.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/contrib/sdk/sources/newlib/libc/include/sys/kos.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/contrib/sdk/sources/newlib/libc/include/sys/socket.h |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/include/sys/dirent.h |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/include/sys/kos_io.h |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/include/sys/dir.h |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/include/sys/ksys.h |
---|
21,6 → 21,7 |
#include <stddef.h> |
#include <stdint.h> |
#include <stdbool.h> |
#ifdef __cplusplus |
extern "C" { |
82,43 → 83,48 |
} ksys_ufile_t; |
typedef struct { |
uint32_t p00; |
uint32_t func_num; |
union { |
uint64_t p04; |
uint64_t offset64; |
struct { |
uint32_t p04dw; |
uint32_t p08dw; |
union { |
uint32_t debug; |
uint32_t offset; |
}; |
union { |
uint32_t flags; |
char* args; |
}; |
uint32_t p12; |
}; |
}; |
uint32_t data_size; |
void* data; |
union { |
uint32_t p16; |
const char* new_name; |
void* bdfe; |
void* buf16; |
const void* cbuf16; |
struct { |
uint8_t zero; |
char* path_ptr; |
}; |
char p20; |
const char* p21; |
} ksys70_t; |
char path[0]; |
}; |
} ksys_file_t; |
typedef struct { |
uint32_t status; |
uint32_t rw_bytes; |
} ksys70_status_t; |
} ksys_file_status_t; |
typedef struct { |
uint32_t attributes; |
uint32_t name_cp; |
ksys_time_t creation_time; |
ksys_date_t creation_date; |
ksys_time_t last_access_time; |
ksys_date_t last_access_date; |
ksys_time_t last_modification_time; |
ksys_date_t last_modification_date; |
uint32_t attr; |
uint32_t name_enc; |
ksys_time_t ctime; |
ksys_date_t cdate; |
ksys_time_t atime; |
ksys_date_t adate; |
ksys_time_t mtime; |
ksys_date_t mdate; |
uint64_t size; |
char name[0]; |
} ksys_bdfe_t; |
} ksys_file_info_t; |
#define KSYS_THREAD_INFO_SIZE 1024 |
1483,103 → 1489,139 |
/*==== Function 70 - work with file system with long names support. ====*/ |
KOSAPI ksys70_status_t _ksys70(const ksys70_t* k) |
enum KSYS_FILE_FUNC { |
KSYS_FILE_READ = 0, |
KSYS_FILE_READ_DIR, |
KSYS_FILE_CREATE, |
KSYS_FILE_WRITE, |
KSYS_FILE_SET_SIZE, |
KSYS_FILE_GET_INFO, |
KSYS_FILE_SET_ATTR, |
KSYS_FILE_EXEC, |
KSYS_FILE_REMOVE, |
KSYS_FILE_CREATE_DIR, |
KSYS_FILE_RENAME, |
}; |
KOSAPI ksys_file_status_t _ksys_file(const ksys_file_t* info) |
{ |
ksys70_status_t status; |
ksys_file_status_t st; |
asm_inline( |
"int $0x40" |
: "=a"(status.status), "=b"(status.rw_bytes) |
: "a"(70), "b"(k) |
: "=a"(st.status), "=b"(st.rw_bytes) |
: "a"(70), "b"(info) |
: "memory"); |
return status; |
return st; |
} |
/*====== Function 70, subfunction 0 - read file with long names support. ======*/ |
KOSAPI ksys70_status_t _ksys_file_read(const char* name, uint64_t offset, uint32_t size, void* buf) |
KOSAPI ksys_file_status_t _ksys_file_read(const char* name, uint64_t offset, uint32_t size, void* buf) |
{ |
ksys70_t k; |
k.p00 = 0; |
k.p04 = offset; |
k.p12 = size; |
k.buf16 = buf; |
k.p20 = 0; |
k.p21 = name; |
return _ksys70(&k); |
ksys_file_t f; |
f.func_num = KSYS_FILE_READ; |
f.offset64 = offset; |
f.data_size = size; |
f.data = buf; |
f.zero = 0; |
f.path_ptr = (char*)name; |
return _ksys_file(&f); |
} |
/*===================== Function 70, subfunction 2 =====================*/ |
/*============ Create/rewrite file with long names support. ============*/ |
KOSAPI int _ksys_file_create(const char* name) |
KOSAPI ksys_file_status_t _ksys_file_create(const char* name) |
{ |
ksys70_t k; |
k.p00 = 2; |
k.p04dw = 0; |
k.p08dw = 0; |
k.p12 = 0; |
k.p21 = name; |
return _ksys70(&k).status; |
ksys_file_t f; |
f.func_num = KSYS_FILE_CREATE; |
f.offset64 = 0; |
f.data_size = 0; |
f.data = NULL; |
f.zero = 0; |
f.path_ptr = (char*)name; |
return _ksys_file(&f); |
} |
/*===================== Function 70, subfunction 3 =====================*/ |
/*=========== Write to existing file with long names support. ==========*/ |
KOSAPI ksys70_status_t _ksys_file_write(const char* name, uint64_t offset, uint32_t size, const void* buf) |
KOSAPI ksys_file_status_t _ksys_file_write(const char* name, uint64_t offset, uint32_t size, const void* buf) |
{ |
ksys70_t k; |
k.p00 = 3; |
k.p04 = offset; |
k.p12 = size; |
k.cbuf16 = buf; |
k.p20 = 0; |
k.p21 = name; |
return _ksys70(&k); |
ksys_file_t f; |
f.func_num = KSYS_FILE_WRITE; |
f.offset64 = offset; |
f.data_size = size; |
f.data = (void*)buf; |
f.zero = 0; |
f.path_ptr = (char*)name; |
return _ksys_file(&f); |
} |
/*========== Function 70, subfunction 4 - set file size. =====*/ |
KOSAPI int _ksys_file_set_size(const char* name, uint64_t size) |
{ |
ksys_file_t f; |
f.func_num = KSYS_FILE_SET_SIZE; |
f.offset64 = size; |
f.data_size = 0; |
f.data = NULL; |
f.zero = 0; |
f.path_ptr = (char*)name; |
return _ksys_file(&f).status; |
} |
/*========== Function 70, subfunction 5 - get information on file/folder. =====*/ |
KOSAPI int _ksys_file_info(const char* name, ksys_bdfe_t* bdfe) |
KOSAPI int _ksys_file_info(const char* name, ksys_file_info_t* info) |
{ |
ksys70_t k; |
k.p00 = 5; |
k.p04dw = 0; |
k.p08dw = 0; |
k.p12 = 0; |
k.bdfe = bdfe; |
k.p20 = 0; |
k.p21 = name; |
return _ksys70(&k).status; |
ksys_file_t f; |
f.func_num = KSYS_FILE_GET_INFO; |
f.offset64 = 0; |
f.data_size = 0; |
f.data = (void*)info; |
f.zero = 0; |
f.path_ptr = (char*)name; |
return _ksys_file(&f).status; |
} |
#define _ksys_dir_info _ksys_file_info |
KOSAPI uint64_t _ksys_file_get_size(const char* name, int* err) |
{ |
ksys_file_info_t info; |
*err = _ksys_file_info(name, &info); |
return info.size; |
} |
#define _ksys_dir_info _ksys_file_info |
/*=========== Function 70, subfunction 7 - start application. ===========*/ |
KOSAPI int _ksys_exec(const char* app_name, char* args) |
KOSAPI int _ksys_exec(const char* path, char* args, bool debug) |
{ |
ksys70_t file_opt; |
file_opt.p00 = 7; |
file_opt.p04dw = 0; |
file_opt.p08dw = (uint32_t)args; |
file_opt.p12 = 0; |
file_opt.p16 = 0; |
file_opt.p20 = 0; |
file_opt.p21 = app_name; |
return _ksys70(&file_opt).status; |
ksys_file_t f; |
f.func_num = KSYS_FILE_EXEC; |
f.debug = debug; |
f.args = args; |
f.zero = 0; |
f.path_ptr = (char*)path; |
return _ksys_file(&f).status; |
} |
/*========== Function 70, subfunction 8 - delete file/folder. ==========*/ |
KOSAPI int _ksys_file_delete(const char* name) |
KOSAPI int _ksys_file_delete(const char* path) |
{ |
ksys70_t k; |
k.p00 = 8; |
k.p20 = 0; |
k.p21 = name; |
return _ksys70(&k).status; |
ksys_file_t f; |
f.func_num = KSYS_FILE_REMOVE; |
f.offset64 = 0; |
f.data_size = 0; |
f.data = NULL; |
f.zero = 0; |
f.path_ptr = (char*)path; |
return _ksys_file(&f).status; |
} |
/*============= Function 70, subfunction 9 - create folder. =============*/ |
1586,10 → 1628,14 |
KOSAPI int _ksys_mkdir(const char* path) |
{ |
ksys70_t dir_opt; |
dir_opt.p00 = 9; |
dir_opt.p21 = path; |
return _ksys70(&dir_opt).status; |
ksys_file_t f; |
f.func_num = KSYS_FILE_CREATE_DIR; |
f.offset64 = 0; |
f.data_size = 0; |
f.data = NULL; |
f.zero = 0; |
f.path_ptr = (char*)path; |
return _ksys_file(&f).status; |
} |
/*============= Function 70, subfunction 10 - rename/move. =============*/ |
1596,12 → 1642,13 |
KOSAPI int _ksys_file_rename(const char* name, const char* new_name) |
{ |
ksys70_t k; |
k.p00 = 10; |
k.new_name = new_name; |
k.p20 = 0; |
k.p21 = name; |
return _ksys70(&k).status; |
ksys_file_t f; |
f.func_num = KSYS_FILE_REMOVE; |
f.data = (void*)new_name; |
f.data_size = 0; |
f.zero = 0; |
f.path_ptr = (char*)name; |
return _ksys_file(&f).status; |
} |
#define _ksys_dir_rename _ksys_file_rename |
1707,25 → 1754,6 |
return err; |
} |
/* ######### Old names of functions and structures. Do not use again! ##########*/ |
#define _ksys_get_event _ksys_wait_event |
#define _ksys_file_get_info _ksys_file_info |
static inline int _ksys_file_read_file(const char* name, unsigned long long offset, unsigned size, void* buff, unsigned* bytes_read) |
{ |
ksys70_status_t res = _ksys_file_read(name, offset, size, buff); |
*bytes_read = res.rw_bytes; |
return res.status; |
} |
static inline int _ksys_file_write_file(const char* name, unsigned long long offset, unsigned size, const void* buff, unsigned* bytes_write) |
{ |
ksys70_status_t res = _ksys_file_write(name, offset, size, buff); |
*bytes_write = res.rw_bytes; |
return res.status; |
} |
#ifdef __cplusplus |
} |
#endif |
/contrib/sdk/sources/newlib/libc/include/sys/stat.h |
---|
10,6 → 10,7 |
#include <sys/cdefs.h> |
#include <sys/types.h> |
#include <sys/_timespec.h> |
#include <sys/ksys.h> |
/* dj's stat defines _STAT_H_ */ |
#ifndef _STAT_H_ |
147,11 → 148,12 |
int _EXFUN(chmod,( const char *__path, mode_t __mode )); |
int _EXFUN(fchmod,(int __fd, mode_t __mode)); |
int _EXFUN(fstat,( int __fd, struct stat *__sbuf )); |
int _EXFUN(mkdir,( const char *_path, mode_t __mode )); |
int _EXFUN(mkfifo,( const char *__path, mode_t __mode )); |
int _EXFUN(stat,( const char *__restrict __path, struct stat *__restrict __sbuf )); |
mode_t _EXFUN(umask,( mode_t __mask )); |
#define mkdir(path, mode) _ksys_mkdir(path) |
#if defined (__SPU__) || defined(__rtems__) || defined(__CYGWIN__) && !defined(__INSIDE_CYGWIN__) |
int _EXFUN(lstat,( const char *__restrict __path, struct stat *__restrict __buf )); |
int _EXFUN(mknod,( const char *__path, mode_t __mode, dev_t __dev )); |
/contrib/sdk/sources/newlib/libc/sdk/fasm/include/libc.inc |
---|
355,7 → 355,6 |
_cosf,'cosf',\ |
_cosh,'cosh',\ |
_coshf,'coshf',\ |
_create_file,'create_file',\ |
_create_image,'create_image',\ |
_create_thread,'create_thread',\ |
_ctime,'ctime',\ |
429,7 → 428,6 |
_gammaf,'gammaf',\ |
_gammaf_r,'gammaf_r',\ |
_get_entry_point,'get_entry_point',\ |
_get_fileinfo,'get_fileinfo',\ |
_get_proc_address,'get_proc_address',\ |
_getenv,'getenv',\ |
_gettimeofday,'gettimeofday',\ |
550,7 → 548,6 |
_rand,'rand',\ |
_rand_r,'rand_r',\ |
_read,'read',\ |
_read_file,'read_file',\ |
_realloc,'realloc',\ |
_remainder,'remainder',\ |
_remainderf,'remainderf',\ |
570,7 → 567,6 |
_scalbn,'scalbn',\ |
_scalbnf,'scalbnf',\ |
_seed48,'seed48',\ |
_set_file_size,'set_file_size',\ |
_setjmp,'setjmp',\ |
_setlocale,'setlocale',\ |
_setvbuf,'setvbuf',\ |
665,7 → 661,6 |
_wctrans,'wctrans',\ |
_wctype,'wctype',\ |
_write,'write',\ |
_write_file,'write_file',\ |
_y0,'y0',\ |
_y0f,'y0f',\ |
_y1,'y1',\ |
/contrib/sdk/sources/newlib/libc/sys/create.c |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/sys/fsize.c |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/sys/finfo.c |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/sys/chdir.c |
---|
0,0 → 1,11 |
/* |
* Copyright (C) KolibriOS team 2004-2024. All rights reserved. |
* Distributed under terms of the GNU General Public License |
*/ |
#include <sys/ksys.h> |
int chdir(char* dir){ |
_ksys_setcwd(dir); |
return 0; |
} |
/contrib/sdk/sources/newlib/libc/sys/close.c |
---|
15,7 → 15,7 |
#include <errno.h> |
#include <stdlib.h> |
#include <sys/unistd.h> |
#include <sys/kos_io.h> |
#include <sys/ksys.h> |
#include "glue.h" |
#include "io.h" |
/contrib/sdk/sources/newlib/libc/sys/conio.c |
---|
1,3 → 1,8 |
/* |
* Copyright (C) KolibriOS team 2004-2024. All rights reserved. |
* Distributed under terms of the GNU General Public License |
*/ |
#include <_ansi.h> |
#include <stdio.h> |
#include <sys/unistd.h> |
16,28 → 21,8 |
size_t offset, size_t count, size_t *done) |
{ |
char *p = buff; |
/*int cnt = 0; |
short c; |
char ch;*/ |
con_gets(p, count+1); |
*done = strlen(p); |
// __asm__ volatile("int3"); |
/* |
do |
{ |
c = con_getch2(); |
printf("%d\n",(char)c); |
ch = (char)c; |
if(ch != 0) |
{ |
p[cnt] = ch != 0x0D ? ch : 0x0A; |
con_write_string(p+cnt, 1); |
cnt++; |
} |
}while(ch != 0x0D); |
*done = cnt; |
*/ |
return 0; |
} |
48,7 → 33,7 |
*writes = count; |
return 0; |
}; |
} |
void __init_conio() |
{ |
/contrib/sdk/sources/newlib/libc/sys/fstat.c |
---|
15,7 → 15,7 |
#include <errno.h> |
#include <string.h> |
#include <sys/unistd.h> |
#include <sys/kos_io.h> |
#include <sys/ksys.h> |
#include <sys/stat.h> |
#include "glue.h" |
#include "io.h" |
25,7 → 25,7 |
int fd _AND |
struct stat *buf) |
{ |
fileinfo_t info; |
ksys_file_info_t info; |
struct tm time; |
__io_handle *ioh; |
33,8 → 33,8 |
if( (fd < 0) || (fd >=64) ) |
{ |
errno = EBADF; |
return (-1); |
}; |
return -1; |
} |
memset (buf, 0, sizeof (* buf)); |
47,7 → 47,7 |
{ |
ioh = &__io_tab[fd]; |
get_fileinfo(ioh->name, &info); |
_ksys_file_info(ioh->name, &info); |
if (info.attr & 0x10) |
buf->st_mode = S_IFDIR; |
/contrib/sdk/sources/newlib/libc/sys/getcwd.c |
---|
0,0 → 1,17 |
/* |
* Copyright (C) KolibriOS team 2004-2024. All rights reserved. |
* Distributed under terms of the GNU General Public License |
*/ |
#include <stdlib.h> |
#include <sys/ksys.h> |
char *getcwd(char *buf, unsigned size){ |
if(!buf){ |
if((buf = malloc(size))==NULL){ |
return NULL; |
} |
} |
_ksys_getcwd(buf, size); |
return(buf); |
} |
/contrib/sdk/sources/newlib/libc/sys/ioread.c |
---|
1,31 → 1,15 |
/* |
* Copyright (C) KolibriOS team 2004-2024. All rights reserved. |
* Distributed under terms of the GNU General Public License |
*/ |
#include <sys/types.h> |
#include <sys/kos_io.h> |
#include <sys/ksys.h> |
int read_file(const char *path, void *buff, |
size_t offset, size_t count, size_t *reads) |
{ |
int retval; |
int d0; |
__asm__ __volatile__( |
"pushl $0 \n\t" |
"pushl $0 \n\t" |
"movl %%eax, 1(%%esp) \n\t" |
"pushl %%ebx \n\t" |
"pushl %%edx \n\t" |
"pushl $0 \n\t" |
"pushl %%ecx \n\t" |
"pushl $0 \n\t" |
"movl %%esp, %%ebx \n\t" |
"mov $70, %%eax \n\t" |
"int $0x40 \n\t" |
"testl %%esi, %%esi \n\t" |
"jz 1f \n\t" |
"movl %%ebx, (%%esi) \n\t" |
"1:" |
"addl $28, %%esp \n\t" |
:"=a" (retval) |
:"a"(path),"b"(buff),"c"(offset),"d"(count),"S"(reads)); |
return retval == 6 ? 0 : retval; |
}; |
ksys_file_status_t st = _ksys_file_read(path, offset, count, buff); |
*reads = st.rw_bytes; |
return st.status == KSYS_FS_ERR_EOF ? 0 : st.status; |
} |
/contrib/sdk/sources/newlib/libc/sys/iowrite.c |
---|
1,33 → 1,20 |
/* |
* Copyright (C) KolibriOS team 2004-2024. All rights reserved. |
* Distributed under terms of the GNU General Public License |
*/ |
#include <sys/types.h> |
#include <errno.h> |
#include <sys/kos_io.h> |
#include <sys/ksys.h> |
int write_file(const char *path,const void *buff, |
size_t offset, size_t count, size_t *writes) |
{ |
int retval; |
__asm__ __volatile__( |
"pushl $0 \n\t" |
"pushl $0 \n\t" |
"movl %%eax, 1(%%esp) \n\t" |
"pushl %%ebx \n\t" |
"pushl %%edx \n\t" |
"pushl $0 \n\t" |
"pushl %%ecx \n\t" |
"pushl $3 \n\t" |
"movl %%esp, %%ebx \n\t" |
"mov $70, %%eax \n\t" |
"int $0x40 \n\t" |
"testl %%esi, %%esi \n\t" |
"jz 1f \n\t" |
"movl %%ebx, (%%esi) \n\t" |
"1:" |
"addl $28, %%esp \n\t" |
:"=a" (retval) |
:"a"(path),"b"(buff),"c"(offset),"d"(count),"S"(writes)); |
if(retval == 0) |
ksys_file_status_t st = _ksys_file_write(path, offset, count, buff); |
*writes = st.rw_bytes; |
if(!st.status) |
return 0; |
else if (retval == 8) |
else if (st.status == KSYS_FS_ERR_8) |
return ENOSPC; |
return -1; |
}; |
} |
/contrib/sdk/sources/newlib/libc/sys/lseek.c |
---|
1,20 → 1,22 |
/* |
* Copyright (C) KolibriOS team 2004-2024. All rights reserved. |
* Distributed under terms of the GNU General Public License |
*/ |
#include <errno.h> |
#include <stdlib.h> |
#include <sys/unistd.h> |
#include <sys/kos_io.h> |
#include <sys/ksys.h> |
#include "glue.h" |
#include "io.h" |
_off_t |
_DEFUN (lseek, (fd, pos, whence), |
int fd _AND |
_off_t pos _AND |
int whence) |
{ |
fileinfo_t info; |
ksys_file_info_t info; |
__io_handle *ioh; |
_off_t ret; |
22,7 → 24,7 |
{ |
errno = EBADF; |
return (-1); |
}; |
} |
ioh = &__io_tab[fd]; |
36,16 → 38,16 |
break; |
case SEEK_END: |
{ |
get_fileinfo(ioh->name, &info); |
_ksys_file_info(ioh->name, &info); |
ret = pos + info.size; |
break; |
} |
default: |
errno = EINVAL; |
return (-1); |
}; |
return -1; |
} |
ioh->offset = ret; |
return( ret ); |
}; |
return ret; |
} |
/contrib/sdk/sources/newlib/libc/sys/open.c |
---|
15,13 → 15,20 |
#include <fcntl.h> |
#include <errno.h> |
#include <string.h> |
#include <sys/kos_io.h> |
#include <sys/ksys.h> |
#include "glue.h" |
#include "io.h" |
#undef erro |
#undef errno |
extern int errno; |
extern int write_file(const char *path,const void *buff, |
size_t offset, size_t count, size_t *writes); |
extern int read_file(const char *path, void *buff, |
size_t offset, size_t count, size_t *reads); |
static inline int is_slash(char c) |
{ |
return c=='/' || c=='\\'; |
49,7 → 56,7 |
} |
} |
*out='\0'; |
}; |
} |
void buildpath(char *buf, const char* file) |
89,26 → 96,14 |
*ptr++ = *file++; |
} |
*ptr = 0; |
}; |
} |
static char *getccwd(char *buf, size_t size) |
{ |
int bsize; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(bsize) |
:"a"(30),"b"(2),"c"(buf), "d"(size) |
:"memory"); |
return buf; |
}; |
int open (const char * filename, int flags, ...) |
{ |
char buf[1024]; |
__io_handle *ioh; |
fileinfo_t info; |
ksys_file_info_t info; |
int iomode, rwmode, offset; |
int hid; |
int err; |
127,11 → 122,11 |
} |
else |
{ |
getccwd(buf, 1024); |
_ksys_getcwd(buf, 1024); |
buildpath(buf, filename); |
} |
err = get_fileinfo(buf, &info); |
err = _ksys_file_info(buf, &info); |
if( flags & O_EXCL && |
flags & O_CREAT ) |
141,13 → 136,13 |
errno = EEXIST; |
__io_free(hid); |
return (-1); |
}; |
} |
} |
if( err ) |
{ |
if(flags & O_CREAT) |
err=create_file(buf); |
err = _ksys_file_create(buf).status; |
if( err ) |
{ |
errno = EACCES; |
157,7 → 152,7 |
}; |
if( flags & O_TRUNC ) |
set_file_size(buf, 0); |
_ksys_file_set_size(buf, 0); |
ioh = &__io_tab[hid]; |
177,14 → 172,17 |
{ |
iomode |= _APPEND; |
offset = info.size; |
}; |
} |
if( flags & (O_BINARY|O_TEXT) ) |
{ |
if( flags & O_BINARY ) |
iomode |= _BINARY; |
} else |
} |
else |
{ |
iomode |= _BINARY; |
} |
ioh->name = strdup(buf); |
ioh->offset = offset; |
193,6 → 191,4 |
ioh->write = write_file; |
return hid; |
}; |
} |
/contrib/sdk/sources/newlib/libc/sys/read.c |
---|
29,7 → 29,7 |
char *buffer = buf; |
int rc; |
int h; |
unsigned amount_read; |
size_t amount_read; |
int err; |
__io_handle *ioh; |
/contrib/sdk/sources/newlib/libc/sys/stat.c |
---|
13,7 → 13,7 |
* they apply. |
*/ |
#include <sys/stat.h> |
#include <sys/kos_io.h> |
#include <sys/ksys.h> |
#include <errno.h> |
#include <time.h> |
#include <string.h> |
28,14 → 28,14 |
struct stat *buf) |
{ |
fileinfo_t info; |
ksys_file_info_t info; |
struct tm time; |
if( get_fileinfo(path, &info)) |
if (_ksys_file_info(path, &info)) |
{ |
errno = ENOENT; |
return (-1); |
}; |
} |
memset (buf, 0, sizeof (* buf)); |
91,4 → 91,3 |
{ |
return stat(path, buf); |
} |
/contrib/sdk/sources/newlib/libc/sys/write.c |
---|
15,7 → 15,6 |
#include <errno.h> |
#include <unistd.h> |
#include <alloca.h> |
#include <sys/kos_io.h> |
#include "io.h" |
#undef erro |
/contrib/sdk/sources/sqlite3/Makefile |
---|
7,7 → 7,7 |
INSTALLDIR ?= /home/autobuild/tools/win32/lib |
CFLAGS = -U__MINGW32__ -UWIN32 -UWindows -U_WINDOWS -U_WIN32 -U__WIN32__ -U_WIN32 -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.36.0\" -DPACKAGE_STRING=\"sqlite\ 3.36.0\" -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.36.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=0 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_FDATASYNC=0 -DHAVE_USLEEP=0 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_EDITLINE_READLINE_H=1 -DHAVE_EDITLINE=1 -DHAVE_ZLIB_H=1 -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_OS_OTHER=1 -USQLITE_OS_WIN_H -DSQLITE_TEMP_STORE=3 -D_NO_STDERR -c -O2 -fomit-frame-pointer -D_KOLIBRI |
CFLAGS = -U__MINGW32__ -UWIN32 -UWindows -U_WINDOWS -U_WIN32 -U__WIN32__ -U_WIN32 -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.36.0\" -DPACKAGE_STRING=\"sqlite\ 3.36.0\" -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.36.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=0 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_FDATASYNC=0 -DHAVE_USLEEP=0 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_EDITLINE_READLINE_H=1 -DHAVE_EDITLINE=1 -DHAVE_ZLIB_H=1 -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_OS_OTHER=1 -USQLITE_OS_WIN_H -DSQLITE_TEMP_STORE=3 -D_NO_STDERR -DSQLITE_OMIT_VIRTUALTABLE -c -O2 -fomit-frame-pointer -D_KOLIBRI |
LDFLAGS=$(LDFLAGS_CMD) |
LDFLAGS+= -shared -s -T dll.lds --entry _DllStartup --image-base=0 |
/contrib/sdk/sources/sqlite3/shell/Tupfile.lua |
---|
8,7 → 8,7 |
INCLUDES= INCLUDES .. " -I .. " |
CFLAGS = CFLAGS .. " -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -DSQLITE_OS_OTHER=1 -DHAVE_UNISTD_H=0 -D_NO_STDERR -DSQLITE_OMIT_POPEN -DSQLITE_THREADSAFE=0 -D_KOLIBRI -U__linux__ -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.36.0\" -DPACKAGE_STRING=\"sqlite-3.36.0\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.36.0\"" |
CFLAGS = CFLAGS .. " -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -DSQLITE_OS_OTHER=1 -DHAVE_UNISTD_H=0 -D_NO_STDERR -DSQLITE_OMIT_POPEN -DSQLITE_THREADSAFE=0 -D_KOLIBRI -DSQLITE_OMIT_VIRTUALTABLE -U__linux__ -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.36.0\" -DPACKAGE_STRING=\"sqlite-3.36.0\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.36.0\"" |
LDFLAGS = LDFLAGS .. " --subsystem console " |
/contrib/sdk/sources/sqlite3/shell/shell.c |
---|
102,7 → 102,7 |
# include <pwd.h> |
# endif |
#endif |
#if (!defined(_WIN32) && !defined(WIN32)) || defined(__MINGW32__) |
#if (!defined(_WIN32) && !defined(WIN32) && !defined (_KOLIBRI)) || defined(__MINGW32__) |
# include <unistd.h> |
# include <dirent.h> |
# define GETPID getpid |
2209,7 → 2209,9 |
#include <fcntl.h> |
#if !defined(_WIN32) && !defined(WIN32) |
# include <unistd.h> |
#ifndef _KOLIBRI |
# include <dirent.h> |
#endif |
# include <utime.h> |
# include <sys/time.h> |
#else |
/programs/demos/gears/trunk/SysCall.h |
---|
File deleted |
/programs/demos/gears/trunk/main.cpp |
---|
File deleted |
/programs/demos/gears/trunk/Tupfile.lua |
---|
File deleted |
/programs/demos/gears/trunk/fps.cpp |
---|
File deleted |
/programs/demos/gears/trunk |
---|
Property changes: |
Deleted: tsvn:logminsize |
-5 |
\ No newline at end of property |
/programs/demos/gears |
---|
Property changes: |
Deleted: tsvn:logminsize |
-5 |
\ No newline at end of property |
/programs/develop/kosjs/Tupfile.lua |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/kosjs.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/import.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/Makefile |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/examples/example.js |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsnumber.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jscompile.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsmath.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jserror.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/COPYING |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/regexp.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jscompile.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/utf.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/regexp.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/utftype.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsdump.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/utf.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsparse.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsvalue.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsdate.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsparse.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsboolean.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsstate.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsvalue.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/import.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/astnames.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jslex.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsgc.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsregexp.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsi.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jslex.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/Makefile |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsintern.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsrun.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsstring.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsobject.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsbuiltin.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/AUTHORS |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsrepr.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsrun.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/Tupfile.lua |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/opnames.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsbuiltin.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/json.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsarray.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/README |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/pp.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsproperty.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsfunction.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/mujs.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/kosjs/libmujs/jsdtoa.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/backy/gcc_version/Backy_lib.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/backy/gcc_version/Tupfile.lua |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/backy/gcc_version/Backy.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/backy/gcc_version/readme.txt |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/backy/gcc_version/Makefile |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/develop/libraries/newlib_example/main.c |
---|
1,12 → 1,12 |
#include <kos32sys.h> |
#include <sys/ksys.h> |
#define B_SZ 10 |
static char * Title="BinClock"; |
static char* title = "BinClock"; |
static void draw_small_box(int x,int y,int is_on) |
{ |
draw_bar(x,y,B_SZ,B_SZ,is_on ? 0xFF0000 : 0x103000); |
_ksys_draw_bar(x, y, B_SZ, B_SZ, is_on ? 0xFF0000 : 0x103000); |
} |
static void draw_box_group(int x,int y,int num) |
15,13 → 15,12 |
char buf[2]; |
buf[0]=(num&(1+2+4+8))+'0'; |
buf[1]='\0'; |
for(i=0;i<4;i++) |
{ |
for(i = 0; i < 4; i++) { |
j=(B_SZ+2)*i; |
draw_small_box(x,y+((B_SZ+2)*i),num & (1<<(3-i)) ? 1 : 0); |
} |
draw_bar(x,y+((B_SZ+2)*4),B_SZ,B_SZ,0x800000); |
draw_text_sys(buf,x+2,y+((B_SZ+2)*4)+3,1,0xFFFFFF); |
_ksys_draw_bar(x, y+((B_SZ+2)*4),B_SZ,B_SZ, 0x800000); |
_ksys_draw_text(buf, x+2, y+((B_SZ+2)*4)+3, 1, 0xFFFFFF); |
} |
static void draw_bcd_num(int x,int y,int num) |
55,11 → 54,11 |
static void paint(void) |
{ |
BeginDraw(); |
DrawWindow(100,100,40+((B_SZ+2)*6)+4,30+((B_SZ+2)*4)+16,Title,0x80,0x13); |
draw_bar(20,26,((B_SZ+2)*6)+4+2,4+((B_SZ+1)*4)+2,0); |
_ksys_start_draw(); |
_ksys_create_window(100, 100, 40+((B_SZ+2)*6)+4,30+((B_SZ+2)*4)+16, title, 0x80, 0x13); |
_ksys_draw_bar(20, 26, ((B_SZ+2)*6)+4+2,4+((B_SZ+1)*4)+2, 0); |
draw_h(); |
EndDraw(); |
_ksys_end_draw(); |
} |
int main(void) |
66,22 → 65,21 |
{ |
int i; |
paint(); |
for(;;) |
{ |
i=wait_for_event(20); |
for(;;) { |
i = _ksys_wait_event_timeout(20); |
draw_h(); |
switch(i) |
{ |
switch(i) { |
case 1: |
paint(); |
continue; |
case 2: |
get_key(); |
_ksys_get_key(); |
continue; |
case 3: |
if(get_os_button()==1) return 0; |
if (_ksys_get_button() == 1) return 0; |
continue; |
} |
} |
} |
/programs/emulator/dgen-sdl-1.33/system.c |
---|
6,7 → 6,9 |
#include <errno.h> |
#include <assert.h> |
#include <string.h> |
#ifndef _KOLIBRI |
#include <dirent.h> |
#endif |
#include <ctype.h> |
#ifndef __MINGW32__ |
#include <sys/types.h> |
658,6 → 660,7 |
*/ |
static char **complete_path_simple(const char *path, size_t len) |
{ |
#ifndef _KOLIBRI |
size_t rlen; |
const char *cpl; |
char *root; |
742,10 → 745,11 |
free(*(ret++)); |
free(ret); |
} |
#endif |
return NULL; |
} |
#if defined(HAVE_GLOB_H) && !defined(__MINGW32__) && !defined(_KOLIBRI) |
#if defined(HAVE_GLOB_H) && !defined(__MINGW32__) |
#define COMPLETE_USERDIR_TILDE 0x01 |
#define COMPLETE_USERDIR_EXACT 0x02 |
/programs/games/fridge/fridge.c |
---|
1,5 → 1,5 |
// Includes // |
#include <sys/kos.h> |
#include "kos.h" |
#include <string.h> |
#include <stdlib.h> |
#include <stdio.h> |
/programs/games/fridge/kos.h |
---|
0,0 → 1,418 |
/* |
sys/kos.h |
An attempt to create new C/C++ wrapper for syscalls |
Based on kos32sys.h |
KolibriOS Team |
*/ |
#include <stdint.h> |
#include <string.h> |
/*********************** Types *************************/ |
typedef unsigned int color_t; |
// struct for sysfn 70 |
#pragma pack(push,1) |
typedef struct { |
unsigned p00; |
unsigned p04; |
char *p08; |
unsigned p12; |
unsigned p16; |
char p20; |
char *p21; |
} kos_Struct70; |
#pragma pack(pop) |
// struct for blitter |
struct blit_call { |
int dstx; |
int dsty; |
int w; |
int h; |
int srcx; |
int srcy; |
int srcw; |
int srch; |
void *bitmap; |
int stride; |
}; |
// struct for sysfn 9 |
#pragma pack(push, 1) |
struct proc_info { |
unsigned long cpu_usage; |
unsigned short pos_in_stack; |
unsigned short slot; |
unsigned short reserved; |
char name[12]; |
unsigned long address; |
unsigned long memory_usage; |
unsigned long ID; |
unsigned long left,top; |
unsigned long width,height; |
unsigned short thread_state; |
unsigned short reserved2; |
unsigned long cleft, ctop, cwidth, cheight; |
unsigned char window_state; |
unsigned char reserved3[1024 - 71]; |
}; |
#pragma pack(pop) |
// struct for sysfn 48 |
struct kolibri_system_colors { |
color_t frame_area; |
color_t grab_bar; |
color_t grab_bar_button; |
color_t grab_button_text; |
color_t grab_text; |
color_t work_area; |
color_t work_button; |
color_t work_button_text; |
color_t work_text; |
color_t work_graph; |
}; |
typedef union __attribute__((packed)) { |
uint32_t val; |
struct { |
short x; |
short y; |
}; |
} pos_t; |
/*********************** Window Syscalls *************************/ |
static inline void kos_BeginDraw(void) { |
__asm__ __volatile__( |
"int $0x40" ::"a"(12),"b"(1)); |
}; |
static inline void kos_EndDraw(void) { |
__asm__ __volatile__( |
"int $0x40" ::"a"(12),"b"(2)); |
}; |
static inline void kos_DrawWindow(int x, int y, int w, int h, const char *title, color_t bgcolor, uint32_t style) { |
__asm__ __volatile__( |
"int $0x40" |
::"a"(0), |
"b"((x << 16) | ((w-1) & 0xFFFF)), |
"c"((y << 16) | ((h-1) & 0xFFFF)), |
"d"((style << 24) | (bgcolor & 0xFFFFFF)), |
"D"(title), |
"S"(0) : "memory"); |
}; |
#define ZPOS_DESKTOP -2 |
#define ZPOS_ALWAYS_BACK -1 |
#define ZPOS_NORMAL 0 |
#define ZPOS_ALWAYS_TOP 1 |
static inline void kos_SetWindowLayerBehaviour(int zpos) { |
__asm__ __volatile__( |
"int $0x40" |
::"a"(18), |
"b"(25), |
"c"(2), |
"d"(-1), |
"S"(zpos) : "memory"); |
}; |
#define OLD -1 |
static inline void kos_ChangeWindow(int new_x, int new_y, int new_w, int new_h) { |
__asm__ __volatile__( |
"int $0x40" |
::"a"(67), "b"(new_x), "c"(new_y), "d"(new_w),"S"(new_h) |
); |
} |
/*********************** Other GUI functions *************************/ |
static inline void kos_DrawText(int x, int y, const char *text, color_t color) { |
__asm__ __volatile__( |
"int $0x40" |
::"a"(4),"d"(text), |
"b"((x << 16) | y), |
"S"(strlen(text)),"c"(color) |
:"memory"); |
} |
static inline void kos_DrawButton(int x, int y, int w, int h, int id, color_t color) { |
__asm__ __volatile__( |
"int $0x40" |
::"a"(8), |
"b"(x * 65536 + w), |
"c"(y * 65536 + h), |
"d"(id), |
"S"(color)); |
}; |
static inline void kos_DrawButtonWithText(int x, int y, int w, int h, int id, color_t color, const char* text) { |
kos_DrawButton(x, y, w, h, id, color); |
int tx = ((((-strlen(text))*8)+w)/2)+x; |
int ty = h/2-7+y; |
kos_DrawText(tx, ty, text, 0x90000000); |
}; |
static inline void kos_DrawLine(int x_start, int y_start, int x_end, int y_end, color_t color) { |
__asm__ __volatile__( |
"int $0x40" |
::"a"(38), "d"(color), |
"b"((x_start << 16) | x_end), |
"c"((y_start << 16) | y_end)); |
} |
static inline void kos_DrawBar(int x, int y, int w, int h, color_t color) { |
__asm__ __volatile__( |
"int $0x40" |
::"a"(13), "d"(color), |
"b"((x << 16) | w), |
"c"((y << 16) | h)); |
} |
static inline void kos_PutPixel(int x, int y, color_t color) { |
__asm__ __volatile__("int $0x40" |
::"a"(1), |
"b"(x), |
"c"(y), |
"d"(color)); |
} |
static inline void kos_DrawBitmap(void *bitmap, int x, int y, int w, int h) { |
__asm__ __volatile__( |
"int $0x40" |
::"a"(7), "b"(bitmap), |
"c"((w << 16) | h), |
"d"((x << 16) | y)); |
} |
static inline void Blit(void *bitmap, int dst_x, int dst_y, |
int src_x, int src_y, int w, int h, |
int src_w, int src_h, int stride) |
{ |
volatile struct blit_call bc; |
bc.dstx = dst_x; |
bc.dsty = dst_y; |
bc.w = w; |
bc.h = h; |
bc.srcx = src_x; |
bc.srcy = src_y; |
bc.srcw = src_w; |
bc.srch = src_h; |
bc.stride = stride; |
bc.bitmap = bitmap; |
__asm__ __volatile__( |
"int $0x40" |
::"a"(73),"b"(0),"c"(&bc.dstx)); |
}; |
// Get screen part as image |
static inline void kos_ScreenShot(char* image, int x, int y, int w, int h) { |
__asm__ __volatile__( |
"int $0x40" |
::"a"(36), |
"b"(image), |
"c"(w*65536+h), |
"d"(x*65536+y) : "memory"); |
}; |
/*********************** Skin *************************/ |
// Get skin height |
static inline uint32_t kos_SkinHeight(void) { |
uint32_t height; |
__asm__ __volatile__( |
"int $0x40 \n\t" |
:"=a"(height) |
:"a"(48),"b"(4)); |
return height; |
}; |
/*********************** Mouse *************************/ |
#define POS_SCREEN 0 |
#define POS_WINDOW 1 |
static inline pos_t kos_GetMousePos(int origin) { |
pos_t val; |
__asm__ __volatile__( |
"int $0x40 \n\t" |
"rol $16, %%eax" |
:"=a"(val) |
:"a"(37),"b"(origin)); |
return val; |
} |
static inline uint32_t kos_GetMouseButtons(void) { |
uint32_t val; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(val) |
:"a"(37),"b"(2)); |
return val; |
}; |
static inline uint32_t kos_GetMouseWheels(void) { |
uint32_t val; |
__asm__ __volatile__( |
"int $0x40 \n\t" |
:"=a"(val) |
:"a"(37),"b"(7)); |
return val; |
}; |
static inline uint32_t kos_LoadCursor(void *path, uint32_t flags) { |
uint32_t val; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(val) |
:"a"(37), "b"(4), "c"(path), "d"(flags)); |
return val; |
} |
static inline uint32_t kos_SetCursor(uint32_t cursor) { |
uint32_t old; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(old) |
:"a"(37), "b"(5), "c"(cursor)); |
return old; |
}; |
static inline int kos_DestroyCursor(uint32_t cursor) { |
int ret; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(ret) |
:"a"(37), "b"(6), "c"(cursor) |
:"memory"); |
return ret; |
}; |
/*********************** OS Events *************************/ |
#define evReDraw 1 |
#define evKey 2 |
#define evButton 3 |
#define evExit 4 |
#define evDesktop 5 |
#define evMouse 6 |
#define evIPC 7 |
#define evNetwork 8 |
#define evDebug 9 |
static inline uint32_t kos_WaitForEventTimeout(uint32_t time) { |
uint32_t val; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(val) |
:"a"(23), "b"(time)); |
return val; |
}; |
static inline uint32_t kos_CheckForEvent(void) { |
uint32_t val; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(val) |
:"a"(11)); |
return val; |
}; |
static inline uint32_t kos_WaitForEvent(void) { |
uint32_t val; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(val) |
:"a"(10)); |
return val; |
}; |
/*********************** Eventmask *************************/ |
#define EVM_REDRAW 1 |
#define EVM_KEY 2 |
#define EVM_BUTTON 4 |
#define EVM_EXIT 8 |
#define EVM_BACKGROUND 16 |
#define EVM_MOUSE 32 |
#define EVM_IPC 64 |
#define EVM_STACK 128 |
#define EVM_DEBUG 256 |
#define EVM_STACK2 512 |
#define EVM_MOUSE_FILTER 0x80000000 |
#define EVM_CURSOR_FILTER 0x40000000 |
static inline uint32_t kos_SetMaskForEvents(uint32_t event_mask) { |
uint32_t old_event_mask; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(old_event_mask) |
:"a"(40),"b"(event_mask)); |
return old_event_mask; |
}; |
/*********************** Other *************************/ |
static inline int kos_GetKey() { |
unsigned short key; |
__asm__ __volatile__("int $0x40":"=a"(key):"0"(2)); |
if(!(key & 0xFF)) return (key>>8)&0xFF; else return 0; |
} |
static inline uint32_t kos_GetButtonID(void) { |
uint32_t val; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(val) |
:"a"(17)); |
return val>>8; |
}; |
static inline void kos_Delay(uint32_t time) { |
__asm__ __volatile__( |
"int $0x40" |
::"a"(5), "b"(time) |
:"memory"); |
}; |
static inline pos_t kos_ScreenSize() { |
pos_t size; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(size) |
:"a"(14)); |
return size; |
}; |
static inline void kos_GetSystemColors(struct kolibri_system_colors *color_table) { |
__asm__ __volatile__ ("int $0x40" |
: |
:"a"(48),"b"(3),"c"(color_table),"d"(40) |
); |
} |
// sysfn 9 |
static inline void kos_ProcessInfo(char *info) { |
__asm__ __volatile__( |
"int $0x40" |
: |
:"a"(9), "b"(info), "c"(-1) |
:"memory"); |
}; |
static inline void kos_RunApp(char* app, char* param) { |
kos_Struct70 r; |
r.p00 = 7; |
r.p04 = 0; |
r.p08 = param; |
r.p12 = 0; |
r.p16 = 0; |
r.p20 = 0; |
r.p21 = app; |
__asm__ __volatile__ ("int $0x40"::"a"(70), "b"(&r)); |
} |