/uspace/trunk/fb/fb.h |
---|
File deleted |
/uspace/trunk/fb/Makefile |
---|
File deleted |
/uspace/trunk/fb/font-8x16.h |
---|
File deleted |
/uspace/trunk/fb/helenos.xbm |
---|
File deleted |
/uspace/trunk/fb/fb.c |
---|
File deleted |
/uspace/trunk/fb/font-8x16.c |
---|
File deleted |
/uspace/trunk/ns/ns.c |
---|
45,8 → 45,6 |
#define NS_HASH_TABLE_CHAINS 20 |
extern int __DONT_OPEN_STDIO__=1; |
static int register_service(ipcarg_t service, ipcarg_t phone, ipc_call_t *call); |
static int connect_to_service(ipcarg_t service, ipc_call_t *call, ipc_callid_t callid); |
83,10 → 81,10 |
ipcarg_t retval, arg1, arg2; |
// printf("%s: Naming service started.\n", NAME); |
printf("%s: Naming service started.\n", NAME); |
if (!hash_table_create(&ns_hash_table, NS_HASH_TABLE_CHAINS, 3, &ns_hash_table_ops)) { |
// printf("%s: cannot create hash table\n", NAME); |
printf("%s: cannot create hash table\n", NAME); |
return ENOMEM; |
} |
96,20 → 94,20 |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_AS_AREA_SEND: |
as_area = (char *)IPC_GET_ARG2(call); |
// printf("Received as_area: %P, size:%d\n", as_area, IPC_GET_ARG3(call)); |
printf("Received as_area: %P, size:%d\n", as_area, IPC_GET_ARG3(call)); |
retval = ipc_answer_fast(callid, 0,(sysarg_t)(1024*1024), 0); |
if (!retval) { |
// printf("Reading shared memory..."); |
// printf("Text: %s", as_area); |
printf("Reading shared memory..."); |
printf("Text: %s", as_area); |
} else |
// printf("Failed answer: %d\n", retval); |
printf("Failed answer: %d\n", retval); |
continue; |
break; |
case IPC_M_INTERRUPT: |
// printf("GOT INTERRUPT: %c\n", IPC_GET_ARG2(call)); |
printf("GOT INTERRUPT: %c\n", IPC_GET_ARG2(call)); |
break; |
case IPC_M_PHONE_HUNGUP: |
// printf("Phone hung up.\n"); |
printf("Phone hung up.\n"); |
retval = 0; |
break; |
case IPC_M_CONNECT_TO_ME: |
126,23 → 124,23 |
retval = connect_to_service(IPC_GET_ARG1(call), &call, callid); |
break; |
case NS_HANGUP: |
// printf("Closing connection.\n"); |
printf("Closing connection.\n"); |
retval = EHANGUP; |
break; |
case NS_PING: |
// printf("Ping...%P %P\n", IPC_GET_ARG1(call), |
// IPC_GET_ARG2(call)); |
printf("Ping...%P %P\n", IPC_GET_ARG1(call), |
IPC_GET_ARG2(call)); |
retval = 0; |
arg1 = 0xdead; |
arg2 = 0xbeef; |
break; |
case NS_PING_SVC: |
// printf("NS:Pinging service %d\n", ping_phone); |
printf("NS:Pinging service %d\n", ping_phone); |
ipc_call_sync(ping_phone, NS_PING, 0xbeef, 0); |
// printf("NS:Got pong\n"); |
printf("NS:Got pong\n"); |
break; |
default: |
// printf("Unknown method: %zd\n", IPC_GET_METHOD(call)); |
printf("Unknown method: %zd\n", IPC_GET_METHOD(call)); |
retval = ENOENT; |
break; |
} |
166,16 → 164,16 |
unsigned long keys[3] = { service, call->in_phone_hash, 0 }; |
hashed_service_t *hs; |
// printf("Registering service %d on phone %d...", service, phone); |
printf("Registering service %d on phone %d...", service, phone); |
if (hash_table_find(&ns_hash_table, keys)) { |
// printf("Service %d already registered.\n", service); |
printf("Service %d already registered.\n", service); |
return EEXISTS; |
} |
hs = (hashed_service_t *) malloc(sizeof(hashed_service_t)); |
if (!hs) { |
// printf("Failed to register service %d.\n", service); |
printf("Failed to register service %d.\n", service); |
return ENOMEM; |
} |
208,7 → 206,7 |
return ENOENT; |
} |
hs = hash_table_get_instance(hlp, hashed_service_t, link); |
// printf("Connecting in_phone_hash=%lX to service at phone %d...", call->in_phone_hash, hs->phone); |
printf("Connecting in_phone_hash=%lX to service at phone %d...", call->in_phone_hash, hs->phone); |
return ipc_forward_fast(callid, hs->phone, 0, 0); |
} |
/uspace/trunk/init/init.c |
---|
42,7 → 42,6 |
#include <string.h> |
#include <errno.h> |
#include <kbd.h> |
#include <ipc/fb.h> |
int a; |
atomic_t ftx; |
349,40 → 348,12 |
printf("Done\n"); |
} |
static void test_fb() |
{ |
int res; |
ipcarg_t result; |
int phoneid; |
// printf("Test: Starting connect...\n"); |
phoneid = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0); |
while ((phoneid = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0)) < 0) { |
volatile int a; |
for(a=0;a<1048576;a++); |
}; |
// printf("Test: Connected: %d\n", res); |
// printf("Test: pinging.\n"); |
while (1) { |
res = ipc_call_sync(phoneid, FB_GET_VFB, 0xbeef,&result); |
// printf("Test: Retval: %d - received: %c\n", res, result); |
// printf("%c", result); |
} |
// printf("Test: Hangin up\n"); |
ipc_hangup(phoneid); |
} |
int main(int argc, char *argv[]) |
{ |
pstid_t ptid; |
int tid; |
// version_print(); |
version_print(); |
// test_printf(); |
// test_printf2(); |
394,12 → 365,8 |
// test_slam(); |
// test_as_send(); |
// test_pci(); |
// test_kbd(); |
// test_fb(); |
test_kbd(); |
printf("Hello\nThis is Init\n\nBye."); |
/* |
printf("Userspace task, taskid=%llX\n", task_get_id()); |
/uspace/trunk/libc/generic/as.c |
---|
69,7 → 69,6 |
} |
static size_t heapsize = 0; |
static size_t maxheapsize = (size_t)(-1); |
/* Start of heap linker symbol */ |
extern char _heap; |
92,8 → 91,6 |
/* Check for too small values */ |
if (incr < 0 && incr+heapsize > heapsize) |
return NULL; |
/* Check for user limit */ |
if ((maxheapsize!=(size_t)(-1)) && (heapsize + incr)>maxheapsize) return NULL; |
rc = as_area_resize(&_heap, heapsize + incr,0); |
if (rc != 0) |
106,11 → 103,3 |
return res; |
} |
void *set_maxheapsize(size_t mhs) |
{ |
maxheapsize=mhs; |
/* Return pointer to area not managed by sbrk */ |
return (void *)&_heap + maxheapsize; |
} |
/uspace/trunk/libc/generic/libc.c |
---|
31,10 → 31,7 |
#include <thread.h> |
#include <malloc.h> |
#include <psthread.h> |
#include <io/stream.h> |
int __DONT_OPEN_STDIO__; |
/* We should probably merge libc and libipc together */ |
extern void _ipc_init(void); |
45,13 → 42,6 |
void __main(void) { |
tcb_t *tcb; |
if(!__DONT_OPEN_STDIO__) |
{ |
open("stdin",0); |
open("stdout",0); |
open("stderr",0); |
} |
tcb = __make_tls(); |
__tcb_set(tcb); |
psthread_setup(tcb); |
/uspace/trunk/libc/generic/io/stream.c |
---|
File deleted |
/uspace/trunk/libc/generic/io/io.c |
---|
92,12 → 92,10 |
return EOF; |
} |
/* |
ssize_t write(int fd, const void * buf, size_t count) |
{ |
return (ssize_t) __SYSCALL3(SYS_IO, (sysarg_t) fd, (sysarg_t) buf, (sysarg_t) count); |
}*/ |
} |
/uspace/trunk/libc/include/ipc/fb.h |
---|
File deleted |
/uspace/trunk/libc/include/ipc/services.h |
---|
37,6 → 37,5 |
#define SERVICE_PCI 1 |
#define SERVICE_FRAME_BUFFER 2 |
#define SERVICE_KEYBOARD 3 |
#define SERVICE_VIDEO 4 |
#endif |
/uspace/trunk/libc/include/as.h |
---|
31,14 → 31,10 |
#include <types.h> |
#include <task.h> |
#include <kernel/arch/mm/as.h> |
#include <kernel/mm/as.h> |
#define USER_ADDRESS_SPACE_SIZE_ARCH (USER_ADDRESS_SPACE_END_ARCH-USER_ADDRESS_SPACE_START_ARCH+1) |
extern void *as_area_create(void *address, size_t size, int flags); |
extern int as_area_resize(void *address, size_t size, int flags); |
extern int as_area_destroy(void *address); |
extern void *set_maxheapsize(size_t mhs); |
#endif |
/uspace/trunk/libc/include/io/stream.h |
---|
File deleted |
/uspace/trunk/libc/Makefile |
---|
52,7 → 52,6 |
generic/futex.c \ |
generic/io/io.c \ |
generic/io/printf.c \ |
generic/io/stream.c \ |
generic/io/sprintf.c \ |
generic/io/snprintf.c \ |
generic/io/vprintf.c \ |
/uspace/trunk/libc/Makefile.toolchain |
---|
27,11 → 27,11 |
# |
DEFS = -DARCH=$(ARCH) |
CFLAGS = -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -O3 -nostdlib -nostdinc -I$(LIBC_PREFIX)/include |
CFLAGS = -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -I$(LIBC_PREFIX)/include |
LFLAGS = -M -N $(SOFTINT_PREFIX)/softint.a |
AFLAGS = |
#-Werror |
## Setup platform configuration |
# |
/uspace/trunk/Makefile |
---|
37,8 → 37,7 |
softfloat \ |
libadt \ |
init \ |
ns \ |
fb |
ns |
ifeq ($(ARCH), amd64) |
DIRS += pci \ |