Changes in / [3e6a98c5:0fa34dd] in mainline
- Files:
-
- 1 added
- 4 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/Makefile.inc
r3e6a98c5 r0fa34dd 76 76 arch/$(KARCH)/src/proc/thread.c \ 77 77 arch/$(KARCH)/src/userspace.c \ 78 arch/$(KARCH)/src/syscall.c \ 79 arch/$(KARCH)/src/debugger.c 78 arch/$(KARCH)/src/syscall.c 80 79 81 80 ifeq ($(CONFIG_SMP),y) -
kernel/arch/amd64/src/amd64.c
r3e6a98c5 r0fa34dd 43 43 #include <arch/bios/bios.h> 44 44 #include <arch/boot/boot.h> 45 #include <arch/debugger.h>46 45 #include <arch/drivers/i8254.h> 47 46 #include <arch/drivers/i8259.h> … … 161 160 #endif 162 161 163 /* Enable debugger */164 debugger_init();165 162 /* Merge all memory zones to 1 big zone */ 166 163 zone_merge_all(); -
kernel/arch/ia32/Makefile.inc
r3e6a98c5 r0fa34dd 105 105 arch/$(KARCH)/src/boot/memmap.c \ 106 106 arch/$(KARCH)/src/fpu_context.c \ 107 arch/$(KARCH)/src/debugger.c \108 107 arch/$(KARCH)/src/syscall.c -
kernel/arch/ia32/src/ia32.c
r3e6a98c5 r0fa34dd 45 45 #include <arch/bios/bios.h> 46 46 #include <arch/boot/boot.h> 47 #include <arch/debugger.h>48 47 #include <arch/drivers/i8254.h> 49 48 #include <arch/drivers/i8259.h> … … 118 117 #endif 119 118 120 /* Enable debugger */121 debugger_init();122 119 /* Merge all memory zones to 1 big zone */ 123 120 zone_merge_all(); -
kernel/generic/include/console/console.h
r3e6a98c5 r0fa34dd 67 67 extern wchar_t getc(indev_t *indev); 68 68 extern size_t gets(indev_t *indev, char *buf, size_t buflen); 69 extern sysarg_t sys_klog(int fd, const void *buf, size_t size);69 extern sysarg_t sys_klog(int cmd, const void *buf, size_t size); 70 70 71 71 extern void grab_console(void); -
kernel/generic/src/console/console.c
r3e6a98c5 r0fa34dd 52 52 #include <errno.h> 53 53 #include <str.h> 54 #include <abi/klog.h> 54 55 55 56 #define KLOG_PAGES 8 … … 335 336 * 336 337 */ 337 sysarg_t sys_klog(int fd, const void *buf, size_t size)338 sysarg_t sys_klog(int cmd, const void *buf, size_t size) 338 339 { 339 340 char *data; 340 341 int rc; 341 342 343 switch (cmd) { 344 case KLOG_UPDATE: 345 klog_update(NULL); 346 return EOK; 347 case KLOG_WRITE: 348 case KLOG_COMMAND: 349 break; 350 default: 351 return ENOTSUP; 352 } 353 342 354 if (size > PAGE_SIZE) 343 355 return (sysarg_t) ELIMIT; … … 355 367 data[size] = 0; 356 368 357 printf("%s", data); 369 switch (cmd) { 370 case KLOG_WRITE: 371 printf("%s", data); 372 break; 373 case KLOG_COMMAND: 374 for (unsigned int i = 0; i < size; i++) 375 indev_push_character(stdin, data[i]); 376 indev_push_character(stdin, '\n'); 377 break; 378 } 379 358 380 free(data); 359 } else 360 klog_update(NULL); 361 381 } 382 362 383 return size; 363 384 } -
uspace/app/klog/Makefile
r3e6a98c5 r0fa34dd 29 29 30 30 USPACE_PREFIX = ../.. 31 LIBS = $(LIBCLUI_PREFIX)/libclui.a 32 EXTRA_CFLAGS = -I$(LIBCLUI_PREFIX) 31 33 BINARY = klog 32 34 -
uspace/app/klog/klog.c
r3e6a98c5 r0fa34dd 48 48 #include <adt/list.h> 49 49 #include <adt/prodcons.h> 50 #include <tinput.h> 50 51 51 52 #define NAME "klog" … … 228 229 } 229 230 231 tinput_t *input = tinput_new(); 232 if (!input) { 233 fprintf(stderr, "%s: Could not create input\n", NAME); 234 return ENOMEM; 235 } 236 230 237 fibril_add_ready(fid); 231 238 event_unmask(EVENT_KLOG); 232 239 klog_update(); 233 240 234 task_retval(0); 235 async_manager(); 236 237 return 0; 241 tinput_set_prompt(input, "klog> "); 242 243 char *str; 244 while ((rc = tinput_read(input, &str)) == EOK) { 245 if (str_cmp(str, "") == 0) { 246 free(str); 247 continue; 248 } 249 250 klog_command(str, str_size(str)); 251 free(str); 252 } 253 254 if (rc == ENOENT) 255 rc = EOK; 256 257 return EOK; 238 258 } 239 259 -
uspace/lib/c/generic/io/klog.c
r3e6a98c5 r0fa34dd 39 39 #include <unistd.h> 40 40 #include <errno.h> 41 #include <abi/klog.h> 41 42 #include <io/klog.h> 42 43 #include <io/printf_core.h> … … 44 45 size_t klog_write(const void *buf, size_t size) 45 46 { 46 ssize_t ret = (ssize_t) __SYSCALL3(SYS_KLOG, 1, (sysarg_t) buf, size);47 ssize_t ret = (ssize_t) __SYSCALL3(SYS_KLOG, KLOG_WRITE, (sysarg_t) buf, size); 47 48 48 49 if (ret >= 0) … … 54 55 void klog_update(void) 55 56 { 56 (void) __SYSCALL3(SYS_KLOG, 1, (uintptr_t) NULL, 0); 57 (void) __SYSCALL3(SYS_KLOG, KLOG_UPDATE, (uintptr_t) NULL, 0); 58 } 59 60 void klog_command(const void *buf, size_t size) 61 { 62 (void) __SYSCALL3(SYS_KLOG, KLOG_COMMAND, (sysarg_t) buf, (sysarg_t) size); 57 63 } 58 64 -
uspace/lib/c/include/io/klog.h
r3e6a98c5 r0fa34dd 42 42 extern size_t klog_write(const void *, size_t); 43 43 extern void klog_update(void); 44 extern void klog_command(const void *, size_t); 44 45 extern int klog_printf(const char *, ...) 45 46 PRINTF_ATTRIBUTE(1, 2); -
uspace/lib/c/include/stdio.h
r3e6a98c5 r0fa34dd 40 40 #include <str.h> 41 41 #include <io/verify.h> 42 #include <abi/klog.h> 42 43 43 44 #define EOF (-1) … … 51 52 int _n = snprintf(_buf, sizeof(_buf), fmt, ##__VA_ARGS__); \ 52 53 if (_n > 0) \ 53 (void) __SYSCALL3(SYS_KLOG, 1, (sysarg_t) _buf, str_size(_buf)); \54 (void) __SYSCALL3(SYS_KLOG, KLOG_WRITE, (sysarg_t) _buf, str_size(_buf)); \ 54 55 } 55 56
Note:
See TracChangeset
for help on using the changeset viewer.